Compare commits

...

3155 Commits

Author SHA1 Message Date
MyPrototypeWhat
ed7308246f Merge remote-tracking branch 'origin/main' into feat/ai-sdk-package 2025-06-20 18:44:26 +08:00
MyPrototypeWhat
3d2caaf96a fix: refine experimental_transform handling and improve chunking logic
- Updated PluginEnabledAiClient to streamline the handling of experimental_transform parameters.
- Adjusted ModernAiProvider's smoothStream configuration for better chunking of text, enhancing processing efficiency.
- Re-enabled block updates in messageThunk for improved state management.
2025-06-20 17:36:39 +08:00
MyPrototypeWhat
02bcf03da9 feat: add Cherry Studio transformation and settings plugins
- Introduced cherryStudioTransformPlugin for converting Cherry Studio messages to AI SDK format, enhancing compatibility.
- Added cherryStudioSettingsPlugin to manage Assistant settings like temperature and TopP.
- Implemented createCherryStudioContext function for preparing context metadata for Cherry Studio calls.
2025-06-20 16:40:46 +08:00
suyao
99ea9f64b9 Merge remote-tracking branch 'origin/feat/ai-sdk-package' into feat/ai-sdk-package 2025-06-20 16:33:30 +08:00
suyao
955c12d1ba refactor: update AiSdkToChunkAdapter and middleware for improved chunk handling
- Modified convertAndEmitChunk method to handle new chunk types and streamline processing.
- Adjusted thinkingTimeMiddleware to remove unnecessary parameters and enhance clarity.
- Updated middleware integration in AiSdkMiddlewareBuilder for better middleware management.
2025-06-20 16:31:16 +08:00
MyPrototypeWhat
ab29c08602 feat: enhance AI SDK documentation and client functionality
- Added detailed usage examples for the native provider registry in the README.md, demonstrating how to create and utilize custom provider registries.
- Updated ApiClientFactory to enforce type safety for model instances.
- Refactored PluginEnabledAiClient methods to support both built-in logic and custom registry usage for text and object generation, improving flexibility and usability.
2025-06-20 16:19:55 +08:00
suyao
3a8b3f5f4a feat: enhance AI core functionality with smoothStream integration
- Added smoothStream to the middleware exports in index.ts for improved streaming capabilities.
- Updated PluginEnabledAiClient to conditionally apply middlewares, removing the default simulateStreamingMiddleware.
- Modified ModernAiProvider to utilize smoothStream in streamText, enhancing text processing with configurable chunking and delay options.
2025-06-20 15:44:11 +08:00
suyao
d7d728bc18 feat: enhance AI SDK middleware integration and support
- Added AiSdkMiddlewareBuilder for dynamic middleware construction based on various conditions.
- Updated ModernAiProvider to utilize new middleware configuration, improving flexibility in handling completions.
- Refactored ApiService to pass middleware configuration during AI completions, enabling better control over processing.
- Introduced new README documentation for the middleware builder, outlining usage and supported conditions.
2025-06-20 15:31:41 +08:00
suyao
3a2a3c04a9 feat: 完成api层,业务逻辑层,编排层的分离
feat: 为插件系统实现中间件
feat: 实现自定义的思考中间件

- Updated package.json and related files to reflect the correct naming convention for the @cherrystudio/ai-core package.
- Adjusted import paths in various files to ensure consistency with the new package name.
- Enhanced type resolution in tsconfig.web.json to align with the updated package structure.
2025-06-20 05:44:44 +08:00
suyao
45cc5333da Merge branch 'main' into feat/ai-sdk-package 2025-06-19 23:04:21 +08:00
suyao
1b56ec33e5 Merge branch 'feat/ai-sdk-package' of https://github.com/CherryHQ/cherry-studio into feat/ai-sdk-package 2025-06-19 22:07:58 +08:00
one
614bde8e37 feat(Markdown): disable indented code blocks (#7288)
* feat(Markdown): disable indented code blocks

* chore: update remark/rehype packages
2025-06-19 19:39:33 +08:00
kangfenmao
e4f3ea2378 chore(version): 1.4.4 2025-06-19 19:09:28 +08:00
MyPrototypeWhat
f9c7ae5169 feat: integrate @cherry-studio/ai-core and enhance AI SDK support
- Added @cherry-studio/ai-core as a workspace dependency in package.json for improved modularity.
- Updated tsconfig to include paths for the new AI core package, enhancing type resolution.
- Refactored aiCore package to use source files directly, improving build efficiency.
- Introduced a new AiSdkToChunkAdapter for converting AI SDK streams to Cherry Studio chunk format.
- Implemented a modernized AI provider interface in index_new.ts, allowing fallback to legacy implementations.
- Enhanced parameter transformation logic for better integration with AI SDK features.
- Updated ApiService to utilize the new AI provider, streamlining chat completion requests.
2025-06-19 18:55:59 +08:00
亢奋猫
009d74abe3 fix: update WindowService transparency and improve Inputbar resizing … (#7362) 2025-06-19 18:37:53 +08:00
one
1434062bdd refactor: hard-coded language map (#7360) 2025-06-19 17:13:29 +08:00
one
5a50748c65 refactor(CodeBlock): support more file extensions for code downloading (#7192) 2025-06-19 15:09:01 +08:00
SuYao
9d1b8bd9cd refactor: remove deprecated MCP server handling and knowledge base ID logic from Inputbar and related services (#7339)
- Removed unused MCP server handling from Inputbar and MessagesService.
- Updated ApiService to fetch active MCP servers directly from the store.
- Deprecated knowledgeBaseIds and enabledMCPs in Message types and related functions.
- Cleaned up related utility functions to enhance code clarity and maintainability.
2025-06-19 13:34:36 +08:00
one
c18a346098 chore(WebDav): remove useless webdav restore (#7347)
- remove webdav restore modal
- fix i18n keys
2025-06-19 12:33:59 +08:00
SuYao
48016d7620 fix: openai response tool use (#7332)
* fix: openai response tool use

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

* fix: remove logging from StreamAdapterMiddleware

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

* fix: update attachRawStreamListener to return a Promise

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

* refactor: enhance attachRawStreamListener to return a ReadableStream

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

* refactor: update getResponseChunkTransformer to accept CompletionsContext

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

* refactor: update getResponseChunkTransformer to accept CompletionsContext

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

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

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

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

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

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

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

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

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

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

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

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

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

* fix: lint errors
2025-06-18 23:19:25 +08:00
SuYao
2b0c45b443 fix: lint (#7333) 2025-06-18 23:14:54 +08:00
MyPrototypeWhat
c51bcdefc5 feat: enhance AI Core with new client and plugin system features
- Introduced `PluginEnabledAiClient` for a more flexible client interface with integrated plugin support.
- Updated `ApiClientFactory` and `UniversalAiSdkClient` to utilize new provider settings for improved type safety.
- Added a comprehensive plugin management system, allowing for dynamic plugin registration and execution.
- Enhanced the provider registry to include new AI providers and updated existing provider settings.
- Removed deprecated files and streamlined the codebase for better maintainability and clarity.
- Updated documentation to reflect new features and usage examples for the plugin system.
2025-06-18 19:23:14 +08:00
SuYao
e197a6f3e4 fix: initialize messageContents and improve message handling in GeminiAPIClient; add new Gemini model to configuration (#7307)
* fix: initialize messageContents and improve message handling in GeminiAPIClient; add new Gemini model to configuration

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

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

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

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

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

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

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

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

* refactor: remove redundant success messages in DataSettings component

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

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

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

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

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

* update i18n

* add fc

* fix: handle errors in app data path retrieval

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

* refactor: simplify app data path handling in IPC

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

* fix: update userData path handling for portable applications

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

* feat: enhance app data path migration with progress indication

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

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

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

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

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

* feat: add stop quit app functionality during data migration

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

* feat: enhance app data path handling and localization updates

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

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

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

* feat: enhance confirmation modal in DataSettings component

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

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

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

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

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

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

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

---------

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

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

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

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

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

* feat: Add custom currency support in model pricing configuration

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

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

* Update ModelEditContent.tsx

* fix(model-price): remove duplicate button

* fix: build error

---------

Co-authored-by: 自由的世界人 <3196812536@qq.com>
2025-06-17 22:53:47 +08:00
suyao
0f22fa18c3 feat: enhance AI Core with image generation capabilities
- Introduced `createImageClient` method in `ApiClientFactory` to support image generation for various providers.
- Updated `UniversalAiSdkClient` to include `generateImage` method, allowing image generation through the unified client interface.
- Refactored client creation functions to utilize the new `ProviderOptions` type for improved type safety.
- Enhanced the provider registry to indicate which providers support image generation, streamlining client creation and usage.
- Updated type definitions in `types.ts` to reflect changes in client options and middleware support.
2025-06-17 22:25:33 +08:00
MyPrototypeWhat
eeb504d447 fix: refactor provider middleware (#7164) 2025-06-17 21:20:52 +08:00
Chen Tao
f2d4255193 fix: use rewrite to search knowledge (#7289) 2025-06-17 21:02:09 +08:00
Ivan Hanloth
ae91ed27bd fix: classify agents as Chinese and English (#7287)
* feat: Create i18n for agents in Chinese

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

---------

Co-authored-by: Pleasurecruise <3196812536@qq.com>
2025-06-17 20:05:44 +08:00
suyao
8910281b09 feat: update AI Core client types and provider registry
- Refactored `ApiClientFactory` and `UniversalAiSdkClient` to use the new `ProviderOptions` type for improved type safety.
- Removed deprecated `AiCoreRequest` interface to streamline request handling.
- Updated the provider registry to include the OpenRouter provider while removing unused providers, enhancing clarity and maintainability.
- Added new dependencies and updated the pnpm-lock.yaml to reflect changes in provider versions.
2025-06-17 20:05:31 +08:00
suyao
7c1b7ee40f Merge branch 'feat/ai-sdk-package' of https://github.com/CherryHQ/cherry-studio into feat/ai-sdk-package 2025-06-17 19:53:58 +08:00
suyao
b771873f6c feat: define types for AI core requests and provider options
feat: define types for AI core requests and provider options

- Introduced `ProviderOptions` type to standardize provider configuration.
- Added `AiCoreRequest` interface to encapsulate request parameters for AI operations.
- Updated `UniversalAiSdkClient` to utilize the new types, enhancing type safety and clarity in API interactions.

feat: update AI provider registry and dependencies

- Added new AI providers: OpenAI Compatible, Qwen, Ollama, and Anthropic Vertex to the provider registry.
- Updated package.json to include new dependencies for the added providers.
- Enhanced pnpm-lock.yaml with corresponding versions and peer dependencies for the new packages.
2025-06-17 19:49:22 +08:00
MyPrototypeWhat
453a2bcb68 feat: enhance AI Core with plugin system and middleware support
- Introduced a plugin system in the AI Core package, allowing for flexible request handling and middleware integration.
- Added support for various hook types: First, Sequential, Parallel, and Stream, enabling developers to customize request processing.
- Implemented a PluginManager for managing and executing plugins, enhancing extensibility and modularity.
- Updated architecture documentation to reflect new plugin capabilities and usage examples.
- Included new middleware types and examples to demonstrate the plugin system's functionality.

This update aims to improve the developer experience by providing a robust framework for extending AI Core's capabilities.
2025-06-17 19:48:14 +08:00
自由的世界人
66f70e9a13 fix: add Markdown preview option in translation settings (#7250) 2025-06-17 14:42:27 +08:00
fullex
763c63841a fix: unified the behavior of SendMessage shortcut (#7276) 2025-06-17 14:38:05 +08:00
koinin
b45faa1b89 Update models.ts, fix doubao-seed-1-6 (#7274)
* Update models.ts, fix doubao-seed-1-6

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

* fix(migrate): add default plain_text export option in v114
2025-06-17 12:43:36 +08:00
fullex
d02fbf9d8f fix(Inputbar): handle Enter key press correctly during composition (#7269) 2025-06-17 10:28:34 +08:00
Kingsword
83a9b2564c fix(PromptPopup): Textarea overflow causes modal's close button unclickable (#7266)
fix(PromptPopup): Textarea overflow causes modal's close button  unclickable.
2025-06-17 08:46:24 +08:00
Chen Tao
341614b586 fix: support tei (#7239)
fix: support mis-tei
2025-06-16 23:52:29 +08:00
chenxue
0c9b215e6e [功能]: aihubmix 更新默认模型 (#7242)
Update models.ts

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

* Update PaintingsRoutePage.tsx

* fix: text to image models
2025-06-16 23:44:11 +08:00
lizhixuan
7187e63ce2 feat: introduce Cherry Studio AI Core package with unified AI provider interface
- Added a new package `@cherry-studio/ai-core` that provides a unified interface for various AI providers based on the Vercel AI SDK.
- Implemented core components including `ApiClientFactory`, `UniversalAiSdkClient`, and a provider registry for dynamic imports.
- Included TypeScript support and a lightweight design for improved developer experience.
- Documented architecture and usage examples in `AI_SDK_ARCHITECTURE.md` and `README.md`.
- Updated `package.json` to include dependencies for supported AI providers.

This package aims to streamline the integration of multiple AI providers while ensuring type safety and modularity.
2025-06-16 22:35:09 +08:00
SuYao
502cce70c2 Feat/vertex ai support (#6416)
* WIP

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

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

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

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

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

* fix: ensure async handling in KnowledgeQueue for base parameters

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

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

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

* refactor: update VertexAPIClient import and class definition

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

* refactor: update AiProvider instantiation across components

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

* refactor: simplify getKnowledgeBaseParams and update API key checks

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

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

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

* refactor: streamline API call in AddKnowledgePopup component

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

* refactor: remove unnecessary await from getKnowledgeBaseParams call

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

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

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

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

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

---------

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

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

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

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

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

* refactor(HomeWindow): optimize message building logic

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

添加蓝耘logo图片

* 添加lanyun api及站点信息

* fix:修改引号

---------

Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2025-06-16 17:29:16 +08:00
one
5d169814f1 fix: gemini generateImage model detection (#7241)
* fix: gemini generateImage model detection

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

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

* sort imports in OpenAIResponseAPIClient.ts

* sort imports in OpenAIResponseAPIClient.ts

* remove pdf-parse

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

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

---------

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

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

* fix(getMessageTitle): optimize loading message

* refactor(notion export): optimize notion export

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

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

* feat: use structured conversation string

* feat: add i18n

* feat: add i18n

* feat: implement summaries for other providers

* fix: adjust new version

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

* fix: improve logic

* fix: improve prompts

* update fetchMessageSummary
2025-06-15 22:40:37 +08:00
kangfenmao
65c61666f7 lint(SyncServersPopup): fix SyncServersPopup lint error 2025-06-15 14:11:29 +08:00
Aichaellee
b658dee638 feat:add lanyun mcp server 2025-06-15 11:17:02 +08:00
Wang Jiyuan
995f6087d9 fix: send message shortcut doesn't work when editing existing message (#6934)
* fix: send message shortcut doesn't work when editing existing message

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

* fix: lint errors
2025-06-14 22:58:49 +08:00
Doekin
bb8e5321e8 fix(ImageGenerationMiddleware): correctly process image URLs (#7198) 2025-06-14 22:39:32 +08:00
one
3c5c63f555 fix(model): qwen3 model detection (#7201) 2025-06-14 21:24:34 +08:00
beyondkmp
2fe790f494 fix: update app-builder-lib patch and adjust minimumSystemVersion handling (#7197)
- Updated the resolution and checksum for the app-builder-lib patch in yarn.lock.
- Modified macPackager.js and updateInfoBuilder.js to correctly reference LSMinimumSystemVersion.
- Enhanced ArchiveTarget.js and NsisTarget.js to include minimumSystemVersion in updateInfo if specified.
2025-06-14 19:39:28 +08:00
beyondkmp
9aefa563de fix: update app-builder-lib patch and add excludeReBuildModules option (#7193) 2025-06-14 15:57:39 +08:00
Wang Jiyuan
9997642d22 feat: add prompt variables docs on topic naming modal popup (#7175) 2025-06-14 14:59:29 +08:00
Wang Jiyuan
57e6715aa5 fix: remove margin-bottom for loading animation (#7191)
* fix: remove margin-bottom for loading animation

* fix: just need to remove the margin-bottom of the last block
2025-06-14 14:57:31 +08:00
Wang Jiyuan
9b6fe25bc1 fix: transparent background on translate dropdown (#7189) 2025-06-14 14:18:25 +08:00
Wang Jiyuan
e1f9a5d66d fix: missing topic prompt on resend/regenerate and duplicate prevention (#7173)
* fix: completion doesn't include topic prompt

* fix: Multiple additions of topic prompts

* fix: improve logic

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

* fix: incorrect model name
2025-06-14 13:35:32 +08:00
kangfenmao
75703ccd3e chore(release): update fetch depth in GitHub Actions workflow
- Changed the fetch depth to 0 in the release workflow to ensure all history is available for tagging. This adjustment improves the accuracy of the release process.
2025-06-14 13:18:59 +08:00
Wang Jiyuan
c7c6773673 feat: add prompt variable "username" (#7174) 2025-06-14 13:08:32 +08:00
fullex
9911196bde fix(SelectionAssistant): make add custom action button bigger (#7185)
fix: make add custom action button bigger
2025-06-14 11:43:13 +08:00
beyondkmp
8fa898a2bf chore(electron.vite.config): update Rollup configuration for single file packaging (#7183)
- Modified the Rollup options to disable code splitting and enable inline dynamic imports, ensuring a single file output for the build process. This change optimizes the packaging of the Electron application.
2025-06-14 10:01:47 +08:00
beyondkmp
796dfaf05c feat: clean up Windows license files (#7133)
* feat: enable minification in build configurations and clean up Windows license files

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

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

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

---------

Co-authored-by: beyondkmp <beyondkmkp@gmail.com>
2025-06-14 08:01:36 +08:00
MyPrototypeWhat
66e577075f refactor(ImageBlock): enhance loading state presentation and improve … (#7160)
* refactor(ImageBlock): enhance loading state presentation and improve layout responsiveness

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

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

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

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

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

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

---------

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

* fix: prevent topic changing on auto renaming

* fix: filter out main text on summarizing
2025-06-13 17:24:24 +08:00
one
12ffa8f9d9 fix(MermaidPreview): re-render mermaid on display change (#7058)
* fix(MermaidPreview): re-render mermaid on display change

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

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

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

* chore: update package.json dependencies

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

* chore: update package dependencies and remove jsdom patch

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

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

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

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

---------

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

* fix: load messages before renaming a topic

* refactor: better error handling

* refactor: make function names more reasonable

* refactor: update shimmer colors

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

- add a customized table component
- update ChatNavigation excluded selectors

* refactor: remove redundant feedback

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

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

* refactor: streamline OpenAIProvider initialization and middleware application

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

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

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

* refactor: enhance middleware structure and context handling in AiProvider

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

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

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

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

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

* refactor: update completions method signatures and introduce CompletionsResult type

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

* refactor: enhance AiProvider middleware and streaming handling

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

* refactor: update AiProvider and middleware for OpenAI completions handling

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

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

* refactor: consolidate middleware types and improve imports

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

* feat: enhance abort handling with AbortController in middleware chain

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

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

* refactor: enhance AiProvider and middleware for improved completions handling

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

* feat(middleware): enhance AbortHandlerMiddleware with recursion handling

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

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

* docs(middleware): 迁移步骤

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

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

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

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

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

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

* feat(AiProvider): implement API client architecture

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

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

* refactor(StreamAdapterMiddleware): simplify stream adaptation logic

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

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

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

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

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

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

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

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

* refactor(middleware): consolidate and enhance middleware architecture

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

* refactor(middleware): update middleware architecture and documentation

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

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

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

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

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

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

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

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

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

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

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

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

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

* refactor: enhance message block handling in messageThunk

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

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

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

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

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

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

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

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

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

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

* refactor(middleware): translation 适配

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

* feat: implement token estimation for message handling

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

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

* feat: add support for image generation and model handling

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

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

* feat: enhance GeminiAPIClient for image generation support

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

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

* feat: enhance image generation handling in OpenAIResponseAPIClient and middleware

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

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

* refactor: remove unused AI provider classes

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

* chore: remove obsolete test files for middleware

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

* chore: remove Suggestions component and related functionality

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

* feat: enhance OpenAIAPIClient and StreamProcessingService for tool call handling

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

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

* fix: copilot error

* fix: improve chunk handling in TextChunkMiddleware and ThinkChunkMiddleware

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

* chore: update dependencies and improve styling

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

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

* feat: implement image generation middleware and enhance model handling

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

* fix: update dedicated image models identification logic

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

* refactor: remove OpenAIResponseProvider class

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

* fix: usermessage

* refactor: simplify AbortHandlerMiddleware for improved abort handling

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

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

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

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

* refactor: update imports and enhance middleware functionality

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

* refactor: streamline middleware logging and improve error handling

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

---------

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

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

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

---------

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

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

* feat: update Cephalon provider configuration and assets

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

* fix: update Cephalon provider model URL

* fix: update official website URL for Cephalon provider
2025-06-12 12:02:03 +08:00
one
378f6ac89a fix(Markdown): inline math overflow (#7095) 2025-06-12 11:05:52 +08:00
kangfenmao
1b2e6c2435 chore(version): 1.4.2 2025-06-12 09:36:27 +08:00
kangfenmao
4eb3f4b5b4 Revert "fix: qwen3 cannot name a topic (#6722)"
This reverts commit 15f93e53f2.
2025-06-11 20:31:24 +08:00
fullex
1f2c467fd4 fix(SelectionAssistant): shortcut in mac and running handling (#7084)
fix(SelectionService): enhance selection and clipboard handling

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

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

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

* refactor: move minapp settings to minapp page

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

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

---------

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

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

* fix: shortcut key

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

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

* fix: show divider in message only in plain mode

* fix: bubble user message style in dark mode

* fix: action button hover style

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

* fix: bubble style assistant message token usage left align

* fix: bubble style

* fix: bubble style

* fix: text color and bubble edit

* fix: bubble editing

* fix: bubble editing

* fix: bubble editor

* fix: editor width

* fix: remove redundant tokens usage

* fix: not unified token font size and color

* fix: unexpected display behavior in plain mode

* fix: info style

* fix: bubble style

* fix: Style fixes for better compatibility

* fix: bubble style

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

* fix: bubble style

* fix: why this happened?

* feat: add description for messages divider in settings

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

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

* fix: update detected language label for consistency across translations

---------

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

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

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

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

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

* feat: improve unresponsive renderer handling and update crash reporting

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

* fix: remove unused session import in index.ts

---------

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

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

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

* fix: english version

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

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

* fix(migrate): old translateModel incorrect

* feat(models): improve default model init

* fix(migrate): update translateModel check

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

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

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

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

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

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

* fix: remove console log

* fix: optimize useEffect dependencies and improve textarea resizing logic

---------

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

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

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

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

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

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

---------

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

* fix: i18n for "高级"

* refactor: move quote-to-main to WindowService

* refactor: move formatQuotedText to renderer
2025-06-06 18:12:38 +08:00
fullex
1d82c13604 fix(SelectionAssistant): add explorer.exe to filterlist 2025-06-06 17:32:16 +08:00
kangfenmao
29e1f53c1e refactor: move minapp settings to minapp page 2025-06-06 17:30:16 +08:00
kangfenmao
74fbadacbd refactor: remove isPreset messages and assistant.messages 2025-06-06 15:54:32 +08:00
beyondkmp
9f3e7fcc42 feat: add set feed url functionality for early access (#5723)
* feat: add update channel functionality for beta testing

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

* add i18n

* update i18n

* update i18n

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

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

* refactor: remove setAutoUpdate method from API

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

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

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

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

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

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

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

* feat: introduce FeedUrl enum for centralized feed URL management

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

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

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

---------

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

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

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

* refactor: create throttlers for blocks

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

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

Signed-off-by: Chan Lee <Leetimemp@gmail.com>
2025-06-06 00:29:47 +08:00
SuYao
dd15b391c5 fix(OpenAIProvider): ensure tool_calls are only yielded when present (#6861)
This update modifies the OpenAIProvider to yield tool_calls only if they exist and have a length greater than zero, improving the handling of delta content. Additionally, a minor cleanup was performed by removing an unnecessary blank line in the code.
2025-06-05 22:49:29 +08:00
fullex
b44b397cdd fix(SelectionToolbar): prevent CSS updates in demo mode 2025-06-05 19:50:49 +08:00
fullex
ff56016d72 fix(SelectionAssistant): ignore CtrlKey mode when ctrl+click (#6843)
fix(SelectionService): add mouse-down listener for multi-selection in ctrlkey mode
2025-06-05 19:05:17 +08:00
kangfenmao
dab1d341f4 chore(version): 1.4.1 2025-06-05 16:30:09 +08:00
Pleasurecruise
113a79dfb7 fix: Improve the switching logic in multi-tab state 2025-06-05 16:26:34 +08:00
LiuVaayne
6d8068c5ac chore: remove unused Delete tokenflux_painting_page.md (#6840)
Delete tokenflux_painting_page.md
2025-06-05 16:23:00 +08:00
kangfenmao
83df1685a3 fix(AssistantsTab): remove untagged group title
This commit updates the AssistantsTab component to only display group titles for tagged assistants, excluding the 'untagged' category. This change enhances the UI by reducing clutter and improving clarity in the display of assistant groups.
2025-06-05 16:18:54 +08:00
SuYao
d383f77db7 chore: update OpenAI package to version 5.1.0 and adjust related patches (#6838)
* chore: update OpenAI package to version 5.1.0 and adjust related patches

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

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

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

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

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

* Add image upload support and comparison view to TokenFlux

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

* Refactor TokenFlux to use service class and components

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

* Refactor TokenFlux to fix state management and polling

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

* Auto-select first model when models are loaded

* Add image generation UI localization strings

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

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

* style: Remove padding from UploadedImageContainer in TokenFluxPage

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

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

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

---------

Co-authored-by: kangfenmao <kangfenmao@qq.com>
2025-06-05 15:47:51 +08:00
Murphy
9dcd4d299e fix: add blank lines between reasoning summary parts (#6827)
Co-authored-by: Chen Tao <70054568+eeee0717@users.noreply.github.com>
2025-06-05 15:39:56 +08:00
George·Dong
cb128f51cf refactor: enhance export functions (#5854)
* feat(markdown-export): add option to show model name in export

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

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

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

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

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

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

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

* fix(settings): remove duplicate showModelNameInMarkdown state

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

* feat(export): update Notion settings i18n

* fix(utils): correct citation markdown formatting

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

* chore: rename function

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

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

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

---------

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

* refactor(constants): remove binary file extensions

* refactor(constants): remove Xcode project
2025-06-05 12:32:28 +08:00
Wang Jiyuan
31479ea2aa fix: OpenAI provider api check doesn't handle error (#6769) 2025-06-05 12:09:37 +08:00
Murphy
3853eb4c06 fix: sync active topic after rename (#6804)
Co-authored-by: Chen Tao <70054568+eeee0717@users.noreply.github.com>
2025-06-05 09:44:11 +08:00
SuYao
ff2b7e0474 fix(AnthropicProvider): update usage and metrics handling to prevent TypeError (#6813) 2025-06-05 09:33:40 +08:00
one
a17e2ca4de fix: use monospace font for theme colorpicker (#6816) 2025-06-05 09:33:26 +08:00
fullex
7542040d5e fix(SelectionAssistant): JetBrains IDEs, Remote desktop, Gaming, PDF views, etc (#6809)
fix: jetbrains ides, remote desktop, pdf views, etcs
2025-06-04 23:56:05 +08:00
SuYao
fe038de23d hotfix: gemini auto thinking (#6810) 2025-06-04 23:25:42 +08:00
one
b4de143462 fix(MermaidPreview): debounce mermaid rendering to alleviate flickering (#6675) 2025-06-04 23:09:47 +08:00
one
b712021c95 fix: codeblock overflow in bubble style (#6773)
* refactor: revert CodeBlockView style change

* fix: codeblock width and overflow

* refactor: improve CodeEditor border

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

* add comments
2025-06-04 19:07:07 +08:00
Zhaker
452a475db6 fix: correct variable name obsidianVault in Obsidian export (#6796) 2025-06-04 18:28:59 +08:00
自由的世界人
c1e91bc8aa fix: optimize multilingual display of documents (#6793)
Update Sidebar.tsx
2025-06-04 17:57:25 +08:00
Lucas
c2e6ee907e fix(ci): Update the nightly-build workflow (#6791)
Update the branch name from `develop` to `main`
2025-06-04 17:37:13 +08:00
one
fda4ca88c1 fix: chat navigation triggering (#6774)
* fix: exclude MessageEditor

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

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

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

- Added new languages (Polish, Turkish, Thai, Vietnamese, Indonesian, Urdu, Malay) to translation options in translate.ts.
- Updated localization JSON files (en-us, ja-jp, ru-ru, zh-cn, zh-tw) to include translations for the new languages.
- Enhanced language detection logic in translate.ts to support new language codes.
2025-06-04 17:11:53 +08:00
fullex
242ea279ee fix(SelectionAssistant): customCSS should not override background (#6746)
fix: customCSS should not override background
2025-06-04 17:11:31 +08:00
beyondkmp
8998bbff27 refactor(BackupManager, WebDav): streamline WebDAV client initialization and enhance directory listing functionality (#6784)
Co-authored-by: beyondkmp <beyondkmkp@gmail.com>
2025-06-04 12:51:21 +08:00
one
11b14c9bd5 fix: prevent message overflow when minimized width (#6775) 2025-06-04 11:50:56 +08:00
one
7c6ff22a4c chore(gitignore): exclude cursor settings (#6779) 2025-06-04 11:48:58 +08:00
Wang Jiyuan
40169f5bdf Fix: outdated provider websites and models (#6766)
* fix: inappropriate provider websites (openrouter, grok)

* fix: outdated model list (grok)
2025-06-04 00:00:33 +08:00
beyondkmp
f2d70b5e96 feat(AppUpdater): implement localized update dialog (#6742)
feat(AppUpdater): implement localized update dialog with new translations for multiple languages

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

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

* chore: remove unuse import

* fix: ensure default emoji

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

---------

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

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

* test(Scrollbar): update snapshot

* test: add more tests

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

* fix

* fix

* fix

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

* fix: update theme listener to properly handle theme updates

---------

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

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

* refactor(Theme): standardize theme handling across components

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

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

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

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

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

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

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

* refactor(Settings): remove theme management from settings

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

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

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

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

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

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

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

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

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

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

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

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

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

* refactor(Theme): remove unused theme retrieval functionality

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

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

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

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

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

---------

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

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

* fix: remove unused model removal function from TranslatePage component

* feat: add language detection and bidirectional translation utilities

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

* fix: improve interaction

* fix: change cld3-asm to franc

* fix: ui/ux

* fix: change eslint

* fix: update

* Revert "fix: update"

This reverts commit 1126a5cce9.

* Reapply "fix: update"

This reverts commit 82b7890f92.

* fix: setloading missing
2025-05-30 13:49:39 +08:00
kangfenmao
a5d10e1ef3 lint: fix eslint error and build:check 2025-05-30 13:44:58 +08:00
kangfenmao
970c517f4b fix(Messages, WebSearchProviderSetting): remove unused variables and update provider logo styling 2025-05-30 13:29:32 +08:00
MyPrototypeWhat
93e9baa421 fix(MainTextBlock): update whiteSpace style for user messages to 'pre-wrap' 2025-05-30 12:12:06 +08:00
kangfenmao
c723af67c0 test(scrollbar): fix snapshot mismatched 2025-05-30 12:11:13 +08:00
one
01b1d7bc47 refactor(SvgPreview): use shadow dom 2025-05-30 12:02:53 +08:00
Caelan
61a658611d feat: dmxapi generate multiple image (#6632)
* chore(version): 1.3.8

* 新增自动添加

* 图片自增功能优化

---------

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

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

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

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

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

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

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

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

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

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

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

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

* refactor: attach listeners to MessagesContainer for better triggering experience

* refactor: add delay to Tooltips

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

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

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

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

* Update MiniAppSettings.tsx

---------

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

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

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

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

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

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

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

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

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

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

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

---------

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

* feat: add tip

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

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

* fix: improve error unit test

* refactor: simplify error handling in ErrorBlock component

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

* fix: update error handling in ErrorBlock component

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

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

* refactor: enhance configuration management

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

* feat: support imagen model

* update proxy notice

---------

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

* add openai painting

* support base64 response

* update config

* fix upload preview bug

* fix remix default model

* fix history data

* feat: optimize structure

* fix history data

---------

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

* fix: optimize the display name logic for action buttons in the selection toolbar
2025-05-27 12:51:49 +08:00
MyPrototypeWhat
7a255c1b6d fix(MainTextBlock): adjust whiteSpace style for user role messages (#6501) 2025-05-27 12:10:09 +08:00
kangfenmao
ef660b4222 chore: update electron-builder configuration to refine file exclusion patterns
- Added exclusions for various distribution directories and module types to optimize the build process.
- Updated license file exclusions to be more inclusive of different casing variations.
2025-05-27 10:06:39 +08:00
kangfenmao
04b66d81d5 chore: update @google/genai to version 1.0.1 and remove GeminiService references
- Updated the @google/genai dependency in package.json and yarn.lock to version 1.0.1.
- Removed the GeminiService and its related references from the codebase to streamline functionality.
- Introduced a new CacheService for managing cached data effectively.
2025-05-27 10:04:41 +08:00
beyondkmp
19905b6696 fix: adjust order of tools in CodeToolbar constants for correct display 2025-05-27 09:38:02 +08:00
fullex
e0bb39b0b9 feat: integrate custom CSS support in SelectionAssistant 2025-05-27 09:37:23 +08:00
fullex
320279fe07 fix[SelectionAssistant]: remove console.log (#6474)
fix: remove console.log
2025-05-26 20:11:13 +08:00
beyondkmp
eda6c70260 fix: cannot run from yarn dev (#6468) 2025-05-26 19:20:38 +08:00
beyondkmp
75a0e52a3b chore: removed unused dependencies to reduce size (#6464)
* chore: update package dependencies and refactor BackupManager to use fs.promises

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

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

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

---------

Co-authored-by: beyondkmp <beyondkmkp@gmail.com>
2025-05-26 18:34:57 +08:00
fullex
3feffaeb54 feat: Selection Assistant / 划词助手 (#5900)
* feat(selection): implement selection assistant with toolbar and action management

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

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

* fix: toolbar hiding

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

* fix: improve logical coordinate handling in SelectionService

* fix: update URL loading and coordinate conversion in SelectionService

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

* refactor(SelectionService): enhance preloaded action window management

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

* fix: toolbar position calculating for multi monitor

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

* fix: SelectionActionUserModal layout

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

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

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

refactor: SelectionActionsList

* chore: enhance tooltip for trigger mode settings

* fix: console.log

* chore: update selection-hook to version 0.9.12

* fix: integrate language settings into selection components

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

* chore: update selection-hook package version to 0.9.13

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

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

* fix: mock individual properties

* test: add tests for CustomTag

* test: add tests for ExpandableText

* test: conditional rendering tooltip of tag

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

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

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

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

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

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

* docs: add debug section to development documentation

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

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

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

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

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

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

* fix: update citation mapping in export tests for consistency

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

* fix: codeblock overflow behaviour

* fix: CodePreview scrollbar

* refactor: move margin to CodeHeader

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

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

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

* Chore: Remove unnecessary comments from MessageMenubar

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

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

---------

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

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

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

---------

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

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

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

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

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

* feat: add CherryCloud provider configuration and token management

* feat: integrate TokenFlux provider support and update related configurations

fix: update redux-persist version to 104

refactor: remove redundant tokenflux provider model assignment in migration

fix: update migration to add TokenFlux provider instead of CherryCloud

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

* feat: update TokenFlux provider assets and add new models

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

* feat: disable TokenFlux provider by default in INITIAL_PROVIDERS

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

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

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

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

* fix: update Russian translations for MinApp popup UI elements

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

---------

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

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

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

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

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

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

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

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

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

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

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

---------

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

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

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

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

* Refactor: Remove unnecessary comments in SettingsTab

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

---------

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

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

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

* refactor: reuse shiki highlighter and markdown-it renderer

* hotfix: exclude GitHub and Copilot models

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

---------

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

* refactor: reuse shiki highlighter and markdown-it renderer

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

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

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

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

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

* clean: remove node-notifier from asarUnpack in Electron config

* fix: update notification type in preload script to align with new structure

* feat: Integrate NotificationService for user notifications across various components

- Implemented NotificationService in useUpdateHandler to notify users of available updates.
- Enhanced KnowledgeQueue to send success and error notifications during item processing.
- Updated BackupService to notify users upon successful restoration and backup completion.
- Added error notifications in message handling to improve user feedback on assistant responses.

This update improves user experience by providing timely notifications for important actions and events.

* feat: Refactor notification handling and integrate new notification settings

- Moved SYSTEM_MODELS to a new file for better organization.
- Enhanced notification handling across various components, including BackupService and KnowledgeQueue, to include a source attribute for better context.
- Introduced notification settings in the GeneralSettings component, allowing users to toggle notifications for assistant messages, backups, and knowledge embedding.
- Updated the Redux store to manage notification settings and added migration logic for the new settings structure.
- Improved user feedback by ensuring notifications are sent based on user preferences.

This update enhances the user experience by providing customizable notification options and clearer context for notifications.

* feat: Add 'update' source to NotificationSource type for enhanced notification context

* feat: Integrate electron-notification-state for improved notification handling

- Added electron-notification-state package to manage Do Not Disturb settings.
- Updated NotificationService to respect user DND preferences when sending notifications.
- Adjusted notification settings in various components (BackupService, KnowledgeQueue, useUpdateHandler) to ensure notifications are sent based on user preferences.
- Enhanced user feedback by allowing notifications to be silenced based on DND status.

* feat: Add notification icon to Electron notifications

* fix: import SYSTEM_MODELS in EditModelsPopup for improved model handling

* feat(i18n): add knowledge base notifications in multiple languages

- Added success and error messages for knowledge base operations in English, Japanese, Russian, Chinese (Simplified and Traditional).
- Updated the KnowledgeQueue to utilize the new notification messages for better user feedback.

* feat(notification): introduce NotificationProvider and integrate into App component

- Added NotificationProvider to manage notifications within the application.
- Updated App component to include NotificationProvider, enhancing user feedback through notifications.
- Refactored NotificationQueue to support multiple listeners for notification handling.
2025-05-21 12:11:52 +08:00
自由的世界人
374e97b9ab feat: add message multiple select (#6085)
* feat: add message multiple select

* fix: build error

* feat: add drag-and-drop multi-selection

* fix: code review

* Revert "fix: code review"

This reverts commit 7e29d5147c.

* fix: hide input bar display

* fix: extract the ChatContext

* fix: eventemitter

* feat: enhance multi-select functionality with message registration

* fix: history page message search

* fix: build error

* fix: remove Event Emitter

* fix: build error

* feat: add hideMenuBar prop to MessageItem and integrate MessageEditingProvider

* fix: improve message selection logic and handle drag events

* fix: update translation keys for multiple select functionality

* fix: refactor message deletion logic and enhance message selection handling

* fix: replace useSelector with useStore for message selection in ChatContext

* fix: refactor MessageGroup to utilize context for multi-select handling and message registration

* Revert "fix: refactor MessageGroup to utilize context for multi-select handling and message registration"

This reverts commit f4d1454525.

* fix: simplify MessageGroup props and utilize context for message selection handling

* fix: streamline multi-select handling by consolidating context usage and simplifying component props
2025-05-21 11:22:36 +08:00
kangfenmao
4c6f7b9282 fix: sse mcp 404 not found 2025-05-21 10:50:28 +08:00
one
75901e2714 fix: improve CodeEditor controlled mode, prevent unnecessary trimming (#6221)
* fix: improve CodeEditor controlled mode, prevent unnecessary trimming

* fix: useEffect dependency
2025-05-21 03:51:30 +08:00
one
6cd324f8ba fix: handle undefined html title (#6229) 2025-05-20 20:57:14 +08:00
LiuVaayne
312b73225a Feat/mcp run python (#6151)
* feat: add MCP Run Python server and integrate Pyodide for executing Python code

* fix: comment out unused polyfill imports in MCP Run Python server
2025-05-20 20:47:30 +08:00
beyondkmp
adf13979ca refactor(PasteService): optimize handler registration logic (#6223)
- Updated registerHandler to only log and update the handler if it changes, reducing unnecessary operations.
- Removed logging from unregisterHandler for cleaner code.
2025-05-20 19:12:45 +08:00
kangfenmao
74fbd37a20 chore(version): 1.3.8 2025-05-20 18:41:41 +08:00
kangfenmao
e0774e49cc feat: implement getFilePath method in FileManager and update KnowledgeContent to use it
- Added getFilePath method in FileManager to construct file paths based on file ID and extension.
- Updated KnowledgeContent to utilize the new getFilePath method for opening file paths, improving code clarity and maintainability.
2025-05-20 18:04:01 +08:00
kangfenmao
4838a02785 Revert "feat: add resolveFilePath functionality to resolve restoring from different computer (#5980)"
This reverts commit 6ed6376707.
2025-05-20 17:44:04 +08:00
kangfenmao
a0cf667f4f refactor: improve FloatingSidebar and HomeTabs components
- Simplified the onOpenChange handler in FloatingSidebar for better readability.
- Added style prop to HomeTabs for enhanced customization.
- Adjusted Container style in HomeTabs to merge with existing border styles.
2025-05-20 17:17:57 +08:00
George Zhao
02a4f9b5f1 fix: add context menu trigger to FloatingSidebar component 2025-05-20 17:10:47 +08:00
kangfenmao
c1a81b88b0 feat: enhance ContentSearch and MessageTools components
- Added placeholder and adjusted styles for the Input in ContentSearch.
- Updated SearchBarContainer to use fixed positioning and improved padding.
- Refactored MessageTools to render raw content correctly and added a new MarkdownContainer for better styling.
- Minor adjustments to other components for improved layout and user experience.
2025-05-20 15:33:10 +08:00
Zhaker
9d64690c42 fix: knowledge icon consistency across components (#6209)
feat: knowledge icon consistency across components
2025-05-20 15:07:57 +08:00
karl
5cf611f1ac fix(mcp): mcp result preview is missing parameters (#6165) 2025-05-20 14:46:21 +08:00
Wei
df5f795671 feat: add new model provider BurnCloud 2025-05-20 13:55:57 +08:00
fullex
6ab0540f90 chore: update Hailuo logo (#6208)
* feat: update Hailuo model configuration with new logo property and border option

* chore: update hailuo_dark model image
2025-05-20 13:11:54 +08:00
beyondkmp
3908080d21 refactor: centralize paste handling logic with PasteService (#6199)
- Integrated PasteService for handling paste events in Inputbar and MessageEditor components.
- Removed redundant paste handling code and improved maintainability.
- Registered paste handlers and set last focused component for better user experience.
- Ensured consistent behavior for text and file pasting across components.

Co-authored-by: beyondkmp <beyondkmkp@gmail.com>
2025-05-20 13:09:37 +08:00
kangfenmao
2fc705c77f chore(version): 1.3.7 2025-05-20 11:33:52 +08:00
kangfenmao
041ae5e09e fix: set default initial values for rendering speed in aihubmixConfig
- Added initialValue 'DEFAULT' for renderingSpeed in multiple mode configurations to ensure consistent default behavior across the application.
2025-05-20 11:31:35 +08:00
jwcrystal
279f5db817 feat: add MCP servers via JSON quickly (#6099)
* feat: add MCP servers via JSON quickly

* refactor(MCPSettings): Extract JSON parsing logic into a helper function

* feat: json linter for EditMcpJsonPopup

* feat(mcp): confirm the MCP server status as connection

* refactor(AddMcpServerModal): 移除冗余注释并修复加载状态

* feat(MCPSettings): Add support for SSE and streamableHttp formats and optimize server configuration parsing

- Add server type validation to ensure the type is stdio, SSE, or streamableHttp
- Optimize JSON parsing logic to ensure server configuration completeness and validity
- Update example text to provide more detailed configuration examples

* fix(MCPSettings): fix AddMcpServerModal default baseUrl login

移除serverToAdd.url作为baseUrl的备选值,确保baseUrl仅使用serverToAdd.baseUrl的值

* feat(MCPSettings): support CodeEditor in AddMcpServerModal

* fix: Remove unnecessary type checks for JSON parsing login

* fix(MCPSettings): fix compatibility issues with the URL field when parsing server data

* refactor: remove unnessary cdoe

* chore: Add a server dropdown button to integrate new features in UI

- Integrate the two buttons for adding a server into a single dropdown menu to enhance user experience and simplify the interface

* chroe: modify the Dropdown items' name of addServer

* refactor(i18n): unify the translation for the MCP server import function

---------

Co-authored-by: one <wangan.cs@gmail.com>
2025-05-20 10:41:25 +08:00
kangfenmao
35d3c8e451 fix: update default values and improve component structure
- Changed default value for `getTrayOnClose` to true in `ConfigManager`.
- Removed fullscreen toggle logic from `WindowService`.
- Adjusted styles in `OpenAIAlert` for better spacing.
- Reorganized imports in `Navbar` and updated component paths in `AssistantsTab` and `SettingsTab`.
- Added new components `AssistantItem` and `OpenAISettingsGroup` for better modularity.
- Enhanced `SettingGroup` styles for improved UI consistency.
- Updated `QuickPhraseSettings` to utilize theme context.
- Minor fixes and refactoring across various services and components.
2025-05-20 00:20:02 +08:00
suyao
a3a3045b1a fix: update file path resolution in new Electron 2025-05-19 23:02:14 +08:00
kangfenmao
2686553c19 docs: update branching strategy documentation and add English and Chinese versions
- Updated the README to link to the new English branching strategy document.
- Added a new English version of the branching strategy document.
- Removed the outdated branching strategy document.
- Added a Chinese version of the branching strategy document.
2025-05-19 22:25:46 +08:00
beyondkmp
6ed6376707 feat: add resolveFilePath functionality to resolve restoring from different computer (#5980)
* feat: add resolveFilePath functionality to file management

* Added new IPC channel for resolving file paths.
* Implemented resolveFilePath method in FileStorage service.
* Updated FileManager to utilize the new resolveFilePath method.
* Enhanced preload API to expose resolveFilePath to the renderer.
* Updated KnowledgeService to ensure file paths are correctly resolved in knowledge bases.

* refactor: remove unused path import from preload index

* Removed the unused 'resolve' import to clean up the codebase.
* Improved code readability by eliminating unnecessary dependencies.

---------

Co-authored-by: beyondkmp <beyondkmkp@gmail.com>
2025-05-19 21:58:44 +08:00
kangfenmao
a18c2b3f0a refactor: remove constructor from KnowledgeQueue and invoke checkAllBases in useAppInit hook 2025-05-19 21:28:25 +08:00
kangfenmao
1469675a20 Merge branch 'develop' 2025-05-19 21:23:17 +08:00
jwcrystal
1739684a27 feat: support default Quick Assistant model (#6150)
* feat: support default Quick Assistant model

- support the configuration of the quick assistant model.
- manage the models independently in Quick Assistant and Default Assistant.

* docs(i18n): Add translation for quick assistant model

* fix(llm): fix the default value of quickAssistantModel to silicon[1]

* refactor(i18n): uniformly the terms, changing "快速助手" to "快捷助手"
2025-05-19 20:49:13 +08:00
SuYao
084cedf071 hotfix: add OpenAI settings tab and related functionality (#6040)
* feat: add OpenAI settings tab and related functionality

* fix: update related logic to support flexible service layer.

* fix(OpenAIResponseProvider): remove unused isOpenAILLMModel import
2025-05-19 20:18:16 +08:00
SuYao
5dddf3c9d3 feat(settings): add OpenAI alert (#6164) 2025-05-19 20:06:54 +08:00
one
9879a02ca8 hotfix: respect user-defined model group name (#6174) 2025-05-19 18:40:01 +08:00
SuYao
783bdc40a6 Hotfix/gemini-para-bug (#6173)
* fix(OpenAIProvider): enhance model support and formatting logic

* fix(OpenAIProvider): Gemini OpenAI Compatible
2025-05-19 17:34:35 +08:00
beyondkmp
0ad2d2162e feat: add zoom factor handling on window restore in WindowService (#6169)
Co-authored-by: beyondkmp <beyondkmkp@gmail.com>
2025-05-19 17:14:55 +08:00
SuYao
3dc0a583ec hotfix: enhance reasoning summary handling in OpenAI response processing (#6037) 2025-05-19 17:07:35 +08:00
jwcrystal
e57d4c9f9a refactor(Scrollbar): Optimize scroll handling logic to support external scroll events (#6047)
* refactor(Scrollbar): Optimize scroll handling logic to support external scroll events

- Refactor `onScroll` logic to support external scroll events
- Integrate with `useScrollPosition` hook for better scroll state management
- Memorize the scoll state for better user experience
- Fix type definition for `ref` attribute
- Remove unnecessary `ref` type overrides
- Improve component compatibility and maintainability

* perf(useScrollPosition): Optimize scroll position updates using requestAnimationFrame

- Wrap the `window.keyv.set` call in `requestAnimationFrame` to reduce unnecessary performance overhead and improve responsiveness during scrolling.

* fix(Messages): Remove unused FC imports and add onComponentUpdate and onFirstUpdate properties
2025-05-19 16:33:06 +08:00
Morax
8c9186a0ee feat: Add-aihubmix-ideogram-v3 (#5958)
* chore: update Yarn version to 4.9.1 and add rendering speed option for V3 model

* Discard changes to .yarnrc.yml

* Discard changes to .yarn/releases/yarn-4.6.0.cjs

* Update package.json

* Delete .yarn/releases/yarn-4.9.1.cjs

* Discard changes to .yarn/releases/yarn-4.6.0.cjs

* docs: Update README.zh.md add GitCode✖️Cherry Studio【新源力】贡献挑战赛

GitCode✖️Cherry Studio【新源力】贡献挑战赛

* fix: Update the file permissions for yarn-4.6.0.cjs, modify image links and formatting in README.zh.md

* clean

* refactor: improve switch case blocks and update config parameters in AihubmixPage

* feat: add error handling for empty image URLs and update localization messages

* refactor: replace modal error handling with warning messages for empty image URLs

* feat: update localization for rendering speed and translating messages in Japanese, Russian, and Traditional Chinese

* feat: add style types and rendering speed options to localization files

---------

Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
Co-authored-by: suyao <sy20010504@gmail.com>
2025-05-19 16:30:07 +08:00
SuYao
45def07a1b refactor: implement message editing and resend functionality (#5901)
* feat: implement message editing and resend functionality with block management

* fix: move start_time_millsec initialization to onChunk for accurate timing

* feat: refactor message update thunks to separate block addition and updates

* feat: enhance MessageBlockEditor with toolbar buttons and attachment functionality

* refactor: implement message editing context and integrate with message operations

* style: adjust padding in MessageBlockEditor and related components

* refactor: remove MessageEditingContext and integrate editing logic directly in Message component

* refactor: streamline message rendering logic by using conditional rendering for MessageEditor and MessageContent

* refactor: remove redundant ipcRenderer variable in useMCPServers hook

* fix: Add mock for electron's ipcRenderer to support testing

* test: Update mocks for ipcRenderer and remove redundant window.electron mock

* fix: enhance file handling in MessageEditor with new Electron API

- Added support for file dragging with visual feedback.
- Improved file type validation during drag-and-drop and clipboard pasting.
- Displayed user notifications for unsupported file types.
- Refactored file handling logic for better clarity and maintainability.
2025-05-19 15:38:00 +08:00
MyPrototypeWhat
3b68a311cc refactor(messageThunk): optimize message update logic with atomic modifications
* Wrapped message and block updates in a database transaction for improved consistency.
* Replaced direct updates with atomic modifications using where().modify() for better performance and clarity.
* Enhanced error handling for message updates to ensure robustness.
2025-05-19 13:48:47 +08:00
suyao
ca1a4e06a1 fix: update token limits for Claude models 2025-05-19 13:47:51 +08:00
LiuVaayne
2acebf1353 refactor: improve sanitization and formatting in buildFunctionCallToo… (#6152)
refactor: improve sanitization and formatting in buildFunctionCallToolName function
2025-05-19 11:20:38 +08:00
George Zhao
eec83da19c feat: add FloatingSidebar component and integrate assistant switching… (#5852)
* feat: add FloatingSidebar component and integrate assistant switching functionality

* refactor: simplify FloatingSidebar by removing unused hooks and components

* refactor: remove unused AddAssistantPopup and related code from FloatingSidebar

* feat: implement sidebar hide cooldown and adjust tooltip delays in Navbar.

* feat: integrate HomeTabs into FloatingSidebar and update Navbar props

* refactor: remove commented-out code and unused components from FloatingSidebar

* fix: update Popover placement from rightTop to bottomRight in FloatingSidebar.

* feat: add forceToSeeAllTab prop to HomeTabs for improved tab visibility control

* fix: update HomeTabs logic to respect forceToSeeAllTab prop for tab selection

* feat: pass position prop to FloatingSidebar and HomeTabs for consistent layout control

* feat: integrate FloatingSidebar into Navbar for improved topic visibility and update HomeTabs logic for consistent tab rendering

* fix: remove unused showTopics from Navbar component

* feat: enhance topic visibility control in Navbar with cooldown logic for sidebar toggle

* fix: add onMouseOut handler to NavbarIcon for sidebar cooldown reset

---------

Co-authored-by: George Zhao <georgezhao@SKJLAB>
2025-05-19 11:05:15 +08:00
kangfenmao
517eaacba9 fix: update min token limit for qwen3 models in THINKING_TOKEN_MAP 2025-05-19 10:49:33 +08:00
kangfenmao
a4d60d2228 Merge branch 'main' into develop 2025-05-19 10:12:15 +08:00
one
8051f36511 refactor: transparent border for code blocks 2025-05-19 08:36:09 +08:00
fullex
9ff336c2b0 refactor: simplify font family handling and improve layout styles in MessageTools and ThinkingBlock components 2025-05-19 08:32:37 +08:00
SuYao
6212349a83 fix: 多发消息时除fold布局以外的其他布局不能被渲染 (#6143) 2025-05-19 01:43:21 +08:00
SuYao
35eaef1395 Revert "feat: add MCP Run Python server and integrate Pyodide for exe… (#6141)
Revert "feat: add MCP Run Python server and integrate Pyodide for executing P… (#5793)"

This reverts commit 4c7756aa78.
2025-05-19 00:54:32 +08:00
kangfenmao
8f1ea3df5c chore(version): 1.3.6 2025-05-18 23:57:53 +08:00
kangfenmao
8a54ebc183 refactor(SyntaxHighlighter): modularize highlighter logic and improve theme/language loading
* Moved highlighter initialization and loading functions to a new utility file for better organization.
* Simplified theme and language loading in the SyntaxHighlighterProvider using the new utility functions.
* Removed redundant code and improved readability in MessageTools by introducing a new CollapsedContent component for rendering tool responses.
* Updated MCPDescription to use an async function for Shiki instance initialization.
2025-05-18 23:33:43 +08:00
kangfenmao
e91a449b82 feat(electron.vite.config): add manual chunking for vendor modules in output configuration 2025-05-18 23:33:43 +08:00
LiuVaayne
4c7756aa78 feat: add MCP Run Python server and integrate Pyodide for executing P… (#5793)
feat: add MCP Run Python server and integrate Pyodide for executing Python code
2025-05-18 23:31:05 +08:00
LiuVaayne
bd88937d7e feat: add buildFunctionCallToolName utility for generating tool names (#6136) 2025-05-18 23:05:44 +08:00
jwcrystal
4ece77b414 hotfix(i18n): Add multi-language support for network search settings (#6138) 2025-05-18 22:44:57 +08:00
Rudbeckia.hirta.L
a4e647ae1d fix: Search results are on the right side (#6133) 2025-05-18 22:21:13 +08:00
kangfenmao
d1e8c09559 refactor: update spinner handling and improve initialization timing
* Modified the Content Security Policy to include 'unsafe-inline' for script-src.
* Changed the spinner display style from 'none' to 'flex' for better visibility.
* Removed the initSpinner function and directly initialized the spinner in useAppInit.
* Added console timing for initialization to track performance.
2025-05-18 22:05:35 +08:00
kangfenmao
7bccac2785 refactor: streamline MCP service handling and improve IPC registration
* Refactored MCPService to implement a singleton pattern for better instance management.
* Updated IPC registration to utilize the new getMcpInstance method for handling MCP-related requests.
* Removed redundant IPC handlers from the main index file and centralized them in the ipc module.
* Added background throttling option in WindowService configuration to enhance performance.
* Introduced delays in MCPToolsButton to optimize resource and prompt fetching after initial load.
2025-05-18 22:04:56 +08:00
自由的世界人
462f31e839 hotfix: github models check error (#6128) 2025-05-18 20:23:29 +08:00
自由的世界人
2700ef7156 hotfix: github models check error (#6128) 2025-05-18 20:16:33 +08:00
kangfenmao
b17326d8f9 fix(WindowService): handle fullscreen toggle before hiding window 2025-05-18 19:43:47 +08:00
George Zhao
d6b5c25d29 fix: remove infinite token display for max count and simplify context count rendering. (#6103)
Co-authored-by: George Zhao <georgezhao@SKJLAB>
2025-05-18 18:37:08 +08:00
MyPrototypeWhat
882c62b4ea refactor(MessageGroup): optimize selected message handling with useMe… (#6124)
* refactor(MessageGroup): optimize selected message handling with useMemo and clean up unused code

* refactor(MainTextBlock): optimize citation handling with useMemo and improve code clarity

* fix:del console
2025-05-18 18:08:13 +08:00
SuYao
d8c6be670a Hotfix/rich text paste (#6122)
fix(Inputbar): 优化粘贴处理逻辑,优先处理文本粘贴
2025-05-18 17:16:05 +08:00
Konjac-XZ
6b11c42d3b fix: Summary for single message export doesn't work. 2025-05-18 15:11:30 +08:00
purefkh
ebfd6bc5f7 fix: Prevent sending message during input method composition in mini window (#6104) 2025-05-18 15:09:56 +08:00
kangfenmao
f6493be82b fix(WindowService): add backgroundThrottling option to Electron configuration 2025-05-18 14:41:10 +08:00
purefkh
5532bb93c8 fix(i18n): websearch has no translation (#6118) 2025-05-18 12:44:06 +08:00
kangfenmao
438fd5fabf chore: update dependencies in yarn.lock
- Removed outdated dependencies including "@babel/plugin-syntax-jsx" and "@bcoe/v8-coverage".
- Added new dependencies such as "@sec-ant/readable-stream", "browserslist", and "cacheable-request".
- Updated versions for existing packages including "got", "ow", and "type-fest".
- Ensured compatibility with the latest versions of peer dependencies.
2025-05-18 11:58:02 +08:00
kangfenmao
e195c4acb5 refactor: streamline SettingsTab layout and remove unnecessary Divider components 2025-05-18 11:50:26 +08:00
Konjac-XZ
0216bb2db5 fix: Summary for single message export doesn't work. 2025-05-18 10:21:45 +08:00
自由的世界人
efd11457db feat: make sidebar setting group collapsible (#6019)
* feat: code tools, editor, executor

CodeEditor & Preview
- CodeEditor: CodeMirror 6
  - Switch to CodeEditor in the settings
  - Support edit&save with a accurate diff&lookup strategy
  - Use CodeEditor for editing MCP json configuration
- CodePreview: Original Shiki syntax highlighting
  - Implemented using a custom Shiki stream tokenizer
  - Remov code caching as it is incompatible with the current streaming code highlighting
  - Add a webworker for shiki
- Other preview components
  - Merge MermaidPopup and Mermaid to MermaidPreview, use local mermaidjs
  - Show mermaid syntax error message on demand
  - Rename PlantUML to PlantUmlPreview
- Rename SyntaxHighlighterProvider to CodeStyleProvider for clarity
- Both light and dark themes are preserved for convenience

CodeToolbar
- Top sticky toolbar provides quick tools (left) and core tools (right)
- Quick tools are hidden under the `More` button to avoid clutter, while core tools are always visible
- View&edit mode
  - Allow switching between preview and edit modes
  - Add a split view

Code execution
- Pyodide for executing Python scripts
- Add a webworker for Pyodide

* fix: migrate version and lint error

* refactor: use constants for defining tool specs

* feat: make setting group collapsible

* fix: yarn.lock

* fix: conflict error

---------

Co-authored-by: one <wangan.cs@gmail.com>
2025-05-18 10:11:14 +08:00
one
9d0b5d2c8f refactor: clean up code for MessageGroupModelList (#6084)
* refactor: clean up comments and useless z-index

* refactor: remove useless styles, restore segment animation, extract renderLabel

* refactor: add left margin to the toggle button

* revert: font size
2025-05-18 10:05:19 +08:00
eeee0717
04c3911243 fix(knowledge): remove topN 2025-05-18 10:02:05 +08:00
MyPrototypeWhat
78af3d146e fix: group message resend (#6106) 2025-05-18 09:52:27 +08:00
MyPrototypeWhat
53cff11726 fix: group message resend (#6106) 2025-05-17 23:53:57 +08:00
kangfenmao
47c9465699 Merge branch 'main' into develop 2025-05-17 21:41:38 +08:00
fullex
bf2aa46977 chore: remove unused packages (#5948)
* chore: update @cherrystudio/embedjs packages to version 0.1.29 and update sass to version 1.88.0; remove deprecated dependencies from package.json and yarn.lock

* chore: add node-stream-zip and update devDependencies in package.json and yarn.lock

* chore: reorganize and update @cherrystudio/embedjs dependencies in package.json

* chore: add zipread dependency to package.json and update yarn.lock

* chore: add @strongtz/win32-arm64-msvc dependency to package.json and update yarn.lock
2025-05-17 21:36:06 +08:00
purefkh
317675b157 fix: Prevent sending message during input method composition in mini window (#6104) 2025-05-17 21:34:17 +08:00
fullex
5f29cc40ab fix: font-family changed in Windows with new Electron (#6079) 2025-05-17 21:27:29 +08:00
icinggslits
501611670e feat: Highlighted search in chat page (#3302)
* feat: Highlighted search in chat page

* Bug fixes and added a temporary F3 shortcut

* Bug fixes

* Bug fixes

* feat: Implement content search functionality with keyboard shortcuts

- Added a new `ContentSearch` component for searching text within a specified target.
- Integrated search functionality with keyboard shortcuts, allowing users to enable search via a new shortcut key.
- Updated internationalization files to include new search-related messages in multiple languages.
- Enhanced shortcut management to accommodate the new search feature, including a migration for shortcut updates.
- Refactored the `Chat` component to utilize the new content search capabilities.

* fix(ContentSearch): Update search index check and enhance container styling

* feat(ContentSearch): Enhance search functionality with case sensitivity and whole word options

- Added options for case sensitivity and whole word matching in the search feature.
- Updated the highlightText function to accommodate new search parameters.
- Improved styling and layout of the search input and buttons for better user experience.
- Refactored related components to support the new search options.

* refactor(useShortcuts): Remove console log for shortcut invocation

* feat: Add user filter and initial text to search

- Improve ContentSearch UI:
  - Add tooltips for search options
  - Enhance result display (e.g., "No results", "0/0")
  - Disable navigation buttons when no matches
  - Relocate search bar to the top of the chat view
- Apply case-sensitivity logic only to Latin characters
- Add translations for new options

* i18n: Translate "No results" message

* Add in-chat search shortcut, update global search to Cmd/Ctrl+Shift+F.

* feat: Allow users to scroll during input and optimize the search result index update logic

* feat: Update search message shortcut to include Shift for improved accessibility

* feat: Refactor search component layout and update highlight color variables

* fix: Adjust margin-bottom for SearchBarContainer

---------

Co-authored-by: suyao <sy20010504@gmail.com>
2025-05-17 21:14:03 +08:00
kangfenmao
609548a053 chore(version): 1.3.5 2025-05-17 20:05:16 +08:00
kangfenmao
a7850d2d2f fix: electron-store config.json missing
* Added 'electron-store' to the Vite configuration for Electron.
* Imported configuration from '@main/config' in the main index file.
* Changed default return value for getTrayOnClose method in ConfigManager to false
2025-05-17 19:58:38 +08:00
SuiYunsy
feb256070d 拓宽”请选择要检测的模型“模态框 (#6062)
许多模型名称很长,目前模态框太短,无法完全显示
2025-05-17 19:57:46 +08:00
kangfenmao
6e13ad4b2d fix: adjust visibility timer and trigger area dimensions in ChatNavigation
* Reduced the button visibility timer from 1500ms to 500ms for quicker feedback.
* Decreased the trigger width from 80 to 60 for improved interaction.
* Updated the height calculation from 40% to 30% of the window height for better layout consistency.
2025-05-17 19:57:09 +08:00
kangfenmao
29b917772c refactor: remove deprecated max token settings from OpenAIProvider and OpenAIResponseProvider 2025-05-17 19:57:09 +08:00
George Zhao
0f97d0302e feat: implement useFullscreen hook and integrate with NavbarRight for dynamic padding (#6000)
* feat: implement useFullscreen hook and integrate with NavbarRight for dynamic padding

* feat: integrate useFullscreen hook to adjust sidebar layout based on fullscreen state

* fix: adjust sidebar height based on fullscreen state for better layout

---------

Co-authored-by: George Zhao <georgezhao@SKJLAB>
2025-05-17 19:48:40 +08:00
Rudbeckia.hirta.L
365eb9bab5 feat: support skipping files during backup(slim backup) (#6075)
* feat: support skipping files during backup

* 修复 lint

* 修复 lint

---------

Co-authored-by: daisai.1 <daisai.1@bytedance.com>
2025-05-17 19:20:40 +08:00
George Zhao
fe45a68260 fix: Ensure last app is displayed when no filtered apps are found (#6090)
* fix: Ensure last app is displayed when no filtered apps are found

* fix: Remove Empty component from AppsPage when no apps are found

---------

Co-authored-by: George Zhao <georgezhao@SKJLAB>
2025-05-17 17:27:45 +08:00
one
3ce7929979 chore: reduce package size (#6092) 2025-05-17 17:07:30 +08:00
Steven Ding
9a931ed0a4 fix: change minimax's URL (#6091)
Signed-off-by: stevending1st <stevending1st@163.com>
2025-05-17 15:55:36 +08:00
beyondkmp
08b9b4594a feat: Drop file improvements (#6089)
* feat: enhance file drag-and-drop functionality and global paste handling in Inputbar

- Added support for file dragging with visual feedback.
- Implemented global paste event handling to allow pasting outside the text area.
- Improved file drop handling to notify users of unsupported file types.

* refactor(Inputbar): simplify global paste handling logic

- Removed unnecessary checks for active element in global paste event handling.
- Streamlined the paste event processing for improved clarity and maintainability.

* style(Inputbar): clean up comments and maintain visual feedback for file dragging

- Removed unnecessary comments related to the styling of the file dragging state.
- Ensured the visual feedback for file dragging remains intact with updated background color.
2025-05-17 09:35:25 +08:00
kangfenmao
a52e3a7428 fix: electron-store config.json missing
* Added 'electron-store' to the Vite configuration for Electron.
* Imported configuration from '@main/config' in the main index file.
* Changed default return value for getTrayOnClose method in ConfigManager to false
2025-05-17 08:46:26 +08:00
1600822305
a6aea0c8c9 fix: Update file API usage for Electron 35.2.2 and add translations f… (#6087)
* Fix: Update file API usage for Electron 35.2.2 and add translations for file error messages

* 修复Electron 35.2.2中的文件API问题
2025-05-17 08:09:30 +08:00
one
77f3770835 refactor(CodeEditor): add more options to props for better customization, fix auto theme (#6071)
* refactor(CodeEditor): add more options to props for better customization

- A complete BasicSetupOptions could be passed in to override system-wise options
- EditMcpJsonPopup now use customized options

* fix: accommodate ThemeMode.auto

* fix: typos
2025-05-17 01:32:54 +08:00
方程
cc34d9ce7e Gitee AI:update name, update models (#6006)
* Gitee AI:update name, update models

* Gitee AI:update name, update models

---------

Co-authored-by: 方程 <fangcheng@oschina.cn>
2025-05-17 00:47:42 +08:00
SuYao
119125038d Hotfix/gemini openrouter (#6080)
feat: 添加对openai兼容情况下Gemini模型的思考配置支持
2025-05-17 00:45:26 +08:00
自由的世界人
807099f231 feat: add citation list right-click copy (#6066)
* feat: add citation list right-click copy

* fix: extract the right-click menu as a component
2025-05-17 00:22:09 +08:00
SuiYunsy
cd1fd700ce 拓宽”请选择要检测的模型“模态框 (#6062)
许多模型名称很长,目前模态框太短,无法完全显示
2025-05-16 23:40:22 +08:00
SuYao
04cbeab1d9 fix: Update the state of the last message block as a fallback (#6076) 2025-05-16 22:21:05 +08:00
MyPrototypeWhat
35e27944f7 Hotfix/thinking time render (#6073)
refactor: simplify ThinkingBlock component and extract thinking time logic

* Removed unnecessary state and interval management from ThinkingBlock.
* Introduced ThinkingTimeSeconds component to handle thinking time display and logic.
* Cleaned up code for better readability and maintainability.
2025-05-16 21:56:40 +08:00
SuYao
451dcd0e4c hotfix: openai websearch render and gemini think (#6055) 2025-05-16 20:42:59 +08:00
SuiYunsy
de2ca774e7 fix: 禁止“自定义CSS”输入框的拼写检查 (#6064) 2025-05-16 19:23:43 +08:00
亢奋猫
2dda76dfa3 docs: Update README.zh.md add GitCode✖️Cherry Studio【新源力】贡献挑战赛
GitCode✖️Cherry Studio【新源力】贡献挑战赛
2025-05-16 17:25:21 +08:00
karl
3909c3c0e4 fix: mcp params error(issues/6050) (#6058) 2025-05-16 16:50:10 +08:00
kangfenmao
dc0ee48b00 fix: adjust visibility timer and trigger area dimensions in ChatNavigation
* Reduced the button visibility timer from 1500ms to 500ms for quicker feedback.
* Decreased the trigger width from 80 to 60 for improved interaction.
* Updated the height calculation from 40% to 30% of the window height for better layout consistency.
2025-05-16 14:46:22 +08:00
kangfenmao
713cc58c20 refactor: remove deprecated max token settings from OpenAIProvider and OpenAIResponseProvider 2025-05-16 14:36:40 +08:00
one
1d8bf38bfa feat: code tools, editor, executor (#4632)
* feat: code tools, editor, executor

CodeEditor & Preview
- CodeEditor: CodeMirror 6
  - Switch to CodeEditor in the settings
  - Support edit&save with a accurate diff&lookup strategy
  - Use CodeEditor for editing MCP json configuration
- CodePreview: Original Shiki syntax highlighting
  - Implemented using a custom Shiki stream tokenizer
  - Remov code caching as it is incompatible with the current streaming code highlighting
  - Add a webworker for shiki
- Other preview components
  - Merge MermaidPopup and Mermaid to MermaidPreview, use local mermaidjs
  - Show mermaid syntax error message on demand
  - Rename PlantUML to PlantUmlPreview
- Rename SyntaxHighlighterProvider to CodeStyleProvider for clarity
- Both light and dark themes are preserved for convenience

CodeToolbar
- Top sticky toolbar provides quick tools (left) and core tools (right)
- Quick tools are hidden under the `More` button to avoid clutter, while core tools are always visible
- View&edit mode
  - Allow switching between preview and edit modes
  - Add a split view

Code execution
- Pyodide for executing Python scripts
- Add a webworker for Pyodide

* fix: migrate version and lint error

* refactor: use constants for defining tool specs

* refactor: add user-select, fix tool specs

* refactor: simplify some state changing

* fix: make sure editor tools registered after the editor is ready

---------

Co-authored-by: 自由的世界人 <3196812536@qq.com>
2025-05-16 13:53:44 +08:00
beyondkmp
da98f07838 feat: upgrade electron to 35.2.2 (#5151)
* upgrade electron to 35.2.0

* update electron to 32.3.3

* udpate electron-vite to 3.0.0

* upgrade to 35.2.2

* patch https://github.com/electron-userland/electron-builder/pull/9046

* add minimumSystemVersion config

* update electron vite

---------

Co-authored-by: beyondkmp <beyondkmkp@gmail.com>
2025-05-16 12:56:52 +08:00
tiankuo.zhou
e4fd3096a8 fix: update mcp sdk version to solve the bug-preserve custom paths in SSE endpoint URLs (#6021)
* fix: update mcp sdk to slove the bug - preserve custom paths in SSE endpoint URLs

* add signoff

Signed-off-by: tiankuo.zhou <tiankuo.zhou@lofty.com>

* add signoff

Signed-off-by: tiankuo.zhou <tiankuo.zhou@lofty.com>

---------

Signed-off-by: tiankuo.zhou <tiankuo.zhou@lofty.com>
Co-authored-by: tiankuo.zhou <tiankuo.zhou@lofty.com>
2025-05-16 10:13:53 +08:00
kangfenmao
05e2666998 chore(version): 1.3.4 2025-05-16 10:12:26 +08:00
kangfenmao
b36645090c Merge branch 'develop' 2025-05-16 10:11:57 +08:00
kangfenmao
f5f13a3eba style: adjust padding and layout in various components
* Updated padding in CustomCollapse for improved spacing.
* Modified Messages component to conditionally apply padding based on prompt visibility.
* Enhanced ModelListSearchBar by adding a flex display style for better alignment.
* Increased gap in ProviderSetting's HStack for improved layout consistency.
2025-05-15 23:00:43 +08:00
Song
f5f932def4 fix: fix portable dir setup time (#6022) 2025-05-15 23:00:43 +08:00
kangfenmao
dcb1d22b33 refactor: add tool use mode translations and refactor settings
* Introduced new translations for "Tool Use Mode" and its options ("Function" and "Prompt") in English, Japanese, Russian, Simplified Chinese, and Traditional Chinese.
* Refactored settings components to replace the deprecated `enableToolUse` with `toolUseMode`, updating related logic and UI elements accordingly.
* Adjusted migration logic to ensure backward compatibility with previous settings.
2025-05-15 23:00:43 +08:00
kangfenmao
a074ce285b i18n: update max tokens settings translations for multiple languages
* Changed the wording for max tokens settings in English, Japanese, Russian, Simplified Chinese, and Traditional Chinese to improve clarity.
* Adjusted confirmation messages to better reflect the functionality of setting maximum token limits.
2025-05-15 23:00:43 +08:00
kangfenmao
d61f1ab67d refactor: remove extended context settings and related logic
* Removed EXTENDED_CONTEXT_LIMIT and EXTENDED_CONTEXT_STEP constants from the configuration.
* Eliminated enableMaxContexts state and associated logic from settings components.
* Updated contextCount handling to accommodate a maximum of 100, with a special case for 100 to represent an unlimited context.
* Cleaned up related translations for max contexts in multiple languages.
2025-05-15 23:00:43 +08:00
fullex
2cfc943229 feat: implement global error handling for uncaught exceptions and unhandled rejections in production mode 2025-05-15 22:54:04 +08:00
MyPrototypeWhat
f3b9b3c84c fix: remove undici dependency and clean up ProxyManager code (#6020) 2025-05-15 22:09:53 +08:00
Song
1c7c102d43 fix: fix portable dir setup time (#6022) 2025-05-15 22:07:10 +08:00
kangfenmao
cb64646cb9 Merge branch 'main' into develop
# Conflicts:
#	yarn.lock
2025-05-15 20:24:00 +08:00
kangfenmao
0091e4aeb3 chore: remove artifacts and database packages
* Deleted the @cherry-studio/artifacts package including its README, package.json, and associated CSS files.
* Removed the @cherry-studio/database package along with its README, package.json, and source files for data handling.
* Cleaned up related yarn.lock files and installation states for both packages.
2025-05-15 20:21:43 +08:00
kangfenmao
e010e975bd chore(version): 1.3.3 2025-05-15 19:50:21 +08:00
Konv Suu
ca73ef167c fix: strange corner style in miniapp pop up (#5976)
* fix: strange corner style in miniapp pop up
2025-05-15 19:46:19 +08:00
MyPrototypeWhat
139a14408b refactor: update ImageBlockGroup layout to use CSS grid for better re… (#5998)
refactor: update ImageBlockGroup layout to use CSS grid for better responsiveness
2025-05-15 19:46:15 +08:00
SuYao
2e504a92dc fix: enhance image block handling in message processing (#5971) 2025-05-15 19:45:09 +08:00
SuYao
462a63d36c fix: timing measurement before sending request (#5970) 2025-05-15 19:44:18 +08:00
Chen Tao
dee44a8d27 fix: remove dimensions(except voyage) (#6015)
* fix: remove dimensions(except voyage)

* fix: #6016
2025-05-15 18:05:29 +08:00
SuYao
fe78ce1d70 fix: update geminiapi check (#6002) 2025-05-15 17:51:08 +08:00
Lao
12a07b853e fix: Update Server McpSettings (#6018)
fix:初始化一个新的MCP Server时,没有防止用户多次点击启用开关
2025-05-15 17:50:52 +08:00
one
c7a15d291e fix: update current topic id and support EmojiAvatar for ChatFlowHistory (#5861)
* fix: update current topic id for ChatFlowHistory to work

* refactor: set current topic id early in loadTopicMessagesThunk

* refactor: extract EmojiAvatar

* fix: style
2025-05-15 01:42:18 +08:00
MyPrototypeWhat
9262f92bff refactor: update ImageBlockGroup layout to use CSS grid for better re… (#5998)
refactor: update ImageBlockGroup layout to use CSS grid for better responsiveness
2025-05-14 23:44:48 +08:00
Konv Suu
596532a8c8 fix: strange corner style in miniapp pop up (#5976)
* fix: strange corner style in miniapp pop up
2025-05-14 23:38:19 +08:00
George Zhao
5e0080c5a1 feat: add support for allowing Escape key to exit fullscreen mode (#5930)
* feat: add support for allowing Escape key to exit fullscreen mode

* feat(i18n): add translation for allowing ESC key to exit fullscreen mode in multiple locales

* feat: enable Escape key to exit fullscreen mode regardless of platform

* feat: 添加允许使用Escape键退出全屏模式的功能,并更新相关国际化支持

* fix: 修复全屏模式下Escape键退出功能的状态管理,移除相关设置项

* feat: 添加全屏状态管理功能至导航栏,更新右侧导航栏组件以支持全屏模式

* feat: 更新导航栏以支持全屏模式,调整右侧导航栏的内边距

* fix: 更新全屏模式下Escape键退出功能的默认设置为启用

* refactor: 移除全屏模式下Escape键退出功能的状态管理逻辑

* fix: 移除全屏模式下Escape键退出功能的调试日志

* feat: 添加全屏模式下Escape键的快捷键配置,默认启用

* refactor: 移除与全屏模式下Escape键退出功能相关的IPC通道和配置

* refactor: 移除全屏模式下Escape键退出功能的配置项

* refactor: 移除Navbar和McpSettingsNavbar中与全屏模式相关的代码

* refactor: 移动exit_fullscreen快捷键配置到shortcuts数组末尾

* refactor: 添加全屏模式下快捷键未设置时直接退出全屏的逻辑

* refactor: 添加全屏模式下快捷键未设置时直接退出全屏的逻辑

* refactor: remove unused useFullscreen hook

* refactor: remove 'allow ESC key to exit fullscreen mode' translations from multiple locale files

---------

Co-authored-by: George Zhao <georgezhao@SKJLAB>
2025-05-14 23:35:02 +08:00
SuYao
8f7c5eed75 fix: inaccurate temperature param (#5973)
* fix: inaccurate temperature param

* fix: enhance model support check for reasoning and web search models
2025-05-14 22:08:04 +08:00
kangfenmao
d5e35117a6 fix: ensure topic is created if not found in loadTopicMessagesThunk
* Added logic to create a new topic with an empty messages array if the specified topic does not exist in the database.
2025-05-14 21:53:28 +08:00
George Zhao
c3f3fe5b79 docs: 贡献者数据源 (#5992)
更新贡献者数据源。
2025-05-14 21:40:47 +08:00
SuYao
5b49f77965 fix: enhance image block handling in message processing (#5971) 2025-05-14 20:55:03 +08:00
SuYao
729752f96a fix: timing measurement before sending request (#5970) 2025-05-14 20:53:08 +08:00
George Zhao
79f66f0d50 fix: use EXTENDED_CONTEXT_STEP for slider step value in settings (#5989)
Co-authored-by: George Zhao <georgezhao@SKJLAB>
2025-05-14 20:08:47 +08:00
George Zhao
577d180e1d feat: 更长上下文 (#5963)
* feat: Extended the fillable context length to 100. #5514

Update src/renderer/src/pages/home/Tabs/SettingsTab.tsx

fix: update context length settings and localization for multiple languages

* fix: adjust context count slider limits and behavior based on max contexts setting

* feat: implement event handling for max contexts changes in settings

* feat: update context count handling to use EXTENDED_CONTEXT_LIMIT in settings

* feat: update context count logic to use EXTENDED_CONTEXT_LIMIT when max contexts are enabled

* refactor: remove unused EXTENDED_CONTEXT_LIMIT import from AssistantService

* feat: simplify context count logic with validAndChangeContextCount function

* feat: 移除TokenCount组件中对最大计数为20的特殊处理,简化上下文计数显示逻辑

* refactor: simplify getContextCount logic by removing max context handling

* feat: adjust step value for context count input based on max contexts setting

---------

Co-authored-by: George Zhao <georgezhao@SKJLAB>
2025-05-14 19:37:37 +08:00
Konv Suu
568fd155c5 fix: define line-clamp for compatibility (#5983) 2025-05-14 18:57:02 +08:00
Lao
4cb4890be7 fix lint errors (#5987)
* Fix code snippets that don't comply with code standards by applying lint rules

* update package.json:add test:lint script
2025-05-14 17:01:33 +08:00
SuYao
51061d4d1a fix: append topic prompt if exists (#5969) 2025-05-14 13:52:31 +08:00
SuYao
0d38fabfac fix: improve citation deduplication logic for non-knowledge citations (#5981) 2025-05-14 13:51:25 +08:00
one
e9afab7725 fix: quickpanel auto-scroll behaviour (#5950)
* fix: quickpanel scrollto changed to smart

* fix: add scrollTrigger as the replacement for scrollBlock

* fix: add a 'none' trigger to prevent accidental scrolling
2025-05-14 00:52:25 +08:00
自由的世界人
3a1ba4eb20 feat: add citation content copy button (#5966)
* feat: add citation content copy button

* fix: build error
2025-05-14 00:13:00 +08:00
上房揭瓦
151bc78e01 添加智能体订阅功能 (#5954)
* 添加智能体订阅功能

* 修改图标

* 修改hook点

修改图标

* 优雅的引用图标

* feat(i18n): add settings title for agents in multiple languages

* fix(i18n): update translations for improved clarity

* Merge branch 'main' into Subscribe

---------

Co-authored-by: VM 96 <eov@88.com>
Co-authored-by: suyao <sy20010504@gmail.com>
2025-05-13 23:09:38 +08:00
kangfenmao
5f30222999 chore(version): 1.3.2 2025-05-13 21:04:14 +08:00
kangfenmao
52dc23d968 Merge branch 'main' into develop
# Conflicts:
#	src/renderer/src/providers/AiProvider/OpenAIProvider.ts
#	src/renderer/src/providers/AiProvider/OpenAIResponseProvider.ts
2025-05-13 20:53:23 +08:00
kangfenmao
fa00ceac1a fix: Grouped message should not reset model and modelId
* Updated the reset logic to conditionally handle model and modelId for grouped messages.
* Ensured that the original model is retained when regenerating responses for grouped messages.
2025-05-13 20:50:52 +08:00
kangfenmao
f414b1881c fix: OpenAIResponseProvider summaryForSearch impl model wrong 2025-05-13 20:50:29 +08:00
kangfenmao
396b400004 revert: openai compatible type 2025-05-13 20:50:02 +08:00
kangfenmao
483ea46440 fix: regenerate message use assistant model 2025-05-13 20:45:50 +08:00
kangfenmao
374987dff1 fix: Grouped message should not reset model and modelId
* Updated the reset logic to conditionally handle model and modelId for grouped messages.
* Ensured that the original model is retained when regenerating responses for grouped messages.
2025-05-13 20:41:15 +08:00
kangfenmao
c0c0faabc8 fix: history topic message block is empty
* Added useEffect to dispatch loadTopicMessagesThunk when the topic is available
* Integrated useAppDispatch for state management
2025-05-13 20:24:41 +08:00
kangfenmao
d2f287592f fix: history topic message block is empty
* Added useEffect to dispatch loadTopicMessagesThunk when the topic is available
* Integrated useAppDispatch for state management
2025-05-13 20:24:19 +08:00
Yohann
0e269cadb9 feat: add DevTools functionality and localization support (#5796)
* feat: add DevTools functionality and localization support

* Added new IPC channels for opening and toggling DevTools.
* Implemented corresponding handlers in the main process.
* Updated preload API to include DevTools methods.
* Enhanced the AboutSettings component with a debug section to control DevTools.
* Added localization strings for debug actions in English, Simplified Chinese, and Traditional Chinese.

* refactor: remove DevTools open state handling and related localization strings

* Removed the IPC channel and associated handlers for checking if DevTools is open.
* Updated the AboutSettings component to eliminate the DevTools open state management.
* Removed localization strings for the DevTools close action in English, Simplified Chinese, and Traditional Chinese.

* ToggleDevTools event uses the source window to trigger switching, compatible with multiple windows

* Remove empty comments

---------

Co-authored-by: yangheng <492238647@qq.com>
2025-05-13 16:53:55 +08:00
fullex
9b01baf0d6 fix(WebviewService): simplify user agent string modification by removing Chrome version replacement 2025-05-13 16:47:18 +08:00
Konv Suu
9a8e17908a feat: add cache size retrieval functionality and integrate with UI (#5689)
* feat: add cache size retrieval functionality and integrate with UI

* chore: clean

* update

* update
2025-05-13 16:17:09 +08:00
one
9a64741d4c refactor: improve model management UI, add animations to some buttons (#5932)
* feat: add motion to ModelListSearchBar

* feat: add motion to health checking button

* refactor(EditModelsPopup): show spin while fetching models

* refactor: remove redundant filtering, use transient props

* chore: remove useless component ModelTags

* refactor: extract and reuse ModelIdWithTags

* refactor(EditModelsPopup): use ExpandableText instead of expandable Typography.Paragraph

* refactor(EditModelsPopup): implement optimistic updates for filter type and loading state

* refactor: startTransition for search

* refactor(EditModelsPopup): enhance search and filter handling with optimistic updates

* refactor(EditModelsPopup): implement debounced search filter updates

---------

Co-authored-by: suyao <sy20010504@gmail.com>
2025-05-13 15:43:42 +08:00
one
830f8db9e9 fix: animation on resolving SelectModelPopup (#5947) 2025-05-13 15:26:43 +08:00
dlzmoe
b8dc066a64 feat: Optimize the display method for the three modes (#5938)
chore: Optimize the display method for the three modes
2025-05-13 15:26:04 +08:00
SuYao
36c64161c9 fix: timer stop (#5914) 2025-05-13 15:25:27 +08:00
one
f8603d0c24 refactor: improve model management UI, add animations to some buttons (#5932)
* feat: add motion to ModelListSearchBar

* feat: add motion to health checking button

* refactor(EditModelsPopup): show spin while fetching models

* refactor: remove redundant filtering, use transient props

* chore: remove useless component ModelTags

* refactor: extract and reuse ModelIdWithTags

* refactor(EditModelsPopup): use ExpandableText instead of expandable Typography.Paragraph

* refactor(EditModelsPopup): implement optimistic updates for filter type and loading state

* refactor: startTransition for search

* refactor(EditModelsPopup): enhance search and filter handling with optimistic updates

* refactor(EditModelsPopup): implement debounced search filter updates

---------

Co-authored-by: suyao <sy20010504@gmail.com>
2025-05-13 14:48:59 +08:00
kangfenmao
5a6a2c0374 chore(version): 1.3.1 2025-05-13 13:48:19 +08:00
beyondkmp
ff3d418622 chore: use node-stream-zip to improve perfermanc and remove unused dependencies (#5946)
* chore: remove unused dependencies from package.json and yarn.lock

* fix: update backup extraction progress logging in BackupManager

---------

Co-authored-by: beyondkmp <beyondkmkp@gmail.com>
2025-05-13 13:41:06 +08:00
one
909acf1da3 fix: animation on resolving SelectModelPopup (#5947) 2025-05-13 13:22:24 +08:00
dlzmoe
2ae1069fc2 feat: Optimize the display method for the three modes (#5938)
chore: Optimize the display method for the three modes
2025-05-13 12:21:12 +08:00
jwcrystal
a90142f4b1 docs: Add Photo instructions to the branch strategy document (#5944) 2025-05-13 12:20:01 +08:00
Teo
57075de816 feature: Hide disabled options for web search (#5943)
* refactor(WebSearchButton): streamline provider item creation and filter disabled items

* refactor(WebSearchButton): optimize provider items mapping and add pageSize to quick panel

* refactor(WebSearchButton): filter out disabled providers in items mapping
2025-05-13 12:07:08 +08:00
kangfenmao
2d02cce877 fix: OpenAIResponseProvider summaryForSearch impl model wrong 2025-05-13 10:23:12 +08:00
SuYao
01439c56d9 fix: timer stop (#5914) 2025-05-13 08:47:14 +08:00
kangfenmao
1d4c3a783e revert: openai compatible type 2025-05-12 22:40:32 +08:00
beyondkmp
c8b272c7b9 fix(ipc): enhance theme handling with title bar overlay updates and broadcast notifications (#5915)
feat(ipc): enhance theme handling with title bar overlay updates and broadcast notifications
2025-05-12 22:27:27 +08:00
George Zhao
e9aaf0da80 fix: ensure correct handling of custom mini app updates and removals (#5922)
* fix: ensure correct handling of custom mini app updates and removals

* fix: update title for custom mini app to be more concise in localization files

---------

Co-authored-by: George Zhao <georgezhao@SKJLAB>
2025-05-12 22:26:44 +08:00
Chen Tao
99463307a8 fix: add i18n (#5921)
* fix(i18n)

* Update en-us.json
2025-05-12 22:26:38 +08:00
beyondkmp
10ce47239c fix(ipc): enhance theme handling with title bar overlay updates and broadcast notifications (#5915)
feat(ipc): enhance theme handling with title bar overlay updates and broadcast notifications
2025-05-12 21:57:50 +08:00
saica.go
d97a1f797b feat: add undo functionality to agent prompt generation (#5821)
* feat: add undo functionality to agent prompt generation

* feat: add a standalone undo button
2025-05-12 21:48:53 +08:00
George Zhao
f9611c78e4 fix: ensure correct handling of custom mini app updates and removals (#5922)
* fix: ensure correct handling of custom mini app updates and removals

* fix: update title for custom mini app to be more concise in localization files

---------

Co-authored-by: George Zhao <georgezhao@SKJLAB>
2025-05-12 20:58:35 +08:00
Chen Tao
0b45e1fd11 fix: add i18n (#5921)
* fix(i18n)

* Update en-us.json
2025-05-12 20:49:31 +08:00
one
0a2d0ec4a8 refactor: SelectModelPopup pinning (#5855)
* refactor: focus the hovered item when toggling a pinned model

* refactor: focus the selected item after loading pinned models

* refactor: update sticky group after loading pinned models

* fix: rapidly update sticky group

* refactor: defer lastscrolloffset

* refactor: rename updateOnListChange to focusOnListChange for clarity

* refactor: increaset overscan count

* refactor: use startTransition instead of deferred value

* refactor: add guard, clean up code

* refactor: simplify cleanup logic

* refactor: remove unnecessary dep on  pinnedModels

* fix: flicker on searching

* refactor: simplify tag tooltips, prevent tooltips in SelectModelPopup
2025-05-12 20:43:45 +08:00
Chen Tao
dd5229d5ba feat(knowledge): adjust default top-n to 10 (#5919) 2025-05-12 20:32:28 +08:00
kangfenmao
259e88ce3d fix: regenerate message use assistant model 2025-05-12 20:28:51 +08:00
suyao
3e6b1ae336 fix: move start_time_millsec initialization to onChunk for accurate timing 2025-05-12 20:28:12 +08:00
suyao
5f3ef42826 fix: move start_time_millsec initialization to onChunk for accurate timing 2025-05-12 18:23:32 +08:00
Wang Jiyuan
2782744a85 feat: minimize token usage when testing model (#5905) 2025-05-12 18:19:03 +08:00
jwcrystal
932cd84d3b fix: fix the formating error on qwen3 (#5899)
fix(ModelMessageService): fix the formating error on qwen3
2025-05-12 14:55:23 +08:00
fullex
058ea07265 chore: remove bufferutil dependency from package.json and yarn.lock 2025-05-12 13:11:52 +08:00
kangfenmao
f0c62a6bc1 fix: update miniWindow URL path in dev mode 2025-05-12 09:50:13 +08:00
chenxue
020806c92e fix:painting support reload (#5886)
* add painting aihubmix provider

* fix: Cannot read properties of undefined (reading 'unshift')

* fix: painting redux data

* feat: customize aihubmix provider request logic

* fix: download error retry

* Update AihubmixProvider.ts

* back

* back

---------

Co-authored-by: zhaochenxue <zhaochenxue@bixin.cn>
Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2025-05-12 09:23:52 +08:00
beyondkmp
d680dde0a7 feat(i18n): add page zoom settings in English, Japanese, and Russian locales 2025-05-12 09:03:09 +08:00
fullex
653f37529f fix: miniWindow not found 2025-05-11 23:54:47 +08:00
GeorgeDong32
23a08feaf1 chore(workflows): update workflows for new repo structure 2025-05-11 23:52:37 +08:00
kangfenmao
abe441d694 fix: update vitest configuration and add setup file for renderer tests
- Updated vitest.config.ts to handle optional chaining for plugins and alias.
- Added setup.ts for mocking electron-log in renderer tests.
- Adjusted test include and exclude patterns to refine test coverage.
2025-05-11 23:41:26 +08:00
Chen Tao
f549f39bb8 fix: copilot annotation bug (#5882)
fix: copilot annotation
2025-05-11 23:04:29 +08:00
jwcrystal
60f261e30d docs: Improve the README for better readability (#5880)
docs: Improve README readability
2025-05-11 22:02:31 +08:00
kangfenmao
af1cdf74e5 docs: add Branching Strategy document and update README with contribution guidelines 2025-05-11 21:07:57 +08:00
SuYao
d2e17747ef fix: ensure modelId is case-insensitive in findTokenLimit function (#5844)
* fix: ensure modelId is case-insensitive in findTokenLimit function

* fix: make modelId case-insensitive in findTokenLimit function
2025-05-11 20:59:42 +08:00
kangfenmao
38f082bd8e chore(version): 1.3.0 2025-05-11 20:28:51 +08:00
MyPrototypeWhat
dc9f5fcbcc fix: next release bugs (#5801)
* style: update ChatNavigation and CitationsList components for improved UI consistency

- Added header style to remove borders in ChatNavigation.
- Enhanced CitationsList with new Skeleton loading state and improved layout for citation cards.
- Refactored CitationLink to a div for better styling control and adjusted padding in OpenButton for a more polished appearance.

* fix: update citation rendering logic in MainTextBlock component

- Added a check to determine if the citation URL is a valid link.
- Updated citation tag formatting to conditionally include the link based on the URL validity.

* Remove Zhipu mode and text-only link handling

* refactor: update message handling and state management

- Simplified message editing logic by removing unnecessary success/error logging.
- Added `updatedAt` timestamp to message updates for better tracking.
- Refactored `editMessageBlocks` to accept message ID and updates directly.
- Removed unused `getTopicLimit` function from `TopicManager`.
- Updated message rendering to use `updatedAt` when available.
- Enhanced type definitions to include `updatedAt` in message structure.

* refactor: optimize block update logic and remove unused code

- Updated `throttledBlockUpdate` to handle asynchronous updates directly.
- Removed the unused `throttledBlockDbUpdate` function and its related logic.
- Added cancellation for throttled updates on error and completion to improve performance and reliability.
- Cleaned up commented-out code for better readability.

* fix: enhance logging and update async handling in StreamProcessingService and messageThunk

- Enabled logging in `createStreamProcessor` for better debugging.
- Added logging for updated messages in `updateExistingMessageAndBlocksInDB` and `saveUpdatesToDB`.
- Updated `onTextComplete` and `onLLMWebSearchComplete` to handle asynchronous operations correctly.
- Commented out unused `saveUpdatedBlockToDB` calls to prevent unnecessary database updates.

* feat: enhance citation handling and add metadata support in citation blocks

* fix: prevent default action in handleLinkClick for better link handling

* fix: update styled component props to use dollar sign prefix for consistency

* feat(i18n): add download success and failure messages in multiple languages

* refactor(messageThunk): remove console.log statements for cleaner code

* refactor(StreamProcessingService): comment out console.log for cleaner code

* feat(MessageMenubar): add edit option to dropdown for single message editing

* fix:  set default zoomFactor in settings

* fix: add support for inline base64 image data in image block

* fix: remove 'auto' option from qwen model supported options

* fix: adjust thinking millisecond handling in message thunk

* fix: update regex for function calling models and improve time tracking logic

* fix: enhance error handling and metrics tracking across AI providers and message processing

* fix: add new image generation models to the configuration

* refactor(GeminiProvider): implement image generation handling in chat responses

* Revert "fix:  set default zoomFactor in settings"

This reverts commit f9d1339bd3367a4f80da23aac1fdc73b4cd2a075.

---------

Co-authored-by: kangfenmao <kangfenmao@qq.com>
Co-authored-by: suyao <sy20010504@gmail.com>
2025-05-11 20:20:43 +08:00
kangfenmao
b517063ef1 feat: replace SvgSpinners180Ring with BeatLoader for improved loading animation in MinappPopupContainer 2025-05-11 19:51:02 +08:00
kangfenmao
4059855678 chore: remove opendal dependency and related code from RemoteStorage service 2025-05-11 19:50:55 +08:00
kangfenmao
9d2bd0221f fix: update persisted reducer version and remove obsolete migration logic 2025-05-11 19:40:12 +08:00
kangfenmao
a1a2718285 feat: add transition animations to various popups and dialogs for improved user experience 2025-05-11 19:38:16 +08:00
kangfenmao
3a0cd738ce refactor: replace console.log with Logger for improved logging consistency across the application 2025-05-11 19:25:50 +08:00
kangfenmao
a64c8ded73 fix: message and rerank errors
commit 1c90e23d76a3e1008408bf29add122ccab7dbe6d
Merge: 4e792033 1fde0999
Author: kangfenmao <kangfenmao@qq.com>
Date:   Sun May 11 18:43:56 2025 +0800

    Merge branch 'main' into fix/next-release-bugs

commit 4e7920336d838501b900a18f1c254f0d17fb54b8
Author: suyao <sy20010504@gmail.com>
Date:   Sun May 11 18:09:58 2025 +0800

    refactor(GeminiProvider): implement image generation handling in chat responses

commit cd1ce4c0c65bc2a111ddb3112722cb36e66b2515
Merge: 968de188 235122c8
Author: suyao <sy20010504@gmail.com>
Date:   Sun May 11 16:45:29 2025 +0800

    Merge branch 'main' into fix/next-release-bugs

commit 968de18866abacc55fd9bd74c8d618871e64ade6
Author: suyao <sy20010504@gmail.com>
Date:   Sun May 11 16:41:38 2025 +0800

    fix: add new image generation models to the configuration

commit 1eaf5801b4c0e2c3fa1aa2ed829b20d97ea57d3f
Merge: cb76588d e6655fff
Author: suyao <sy20010504@gmail.com>
Date:   Sun May 11 13:14:17 2025 +0800

    Merge branch 'main' into fix/next-release-bugs

commit cb76588dc692f35da1f3d4fdbc9217c6a1a36501
Author: suyao <sy20010504@gmail.com>
Date:   Sun May 11 13:13:20 2025 +0800

    fix: enhance error handling and metrics tracking across AI providers and message processing

commit c2d6bdabc00b48419773d08c7d6630803d6310c8
Author: suyao <sy20010504@gmail.com>
Date:   Sun May 11 05:36:52 2025 +0800

    fix: update regex for function calling models and improve time tracking logic

commit 95340b87d0bba3cdcd173a181953afa42b26da9b
Author: suyao <sy20010504@gmail.com>
Date:   Sun May 11 05:05:05 2025 +0800

    fix: adjust thinking millisecond handling in message thunk

commit f4d4d3901603f14df616582fa537f3d9c1a694eb
Author: suyao <sy20010504@gmail.com>
Date:   Sun May 11 03:52:26 2025 +0800

    fix: remove 'auto' option from qwen model supported options

commit e26f603dfe1a9146b0575142363d5ceab30e32df
Author: suyao <sy20010504@gmail.com>
Date:   Sun May 11 03:50:05 2025 +0800

    fix: add support for inline base64 image data in image block

commit bb0093c656b2b72158db1bf7bfef6aae46b8096c
Merge: f9d1339b d39584fc
Author: suyao <sy20010504@gmail.com>
Date:   Sun May 11 03:00:57 2025 +0800

    Merge branch 'main' into fix/next-release-bugs

commit f9d1339bd3367a4f80da23aac1fdc73b4cd2a075
Author: suyao <sy20010504@gmail.com>
Date:   Sun May 11 03:00:11 2025 +0800

    fix:  set default zoomFactor in settings

commit 7cf6fd685662a012e2460e722edcbe5ed12f1a1c
Merge: ba9c4482 3bebfe27
Author: suyao <sy20010504@gmail.com>
Date:   Sun May 11 01:31:05 2025 +0800

    Merge branch 'main' into fix/next-release-bugs

commit ba9c44828578a3b5cc9fd1aaba80158615921785
Merge: 97dffe71 3bf0b6b3
Author: kangfenmao <kangfenmao@qq.com>
Date:   Sat May 10 20:18:44 2025 +0800

    Merge branch 'main' into fix/next-release-bugs

commit 97dffe719ee00ace2325c80022a48c44f03d6e26
Author: lizhixuan <daoquqiexing@gmail.com>
Date:   Sat May 10 11:38:01 2025 +0800

    feat(MessageMenubar): add edit option to dropdown for single message editing

commit 70157439a1d9778cacc87b1781a84d159a8d3f33
Author: lizhixuan <daoquqiexing@gmail.com>
Date:   Sat May 10 10:53:10 2025 +0800

    refactor(StreamProcessingService): comment out console.log for cleaner code

commit fa33ba77a9306ad316f34da4149858192079f7a2
Author: lizhixuan <daoquqiexing@gmail.com>
Date:   Sat May 10 10:52:08 2025 +0800

    refactor(messageThunk): remove console.log statements for cleaner code

commit 6544c5d2990adf1943195e1d4d11383859a05488
Author: kangfenmao <kangfenmao@qq.com>
Date:   Sat May 10 10:17:44 2025 +0800

    feat(i18n): add download success and failure messages in multiple languages

commit e23bb6744a4a99b2062012691340f78fad4e1952
Merge: 55c5c553 60cc1dee
Author: kangfenmao <kangfenmao@qq.com>
Date:   Sat May 10 09:54:38 2025 +0800

    Merge branch 'main' into fix/next-release-bugs

commit 55c5c5533eab46a1de9c5511433ed1b1b9e90512
Author: suyao <sy20010504@gmail.com>
Date:   Fri May 9 22:19:35 2025 +0800

    fix: update styled component props to use dollar sign prefix for consistency

commit 7a5839e0efdf3eb648b3d26cdf7ce131a2821f6a
Author: suyao <sy20010504@gmail.com>
Date:   Fri May 9 22:02:06 2025 +0800

    fix: prevent default action in handleLinkClick for better link handling

commit ecb075fddfc2bc5796a804ccde29aaa762d85da6
Merge: df149608 963f04f7
Author: suyao <sy20010504@gmail.com>
Date:   Fri May 9 21:55:54 2025 +0800

    Merge branch 'main' into fix/next-release-bugs

commit df149608904039903d74d7a72a722b6c1a567ee3
Merge: 93bd4eb9 e29a9303
Author: suyao <sy20010504@gmail.com>
Date:   Fri May 9 21:48:13 2025 +0800

    Merge branch 'main' into fix/next-release-bugs

commit 93bd4eb907816414af5c27efbaa2d3d014c707fc
Merge: c4d1deb6 38ff9b90
Author: suyao <sy20010504@gmail.com>
Date:   Fri May 9 21:27:08 2025 +0800

    Merge branch 'fix/next-release-bugs' of github.com:CherryHQ/cherry-studio into fix/next-release-bugs

commit c4d1deb6911977a23cf731db6bed80b8352557ff
Author: suyao <sy20010504@gmail.com>
Date:   Fri May 9 21:24:48 2025 +0800

    feat: enhance citation handling and add metadata support in citation blocks

commit 38ff9b90b8fee91ed1fba7b83c9470bc40bd3429
Author: MyPrototypeWhat <daoquqiexing@gmail.com>
Date:   Fri May 9 19:47:24 2025 +0800

    fix: enhance logging and update async handling in StreamProcessingService and messageThunk

    - Enabled logging in `createStreamProcessor` for better debugging.
    - Added logging for updated messages in `updateExistingMessageAndBlocksInDB` and `saveUpdatesToDB`.
    - Updated `onTextComplete` and `onLLMWebSearchComplete` to handle asynchronous operations correctly.
    - Commented out unused `saveUpdatedBlockToDB` calls to prevent unnecessary database updates.

commit cda0215c9c4e007c2c7240c3c9c8521fb7111774
Author: MyPrototypeWhat <daoquqiexing@gmail.com>
Date:   Fri May 9 18:47:55 2025 +0800

    refactor: optimize block update logic and remove unused code

    - Updated `throttledBlockUpdate` to handle asynchronous updates directly.
    - Removed the unused `throttledBlockDbUpdate` function and its related logic.
    - Added cancellation for throttled updates on error and completion to improve performance and reliability.
    - Cleaned up commented-out code for better readability.

commit de2f5b09c8384eabd4df7253047b838a2759671a
Author: MyPrototypeWhat <daoquqiexing@gmail.com>
Date:   Fri May 9 18:42:00 2025 +0800

    refactor: update message handling and state management

    - Simplified message editing logic by removing unnecessary success/error logging.
    - Added `updatedAt` timestamp to message updates for better tracking.
    - Refactored `editMessageBlocks` to accept message ID and updates directly.
    - Removed unused `getTopicLimit` function from `TopicManager`.
    - Updated message rendering to use `updatedAt` when available.
    - Enhanced type definitions to include `updatedAt` in message structure.

commit 700fa13971cafb04314817d2d8732c8fbf33c9d7
Author: suyao <sy20010504@gmail.com>
Date:   Fri May 9 16:19:55 2025 +0800

    Remove Zhipu mode and text-only link handling

commit 06bd1338cd671b255e477cec76b12663ea759f4c
Author: kangfenmao <kangfenmao@qq.com>
Date:   Fri May 9 15:49:02 2025 +0800

    fix: update citation rendering logic in MainTextBlock component

    - Added a check to determine if the citation URL is a valid link.
    - Updated citation tag formatting to conditionally include the link based on the URL validity.

commit e96c9a569f7708816f57505975d30667929eeb19
Author: kangfenmao <kangfenmao@qq.com>
Date:   Thu May 8 18:31:14 2025 +0800

    style: update ChatNavigation and CitationsList components for improved UI consistency

    - Added header style to remove borders in ChatNavigation.
    - Enhanced CitationsList with new Skeleton loading state and improved layout for citation cards.
    - Refactored CitationLink to a div for better styling control and adjusted padding in OpenButton for a more polished appearance.
2025-05-11 18:44:28 +08:00
beyondkmp
1fde0999f8 refactor: update zoom handling in IPC and settings (#5868)
* refactor: update zoom handling in IPC and settings

* renamed zoom-related IPC channels for clarity
* refactored zoom handling logic in ipc.ts and ShortcutService
* removed unused zoom factor state management from settings
* updated DisplaySettings component to manage zoom via buttons
* localized zoom settings in multiple languages

* refactor: remove unused zoom factor state from settings

* eliminated the zoomFactor state from initialSettings as part of the zoom handling refactor

* refactor: improve zoom handling in DisplaySettings component

* initialized current zoom value on component mount
* refactored resize event listener to prevent memory leaks
* added cleanup for resize event listener to enhance performance

* refactor: enhance resize event handling in DisplaySettings component

* added logic to track previous window width to prevent unnecessary updates during resize events
* improved comments for clarity on zoom handling and resize event listener functionality

* refactor: streamline zoom handling across IPC and ShortcutService

* updated handleZoomFactor function to accept an array of BrowserWindows for batch processing
* simplified zoom factor adjustments in IPC and shortcut handlers
* removed unnecessary window destruction checks for improved performance
2025-05-11 18:42:25 +08:00
MyPrototypeWhat
235122c843 feat: add motion library for animations and enhance Spinner and Messa… (#5869)
feat: add motion library for animations and enhance Spinner and MessageBlock components

- Added 'motion' library to package.json and yarn.lock for animation support.
- Refactored Spinner component to utilize motion for animated effects.
- Introduced AnimatedBlockWrapper in MessageBlockRenderer for animated transitions.
- Updated ThinkingBlock to include animated lightbulb effect during thinking state.
2025-05-11 16:20:28 +08:00
one
dc24fecba5 fix(Inputbar): do not reset selection on focus (#5866) 2025-05-11 13:47:25 +08:00
自由的世界人
7e2f27c2f9 feat: add message translate copy & close (#5684)
* feat: add message translate copy & close

* fix: remove blockEntity
2025-05-11 13:40:09 +08:00
one
299df2aa6e refactor(checkAPI): check api or model with stream enabled first (#5857)
* refactor(checkAPI): check api or model with stream enabled first

* refactor: improve healthcheck summary

* refactor: remove cursor style from status indicator

* fix: update apikey input box after deleting invalid keys
2025-05-11 13:32:47 +08:00
one
1fd1173fd1 fix: conditionally aquire focus for inputbar (#5860) 2025-05-11 13:27:10 +08:00
SuYao
e6655fff87 Revert "fix: update selectedTypes logic in ModelEditContent for better handling" (#5858) 2025-05-11 12:18:51 +08:00
one
d39584fc26 revert: customtag tooltip delay (#5856) 2025-05-11 02:46:34 +08:00
自由的世界人
04e40c911e fix: clean up code (#5851) 2025-05-11 00:37:01 +08:00
one
3bebfe270f fix: check isComposing on keydown (#5848) 2025-05-10 23:55:18 +08:00
George Zhao
37a34385dd feat(i18n): 更新机器翻译多语言,使用Qwen3 236b进行机器翻译。 (#5840)
feat(i18n): update Portuguese translations for import/export features, assistant settings, and mini app configurations

Co-authored-by: George Zhao <georgezhao@SKJLAB>
2025-05-10 23:40:57 +08:00
SuYao
feddab311a fix: jina embedding error (#5839)
* fix: jina embedding error

* fix: handle jina model encoding format in Embeddings class
2025-05-10 23:03:48 +08:00
George Zhao
81d7f4fa2d feat: regularPhrases可以随Agent一起导出。 (#5836)
* feat: add regularPhrases to AgentCard props

* fix: agentcard style btw

---------

Co-authored-by: George Zhao <georgezhao@SKJLAB>
Co-authored-by: Pleasurecruise <3196812536@qq.com>
2025-05-10 22:49:29 +08:00
kangfenmao
6309fac7c8 style: add centered prop to modals and components for improved layout consistency 2025-05-10 22:21:37 +08:00
George Zhao
4de06e7184 feat: Agent Regular Phrases (#5775)
* feat: add regular prompts settings component and integrate into assistant settings.

* feat: add regular prompts to assistant creation and update QuickPhrasesButton to utilize them.

* feat: add regular prompts settings and update localization for multiple languages.

* fix: update assistantObj type to Assistant and clean up unused console logs.

* feat: enhance QuickPhrasesButton with modal for adding phrases and localization updates.

* feat: update localization for regular prompts to regular phrases in English, Simplified Chinese, and Traditional Chinese.

* fix: update localization for assistant prompts to assistant phrases in English and Simplified Chinese.

* feat: add regular prompts to new agents during import.

* refactor: rename regular_prompts to regular_phrases across localization and components

* feat: enhance QuickPhrasesButton with icons for location selection options

* perf: optimize loadQuickListPhrases with useCallback and update icon sizes in QuickPhrasesButton

---------

Co-authored-by: George Zhao <georgezhao@SKJLAB>
2025-05-10 21:57:57 +08:00
Camol
cf9aaf3ecf style: remove small size prop from Switch component in AssistantModel… (#5833)
style: remove small size prop from Switch component in AssistantModelSettings

Co-authored-by: kanweiwei <kanweiwei@nutstore.net>
2025-05-10 21:34:48 +08:00
Jee
3bf0b6b315 feat: add prompt display control (#5439)
Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2025-05-10 20:16:59 +08:00
kangfenmao
0e4236d3a8 fix: message render bugs
commit c6cf790851
Author: lizhixuan <daoquqiexing@gmail.com>
Date:   Sat May 10 11:38:01 2025 +0800

    feat(MessageMenubar): add edit option to dropdown for single message editing

commit 87b106fad6
Author: lizhixuan <daoquqiexing@gmail.com>
Date:   Sat May 10 10:53:10 2025 +0800

    refactor(StreamProcessingService): comment out console.log for cleaner code

commit 7d0b8b33af
Author: lizhixuan <daoquqiexing@gmail.com>
Date:   Sat May 10 10:52:08 2025 +0800

    refactor(messageThunk): remove console.log statements for cleaner code

commit 7310eebebc
Author: kangfenmao <kangfenmao@qq.com>
Date:   Sat May 10 10:17:44 2025 +0800

    feat(i18n): add download success and failure messages in multiple languages

commit 42733d0fc8
Merge: 6364f4c0 60cc1dee
Author: kangfenmao <kangfenmao@qq.com>
Date:   Sat May 10 09:54:38 2025 +0800

    Merge branch 'main' into fix/next-release-bugs

commit 6364f4c006
Author: suyao <sy20010504@gmail.com>
Date:   Fri May 9 22:19:35 2025 +0800

    fix: update styled component props to use dollar sign prefix for consistency

commit 34c49b84f6
Author: suyao <sy20010504@gmail.com>
Date:   Fri May 9 22:02:06 2025 +0800

    fix: prevent default action in handleLinkClick for better link handling

commit 84bf76cc43
Merge: 572ffcc8 963f04f7
Author: suyao <sy20010504@gmail.com>
Date:   Fri May 9 21:55:54 2025 +0800

    Merge branch 'main' into fix/next-release-bugs

commit 572ffcc8be
Merge: 9ba630b5 e29a9303
Author: suyao <sy20010504@gmail.com>
Date:   Fri May 9 21:48:13 2025 +0800

    Merge branch 'main' into fix/next-release-bugs

commit 9ba630b5e8
Merge: bf819a71 6d910755
Author: suyao <sy20010504@gmail.com>
Date:   Fri May 9 21:27:08 2025 +0800

    Merge branch 'fix/next-release-bugs' of github.com:CherryHQ/cherry-studio into fix/next-release-bugs

commit bf819a7142
Author: suyao <sy20010504@gmail.com>
Date:   Fri May 9 21:24:48 2025 +0800

    feat: enhance citation handling and add metadata support in citation blocks

commit 6d9107558e
Author: MyPrototypeWhat <daoquqiexing@gmail.com>
Date:   Fri May 9 19:47:24 2025 +0800

    fix: enhance logging and update async handling in StreamProcessingService and messageThunk

    - Enabled logging in `createStreamProcessor` for better debugging.
    - Added logging for updated messages in `updateExistingMessageAndBlocksInDB` and `saveUpdatesToDB`.
    - Updated `onTextComplete` and `onLLMWebSearchComplete` to handle asynchronous operations correctly.
    - Commented out unused `saveUpdatedBlockToDB` calls to prevent unnecessary database updates.

commit c402a1d21f
Author: MyPrototypeWhat <daoquqiexing@gmail.com>
Date:   Fri May 9 18:47:55 2025 +0800

    refactor: optimize block update logic and remove unused code

    - Updated `throttledBlockUpdate` to handle asynchronous updates directly.
    - Removed the unused `throttledBlockDbUpdate` function and its related logic.
    - Added cancellation for throttled updates on error and completion to improve performance and reliability.
    - Cleaned up commented-out code for better readability.

commit 6da1d08c9a
Author: MyPrototypeWhat <daoquqiexing@gmail.com>
Date:   Fri May 9 18:42:00 2025 +0800

    refactor: update message handling and state management

    - Simplified message editing logic by removing unnecessary success/error logging.
    - Added `updatedAt` timestamp to message updates for better tracking.
    - Refactored `editMessageBlocks` to accept message ID and updates directly.
    - Removed unused `getTopicLimit` function from `TopicManager`.
    - Updated message rendering to use `updatedAt` when available.
    - Enhanced type definitions to include `updatedAt` in message structure.

commit 30696e1ef1
Author: suyao <sy20010504@gmail.com>
Date:   Fri May 9 16:19:55 2025 +0800

    Remove Zhipu mode and text-only link handling

commit 5b95d20294
Author: kangfenmao <kangfenmao@qq.com>
Date:   Fri May 9 15:49:02 2025 +0800

    fix: update citation rendering logic in MainTextBlock component

    - Added a check to determine if the citation URL is a valid link.
    - Updated citation tag formatting to conditionally include the link based on the URL validity.

commit 28f1e486e6
Author: kangfenmao <kangfenmao@qq.com>
Date:   Thu May 8 18:31:14 2025 +0800

    style: update ChatNavigation and CitationsList components for improved UI consistency

    - Added header style to remove borders in ChatNavigation.
    - Enhanced CitationsList with new Skeleton loading state and improved layout for citation cards.
    - Refactored CitationLink to a div for better styling control and adjusted padding in OpenButton for a more polished appearance.
2025-05-10 20:12:11 +08:00
Camol
deb486357e fix: update selectedTypes logic in ModelEditContent for better handling (#5819)
refactor: improve model type checking logic in models.ts and ModelEditContent.tsx

* Refactor isFunctionCallingModel, isEmbeddingModel, isVisionModel, isReasoningModel, and isWebSearchModel functions for better readability and maintainability.
* Simplify type selection logic in ModelEditContent by directly using model.type or defaultTypes.
* Remove unnecessary conditional checks to streamline the code.

Co-authored-by: kanweiwei <kanweiwei@nutstore.net>
2025-05-10 19:55:56 +08:00
jwcrystal
4d458b6fdc docs(README): add Architecture overview document (#5824)
- Add the Architecture Overview document to help the contributor how to develop quickly.
2025-05-10 18:03:19 +08:00
SuYao
12b210dcce feat(webSearch): add Bocha web search provider integration (#5608)
* feat(webSearch): add Bocha web search provider integration

- Introduced BochaProvider for handling web search queries.
- Added Bocha logo and updated web search provider configuration.
- Implemented API host and key validation for Bocha.
- Enhanced web search settings to support Bocha provider.
- Updated Redux store to include Bocha in the web search provider list.
- Added validation schemas for Bocha search parameters and responses.

* fix(WebSearch): improve error handling in BochaProvider and validate web search questions

- Added error handling for failed Bocha search responses.
- Enhanced validation for web search questions to ensure they are an array and not empty.

* fix(WebSearch): add API host validation for Tavily provider

* chore: remove api host check button

* fix: add check for unnecessary web search in fetchExternalTool

---------

Co-authored-by: eeee0717 <chentao020717Work@outlook.com>
2025-05-10 16:42:09 +08:00
SuYao
a8b183b2a6 fix: qwen3 check (#5811) 2025-05-10 13:52:39 +08:00
one
5ae6562f5b fix: SelectModelPopup scrolling behaviour (#5812)
* fix: focus the selected or the first item on searching

* refactor: remove unnecessary deferred values

* refactor: add a hook usePinnedModels for pinned models

* refactor: make the definition more consistent with other popups

* refactor: improve state management, improve scrolling behaviour

* fix: avoid potential modulo-by-zero

* fix: type error

* fix: async loading pinned models
2025-05-10 13:48:25 +08:00
Chen Tao
f9f0b857ae feat: combine to general reranker (#5818)
* feat: combine to general reranker

* chore

* chore: set not support provider

* chore: add i18n
2025-05-10 13:42:54 +08:00
jwcrystal
60cc1dee96 fix(Qwen3): Add Qwen3 Model Thinking Mode Switch in Thinking Button(#5781)
* feat(Qwen3): Add Qwen3 Model Thinking Mode Switch

- Add a thinking mode switch for the Qwen3 model on the settings page,
- Enabled: Generates thinking content. Disabled: Does not generate thinking content.

This feature is implemented by adding new settings items and corresponding logic.

* docs(i18n): Add multilingual translations for Qwen3 model's thinking mode

* refactor(Qwen3): Remove Qwen thinking mode related code from SettingTab

- Remove Qwen thinking mode related state and logic from the SettingsTab component
- Integarte Qwen 3 thinking mode switch login the ThinkingButton component to simplify the code and improve maintainability

* refactor(OpenAICompatibleProvider): Extract qwen3 handling logic to ModelMessageService

Move the postsuffix handling logic in OpenAICompatibleProvider to ModelMessageService to improve code maintainability and reusability

* docs(i18n): Remove Qwen3 model-related translations

Remove the translation content of the unused Qwen3 model's thinking mode and its prompts
2025-05-09 22:21:04 +08:00
beyondkmp
96fb0188bf feat: add inspect option to context menu with localization support (#5807)
* implemented a new inspect menu item in the context menu that toggles developer tools
* added localization for the inspect option in English, Japanese, Russian, and Chinese (both simplified and traditional)
2025-05-09 22:12:16 +08:00
Camol
963f04f7d8 fix: update input schema reference in MessageTools for accurate tool … (#5804)
* fix: update input schema reference in MessageTools for accurate tool response handling

* refactor: remove unused CustomEditorContainer styles from MiniAppSettings

---------

Co-authored-by: kanweiwei <kanweiwei@nutstore.net>
2025-05-09 21:54:13 +08:00
kangfenmao
e29a930390 refactor: update icon usage and improve painting state management
* replaced InfoCircleFilled icon with Info from lucide-react for consistency
* simplified painting state initialization and handling in AihubmixPage and PaintingsPage
* removed unnecessary conditional logic for setting default painting
2025-05-09 20:50:18 +08:00
Camol
66334517c1 feat: support both function call and system prompt for MCP tools (#5499)
* feat: support both function call and system prompt for MCP tools
- Add support for using both function call and system prompt to implement MCP tool calls
- Refactor tool handling logic to be more flexible and maintainable
- Improve code readability with better variable naming and comments
- Fix potential issues with tool call implementation

* fix: Add tool_calls in OpenAI streaming logic

* refactor: enhance OpenAICompatibleProvider and BaseOpenAiProvider structure

* feat: add tool call setting to SettingsTab component

* fix: enhance tool call handling in OpenAICompatibleProvider

* fix: enhance content handling in GeminiProvider for nonstreaming response

* refactor: improve tool property filtering logic in OpenAIProvider and mcp-tools utility

* fix: resolve eslint errors

* fix: add history for function call message in GeminiProvider

* refactor: unify MCP tool response handling across providers for consistency

* refactor: update mcp tools conversion logic in OpenAICompatibleProvider and OpenAIProvider

* refactor: enhance AihubmixProvider and BaseProvider with MCP tool handling methods

* refactor: introduce SYSTEM_PROMPT_THRESHOLD constant in BaseProvider for improved readability

* refactor: rename tool_call to enable_tool_use for clarity and consistency across the application

* refactor: remove unnecessary onChunk call in processStream for cleaner code

* fix: add toolCallId to response structure and enhance content handling in AnthropicProvider

* fix: respond image data to llm while using function call

* fix: add reasoning handling in OpenAICompatibleProvider for improved response processing

---------

Co-authored-by: kanweiwei <kanweiwei@nutstore.net>
Co-authored-by: jay <sevenjay@users.noreply.github.com>
2025-05-09 20:20:16 +08:00
kangfenmao
0c65bdcb41 feat: replace n8n icon with SVG version and update references
* removed the old n8n.ico file
* added new n8n.svg file
* updated references in minapps configuration and app components to use the new SVG logo
* changed file handling from 'customMiniAPP' to 'custom-minapps.json' for consistency
2025-05-09 20:19:34 +08:00
kangfenmao
db81508fe1 Revert "feat: ParateraAI 添加支持 (#5792)"
This reverts commit 18b745a540.
2025-05-09 20:04:44 +08:00
one
65d01805d4 fix: SelectModelPopup sticky header (#5795)
* fix: remove console logs

* refactor: use onScroll instead of onItemsRendered
2025-05-09 16:43:22 +08:00
kangfenmao
472123ff8d fix: message citations styles and bugs 2025-05-09 15:56:54 +08:00
George Zhao
18b745a540 feat: ParateraAI 添加支持 (#5792)
* feat: add Paratera mini app with logo and URL.

* feat: add Paratera AI provider and associated model.

* feat: add Paratera provider to migration configuration

* fix: update Paratera entry in default mini apps configuration

* feat: add additional Paratera models to system models configuration

* feat: reintroduce Paratera provider in migration configuration

* fix: update redux-persist version to 99 in store configuration

---------

Co-authored-by: George Zhao <georgezhao@SKJLAB>
2025-05-09 14:45:29 +08:00
one
a2d8beafcf fix: user message usage (#5657)
* fix: user message usage estimation

* fix: estimate usage on resending edited user message

* refactor: renaming

* refactor: renaming
2025-05-09 14:17:28 +08:00
Roland
759fa78a30 feat: add the "Export Agent" feature (#5789) 2025-05-09 13:30:21 +08:00
one
fcc52867c4 perf: virtual list for quick panel and SelectModelPopup (#5594)
* perf: quick panel with virtual list

* fix: adaptive virtual list height

* fix: keep panel content if it is re-opened in a very short interval

* refactor: use modified rc-virtual-list to support overscan

* fix: virtual list item key

* refactor: remove useless styles

* refactor: support smooth scrolling for virtual list

* fix: lint error

* perf: use virtual list for SelectModelPopup

* refactor: change model name style

* fix: better auto scroll behaviour

* perf: improve memorization for SelectModelPopup

* fix: group name background

* refactor: change model item margin

* chore: update rc-virtual-list to 3.19.2

* fix: adaptive list height

* refactor: improve styles for focused or selected items

* refactor: do not show model if the assistant has not default model

* chore: migrate to custom rc-virtual-list

* refactor: improve selected item style

* refactor: improve selected item style

* fix: left margin

* refactor: simplify the indicator for selected item

* fix: prevent mouse hover for keyboard events

* chore: bump rc-virtual-list

* refactor: simulate sticky group header in SelectModelPopup

* fix: cleanup timer, add comments

* perf: improve smooth scrolling

* chore: bump to rc-virtual-list:3.19.6

* refactor: update memorization

* refactor: extract item rendering logic

* refactor: delay CustomTag tooltip for performance

* fix: disable spellcheck in model search bar

* refactor: expand/collapse model label on resizing window

* refactor: simplify filtering

* chore: update rc-virtual-list

* refactor: always render virtual list to avoid inconsistent state

* chore: update dependencies

* chore: update dependencies

* chore: update dependencies

* refactor: remove useless states

* refactor: simplify selected state

* refactor: improve keyboard events for SelectModelPopup

* revert: do not expand mode tags

* refactor: reduce animation time

* chore: update dependencies

* refactor: better names and comments

* refactor: better error handling

* refactor: simplify auto-scrolling logic

* refactor: use react-window rather than rc-virtual-list

* fix: disable auto-scroll

* fix: scroll bar style and item margin

* fix: initialize sticky banner

* refactor: distinguish auto-scrolling behaviour for different causes

* fix: keyboard navigation error
2025-05-09 11:54:54 +08:00
Konv Suu
685ea0e297 fix: remove useless border and border radius for code block 2025-05-09 09:55:47 +08:00
karl
416a5ebcc6 feat: tooluse result display style optimization (#5758) 2025-05-09 09:52:15 +08:00
Camol
671bc64529 fix: display image from mcp response (#5780) 2025-05-09 09:43:22 +08:00
George Zhao
3bd7a9fbe8 feat(minapps): add n8n mini app with logo and URL. (#5776)
Co-authored-by: George Zhao <georgezhao@SKJLAB>
2025-05-09 00:52:15 +08:00
one
83cea0750d refactor(ModelList): improve model list style and grouping (#5674)
* refactor(ModelList): make the group removing button consistent with model removing button

* refactor(ModelList): improve auto-grouping, reduce the number of groups

* refactor(EditModelsPopup): extract model group tools

* refactor(naming): add special grouping rules for some providers

* feat(ModelList): add a button to add/remove all the listed models

* refactor(naming): update auto grouping

* refactor: update auto grouping for dmxapi

* revert: remove ungrouped
2025-05-08 23:20:29 +08:00
George Zhao
4c3c863c7d feat: Custom mini app (#5731)
* feat: 新增文件写入功能,支持通过 ID 写入文件并加载自定义小应用配置。

* feat(i18n): 添加自定义小程序配置的多语言支持,包括英文、简体中文和繁体中文。

* fix(minapps): 使用 await 加载自定义小应用并合并到默认应用中,同时添加日志输出以便调试

* fix(minapps): 在开发环境中添加条件日志输出,以便调试加载的默认小应用。

* refactor(miniappSettings): 移动自定义小应用编辑区域的位置,优化界面布局。

* refactor(miniappSettings): 修改自定义小应用保存逻辑,优化应用列表重新加载方式。

* feat(i18n): 修复在merge过程中丢失的语言设置。

* fix(bug_risk): Consider adding stricter validation for the JSON config on load.

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>

* feat(miniapp): 添加自定义小应用功能,优化应用列表展示,支持通过模态框添加新应用。

* feat(App): enhance custom app modal to support logo upload via URL.

* feat(miniapp): add application logo support and update mini app list reloading logic.

* feat(i18n): update mini app custom settings translations for multiple languages.

* feat(miniapp): add updateDefaultMinApps function and refactor mini app list reloading logic.

* feat(miniapp): add removeCustom functionality to handle custom mini app deletion

* feat(miniapp): add duplicate ID check when adding custom mini apps.

* feat(i18n): 重构侧边栏相关翻译为结构化格式,增加删除自定义应用的翻译支持。

* feat(miniapp): 优化删除自定义应用的逻辑,使用条件渲染简化代码结构。

* feat(miniapp): 添加自定义小应用内容的空值处理,确保 JSON 格式有效。

* feat(i18n): 更新默认语言为英语,并移除多个语言文件中的默认代理字段。

* feat(i18n): 为多个语言文件添加自定义小应用配置编辑描述翻译。

* feat(i18n): add success and error messages for deleting custom mini apps in multiple language files.

* feat(i18n): update success and error messages for custom mini app operations and add placeholder text in multiple language files.

* feat(i18n): 为多个语言文件添加重复ID和冲突ID的错误信息翻译,并在自定义小应用设置中实现相关检查逻辑。

* feat(miniapp): 在添加自定义小应用时,增加对默认最小应用ID的重复检查逻辑。

* feat(i18n): update edit description for custom mini app configuration in Traditional Chinese locale

* fix(miniapp): enhance error messages for duplicate and conflicting IDs in custom mini app configuration

---------

Co-authored-by: George Zhao <georgezhao@SKJLAB>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: suyao <sy20010504@gmail.com>
2025-05-08 21:59:55 +08:00
SuYao
c17fdb81aa Feat/claude websearch support (#5771)
* feat: enhance web search capabilities in AnthropicProvider

- Added support for Claude models in web search functionality with a new regex.
- Implemented logic to retrieve web search parameters and handle web search results.
- Updated message handling to include web search progress and completion states.
- Enhanced citation formatting for web search results from Anthropic source.

* feat: import WebSearchResultBlock for enhanced message handling

- Added import for WebSearchResultBlock from the Anthropic SDK to improve message processing capabilities in messageBlock.ts.
- Removed duplicate import to streamline the code.

* chore: update @anthropic-ai/sdk to version 0.41.0 in package.json and yarn.lock

* Update src/renderer/src/store/messageBlock.ts

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>

---------

Co-authored-by: Chen Tao <70054568+eeee0717@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2025-05-08 21:30:43 +08:00
Roland
e2ffea93af fix(MCP): Revise the server type judgment logic to ensure the correct… (#5769) 2025-05-08 20:57:48 +08:00
ous50 | ousfifty | 欧式fifty
5f09cd2718 Feat: change Gemini Safety Settings to OFF; upgrade @google/genai package (#5763)
* Feat: change Gemini Safety Settings to OFF; upgrade @google/genai package

* fix: remove model.id param in getSafetySettings in Gemini Provider
2025-05-08 18:21:39 +08:00
MyPrototypeWhat
9390b92ebb fix: enhance search functionality with optional HTTP options (#5765)
* feat: enhance search functionality with optional HTTP options

- Updated the search method signatures in BaseWebSearchProvider, WebSearchEngineProvider, LocalSearchProvider, and WebSearchService to accept optional HTTP options.
- Modified fetchWebContent and fetchWebContents to utilize the new HTTP options parameter for improved request handling.
- Enhanced error handling in messageThunk to manage abort errors more effectively.

* feat: implement abortable promises for web search and fetch operations

- Added createAbortPromise utility to handle abort signals for promises.
- Updated LocalSearchProvider and fetchWebContent to utilize abortable promises, allowing for better control over ongoing requests.
- Enhanced error handling in ApiService to log errors consistently.
2025-05-08 18:03:19 +08:00
自由的世界人
1f96b326b6 fix(theme): citation list dark theme display & url repeatedly requesting (#5752)
* fix(theme): citation list dark theme  display

* fix: 减少属性变量及反复请求

* fix: update react-query
2025-05-08 17:24:04 +08:00
MyPrototypeWhat
875d20d34c feat(MCP): update auto-install server name and add server registration logic
- Changed the auto-install server name to '@cherry/mcp-auto-install' in migration logic.
- Implemented logic to register the MCP server upon tool invocation if it matches the auto-install server name.
2025-05-08 13:26:40 +08:00
kangfenmao
aeb8091c89 feat: refactor AihubmixProvider and OpenAICompatibleProvider for improved model handling (#5732) 2025-05-08 13:20:12 +08:00
LiuVaayne
5c2998cc48 feat(MCP): implement login shell environment retrieval (#5739)
feat: implement login shell environment retrieval
2025-05-08 10:14:01 +08:00
kangfenmao
6f1101e96d feat: customize aihubmix provider request logic (#5728) 2025-05-08 09:52:53 +08:00
suyao
06b1b889d6 chore: remove unuseful doc 2025-05-08 09:40:08 +08:00
beyondkmp
a33a234f36 feat: add zoom factor setting and localization support (#5665)
* feat: add zoom factor setting and localization support

- Introduced App_SetZoomFactor IPC channel for managing zoom levels.
- Implemented zoom factor functionality in the main IPC handler.
- Added setZoomFactor method in the settings store and corresponding UI in DisplaySettings.
- Included localization for zoom settings in English and Chinese.

* add i18n

* recover file

* delete code

* fix: update zoom factor handling to apply to all windows

- Modified the IPC handler for App_SetZoomFactor to set the zoom factor for all non-destroyed windows instead of just the main window.

* add getzoomfactor api

* feat: synchronize zoom factor with Redux state on app initialization

- Added functionality to fetch the zoom factor from the main process and dispatch it to the Redux store during app initialization.
- Removed redundant zoom factor fetching logic from DisplaySettings component.

* feat: enhance zoom factor management with IPC updates

- Added a new IPC channel for zoom factor updates to notify all renderer processes.
- Introduced a constant for predefined zoom levels to streamline zoom adjustments.
- Updated the zoom handling logic to utilize the new zoom levels and ensure smooth transitions.
- Implemented a listener in the preload script to handle zoom factor updates from the main process.
- Refactored the app initialization to include real-time updates for the zoom factor in the Redux state.

* feat: integrate zoom options into DisplaySettings component

- Added ZOOM_OPTIONS constant to generate structured options for Ant Design Select from predefined zoom levels.
- Refactored DisplaySettings to utilize ZOOM_OPTIONS, removing redundant zoom option definitions.
- Simplified the zoom factor fetching logic in useAppInit for better readability and efficiency.

* refactor: streamline zoom factor handling and remove unused IPC channel

- Removed the App_GetZoomFactor IPC channel as it was no longer needed.
- Updated zoom factor handling to directly set and notify the main window of changes.
- Simplified the logic for setting the zoom factor in the WindowService and ShortcutService.
- Adjusted the useAppInit hook to utilize the new zoom factor management approach.

* refactor: improve zoom factor handling in WindowService and useAppInit hook

- Simplified the zoom factor setting in WindowService by directly using the config manager.
- Updated useAppInit to ensure the zoom factor is set correctly on initialization, enhancing responsiveness to changes.
2025-05-08 07:18:43 +08:00
Xuanwo
94ef903b46 feat: Add OpenDAL based Remote Storage class (#2700)
* feat: Add OpenDAL based Remote Storage class

Signed-off-by: Xuanwo <github@xuanwo.io>

* Fix error logging

Signed-off-by: Xuanwo <github@xuanwo.io>

* fix(dependencies): update opendal version to ^0.47.11 and add platform-specific binaries

---------

Signed-off-by: Xuanwo <github@xuanwo.io>
Co-authored-by: suyao <sy20010504@gmail.com>
2025-05-08 03:09:40 +08:00
自由的世界人
266a347dd2 fix: citation list loading (#5742)
* fix: citation loading

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>

* fix: remove unused import & cleanup some code

---------

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2025-05-08 03:04:31 +08:00
chenxi
26bade489c fix: failed to connect OAuth MCP server (#5709)
* fix: failed to connect OAuth MCP server

* polish: handle token fetching errors gracefully
2025-05-08 00:32:51 +08:00
SuYao
12f4500c47 refactor(middleware): add extractReasoningMiddleware for enhanced text processing (#5637) 2025-05-07 22:09:12 +08:00
kangfenmao
787ffc3390 Revert "perf: <tool_use> display (#5489)"
This reverts commit 44ee736a10.
2025-05-07 21:08:59 +08:00
kangfenmao
f4c127642b fix(upgrades): add check for empty content in error block creation during upgrade to v7 2025-05-07 21:08:59 +08:00
自由的世界人
0c845d8661 fix: knowledge base url error (#5735) 2025-05-07 19:42:48 +08:00
Chen Tao
c34f2527b0 feat: optimize knowledge recognize (#5707)
Co-authored-by: 自由的世界人 <3196812536@qq.com>
2025-05-07 14:34:38 +08:00
自由的世界人
2be55e1d44 feat: change citation list style (#5516)
* feat: change citation list style

* feat: add link preview

* fix: model inside searching

* fix: change button word
2025-05-07 14:21:58 +08:00
自由的世界人
fbf47fc943 fix: chat message translate (#5682)
* fix: add updateTranslationBlockThunk
2025-05-07 14:19:47 +08:00
Chen Tao
2d1a17d464 feat: support dashscope reranker (#5725) 2025-05-07 14:17:03 +08:00
MyPrototypeWhat
5051c84e81 优化消息块渲染性能,使用 useMemo 缓存图像块组;移除调试日志以清理代码 (#5722) 2025-05-07 13:38:09 +08:00
fullex
1b54312bdb fix(StoreSyncService): set flag bug when register IPC handler (#5715)
fix: register IPC handler in StoreSyncService
2025-05-07 10:52:51 +08:00
Teo
9b9d8dd2e4 feat(WebSearchButton): add 'Disable Web Search' option (#5717) 2025-05-07 10:37:08 +08:00
SuYao
e3aebf9e59 fix: update thinkingbutton model checks (#5708)
* fix: update model checks to include supported reasoning and thinking token models

* fix: simplify thinking button visibility logic in Inputbar component
2025-05-06 23:39:36 +08:00
fullex
5bd68b7b5d feat: emit event on message complete (#5696)
feat: add MESSAGE_COMPLETE event to EventService and emit on message processing completion
2025-05-06 23:14:41 +08:00
ipcjs
d700822505 feat(miniapps): add Grok / X (#5706) 2025-05-06 20:17:57 +08:00
one
c789348767 fix: memorize assistant with model (#5701) 2025-05-06 18:05:32 +08:00
SuYao
2fce1b58c8 fix: include thinking_millsec in message block creation (#5685) 2025-05-06 08:09:25 +08:00
自由的世界人
5097e24dee fix: openaiprovider timeout is not an integer (#5681)
Update OpenAIProvider.ts
2025-05-05 22:03:28 +08:00
SuYao
8b3894fd19 feat(OpenAI): new Responses API support (#5621)
* feat(OpenAI): new Responses API support

- Added OpenAICompatibleProvider to handle requests for OpenAI-compatible models.
- Updated ProviderSettings to reflect changes in provider types from 'openai' to 'openai-compatible'.
- Enhanced model validation and response handling in OpenAIProvider to support new input formats.
- Refactored existing components to accommodate the new provider structure and ensure compatibility with OpenAI's response API.
- Incremented store version to 98 to reflect changes in provider types and settings.
- Updated migration logic to convert existing 'openai' provider types to 'openai-compatible' where applicable.

* refactor(OpenAI): update model validation and response handling

- Renamed `isOpenAIModel` to `isOpenAILLMModel` for clarity in model type checking.
- Updated references to the new model validation function across `OpenAICompatibleProvider` and `OpenAIProvider`.
- Enhanced web search model validation logic to accommodate new model checks.
- Refactored `getOpenAIWebSearchParams` to return structured parameters based on model type.
- Improved citation formatting in message blocks for better web search results handling.

* fix(OpenAICompatibleProvider): reset timestamps for first token handling

- Updated logic to reset timestamps for the first token and content when no prior thinking content is present.
- Added comments for clarity on the purpose of the changes and marked a temporary fix for timestamp handling.

* refactor(OpenAICompatibleProvider): improve code readability with consistent formatting

* fix(OpenAIProvider): refine service tier logic for model identification

* fix: eslint error

* fix(OpenAIProvider): enhance response metrics tracking in streaming process

* feat(OpenAIProvider): add timeout handling for model requests

---------

Co-authored-by: 自由的世界人 <3196812536@qq.com>
2025-05-05 21:08:05 +08:00
chenxi
c8730c62f7 Fix: 'Web Search' and 'Clear Context' don't work (#5677) 2025-05-05 21:04:18 +08:00
beyondkmp
2f4ed1378f refactor: add Linux support for margin adjustments in MinappPopupConainer and McpSettingsNavbar (#5673)
* refactor: add Linux support for margin adjustments in MinappPopupContainer and McpSettingsNavbar

* refactor: adjust margin and padding for Linux support in MinappPopupContainer and McpSettingsNavbar

* refactor: enhance Linux support in MinappPopupContainer by updating button group class condition
2025-05-05 16:58:14 +08:00
one
470d8710f3 fix: infinite scroller layout (#5671) 2025-05-05 15:17:10 +08:00
chenxi
80d970050e feat: popup question editor support translation assistant (#5660)
* feat: TextEditPopup support translation assistant

* polish: ensure safe state updates in TextEditPopup during unmount

* test: make delay assertion more lenient in unclassified utils tests

* feat: add loading indicator to translation button in TextEditPopup
2025-05-05 14:58:57 +08:00
one
98a2269b8a fix: conditionally show loading more spinner (#5670) 2025-05-05 14:57:01 +08:00
SuYao
61bb81827e Fix/image height (#5658) 2025-05-04 22:31:00 +08:00
George Zhao
1e5ec5df7f feat: 支持自定义助手地址 (#5540)
* feat: 支持自定义助手地址

feat: 支持自定义助手地址

* feat: 更新多语言支持,添加“defaultaides”字段至隐私设置,并修改默认智能体的值为设置中的引用。

* feat: 更新默认助手设置,修复函数命名错误并优化状态管理

* refactor: update agent loading logic to use settings and improve error handling

* refactor: update DefaultaidesSettings to use custom hook for state management and replace icon in DataSettings

* fix: improve error message formatting in callMCPTool function

* feat: 添加多语言支持的默认助手设置,包括英文、日文、俄文和中文的翻译。

* refactor: 优化智能体加载逻辑,合并本地和远程智能体,并改进错误处理。

* feat: add import functionality for agents and update translations in multiple languages.

* feat: implement agent import functionality with validation and error handling.

* feat(i18n): add import success and error messages for agents in multiple languages.

* fix(i18n): standardize import success message key across multiple languages.

* refactor(i18n): remove default aides section from multiple language files

* refactor(i18n): update Traditional Chinese translations for agent management and privacy settings.

* feat(i18n): add import functionality for agents with URL and file options, including error handling and translations in multiple languages.

* refactor(i18n): rename 'defaultaides' to 'defaultAgent' across multiple language files and update related settings.

* refactor(AgentsPage): remove unused addAgent function from useAgents hook.

---------

Co-authored-by: 上房揭瓦 <hoaobo@foxmail.com>
Co-authored-by: George Zhao <georgezhao@SKJLAB>
Co-authored-by: suyao <sy20010504@gmail.com>
2025-05-04 21:04:04 +08:00
自由的世界人
0bad95230e fix: remove redundant local variables (#5654) 2025-05-04 19:56:56 +08:00
beyondkmp
df943f3027 chore(dependencies): update electron-builder to 26.0.15 (#5651)
* chore(dependencies): update electron-builder and related dependencies to version 26.0.15

* chore(electron-builder): update portable build configuration and clean up artifact build script

- Set buildUniversalInstaller to false for portable builds in electron-builder configuration.
- Removed obsolete condition for deleting portable files in artifact build completion script.
2025-05-04 18:34:43 +08:00
beyondkmp
54ec61fd0d chore(dependencies): update electron-updater to version 6.6.4 and remove patches (#5650)
chore(dependencies): update electron-updater to version 6.6.4 and remove obsolete patch
2025-05-04 18:33:27 +08:00
SuYao
d95e4d8155 fix(models): normalize model IDs to lowercase for consistency (#5642)
fix(models): normalize model IDs to lowercase for consistent matching in isSupportedThinkingTokenQwenModel function
2025-05-04 16:07:35 +08:00
beyondkmp
3718b86044 refactor(WindowService, ThemeProvider): streamline title bar style and theme toggling logic (#5633)
* fix(config): update title bar overlay colors for better visibility

* fix(Navbar): add Linux support for padding adjustment in Navbar component
2025-05-04 13:19:56 +08:00
Starsky Wong
6e9bde6b6d fix the issue of webdav local backup file storage (#5643)
fix the issue of unlimited webdav local backup file storage
2025-05-04 13:16:06 +08:00
beyondkmp
094d369187 refactor(WindowService): improve context menu setup (#5589)
* refactor(WindowService): streamline context menu setup and enhance webview spellcheck functionality

* update format

* delete setSpellCheckerLanguages
2025-05-04 11:04:56 +08:00
SuYao
7456c55974 fix(OpenAIProvider): enhance token budget calculation in OpenRouter (#5625)
* fix(OpenAIProvider): enhance token budget calculation in OpenRouter

* fix(OpenAIProvider): update budget token calculation and adjust effort ratio for improved reasoning support
2025-05-04 01:04:38 +08:00
MyPrototypeWhat
1111696aab feat(messageOperations): add editMessageBlocks functionality and update message handling logic (#5641)
feat(messageOperations): add editMessageBlocks functionality and update message handling logic

- Introduced editMessageBlocks to update properties of message blocks.
- Enhanced editMessage to include error handling and logging.
- Updated useTopicMessages to accept topic ID directly.
- Refactored MessageMenubar to utilize editMessageBlocks for editing messages.
- Improved saveMessageAndBlocksToDB for better state management.
2025-05-04 00:57:10 +08:00
MyPrototypeWhat
e7104fe7a9 fix(messageThunk): enhance reset message logic to include model for s… (#5632)
fix(messageThunk): enhance reset message logic to include model for single message resets
2025-05-03 20:39:40 +08:00
SuYao
ce5f6392ce fix(i18n): add missing translation for Ru (#5631)
fix(i18n): add missing translation for reasoning effort settings in Russian locale
2025-05-03 17:22:17 +08:00
yushihang
61f5fa9be2 Remove redundant condition check in MCP service args handling (#5606)
Remove duplicate !args.includes('-y') check
2025-05-02 22:51:40 +08:00
KumaKorin
fb3c18ff48 fix: resolve scrolling issue on files page (#5618) (#5619) 2025-05-02 22:37:05 +08:00
SuYao
6601c7895d fix(Anthropic): add base64 file handling to IPC and file management (#5595) 2025-05-02 22:30:34 +08:00
fullex
42179d9441 refactor: simplify custom CSS functionality by store sync (#5596)
* feat: implement store synchronization across windows

- Added new IPC channels for store synchronization: StoreSync_Subscribe, StoreSync_Unsubscribe, StoreSync_OnUpdate, and StoreSync_BroadcastSync.
- Integrated store sync service in various components, including the main IPC handler and renderer store.
- Removed the MiniWindowReload IPC channel as it was no longer needed.
- Updated the store configuration to support synchronization of specific state slices.

* refactor: remove custom CSS functionality from IPC and related components

- Removed the App_SetCustomCss channel and associated handlers from the IPC and ConfigManager.
- Updated the renderer components to eliminate references to custom CSS settings.
- Refactored the MiniWindow component to manage custom CSS directly without IPC communication.
2025-05-02 15:19:47 +08:00
one
6c17277540 perf(inputbar): improve long text paste (#5580) 2025-05-02 11:27:16 +08:00
fullex
b71798d3e1 feat: implement store synchronization across windows (#5592)
- Added new IPC channels for store synchronization: StoreSync_Subscribe, StoreSync_Unsubscribe, StoreSync_OnUpdate, and StoreSync_BroadcastSync.
- Integrated store sync service in various components, including the main IPC handler and renderer store.
- Removed the MiniWindowReload IPC channel as it was no longer needed.
- Updated the store configuration to support synchronization of specific state slices.
2025-05-02 03:08:26 +08:00
SuYao
d639a99a5f Feat/qwen3 support (#5533)
* feat: implement ThinkingPanel for managing reasoning effort and token limits

- Added ThinkingPanel component to handle user settings for reasoning effort and thinking budget.
- Introduced ThinkingSelect and ThinkingSlider components for selecting reasoning effort and adjusting token limits.
- Updated models and hooks to support new reasoning effort and thinking budget features.
- Enhanced Inputbar to integrate ThinkingPanel and provide a toggle for enabling thinking features.
- Updated translations and styles for new components.

* refactor: enhance ThinkingPanel and related components for improved reasoning effort management

- Updated ThinkingPanel to streamline token mapping and error messaging.
- Refactored ThinkingSelect to utilize a list for better UI interaction.
- Enhanced ThinkingSlider with styled components for a more intuitive user experience.
- Adjusted model checks in the configuration to support new reasoning models.
- Improved translations for clarity and consistency across languages.

* feat: close ThinkingPanel on outside click

* feat(icons): add new lightbulb icons and update reasoning effort settings in translations

- Introduced new SVG icons for lightbulb states (off, on at 10%, 50%, and 90%).
- Added "Off" reasoning effort option in English, Japanese, Russian, Simplified Chinese, and Traditional Chinese translations.
- Refactored Inputbar and ThinkingButton components to integrate new reasoning effort logic and icon display.

* feat(thinking): refactor reasoning effort management and introduce new lightbulb icon

- Removed ThinkingPanel, ThinkingSelect, and ThinkingSlider components to streamline reasoning effort management.
- Added new MdiLightbulbAutoOutline icon for the auto reasoning effort option.
- Updated reasoning effort logic in ThinkingButton to support 'auto' and fallback options.
- Enhanced translations for reasoning effort options across multiple languages.
- Adjusted model configurations to integrate new reasoning effort settings.

* refactor(messageThunk): update multi-model dispatch logic for improved assistant handling

- Changed the parameter from baseAssistantId to assistant object for better clarity.
- Updated tasksToQueue structure to include assistant configuration instead of just ID and model.
- Enhanced the creation of assistant messages to utilize the full assistant object.

* chore(messageThunk): remove unused comment for clarity in multi-model response handling

* fix(ThinkingButton): update quick panel title for reasoning effort settings

* fix(GeminiProvider, OpenAIProvider): apply Math.floor to budget calculations for improved accuracy

---------

Co-authored-by: ousugo <dkzyxh@gmail.com>
Co-authored-by: Teo <cheesen.xu@gmail.com>
2025-05-01 22:57:04 +08:00
fullex
1980b46880 refactor: Seperate MiniWindow loading from MainWindow (#5581) 2025-05-01 21:29:41 +08:00
Chen Tao
72b8faf760 fix: 调整图片高度,修复gemini画图 (#5585) 2025-05-01 21:03:10 +08:00
fullex
4162dd6c61 refactor: remove unused selection window (#5586) 2025-05-01 20:57:31 +08:00
SuYao
caf645a145 refactor: enhance image block rendering and styling (#5567)
* refactor: enhance image block rendering and styling

* 更新 index.tsx

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>

* refactor: update key usage in MessageBlockRenderer for improved readability

---------

Co-authored-by: Chen Tao <70054568+eeee0717@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2025-05-01 18:22:27 +08:00
MyPrototypeWhat
d78d8373d7 fix(mcp-tools): improve error message formatting and response handlin… (#5565)
fix(mcp-tools): improve error message formatting and response handling in upsertMCPToolResponse function
2025-05-01 18:06:53 +08:00
one
e0e1edebbe perf: improve inputbar button memorization 2025-05-01 17:49:51 +08:00
SuYao
b43702f21d feat(OpenAIProvider): support image edit (#5469)
* feat(OpenAIProvider): support image edit

* fix: can edit image

* feat: add upload situation

* chore: optimize  abort

* fix: image cannot read

* chore(SvgSpinners180Ring): remove unused React import

* refactor(FileManager): simplify file reading logic by storing intermediate data

---------

Co-authored-by: eeee0717 <chentao020717Work@outlook.com>
2025-05-01 12:38:33 +08:00
one
23dd66d4a1 fix: reset hasReasoningContent (#5563) 2025-05-01 11:47:53 +08:00
SuYao
d05f6985bb fix(messageThunk): ensure usage is only estimated when not already present in response (#5553)
* fix(messageThunk): ensure usage is only estimated when not already present in response

* refactor: clean logic
2025-05-01 11:04:43 +08:00
one
f9690d52ee fix: refresh thinking state on streaming (#5557) 2025-05-01 01:08:22 +08:00
nmnmtttt
d571c46aad Fix error #5456 (#5543)
* Fix default assistant model settings where temperature value 0 fails to trigger updates #5456

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

* fix: remove console.log

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

* fix: use simple condition to tell value  (#5456)
*use  value not equal null to  tell false condition
Signed-off-by: LeeSH <shuhao_lin@fzzixun.com>

---------

Signed-off-by: LeeSH <shuhao_lin@fzzixun.com>
Co-authored-by: Lee SH <shuhao_lin@fzzixun.com>
2025-04-30 22:52:18 +08:00
one
aaf396f83a feat: support streaming for model health check (#5546) 2025-04-30 22:25:32 +08:00
one
28ec990100 fix: prevent overriding block status on aborting (#5547) 2025-04-30 20:15:13 +08:00
beyondkmp
49658c6437 feat(WindowService): add main window monitor for renderer process events (#5532)
* feat(WindowService): add main window monitor for renderer process events

* fix(WindowService): enhance renderer process crash handling to improve application stability
2025-04-30 18:02:25 +08:00
MyPrototypeWhat
457c8e05da Fix/message block structure (#5536)
* refactor:  重构快捷助手

- 移除不必要的 `model` 属性,简化 `MessageContent` 和相关组件的参数传递。
- 更新 `MessageItem` 和 `MessageBlockRenderer` 以提高可读性和性能,确保消息内容的正确渲染。
- 修复 `fetchCitations` 中的潜在错误,确保引用数据的正确处理。
- 清理未使用的代码和注释,提升代码整洁性。

* refactor: 优化消息块处理和错误显示逻辑

- 在 `upgradeToV7` 函数中调整了消息块的创建顺序,以保持与旧版本的一致性。
- 更新了 `ErrorBlock` 组件,增强了错误信息的显示逻辑,支持更详细的 HTTP 错误状态处理。
- 在多个语言文件中添加了暂停占位符文本,提升了用户体验。
- 移除了未使用的代码和注释,提升了代码整洁性。

* refactor(useAssistant): optimize topic handling with useMemo

* feat(locales): add Russian translations for MinApp and MiniWindow components

- Introduced new translations for various UI elements in the MinApp and MiniWindow sections, enhancing the user experience for Russian-speaking users.
- Updated the HomeWindow component to streamline topic handling by directly accessing the default assistant's topics, improving code clarity and performance.

* refactor(message): remove loading state management from newMessage slice and streamline message loading logic

- Removed the loading state update for topics in the `newMessage` slice to simplify state management.
- Updated `loadTopicMessagesThunk` to eliminate unnecessary loading checks, enhancing clarity and performance during message loading.

---------

Co-authored-by: suyao <sy20010504@gmail.com>
2025-04-30 17:58:08 +08:00
Akey Zhang
c8240421e9 style: optimize mcp arg name display layout when tool or prompt descr… (#5467)
* style: optimize mcp arg name display layout when tool or prompt description is short

* style: optimize mcp arg name display layout, make it simple

* fix: remove unused import
2025-04-30 11:22:39 +08:00
MyPrototypeWhat
37f09d3cb8 fix: update webSearch type and results structure in upgrade logic (#5512) 2025-04-30 00:16:58 +08:00
one
8fe44e1cd0 fix: determining thinking process using block status (#5509)
* fix: determining thinking process using block status

* refactor: merge MessageThought to ThinkingBlock

* style: fix typos

* fix: error handling

* refactor: set collapsed status as default

* refactor: remove pending status

* refactor: better collapsing behaviour

* refactor: remove processing status
2025-04-30 00:04:13 +08:00
SuYao
10f1c3725f feat(messageThunk): integrate autoRenameTopic functionality to update topic names based on assistant responses (#5504) 2025-04-29 23:07:09 +08:00
Chen Tao
be4d3e4eb7 feat: optimize extract logic (#5470)
* feat: optimize extract logic

* chore
2025-04-29 20:43:50 +08:00
karl
48a3f7b62a fix: The Error display of the failed mcp call shows that the Error type cannot be displayed (#5492)
* fix: The Error display of the failed mcp call shows that the Error type cannot be displayed

* Update src/renderer/src/utils/mcp-tools.ts

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>

---------

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2025-04-29 17:40:50 +08:00
SuYao
3f1045b936 fix(GeminiProvider): relocate grounding metadata handling (#5490)
* fix(GeminiProvider): relocate grounding metadata handling to improve code clarity and maintainability

* refactor(GeminiProvider): enhance conditional checks for chunk processing
2025-04-29 17:36:35 +08:00
karl
44ee736a10 perf: <tool_use> display (#5489) 2025-04-29 16:39:19 +08:00
Teo
760c402bc7 refactor: network search module, support quick menu (#5291)
* refactor: Reconstruct the network search module to support quick menu switching between different suppliers.

* refactor(GeminiProvider): simplify web search enablement logic

* refactor(settings): remove unnecessary SettingDivider for cleaner layout

* refactor(SelectModelButton): remove unused setModel function for improved performance

* refactor(ApiService): simplify web search condition by removing redundant check
2025-04-29 16:31:41 +08:00
Chen Tao
3cad49f8fc fix: message do not use knowledge (#5485) 2025-04-29 16:19:19 +08:00
SuYao
1ac9ac09c9 refactor(MainTextBlock): enhance content processing by ignoring tooluse (#5483) 2025-04-29 16:16:34 +08:00
MyPrototypeWhat
08de8eac86 feat: 添加 messageBlock、messageThunk 和 useMessageOperations 使用指南文档
- 新增 `how-to-use-messageBlock.md`,详细介绍 `messageBlock.ts` 的 Redux Slice 及其状态管理、actions 和 selectors。
- 新增 `how-to-use-messageThunk.md`,概述 `messageThunk.ts` 的核心功能和主要 Thunks 的使用。
- 新增 `how-to-use-useMessageOperations.md`,提供 `useMessageOperations` Hook 的使用示例和功能说明,简化组件与消息数据的交互。
2025-04-29 15:14:55 +08:00
chenxue
4ebdd52709 feat: add painting aihubmix provider (#4503)
* add painting aihubmix provider

* fix: Cannot read properties of undefined (reading 'unshift')

* fix: painting redux data

---------

Co-authored-by: zhaochenxue <zhaochenxue@bixin.cn>
Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2025-04-29 14:38:59 +08:00
MyPrototypeWhat
4757583691 refactor: message block structure (#4660)
* feat(message-blocks): introduce new message block types and middleware for handling message updates

- Added new types for message blocks including MainText, Thinking, Translation, Code, Image, ToolCall, ToolResult, KnowledgeCitation, WebSearch, File, and Error blocks.
- Implemented middleware to manage message block mapping and updates in Redux, enhancing the handling of message states and blocks.
- Introduced LRU caching for efficient message block retrieval and management.

* feat(messages): implement message management slice and utility functions

- Introduced a new Redux slice for managing messages, including actions for setting the current topic, loading state, error handling, and message updates.
- Added utility functions for creating various message block types, enhancing the structure and management of message content.
- Updated message type definitions to include timestamped block references, improving the tracking of message block states.

* feat(store): add messageBlocks reducer and integrate into rootReducer

- Introduced a new messageBlocks reducer to manage message block state.
- Updated rootReducer to include messageBlocks alongside existing reducers.
- Refactored newMessage slice to accommodate changes in message structure and block handling.
- Removed obsolete messageBlockMap utility file to streamline codebase.

* feat(database): implement version 7 migration and enhance message structure

- Added new message_blocks table to the database schema for improved message handling.
- Introduced upgradeToV7 function to migrate existing topics and messages to the new structure.
- Refactored message creation utilities to support new message block types and improved error handling.
- Implemented various message filtering utilities to streamline message processing.
- Updated Redux store to accommodate new message structure and loading states.

* feat(message): refactor message handling and introduce messageStreamProcessor

- Updated database schema to correct types for topics and message blocks.
- Introduced messageStreamProcessor to handle API responses and transform them into application-specific data structures.
- Refactored messageThunk to streamline message creation and updates, ensuring consistency with the new message structure.
- Enhanced error handling and state management during message processing.

* refactor(message): update message handling with new types and utility functions

- Refactored message operations to utilize new message types and improved utility functions for content retrieval.
- Introduced helper functions for finding message blocks, enhancing the structure and readability of message processing.
- Updated various providers to align with the new message structure, ensuring consistent handling of message content and blocks.
- Enhanced error handling and state management during message processing, improving overall reliability.

* refactor(message): wip create XxxBlock components

- Refactored message handling to utilize new message types, enhancing the overall structure and readability.
- Introduced new message blocks including CitationBlock, CodeBlock, ErrorBlock, FileBlock, ImageBlock, ThinkingBlock, ToolBlock, and TranslationBlock.
- Updated existing components to align with the new message structure, ensuring consistent handling of message content and blocks.
- Improved utility functions for finding and processing message blocks, enhancing the reliability of message operations.

* refactor(message): enhance message operations with new selectors and blocks

- Updated useMessageOperations to integrate new message block types and selectors for improved state management.
- Introduced new selectors for fetching topic messages and loading states, enhancing the efficiency of message retrieval.
- Refactored message handling in Inputbar and MessageContent components to align with the new message structure.
- Added CitationBlock and improved rendering logic for message blocks, ensuring consistent display of message content.
- Enhanced error handling and logging for message operations, improving overall reliability.

* refactor(message): enhance message update logic with block instructions

- Updated the updateMessage reducer to handle block instructions, allowing for more flexible message updates.
- Improved the fetchAndProcessAssistantResponseImpl function to track the last added block, ensuring proper handling of streaming content.
- Refactored stream processing to accommodate new callback signatures and improve error handling.
- Removed unused console logs and cleaned up code for better readability and maintainability.

* merge origin/main

* refactor(message): update message handling and block structure

- Replaced `prepareTopicMessages` with `loadTopicMessagesThunk` for improved message loading logic.
- Updated `MessageTools` to accept `ToolBlock` instead of `Message`, enhancing type safety.
- Introduced `resetMessage` utility to streamline message object creation and reset mutable fields.
- Refactored `findCitationBlocks` and related types for consistency in message block handling.
- Enhanced error handling in message update logic to ensure robustness during database operations.

* refactor(message): update message and block handling for improved clarity and performance

- Refactored message handling by removing unnecessary cloning of messages in `MessageContent`.
- Updated `Inputbar` to import `Message` from the new message types module.
- Simplified block rendering logic in `MessageBlockRenderer` by removing redundant checks.
- Adjusted `StreamProcessingService` to use the updated import path for `GroundingMetadata`.
- Enhanced message status handling in `newMessage` to include 'streaming' status.
- Removed deprecated `createUserMessageThunk` to streamline thunk actions.
- Updated type definitions in `newMessageTypes` for better clarity and consistency.

* refactor(message): enhance message block structure and type handling

- Updated `Markdown` component to utilize `MainTextMessageBlock` for improved type safety.
- Refactored `MessageContent` to remove error handling logic and streamline rendering.
- Adjusted `MessageError` to accept `ErrorMessageBlock` and simplified error display logic.
- Enhanced `MessageTools` to work with `ToolMessageBlock`, improving clarity in tool response handling.
- Updated `MainTextBlock` to pass the correct props to `Markdown`, ensuring consistent rendering.
- Refactored utility functions to align with new message block types, enhancing overall code clarity and maintainability.

* refactor: update message types import paths and enhance message handling logic

- Changed import paths for message types from 'newMessageTypes' to 'newMessage' across multiple files.
- Refactored message handling functions to utilize the new message structure, ensuring compatibility with the updated types.
- Improved logic for finding and processing main text blocks in messages.
- Updated related components and hooks to reflect the new message structure, enhancing overall code maintainability.

* refactor: improve stream processing and message handling logic

- Updated the `createStreamProcessor` function to handle null and undefined chunks more robustly.
- Introduced a helper function `handleBlockTransition` to streamline state transitions between message blocks.
- Enhanced error handling in the `onComplete` function to specifically manage abort errors and create error blocks when necessary.
- Improved final block status updates to ensure accurate tracking of message processing states.

* refactor: use rehype-sanitize for html tags

# Conflicts:
#	src/renderer/src/pages/home/Markdown/Markdown.tsx

* refactor: merge rehype plugins

* refactor(ModelList): extract NameSpan component and adjust styling for better layout

* feat: update Z.ai app configuration with additional styling and increment store version to 97

# Conflicts:
#	src/renderer/src/store/index.ts

* feat(FeatureMenus, Footer): replace Ant Design icons with Lucide icons and enhance layout

- Updated icons in FeatureMenus from Ant Design to Lucide for improved visual consistency.
- Refactored Footer component to use Lucide icons and adjusted layout for better alignment and spacing.
- Enhanced styling of Tag components for a more cohesive design.

* lint: fix code format

* chore(version): 1.2.5

* feat(locales): add locale cleanup functionality to after-pack script

- Introduced a new `remove-locales.js` script to handle the removal of unnecessary locale files based on the platform.
- Integrated the locale cleanup process into the `after-pack.js` script to ensure locales are managed during packaging.

* feat: support escaping the comma character in the API key. (#5088)

feat: support escaping the comma character in the API key.

* feat(Citations): enhance CitationsList with title and info icon, and update styling

* Revert "feat: add chat message translate copy button (#4620)"

This reverts commit c452fdfd20.

# Conflicts:
#	src/renderer/src/hooks/useMessageOperations.ts
#	src/renderer/src/pages/home/Inputbar/Inputbar.tsx

* refactor: update message status handling and improve message creation logic

- Introduced `AssistantMessageStatus` to standardize message statuses across the application.
- Updated various components and services to utilize the new status enum, replacing string literals for better type safety.
- Refactored message creation and processing functions to align with the new status definitions.
- Adjusted filtering logic in `useMessageOperations` to reflect changes in message status handling.
- Cleaned up unused code and comments for improved readability.

* refactor: enhance citation handling and web search integration

- Updated CitationBlock and MainTextBlock components to improve citation processing logic.
- Refactored citation data handling to accommodate new web search sources and formats.
- Introduced new chunk types for better handling of streaming responses, including text and web search results.
- Enhanced the integration of web search results into message blocks, ensuring accurate citation references.
- Updated related types and interfaces to reflect changes in citation and web search structures.

* refactor: improve message handling and citation integration

- Added debug logging to various components for better traceability during message processing.
- Refactored CitationBlock and MainTextBlock to streamline citation handling and improve integration with web search results.
- Updated Inputbar to include debug logs for message sending and dispatching actions.
- Enhanced the message block rendering logic to decouple citation references from main text blocks.
- Improved the handling of citation data and ensured accurate formatting across different sources.

* feat: add regenerate assistant response functionality

- Introduced `regenerateAssistantResponseThunk` to allow regeneration of assistant messages.
- Updated `useMessageOperations` to include the new `regenerateAssistantMessage` function.
- Refactored `MessageMenubar` to utilize the new regeneration feature.
- Adjusted `MessageImage` and `ImageBlock` components to align with updated props.
- Cleaned up unused code and comments across various files for improved readability.

* fix: deepseek-reasoner does not support successive user or assistant messages in MCP scenario (#5112)

* fix: deepseek-reasoner does not support successive user or assistant messages in MCP scenario.

* fix: @ts-ignore

* refactor: remove google analytics

* feat: add PostHogProvider for analytics integration

- Introduced PostHogProvider to manage data collection based on user settings.
- Wrapped the main application in PostHogProvider to enable analytics when data collection is allowed.

* refactor(AxiosProxy): improve proxy handling and initialization logic

- Changed cacheAxios from undefined to null for better initialization.
- Updated proxy handling to use ProxyAgent, ensuring axios instance is recreated when the proxy changes.
- Simplified axios instance creation by directly using the current proxy agent.

* refactor: remove search enhanceMode

* fix: 知识库和网络搜索使用输出语言问题 (#5129)

* feat(proxy): use os-proxy-config to get system proxy info instead of resolveProxy (#5123)

* feat(proxy): integrate os-proxy-config for system proxy management

- Added os-proxy-config dependency to manage system proxy settings.
- Refactored setSystemProxy method to utilize getSystemProxy for improved proxy handling.

* fix lint error

* chore(version): 1.2.6

* fix: zipfile dependencies

* chore(release): update default release tag to v1.0.0 and install setuptools for Mac build

* disable auto update in portable exe

* chore(electron-builder): add StartupWMClass for CherryStudio in liunx desktop configuration (#5158)

chore(electron-builder): add StartupWMClass for CherryStudio in desktop configuration

* fix(MinApp): integrate dynamic background color for MinappPopupContainer (#5142)

* fix(models): 更新OpenRouter模型ID和名称,简化模型组分类 (#5172)

* fix: purify minapp user agent tag (#5173)

* fix: electron-builder 新增配置导致的无法构建的问题  (#5175)

fix: electron-builder 新增配置导致的无法构建的问题

当前 electron-builder 的版本为 "26.0.13",但在 v26 之后,StartupWMClass 等配置标签要在 desktop > entry 下,而不是直接在 desktop 下,否则会导致无法构建打包

* Revert "fix(minapps): remove AI Studio entry from default mini apps list" (#5177)

This reverts commit 5834eaea2e.

* refactor(Markdown): remove rehype-sanitize and implement custom element filtering

- Removed rehype-sanitize dependency and its related configuration.
- Introduced ALLOWED_ELEMENTS and DISALLOWED_ELEMENTS for custom HTML element filtering.
- Updated rehypePlugins logic to conditionally apply plugins based on message content.
- Added encodeHTML utility function for HTML entity encoding.

# Conflicts:
#	src/renderer/src/pages/home/Markdown/Markdown.tsx

* refactor: mcp buttons and mcp settings

* refactor: add MessageTranslate.tsx & MessageCitations.tsx

* refactor: add MessageContent.main.tsx { getModelUniqId } from '@renderer/services/ModelService' import { Message, Model } from '@renderer/types' import { getBriefInfo } from '@renderer/utils' import { formatCitations, withMessageThought } from '@renderer/utils/formats' import { encodeHTML } from '@renderer/utils/markdown' import { Flex } from 'antd' import { clone } from 'lodash' import { Search } from 'lucide-react' import React, { Fragment, useMemo } from 'react' import { useTranslation } from 'react-i18next' import BarLoader from 'react-spinners/BarLoader' import styled, { css } from 'styled-components'

* refactor: enhance translation handling by integrating TranslationMessageBlock into Markdown and MessageTranslate components, and streamline TranslationBlock to utilize MessageTranslate for rendering.

* refactor: introduce citation processing optimization checklist and enhance citation handling

- Added a new refactoring checklist for optimizing citation processing logic.
- Implemented a lookup map for citations in MainTextBlock to improve performance.
- Updated Citation interface to include optional content field.
- Modified chunk types for web and knowledge search responses to improve type safety.
- Enhanced citation formatting to include content from web search results.

* refactor: update web search handling in GeminiProvider and OpenAIProvider

* refactor: update prompt handling and citation processing logic

* refactor: standardize chunk type usage across providers and improve image handling in MessageImage component

* refactor: update message operations and API service for improved message handling

- Translated comment in useMessageOperations.ts for clarity.
- Refactored ApiService to utilize findMainTextBlocks for knowledge base checks.
- Enhanced messageThunk with multi-model dispatch logic for better assistant response handling.

* refactor: optimize knowledge base ID handling in ApiService

- Removed unused store import and streamlined knowledge base ID extraction logic.
- Enhanced fetchExternalTool function to utilize mainTextBlocks for knowledge base checks, improving clarity and efficiency.

* feat: add message lifecycle documentation and enhance citation handling in CitationBlock component

* feat: add SearchingSpinner component and enhance message handling with ThinkingMessageBlock

- Introduced a new SearchingSpinner component for better user feedback during processing.
- Updated Markdown and MessageThought components to support ThinkingMessageBlock.
- Enhanced CitationBlock to display the SearchingSpinner when processing citations.
- Refactored message handling to include thinking time metrics across various components and services.

* refactor: enhance ApiService and message handling for improved search functionality

- Streamlined knowledge base ID extraction using flatMap for better performance.
- Added early checks for extractResults in search functions to prevent errors and improve logging.
- Updated chunk types to include SEARCH_IN_PROGRESS_UNION and SEARCH_COMPLETE_UNION for better state management during searches.
- Refactored search execution logic to handle different search scenarios more efficiently.

* refactor: streamline message update logic and enhance block handling

- Simplified message update dispatching by using the store's dispatch directly.
- Improved block transition handling by replacing direct calls with a dedicated function.
- Refactored conditional logic for updating blocks to ensure accurate state management.

* feat: enhance StreamProcessingService with tool call progress handling

- Added onToolCallInProgress callback to StreamProcessorCallbacks for handling tool call progress updates.
- Updated createStreamProcessor function to accept an empty object as default for callbacks.
- Implemented logic to process MCP_TOOL_IN_PROGRESS and MCP_TOOL_COMPLETE chunks in message handling.
- Improved type definitions for MCPToolInProgressChunk to include responses.

* refactor: enhance AI providers with abort controller integration for improved request handling

- Added abort controller functionality to AnthropicProvider, GeminiProvider, and OpenAIProvider to manage request cancellations effectively.
- Updated API calls to include signal for aborting requests, ensuring better control over ongoing operations.
- Improved cleanup logic to handle abort scenarios gracefully.

* feat: add TODO for pause capability in WebSearchService

- Added a TODO comment in WebSearchService to implement pause functionality for network searches, enhancing future service capabilities.

* fix(WebdavBackupManager): update modal confirmation to use window.modal and center content

* refactor: improve message operations and API service for enhanced functionality

- Updated useMessageOperations to dispatch resendMessageThunk with topic ID instead of object for better clarity.
- Refactored ApiService to streamline knowledge base ID extraction using flatMap and added early checks for improved error handling.
- Enhanced message handling in messageThunk by integrating topic queue management and simplifying error handling logic.
- Cleaned up commented-out code for better readability and maintainability.

* fix: enhance message resending functionality and integrate abort signal for web searches

- Updated resendMessageThunk to reset assistant messages without deleting other messages, improving user experience.
- Integrated abort signal handling in WebSearchService and fetch functions to manage request cancellations effectively.
- Refactored fetchWebContents and fetchWebContent to accept an optional abort signal for better control over fetch operations.
- Added resetAssistantMessage utility to streamline the resetting of assistant messages for regeneration.

* fix: enhance chunk handling in AI providers for improved message processing

- Added onChunk calls in AnthropicProvider and GeminiProvider to ensure complete text messages are processed correctly.
- Updated OpenAIProvider to handle finish reasons more accurately, improving message completion handling.
- Removed outdated TODO comment in WebSearchService for better code clarity.

* feat: enhance SearchingSpinner component and add processing text localization

- Updated SearchingSpinner to accept a text prop for dynamic message rendering.
- Added "processing" text localization in English, Japanese, Russian, Chinese (Simplified and Traditional) for improved user experience.
- Integrated updated SearchingSpinner in CitationBlock and MainTextBlock components to display appropriate loading messages.

* fix(WebdavBackupManager): update modal confirmation to use window.modal and center content

fix sse no headers

add eventSourceInit

refactor: switch from @vitejs/plugin-react to @vitejs/plugin-react-swc for improved performance

perf: improve streaming performance (#4986)

feat(ProviderSettings): move model provider to the top when toggled

When the model provider is toggled (OFF to ON), it is moved to the top of the provider setting for convenience. The change is minimal.

fix(settings): handle undefined content limit in BasicSettings component (#5252)

feat: update os-proxy-config to 1.1.2 and delete the patch (#5255)

updte os-proxy-config to 1.1.2 and delete the patch

feat: 添加嵌入维度配置 (#3947)

fix(ci): Remove a deleted step which make the nightly build pipeline fail

These lines were deleted in `release.yml` in commit 985996f0.

build: fix nightly build error

build: remove sentry integration

refactor(GeminiProvider): streamline abort signal handling and improve stream processing #5276

需要处理 GeminiProvider processStream 函数代码

https://github.com/CherryHQ/cherry-studio/pull/5276/files

Update @modelcontextprotocol/sdk to v1.10.2 (#5266)

- Removed MCPStreamableHttpClient.ts as it is now provided by the SDK.
- Adjusted imports in MCPService.ts to use the SDK's implementation.
- Updated yarn.lock to reflect the new SDK version.

feat: add cherry-text-logo.svg and remove npm.svg; update MCPSettings and NpxSearch components

- Introduced a new cherry-text-logo.svg file for branding.
- Removed the deprecated npm.svg file.
- Refactored MCPSettings and NpxSearch components to enhance functionality and UI, including state management and layout adjustments.
- Updated translations in multiple locales to include new types for MCP servers.

style(settings): update border-radius to use CSS variable for consistency

feat(mcp): mcp setting add service description page

chore: update dependencies and clean up code

- Reintroduced @mozilla/readability, @shikijs/markdown-it, and @xyflow/react to package.json.
- Updated shiki version to 3.2.2 in both package.json and yarn.lock.
- Removed trailing whitespace in IpcChannel.ts and index.ts for code cleanliness.
- Added outline style to .ant-tabs-tab-btn in ant.scss for improved UI consistency.

feat(WindowService): add maximize functionality and disable electron-window-state maxmize (#5292)

* feat(WindowService): add maximize functionality and clean up window close logic

- Introduced a new `maximize` option in the window state configuration.
- Added `setupMaximize` method to handle window maximization based on the launch state.
- Removed redundant logic from the window close event handler for clarity.

* add code

* update code

Create pull_request_template.md

feat: enhance MinAppIcon component with sidebar prop

- Added optional sidebar prop to MinAppIcon for conditional styling.
- Updated Sidebar component to pass sidebar prop to MinAppIcon for consistent appearance in sidebar context.

refactor(MessageAttachments): move styled component definition inside the component for better encapsulation

feat: support portable config dir (#5039)

* feat: support portable config dir

* fix: remove redundant mkdir

feat(image): support grok-2-image image and gpt-4o-image (#4767)

* feat(image): support grok image

* feat: add gpt-4o-image

* feat: 添加 gpt-image-1 到生成图像模型列表

* refactor(GeminiProvider): remove redundant onChunk call in processStream function

* refactor(OpenAIProvider): update image generation response format and improve prompt handling

* feat(AiProvider): implement thought processing for incremental reasoning and update MessageContent component

* refactor(useMessageOperations): update topic handling in resendUserMessageWithEditThunk and improve MessageMenubar component structure

* refactor(Messages): streamline message rendering and update type imports for better clarity

* refactor(Messages):  improve message block rendering logic

* refactor(Messages): enhance thinking time calculations

* refactor(Messages): enhance message usage estimation logic

* refactor(OpenAIProvider): get image generation usage

* refactor(Messages): optimize citation handling and improve main text block rendering

* refactor(Messages): improve clipboard copy functionality and streamline API response handling

* refactor(Messages): update message state management and improve selector usage for topic messages

* refactor(upgrades): update citation data structure in upgradeToV7 function and remove unused comments in messageBlock.ts

* feat(OpenAIProvider): enhance link conversion for web search results and refactor related logic in ApiService and messageBlock

* feat(translation): implement streaming translation updates and refactor translation handling

- Added a new `getTranslationUpdater` function to manage streaming translation updates.
- Refactored `translate` methods across various providers to support incremental updates.
- Updated `fetchTranslate` to accept content directly instead of a message object.
- Removed the `MessageContent.main.tsx` file as part of the cleanup.
- Enhanced error handling and logging during translation processes.

* feat(message-operations): add appendAssistantResponse functionality and enhance message operations

- Introduced `appendAssistantResponse` to allow appending new assistant responses using a specified model.
- Updated `useMessageOperations` hook to include the new function and improved documentation for existing methods.
- Refactored `MessageMenubar` to utilize the new `appendAssistantResponse` function for message handling.
- Enhanced error handling and logging in message-related thunks for better debugging and state management.

* feat(message): refactor message handling and enhance file block integration

- Updated `message_blocks` schema to include `file.id` for better file association.
- Refactored `FilesPage` to improve file deletion logic, ensuring related message blocks are updated or deleted accordingly.
- Enhanced `Inputbar` and `MessageAttachments` components to utilize new message structure and improve file handling.
- Removed deprecated `MessageCitations` component to streamline message management.
- Updated various components to use the new `MessageInputBaseParams` type for consistency across message operations.

* refactor(tests): clean up and organize formats test suite

- Removed commented-out code and unnecessary imports to enhance readability.
- Organized test cases for `escapeDollarNumber`, `escapeBrackets`, `extractTitle`, and `removeSvgEmptyLines` for better structure.
- Maintained existing test functionality while improving overall code clarity.

* refactor(tests): comment out unused tests in formats test suite

- Commented out the `withGeminiGrounding` test suite to improve clarity and focus on active tests.
- Removed unnecessary imports and organized the test structure for better readability.
- Maintained existing functionality while enhancing overall code organization.

* refactor(components): remove role prop from Markdown component in MessageThought and MessageTranslate

- Removed the `role` prop from the `Markdown` component in both `MessageThought` and `MessageTranslate` for consistency and to simplify the component usage.
- Updated import statements in `export.ts` to use type imports for `Message` and `Topic`, enhancing type safety.
- Commented out unused mock dependencies in the formats test suite to improve clarity and focus on active tests.

* refactor(messages): update message selection and handling for improved consistency

- Replaced legacy message selectors with new message handling methods in `ChatFlowHistory`, `ChatNavigation`, and `MessageAnchorLine` components.
- Utilized `getMainTextContent` utility for consistent message content retrieval across components.
- Updated state management in `messageThunk` to set the current topic ID correctly.
- Enhanced markdown export functions to utilize new message structure for better content handling.

* fix(databases): correct syntax in message_blocks schema for proper key separation

- Updated the `message_blocks` schema to include a comma separator between `messageId` and `file.id` for accurate primary key definition.
- Ensured consistency in database schema definitions to prevent potential issues during data retrieval.

* refactor(messages): enhance loading state handling and improve message block rendering

- Introduced a new `LoadingBlock` component to manage loading states for different message block types using `BeatLoader`.
- Updated `MessageContent` to display loading indicators when messages are pending.
- Cleaned up commented-out code and improved the structure of message block rendering logic.
- Adjusted `throttledBlockUpdate` and `throttledBlockDbUpdate` to prevent unnecessary updates when block statuses are already successful.
- Added error handling improvements in `fetchExternalTool` and `fetchAndProcessAssistantResponseImpl` for better robustness.

* refactor(messages): improve loading state handling in message block rendering

- Integrated `MessageBlockStatus` for better management of message block statuses.
- Added `LoadingBlock` component to handle loading states during message processing.
- Updated `fetchAndProcessAssistantResponseImpl` to set the status of tool blocks to `PROCESSING` for improved state tracking.
- Cleaned up commented-out code to enhance readability and maintainability of the rendering logic.

* refactor(messages): streamline message handling for clearing user messages

* feat(message-operations): add createTopicBranch functionality to clone messages to a new topic

- Implemented `createTopicBranch` in `useMessageOperations` to facilitate cloning messages from a source topic to a new topic.
- Introduced `cloneMessagesToNewTopicThunk` for handling the cloning process, including unique ID generation and database updates.
- Updated `Messages` component to utilize the new cloning functionality, ensuring proper topic management and error handling.
- Cleaned up unused imports and commented-out code in `MessageMenubar` for improved readability.

* fix(Messages): remove unused message operations in Messages component

- Removed `createNewContext` from the destructured message operations in the `Messages` component to clean up unused functionality.
- Added `getUserMessage` import to enhance message handling capabilities.

* 优化格式化和测试:重构消息处理和格式化功能

- 在 `formats.ts` 中移除未使用的 `withGeminiGrounding` 函数,并更新相关类型导入。
- 在测试文件中添加了对 `withGenerateImage` 和 `addImageFileToContents` 函数的测试,确保它们正确处理消息块和图像元数据。
- 通过创建辅助函数来简化测试数据的生成,提高测试的可读性和一致性。
- 清理了测试中的注释代码,提升了代码的整洁性。

* 优化消息处理和类型导入:更新消息相关组件以使用新消息类型

- 在多个组件中更新消息导入,确保使用 `newMessage` 类型以提高类型安全性。
- 移除未使用的 `CodeBlock` 组件,简化代码结构。
- 在 `SearchResults` 组件中引入 `getMainTextContent` 函数,以改进消息内容处理。
- 清理 `Suggestions` 组件中的冗余代码,提升可读性。
- 更新 `Message` 组件以支持新的消息处理逻辑,确保与助手消息状态的兼容性。

* feat(PlaceholderBlock): introduce PlaceholderBlock and Spinner component for loading states

- Added a new `Spinner` component to provide a visual loading indicator using `BarLoader` and `Search` icon.
- Replaced the deprecated `SearchingSpinner` with the new `Spinner` component in `CitationBlock` and `PlaceholderBlock` for improved consistency in loading states.
- Removed the unused `LoadingBlock` component to streamline the codebase.
- Updated `MessageContent` to enhance rendering logic by removing commented-out code and improving readability.

* feat:upgradeToV7 del catch

* fix:mini/message lint error

* feat(CitationsList): refactor citations rendering with Collapse component

- Replaced the direct rendering of citations with a Collapse component for better UI organization.
- Utilized useMemo for optimized rendering of citation items.
- Updated styling in CitationsContainer for improved layout.
- Enhanced PlaceholderBlock to use BeatLoader for loading state indication.

* fix(messageThunk): improve logging and cloneMessagesToNewTopicThunk functionality

- Updated debug logging to provide clearer information about topic retrieval and cloning process.
- Enhanced the cloning logic to correctly map askId for assistant messages, ensuring proper linkage in the new topic.
- Added checks to ensure file modifications only occur if the file exists, improving robustness.
- Cleaned up comments and improved readability in the cloneMessagesToNewTopicThunk function.

* fix(GeminiProvider): enhance image generation logic and response configuration (#5447)

* feat(GeminiProvider): enhance image generation logic and response configuration

* refactor(GeminiProvider): improve image generation logic readability

* feat(Message): enhance message handling and introduce MessageContent component

- Updated createAssistantMessage to remove unnecessary 'blocks' property from overrides.
- Refactored MessageItem to manage MainTextMessageBlock state and improve message processing logic.
- Added new MessageContent component for rendering message content with mentions and Markdown support.

---------

Co-authored-by: lizhixuan <zhixuan.li@banosuperapp.com>
Co-authored-by: one <wangan.cs@gmail.com>
Co-authored-by: ousugo <dkzyxh@gmail.com>
Co-authored-by: kangfenmao <kangfenmao@qq.com>
Co-authored-by: chenxi <16267732+chenxi-null@users.noreply.github.com>
Co-authored-by: suyao <sy20010504@gmail.com>
Co-authored-by: beyondkmp <beyondkmp@gmail.com>
Co-authored-by: Chen Tao <70054568+eeee0717@users.noreply.github.com>
Co-authored-by: Asurada <43401755+ousugo@users.noreply.github.com>
Co-authored-by: Roland <shlroland1995@gmail.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Co-authored-by: tchigher <34847046+tchigher@users.noreply.github.com>
2025-04-29 14:12:07 +08:00
Teo
61a11371c8 refactor(TopicsTab): Use onContextMenu instead of onMouseEnter (#5459)
refactor(TopicsTab): change mouse event from onMouseEnter to onContextMenu for setting target topic
2025-04-29 10:14:19 +08:00
kangfenmao
a488489092 refactor(Sidebar, McpSettingsNavbar): update icons and improve layout for better UI consistency 2025-04-29 09:35:02 +08:00
kangfenmao
60a10bd6af chore(version): 1.2.10 2025-04-29 09:12:13 +08:00
SuYao
736953f03e fix(GeminiProvider): enhance image generation logic and response configuration (#5447)
* feat(GeminiProvider): enhance image generation logic and response configuration

* refactor(GeminiProvider): improve image generation logic readability
2025-04-29 09:02:39 +08:00
Akey Zhang
35aeee7662 refactor: use the existing hook 2025-04-29 09:00:08 +08:00
kangfenmao
6125a1343c refactor(McpSettings): streamline form layout and enhance advanced settings toggle functionality 2025-04-29 08:58:42 +08:00
xixiaxixi
6541b0b35c feat: 允许功能键(F1-F19)可以被设置为快捷键而不需要修饰键 2025-04-29 08:01:21 +08:00
kangfenmao
e4aa2633d1 fix: update API key URL in provider configuration 2025-04-29 07:58:11 +08:00
SuYao
4c8685d427 fix(McpOAuthClientProvider): update redirect URL (#5449)
fix(McpOAuthClientProvider): update redirect URL to use 127.0.0.1 instead of localhost
2025-04-29 01:40:08 +08:00
Camol
66534c60f0 chore: Update runtime version in VSCode launch configuration (#5434)
Co-authored-by: kanweiwei <kanweiwei@nutstore.net>
2025-04-28 18:48:00 +08:00
Akey Zhang
1cc08668da style: optimize mcp arg name display layout 2025-04-28 18:11:33 +08:00
Teo
b381a7096b feat(TopicsTab): 简单方式优化话题列表切换卡顿问题 (#5436)
* feat(TopicsTab): refactor topic menu item handling and improve state management

* refactor(TopicsTab): enhance state management with useDeferredValue for target topic
2025-04-28 17:55:42 +08:00
beyondkmp
8ad1498df6 feat: update theme handling in ConfigManager and WindowService (#5433)
- Change default theme return value to 'auto' in ConfigManager.
- Adjust WindowService to set nativeTheme based on the updated theme configuration.
2025-04-28 16:52:56 +08:00
kangfenmao
0a7bf424d2 feat: Add model notes functionality to provider context menu 2025-04-28 09:38:28 +08:00
africa1207
da16397902 feat: 增加模型备注功能 (#5392)
* feat: 增加模型备注功能

* fix: 移除未使用变量

---------

Co-authored-by: liutao <>
2025-04-28 09:11:55 +08:00
karl
38830d34aa fix(MCPService): Tool call failure caused by incorrect tool parameters 2025-04-28 09:05:49 +08:00
fullex
6ba1e898c2 refactor: simplify window.api definition (#5412)
* refactor(preload): remove unused index.d.ts file and export WindowApiType from index.ts

* fix: type def errors in original index.ts file
2025-04-28 09:02:14 +08:00
beyondkmp
63870024cc fix(AppUpdater): update condition for checking available updates (#5417) 2025-04-27 22:22:31 +08:00
Chen Tao
dd16ad9d67 revert: generate image button (#5414)
* revert: generate image button

* chore
2025-04-27 21:19:27 +08:00
beyondkmp
56cd5cc3df fix: update electron-updater patch and refine content-type regex (#5416)
fix: update electron-updater patch and refine content-type regex in multipleRangeDownloader.js
2025-04-27 21:17:33 +08:00
木子不是木子狸
2ade08a9b7 #4288 Added a "Copy" button next to each search result. (#5389)
Co-authored-by: eeee0717 <chentao020717Work@outlook.com>
Co-authored-by: Chen Tao <70054568+eeee0717@users.noreply.github.com>
2025-04-27 19:41:30 +08:00
Chen Tao
634b9f276b chore: add grok image alias (#5408) 2025-04-27 17:07:36 +08:00
SuYao
175d189634 fix(OpenAIProvider): refine system message handling for specific model IDs (#5397)
* fix(OpenAIProvider): refine system message handling for specific model IDs

* refactor(OpenAIProvider): introduce OPENAI_NO_SUPPORT_DEV_ROLE_MODELS for model ID checks
2025-04-27 15:10:01 +08:00
LiuVaayne
0fe34a12a3 feat(MCP): Add MCP resources dropdown in settings navbar (#5394)
* Add MCP resources dropdown in settings navbar

* Refactor MCP settings navbar with inline styles

- Replace styled-components with inline styles
- Update resource URLs and capitalize "Servers" in title
- Add noopener,noreferrer to external links
- Simplify component structure with direct Menu.Item usage
2025-04-27 14:32:27 +08:00
beyondkmp
e894ab0c4c feat(MCPService): add method to find PowerShell executable path (#5393)
- Implemented `findPowerShellExecutable` to determine the correct PowerShell executable path on Windows.
- Updated `getSystemPath` to utilize the new method for improved path retrieval.
2025-04-27 14:25:37 +08:00
LiuVaayne
44299a8f5b Feat/mcp enhancement (#5386) 2025-04-27 12:15:00 +08:00
karl
f47802d64f fix(MCPSettings): fix mcp setting state error,fix mcp setting save searchKey lose (#5384) 2025-04-27 11:42:19 +08:00
AO2233
2392cba477 fix: Fix the image support for the GitHub Copilot models (#5379) 2025-04-27 01:55:19 +08:00
beyondkmp
3f42c7bace feat: Enhance theme management with auto mode support (#5374)
- Updated IPC channel to handle 'auto' theme mode, allowing dynamic theme changes based on system preferences.
- Modified theme setting functions in preload scripts to accommodate the new 'auto' option.
- Adjusted Sidebar component to display an icon for 'auto' theme mode.
- Refactored ThemeProvider to manage theme state more effectively and listen for theme changes across windows.
2025-04-26 22:16:12 +08:00
Chen Tao
dfc3dadc53 feat: Enable image generation in assistant based on model selection (#5364)
* feat: Enable image generation in assistant based on model selection

* chore: remove generate image button
2025-04-26 22:15:48 +08:00
kangfenmao
f8e815b760 chore(version): 1.2.9 2025-04-26 15:45:48 +08:00
Song
ff21f764de fix: more robust portable data dir setup logic (#5347) 2025-04-26 15:29:54 +08:00
kangfenmao
4fff7f9014 feat: Update MCP server configurations with environment variables
- Adjusted MCP server definitions to include environment variable placeholders for MEMORY_FILE_PATH, BRAVE_API_KEY, and DIFY_KEY.
- Modified styling in SyncServersPopup to reduce gap between elements and removed unnecessary margin.
2025-04-26 11:29:51 +08:00
emaryn
74d66edf75 feat: Implement deep linking for AppImage on Linux (#5360)
Signed-off-by: emaryn <197520219+emaryn@users.noreply.github.com>
Co-authored-by: emaryn <emaryn@users.noreply.github.com>
Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2025-04-26 11:19:53 +08:00
Chen Tao
0a18ec82b4 feat: add dify knowledge mcp (#5290)
feat: add dify mcp
2025-04-26 11:19:22 +08:00
LiuVaayne
0a4131379a feat: Add MCP server installation via URL protocol (#5351)
* Add MCP server installation via URL protocol

Implement handler for cherrystudio://mcp/install URLs to add MCP servers
from encoded configuration data. Supports multiple server configuration
formats and adds a new IPC channel for server addition.

* feat: Enhance MCP protocol handling and navigation

- Implemented navigation to the '/settings/mcp' page using executeJavaScript in the MCP protocol URL handler.
- Updated NavigationService to expose the navigate function globally for easier access in the application.
- Added NavigateFunction type to the global environment for improved type safety in navigation operations.

---------

Co-authored-by: kangfenmao <kangfenmao@qq.com>
2025-04-26 11:09:58 +08:00
SuYao
f17fe3adb5 feat(models): add new search models (#5349)
* feat(models): add new Perplexity search models and update Gemini search models

* fix(models): update Perplexity search model names for consistency
2025-04-25 22:57:39 +08:00
LiuVaayne
a58f23f68e feat(McpServersList): add ModelScope sync functionality (#5250)
* feat: add sync servers functionality and UI components for MCP settings

* Rename 'Discover Models' to 'Discover MCP Servers'

Replace Radio button group with Select dropdown for provider selection
in the sync servers popup UI and update related styling
Rename 'Discover Models' to 'Discover MCP Servers'

* Add error messages for MCP server sync

Improve error handling in modelscopeSyncUtils with new localization
strings for unauthorized access and no available servers. Update error
message handling in all language files and use nanoid for unique server
naming.
2025-04-25 22:11:23 +08:00
eeee0717
0fa8ae9560 feat: add document count in create popup 2025-04-25 21:40:13 +08:00
木子不是木子狸
ec0836c471 fix #5127
Signed-off-by: 木子不是木子狸 <richardllleeeee@gmail.com>
2025-04-25 21:23:58 +08:00
beyondkmp
5db7be061c refactor(auto-update): should triggle download when checking for update manually (#5262)
refactor(auto-update): streamline update check logic and enhance error handling

- Moved update check logic from IPC handler to AppUpdater class for better organization.
- Improved error handling during update checks to ensure graceful failure.
- Removed redundant conditions in the AboutSettings component for cleaner rendering.
2025-04-25 21:21:44 +08:00
自由的世界人
f25860a82e Update issue-management.yml (#5314)
* Update issue-management.yml

* feat: enhance issue management with new templates and automated stale issue handling

* fix: update issue templates for clarity and consistency in descriptions

* fix: improve clarity in issue templates and add area labels for better categorization

* fix: reorder question template title for improved clarity and update issue-checker to remove redundant label handling

* fix: add skip and remove labels for kind/bug, kind/enhancement, and kind/question in issue-checker

* fix: remove redundant handling for needs-more-info labels in issue-checker
2025-04-25 21:18:17 +08:00
Miter
51b72eb6c2 获取searxng搜索结果url的内容作为大模型回答的参考,而不是使用searxng搜索结果的摘要内容 2025-04-25 18:13:43 +08:00
beyondkmp
1bed05b57c fix: update electron-updater to patch to support window arm upgrade (#5337) 2025-04-25 18:13:07 +08:00
kangfenmao
2d7bdcd1a9 feat: update licensing terms and UI components
- Revised the licensing agreement to introduce a User-Segmented Dual Licensing model, detailing conditions for individual and organizational use.
- Enhanced UI components to display a specific empty state image in various popups and pages.
- Adjusted styles in MiniAppIconsManager and MiniAppSettings for improved layout and appearance.
- Updated default web search provider to 'local-bing' and modified font size in ProviderOAuth description for better readability.
- Changed window style setting from 'transparent' to 'opaque' for a more consistent user experience.
2025-04-25 17:50:33 +08:00
kangfenmao
4ad3c166f9 refactor: reorder llm providers 2025-04-25 17:16:40 +08:00
kangfenmao
87d0b1429a refactor: remove ollama settings 2025-04-25 17:16:27 +08:00
kangfenmao
0edc62286d feat: enhance OAuth provider settings with new functionality
- Added a new ProviderOAuth component to manage OAuth authentication and billing for providers.
- Updated existing components to integrate the new ProviderOAuth functionality.
- Enhanced internationalization support for OAuth-related texts across multiple languages.
- Introduced new utility functions for handling provider billing.
2025-04-25 16:55:36 +08:00
fullex
8c22c3c9d5 feat: open popup url in external browser (#4446)
* feat: open popup url in external browser

* fix: allow google auth popup internal

* feat: add functionality(including settings) to open links in external browser for webviews

* fix: set useragent globally

* fix: remove setUserAgent in webview

* fix: set Chrome version to newest
2025-04-25 09:45:54 +08:00
kangfenmao
e5db6e79b3 feat: update release notes with new features and fixes
- Added support for grok-2-image and gpt-4o-image.
- Enabled portable version of Windows to use the data directory for storage.
- Revamped MCP interface with new description display.
- Optimized Mermaid rendering logic.
- Added option to disable public rendering.
- Fixed OpenAI type rendering errors.
2025-04-25 09:44:13 +08:00
shiquda
64204251e8 feat: support preview of MCP call results (#5236) 2025-04-25 08:59:41 +08:00
Chen Tao
eec9618084 fix: image abort error and message render error (#5303) 2025-04-24 21:55:47 +08:00
dcai
86d00762ee fix: Resolve unsafe map call in MessageContent.tsx (#5311) 2025-04-24 21:39:35 +08:00
kangfenmao
1db3907792 chore(version): 1.2.8 2025-04-24 18:16:00 +08:00
kangfenmao
16002eae97 docs: contributor guide 2025-04-24 18:14:21 +08:00
SuYao
890a03aa40 feat: add English contributor guide and update issue templates (#5300)
- Introduced a new English version of the contributor guide (CONTRIBUTING_EN.md) to enhance accessibility for non-Chinese speakers.
- Updated issue templates to use more specific labels (kind/bug, kind/enhancement, kind/question) for better categorization.
- Added a testing section in the developer guide to clarify testing procedures.
2025-04-24 18:04:45 +08:00
Chen Tao
e66b1f0505 fix(openai): 修复OpenAI类型渲染错误 (#5263) 2025-04-24 17:51:13 +08:00
Chen Tao
4d06af69a6 feat(image): support grok-2-image image and gpt-4o-image (#4767)
* feat(image): support grok image

* feat: add gpt-4o-image

* feat: 添加 gpt-image-1 到生成图像模型列表
2025-04-24 17:26:15 +08:00
Song
7d69c1274b feat: support portable config dir (#5039)
* feat: support portable config dir

* fix: remove redundant mkdir
2025-04-24 17:23:56 +08:00
kanweiwei
17eeab2897 refactor(MessageAttachments): move styled component definition inside the component for better encapsulation 2025-04-24 17:06:35 +08:00
kangfenmao
e2396f3f14 feat: enhance MinAppIcon component with sidebar prop
- Added optional sidebar prop to MinAppIcon for conditional styling.
- Updated Sidebar component to pass sidebar prop to MinAppIcon for consistent appearance in sidebar context.
2025-04-24 17:03:12 +08:00
HuiZhang
c20d2d0c17 Create pull_request_template.md 2025-04-24 16:56:43 +08:00
beyondkmp
b9e50fa08d feat(WindowService): add maximize functionality and disable electron-window-state maxmize (#5292)
* feat(WindowService): add maximize functionality and clean up window close logic

- Introduced a new `maximize` option in the window state configuration.
- Added `setupMaximize` method to handle window maximization based on the launch state.
- Removed redundant logic from the window close event handler for clarity.

* add code

* update code
2025-04-24 16:55:51 +08:00
kangfenmao
3094adcb03 chore: update dependencies and clean up code
- Reintroduced @mozilla/readability, @shikijs/markdown-it, and @xyflow/react to package.json.
- Updated shiki version to 3.2.2 in both package.json and yarn.lock.
- Removed trailing whitespace in IpcChannel.ts and index.ts for code cleanliness.
- Added outline style to .ant-tabs-tab-btn in ant.scss for improved UI consistency.
2025-04-24 16:39:09 +08:00
寇佳龙
696bf2dc79 feat(mcp): mcp setting add service description page 2025-04-24 15:55:43 +08:00
kangfenmao
317d452498 style(settings): update border-radius to use CSS variable for consistency 2025-04-24 15:18:53 +08:00
kangfenmao
7311af9a56 feat: add cherry-text-logo.svg and remove npm.svg; update MCPSettings and NpxSearch components
- Introduced a new cherry-text-logo.svg file for branding.
- Removed the deprecated npm.svg file.
- Refactored MCPSettings and NpxSearch components to enhance functionality and UI, including state management and layout adjustments.
- Updated translations in multiple locales to include new types for MCP servers.
2025-04-24 15:17:20 +08:00
LiuVaayne
a33b0a0c55 Update @modelcontextprotocol/sdk to v1.10.2 (#5266)
- Removed MCPStreamableHttpClient.ts as it is now provided by the SDK.
- Adjusted imports in MCPService.ts to use the SDK's implementation.
- Updated yarn.lock to reflect the new SDK version.
2025-04-24 15:05:42 +08:00
SuYao
b7e502f2b8 refactor(GeminiProvider): streamline abort signal handling and improve stream processing (#5276) 2025-04-24 13:52:29 +08:00
kangfenmao
8974b52615 build: remove sentry integration 2025-04-24 11:48:53 +08:00
kangfenmao
8340b0873f build: fix nightly build error 2025-04-24 10:59:52 +08:00
Lucas
e521c9d01a fix(ci): Remove a deleted step which make the nightly build pipeline fail
These lines were deleted in `release.yml` in commit 985996f0.
2025-04-24 10:29:05 +08:00
Chen Tao
0fe31c43bf feat: 添加嵌入维度配置 (#3947) 2025-04-24 10:18:23 +08:00
beyondkmp
42374d4d2c feat: update os-proxy-config to 1.1.2 and delete the patch (#5255)
updte os-proxy-config to 1.1.2 and delete the patch
2025-04-24 09:24:08 +08:00
Asurada
a3faaa99fb fix(settings): handle undefined content limit in BasicSettings component (#5252) 2025-04-24 02:58:36 +08:00
kabu1204
39008f704d feat(ProviderSettings): move model provider to the top when toggled
When the model provider is toggled (OFF to ON), it is moved to the top of the provider setting for convenience. The change is minimal.
2025-04-24 00:04:30 +08:00
one
bf628e5e57 perf: improve streaming performance (#4986) 2025-04-24 00:02:04 +08:00
suyao
d2130bb592 refactor: switch from @vitejs/plugin-react to @vitejs/plugin-react-swc for improved performance 2025-04-23 23:56:02 +08:00
Rocky LIU Yan
e7329ae8b9 fix sse no headers
add eventSourceInit
2025-04-23 22:35:10 +08:00
kangfenmao
bb110200f9 fix(WebdavBackupManager): update modal confirmation to use window.modal and center content 2025-04-23 22:33:18 +08:00
Teo
a5d31b685c style: fix animation (#5243)
* style: fix animation

* fix(animation): correct animation name typos in multiple components
2025-04-23 22:31:26 +08:00
kangfenmao
a01e6b933b feat(mermaid): update Mermaid integration and improve rendering logic
- Upgraded Mermaid script to version 11.6.0.
- Refactored rendering logic to use a debounced function for improved performance.
- Added event listener for 'mermaid-loaded' to trigger rendering.
- Enhanced error handling during Mermaid chart rendering in both main and popup components.
- Removed unnecessary initialization calls and streamlined the use of theme settings.
2025-04-23 21:12:54 +08:00
kangfenmao
97257839de chore(release): increase Node.js memory limit in release workflow
- Added NODE_OPTIONS to set max-old-space-size to 8192 in the release workflow for Mac, Windows, and Linux builds.
2025-04-23 18:59:53 +08:00
beyondkmp
a8ddc1467a feat(auto-update): improve auto-update toggle functionality (#5215)
* feat(auto-update): improve auto-update toggle functionality

- Added setAutoUpdate method in AppUpdater to control auto-update behavior.
- Updated IPC handler to set auto-update status based on user preference.
- Modified AboutSettings component to conditionally display update options based on auto-check setting.

* update autoupdate position
2025-04-23 16:13:55 +08:00
fullex
12625354b2 fix: should give more time to init autosync (#5219) 2025-04-23 16:01:02 +08:00
beyondkmp
350422616b fix(proxy): update os-proxy-config patch to correct proxy URL handling (#5222)
* fix(proxy): update os-proxy-config patch to correct proxy URL handling

- Modified the os-proxy-config dependency in package.json to apply a patch.
- The patch updates the logic in getSystemProxy to correctly handle HTTP and SOCKS proxy settings.

* use http instead of https for https proxy
2025-04-23 15:53:25 +08:00
PilgrimLyieu
8180b9b037 feat: add support for 'none' option in math engine settings (#5122) 2025-04-23 14:53:19 +08:00
kangfenmao
58a4ca3c22 fix(sentry): update Sentry configuration and initialization logic
- Changed the organization in the Sentry Vite plugin configuration.
- Modified Sentry initialization in the main process to always check data collection settings.
- Simplified Sentry initialization in the renderer process by removing the packaged check.
2025-04-23 10:59:17 +08:00
kangfenmao
5789c0dc1b feat: add sentry integration 2025-04-22 22:05:56 +08:00
kangfenmao
51424b7d96 chore(version): 1.2.7 2025-04-22 20:39:14 +08:00
Chen Tao
3792b3dd4b fix(knowledge): fix citation bug and optimize extract logic (#5195)
* fix(knowledge): change search ui and fix search bug

* fix: knowledge citation

* feat: optimize extract logic
2025-04-22 20:17:11 +08:00
kangfenmao
66fe2d09a1 feat(BackupManager): replace AdmZip with archiver for improved backup compression and add extract-zip for unzipping functionality
- Updated BackupManager to use archiver for creating ZIP files, enabling better performance and support for large files.
- Integrated extract-zip for unzipping backup files, enhancing the backup restoration process.
- Adjusted progress reporting during backup and restore operations for better user feedback.
- Updated package.json and yarn.lock to include archiver and extract-zip dependencies.
2025-04-22 18:03:16 +08:00
eeee0717
caaa80c9be fix(knowledge): change search ui and fix search bug 2025-04-22 16:10:03 +08:00
kangfenmao
aab4db223e feat(Messages): add MessageCitations and MessageTranslate components for citation and translation display
- Introduced MessageCitations component to handle and display citations from messages.
- Added MessageTranslate component to show translated content with loading state.
- Updated MessageContent to integrate new components and streamline citation formatting.
- Refactored citation handling logic in formats utility for improved performance and clarity.
- Enhanced MessageImage component to manage image download and clipboard copy functionality.

refactor(MCP): optimize MCP server handling in Inputbar and MCPToolsButton

wip

refactor(MCPSettings): streamline MCP server management and enhance UI components

- Removed unused imports and optimized state management for selected MCP servers.
- Introduced McpServersList component to encapsulate server listing and management logic.
- Updated routing to accommodate the new component structure.
- Adjusted styles for better layout and user experience in MCP settings.
2025-04-22 15:40:39 +08:00
SuYao
2920c7a2db Revert "fix(minapps): remove AI Studio entry from default mini apps list" (#5177)
This reverts commit 5834eaea2e.
2025-04-22 15:40:33 +08:00
tchigher
fc0288ba53 fix: electron-builder 新增配置导致的无法构建的问题 (#5175)
fix: electron-builder 新增配置导致的无法构建的问题

当前 electron-builder 的版本为 "26.0.13",但在 v26 之后,StartupWMClass 等配置标签要在 desktop > entry 下,而不是直接在 desktop 下,否则会导致无法构建打包
2025-04-22 15:40:33 +08:00
fullex
050bc26b71 fix: purify minapp user agent tag (#5173) 2025-04-22 15:40:33 +08:00
Roland
42a5d55fe8 fix(models): 更新OpenRouter模型ID和名称,简化模型组分类 (#5172) 2025-04-22 15:40:33 +08:00
kangfenmao
39153375bc refactor(Markdown): remove rehype-sanitize and implement custom element filtering
- Removed rehype-sanitize dependency and its related configuration.
- Introduced ALLOWED_ELEMENTS and DISALLOWED_ELEMENTS for custom HTML element filtering.
- Updated rehypePlugins logic to conditionally apply plugins based on message content.
- Added encodeHTML utility function for HTML entity encoding.
2025-04-22 11:00:27 +08:00
SuYao
d1e137e5b3 fix(MinApp): integrate dynamic background color for MinappPopupContainer (#5142) 2025-04-21 23:44:15 +08:00
Asurada
8430ed266e chore(electron-builder): add StartupWMClass for CherryStudio in liunx desktop configuration (#5158)
chore(electron-builder): add StartupWMClass for CherryStudio in desktop configuration
2025-04-21 23:40:20 +08:00
beyondkmp
47d1045200 disable auto update in portable exe 2025-04-21 20:14:07 +08:00
kangfenmao
0b392ef20f chore(release): update default release tag to v1.0.0 and install setuptools for Mac build 2025-04-21 20:02:37 +08:00
kangfenmao
d5515e898d fix: zipfile dependencies 2025-04-21 19:25:09 +08:00
kangfenmao
d815abf6c0 chore(version): 1.2.6 2025-04-21 18:52:01 +08:00
beyondkmp
ceea0ec36d feat(proxy): use os-proxy-config to get system proxy info instead of resolveProxy (#5123)
* feat(proxy): integrate os-proxy-config for system proxy management

- Added os-proxy-config dependency to manage system proxy settings.
- Refactored setSystemProxy method to utilize getSystemProxy for improved proxy handling.

* fix lint error
2025-04-21 12:45:01 +08:00
Chen Tao
750ef84272 fix: 知识库和网络搜索使用输出语言问题 (#5129) 2025-04-21 11:42:48 +08:00
kangfenmao
1809ea6406 refactor: remove search enhanceMode 2025-04-21 11:35:06 +08:00
beyondkmp
01e3b275af refactor(AxiosProxy): improve proxy handling and initialization logic
- Changed cacheAxios from undefined to null for better initialization.
- Updated proxy handling to use ProxyAgent, ensuring axios instance is recreated when the proxy changes.
- Simplified axios instance creation by directly using the current proxy agent.
2025-04-21 11:26:13 +08:00
kangfenmao
48b3a872d4 feat: add PostHogProvider for analytics integration
- Introduced PostHogProvider to manage data collection based on user settings.
- Wrapped the main application in PostHogProvider to enable analytics when data collection is allowed.
2025-04-21 11:18:11 +08:00
kangfenmao
4f03c81d52 refactor: remove google analytics 2025-04-21 11:01:22 +08:00
chenxi
8f76f0ba7b fix: deepseek-reasoner does not support successive user or assistant messages in MCP scenario (#5112)
* fix: deepseek-reasoner does not support successive user or assistant messages in MCP scenario.

* fix: @ts-ignore
2025-04-21 09:04:47 +08:00
one
a95b563128 test: add vitest (#5085)
* test: migrate to vitest

* test: update vitest config

* test: updates tests for utils

* ci: fix test command

* test: add tests for format.ts

* test: add snapshots

* test: update snapshots

* test: add tests for linkConverter

* test: add tests for error.ts

* test: update test coverage script name

* test: update tests for prompt.ts

* test: re-group utils, add tests

* test: add tests for export.ts

* test: add tests for sort.ts
2025-04-20 22:44:01 +08:00
beyondkmp
f0cff95381 refactor(locales): fix locales errors (#5080) 2025-04-20 21:27:49 +08:00
Pleasurecruise
1987160c1c fix: language error 2025-04-20 19:03:06 +08:00
kangfenmao
2901ee7e77 update(README): replace outdated screenshots in English, Japanese, and Chinese documentation 2025-04-20 15:50:58 +08:00
kangfenmao
bda9f4a56d Revert "refactor(ipc): remove Windows ARM update check from IPC handler and AboutSettings component"
This reverts commit 4afd1c512e.
2025-04-20 11:32:59 +08:00
fullex
374b89dce1 fix(AssistantSettings): temporarily disable transitionName to resolve modal closing issues in production 2025-04-20 11:20:15 +08:00
lossercode
a3d4d2ef2f fix(MCPService):修复MCP server 请求头不生效 (#5072) 2025-04-20 11:18:34 +08:00
chenxi
116be6dc9b feat: support escaping the comma character in the API key. (#5088)
feat: support escaping the comma character in the API key.
2025-04-20 10:25:28 +08:00
kangfenmao
a224d9243f feat(locales): add locale cleanup functionality to after-pack script
- Introduced a new `remove-locales.js` script to handle the removal of unnecessary locale files based on the platform.
- Integrated the locale cleanup process into the `after-pack.js` script to ensure locales are managed during packaging.
2025-04-19 19:22:36 +08:00
kangfenmao
b44b941902 chore(version): 1.2.5 2025-04-19 18:58:53 +08:00
kangfenmao
527eeb895f lint: fix code format 2025-04-19 18:58:26 +08:00
kangfenmao
3561229d93 feat(FeatureMenus, Footer): replace Ant Design icons with Lucide icons and enhance layout
- Updated icons in FeatureMenus from Ant Design to Lucide for improved visual consistency.
- Refactored Footer component to use Lucide icons and adjusted layout for better alignment and spacing.
- Enhanced styling of Tag components for a more cohesive design.
2025-04-19 18:54:17 +08:00
kangfenmao
66de742732 Revert "feat: add chat message translate copy button (#4620)"
This reverts commit c452fdfd20.
2025-04-19 18:09:44 +08:00
kangfenmao
859c6ddd1d feat(Messages): enhance citations display with improved styling and translation support
- Added a title for the citations list with translation using `useTranslation`.
- Introduced an `Info` icon next to the citations title.
- Updated the `CitationsContainer` styling for better visual appeal.
- Refactored citation rendering logic in `MessageContent` to streamline citation handling.
2025-04-19 17:44:44 +08:00
kangfenmao
ec7f18e3a4 feat: update Z.ai app configuration with additional styling and increment store version to 97 2025-04-19 17:28:23 +08:00
ousugo
607ad24b1a refactor(ModelList): extract NameSpan component and adjust styling for better layout 2025-04-19 13:58:21 +08:00
one
0c491a1376 refactor: merge rehype plugins 2025-04-19 13:55:33 +08:00
one
da789315d3 refactor: use rehype-sanitize for html tags 2025-04-19 13:55:33 +08:00
karl
8d13feea47 feat: mcp configuration extraction logic optimization (#4918)
Co-authored-by: 寇佳龙 <koujialong@bonc.com.cn>
2025-04-19 10:45:22 +08:00
寇佳龙
db9f8ef850 fix: mcp search field redundancy 2025-04-19 10:39:44 +08:00
自由的世界人
c452fdfd20 feat: add chat message translate copy button (#4620)
* feat: add chat message translate copy button

* Update MessageMenubar.tsx

* fix: copy button display
2025-04-19 10:36:57 +08:00
Simple4
a9dfc6727a fix(obsidian): update title update logic 2025-04-19 10:24:45 +08:00
缘生
c86c1e112b feat: implement maximum backups feature in WebDAV settings (#5060)
* feat: implement maximum backups feature in WebDAV settings

- Add maximum backups feature to WebDAV settings

Signed-off-by: ysicing <i@ysicing.me>

* refactor: refactor backup file management for device-specific handling

- Change the order of hostname and device type in the backup file name
- Add filtering for backup files to manage device-specific backups
- Update logic to delete the oldest backup files based on the specific device count

Signed-off-by: ysicing <i@ysicing.me>

---------

Signed-off-by: ysicing <i@ysicing.me>
2025-04-19 10:22:03 +08:00
Asurada
1bab6bb29b fix (UI): Resolve the issue of overly long file names and path names not being displayed correctly (#5054)
* feat(Messages): enhance file upload display with styled component for better UI

* feat(Inputbar): add file name truncation for better display in attachment preview

* feat(DataSettings): replace Typography.Text with PathText for improved path display and add text truncation styling

* feat(DataSettings): refactor path display with PathRow component for better layout and styling
2025-04-19 02:00:11 +08:00
Hantong Chen
23fd7bb907 feat(websearch): HTTP basic auth support for Searxng (#5009)
* feat(websearch): HTTP basic auth support for Searxng

* fix(websearch): schema migration

* refactor(i18n): update translations for basic authentication

* fix(websearch): 修正 `HTTP 认证` 相关翻译

* feat(websearch): 为 `HTTP 认证` 添加注释

---------

Co-authored-by: suyao <sy20010504@gmail.com>
2025-04-19 01:58:03 +08:00
SuYao
933b1fd51a feat: gemini reasoning budget support (#5052)
* feat(models): add Gemini 2.5 reasoning model identification and integrate reasoning effort logic in GeminiProvider

* feat(AiProvider): enhance usage tracking by adding thoughts_tokens and updating usage types
2025-04-19 01:27:20 +08:00
chenxi
11459a35ef fix(deepseek-reasoner) doesn't support successive user or assistant messages (#5051)
fix(deepseek-reasoner) does not support successive user or assistant messages
2025-04-19 01:21:27 +08:00
fullex
687516d62b fix: should not download when autoupdate is false (#5029) 2025-04-18 16:28:20 +08:00
ousugo
7153f19764 feat(models): update gemini model identification logic to be more general 2025-04-18 09:58:44 +08:00
fullex
69962e836f fix: Nutstore auto-sync when app starts (#5005)
feat: integrate Nutstore auto-sync functionality in initialization process
2025-04-17 21:57:24 +08:00
缘生
7d66892b21 feat: add hostname retrieval for backup webdav (#5004)
fix #4705

Signed-off-by: ysicing <i@ysicing.me>
2025-04-17 21:21:39 +08:00
SuYao
672878600a feat(UI): Support custcom css in mini window (#4255)
* feat(UI): enable custom CSS functionality with miniWindow

* feat(UI): implement custom CSS handling in IPC and update related components
2025-04-17 20:54:34 +08:00
Chen Tao
2ee6b349ee fix: knowledge citations (#4988) 2025-04-17 15:43:30 +08:00
one
2c272c6cd2 refactor: improve error boundary messsage (#4987) 2025-04-17 15:39:40 +08:00
ousugo
0c9d0fe6e6 fix(AddAgentPopup): update form handling and simplify prompt input layout 2025-04-17 15:30:42 +08:00
Asurada
ef5c0d8460 fix(models): simplify OpenAI o-series model identification logic (#4985)
* fix(models): simplify OpenAI o-series model identification logic

* Update OpenAIProvider.ts

---------

Co-authored-by: Pleasurecruise <3196812536@qq.com>
2025-04-17 15:19:14 +08:00
Chen Tao
70196a4500 feat: LLM可以根据需求自行选择使用知识库或者网络搜索 (#4806) 2025-04-17 13:11:43 +08:00
beyondkmp
985996f01a chore(electron-builder): Simplify file renaming logic and remove space (#4919)
* chore(electron-builder): Disable universal installer option in NSIS configuration

* refactor(after-build): Change file handling to delete files with spaces and rename files in YAML data

- Updated the function to delete files containing spaces instead of renaming them.
- Enhanced YAML processing to rename files and their blockmaps, ensuring proper handling of setup and portable versions.
- Adjusted the final YAML output to reflect the new file names.

* refactor(after-build): Simplify file renaming logic and remove space handling script

- Updated the after-build script to rename artifact files by replacing spaces with hyphens.
- Removed the replace-spaces.js script as its functionality is now integrated into the after-build process.
- Adjusted the build process in package.json to reflect the changes in file handling.

* refactor(electron-builder): Update artifact build script reference and remove obsolete after-build script

- Changed the artifactBuildCompleted script reference in electron-builder.yml to point to the new script.
- Deleted the outdated after-build.js script, which is no longer needed for file handling.

* delete js-yml
2025-04-17 10:05:48 +08:00
Asurada
6ae089b4f5 feat(models): add support for o3 and o4-mini models in vision and logo configurations (#4963) 2025-04-17 02:13:53 +08:00
SuYao
77ec62a0f3 fix(GeminiProvider): update content configuration based on model type (#4960)
* fix(GeminiProvider): update content configuration based on model type

* chore(ApiService): comment out debug log for message output
2025-04-17 00:00:35 +08:00
SuYao
002b681ae7 refactor(Gemini): migrate generative-ai sdk to genai sdk (#4939)
* refactor(GeminiService): migrate to new Google GenAI SDK and update file handling methods

- Updated import statements to use the new Google GenAI SDK.
- Refactored file upload, retrieval, and deletion methods to align with the new SDK's API.
- Adjusted type definitions and response handling for improved type safety and clarity.
- Enhanced file listing and processing logic to utilize async iteration for better performance.

* refactor(GeminiProvider): update message handling and integrate abort signal support

- Refactored message content handling to align with updated type definitions, ensuring consistent use of Content type.
- Enhanced abort signal management for chat requests, allowing for better control over ongoing operations.
- Improved message processing logic to streamline user message history handling and response generation.
- Adjusted type definitions for message contents to enhance type safety and clarity.

* refactor(electron.vite.config): replace direct import of Vite React plugin with dynamic import

* fix(Gemini): clean up unused methods and improve property access

* fix(typecheck): update color properties to use CSS variables

* feat: 修改画图逻辑

* fix: import viteReact

---------

Co-authored-by: eeee0717 <chentao020717Work@outlook.com>
2025-04-16 23:13:22 +08:00
LiuVaayne
e97dfb4a4e Feat/mcp oauth (#4837)
* feat: implement OAuth client provider and lockfile management

* feat: implement OAuth callback server and refactor authentication flow

* fix(McpService): restrict command handling to 'npx' for improved clarity

* refactor: make callbackPort optional in OAuthProviderOptions and clean up MCPService

* refactor: restructure OAuth handling by creating separate callback and provider classes, and remove unused utility functions
2025-04-16 22:07:32 +08:00
beyondkmp
5062d56ea6 chore: Update electron-builder configuration to remove architecture specifications for targets and adjust build scripts for Windows, macOS, and Linux to include both x64 and arm64 architectures. 2025-04-16 10:49:27 +08:00
nutstore-dev
4f20b5fd54 refractor: nutstore sdk changed to JS version (#4913)
Co-authored-by: shlroland <shlroland1995@gmail.com>
2025-04-16 10:47:08 +08:00
W
94630f8aab fix: 快捷助手发起询问后没有清理掉输入框内的内容 (#4907) 2025-04-16 10:42:34 +08:00
Asurada
79a5142951 fix(OpenAIProvider): Filter empty system prompts (#4896) 2025-04-16 02:15:06 +08:00
Cle2ment
b17101cb71 fix(ReadMe): the redirection error of the Maple Neon theme (#4893)
* 修复Maple Neon Theme的链接重定向错误.

* 修复中文和日语主题的排版错误,改为和英文README统一的列表.
2025-04-16 00:03:11 +08:00
liqihao
30dc524e44 Fix(MCPService): 修复 getSystemPath 因硬编码 Shell 路径导致的兼容性问题 (#4853)
Fix(MCPService): Prioritize process.env.SHELL for PATH retrieval

Co-authored-by: liqihao <liqiha0@outlook.com>
2025-04-15 23:23:28 +08:00
心如止水自在如风
ad637ed43a fix: MCP服务器添加server-filesystem时填写参数后启用时报错 (#4872)
fix: MCP服务器添加server-filesystem时填写地址后启用时报错

Co-authored-by: annan01 <annan01@qianxin.com>
2025-04-15 23:19:22 +08:00
Cle2ment
660603ec8b chore(README): 为各语言的README都添加了Maple-Neon主题. (#4891) 2025-04-15 23:14:14 +08:00
SuYao
cf7b22fa72 fix(OpenAIProvider): remove unnecessary o-series model stream restriction (#4889)
* fix(OpenAIProvider): remove unnecessary o-series model stream restriction

* lint(OpenAIProvider): remove redundant code
2025-04-15 22:53:34 +08:00
Hao He
8b6595e4a9 feat(MessageContent): Add Collapsible Citations Display (#4285)
* feat(MessageContent): 添加引用内容折叠功能,优化用户界面交互

* feat(Citations): add hideTitle prop to control title visibility in CitationsList

* feat(Messages): add message update functionality and manage UI state for citations and web search

* fix: web search citation

---------

Co-authored-by: 自由的世界人 <3196812536@qq.com>
2025-04-15 22:47:20 +08:00
牡丹凤凰
ba4e6be254 Update README.ja.md 2025-04-15 19:45:40 +08:00
牡丹凤凰
03a2f17a6b Update README.zh.md 2025-04-15 19:44:23 +08:00
牡丹凤凰
5d70f223e1 Update README.md 2025-04-15 19:42:16 +08:00
SuYao
e8758bfc01 feat(model): add ModelCard schema and related types for input/output capabilities (#4812)
* feat(model): add ModelCard schema and related types for input/output capabilities

* refactor(model): make limits and price properties optional in ModelSchema

* feat(model): add textGeneration capability to ModelSchema
2025-04-15 19:40:13 +08:00
beyondkmp
d2d805e392 feat: integrate AxiosProxy for HTTP requests in rerankers and Copilot… (#4858)
* feat: integrate AoxisProxy for HTTP requests in rerankers and CopilotService

- Replaced direct axios calls with aoxisProxy in JinaReranker, SiliconFlowReranker, and VoyageReranker to utilize proxy settings.
- Introduced AoxisProxy service to manage axios instances with proxy configurations.
- Updated CopilotService to use aoxisProxy for API requests, ensuring consistent proxy handling across services.

* refactor(AxiosProxy): improve proxy handling and initialization logic

* fix tyop

* fix tyop
2025-04-15 18:42:31 +08:00
ousugo
0a84a5325f fix(styles): add support for lucide icons in global styles 2025-04-15 17:44:50 +08:00
karl
36cf8a282c feat/search mcp auto config (#4780)
feat: mcp search carry basic configuration

Co-authored-by: 寇佳龙 <koujialong@bonc.com.cn>
2025-04-15 16:05:17 +08:00
Teo
5d92cec904 feat(QuickPanel): enhance pinyin filtering and improve input handling in QuickPanel 2025-04-15 15:58:44 +08:00
Asurada
5a970b0e3e chore(issue-template): improve clarity and requirements in bug report checklist (#4847) 2025-04-15 13:29:16 +08:00
Asurada
2362a6b5f9 feat(models): add gpt-4.1 model to visionAllowedModels (#4843) 2025-04-15 12:14:51 +08:00
Asurada
8b3a94702a feat(models): update GLM model list and add new GLM-Z1 reasoning models (#4836) 2025-04-15 11:07:17 +08:00
Chen Tao
1cecec8fb5 fix: websearch ui (#4840)
fix(ui)
2025-04-15 11:06:28 +08:00
自由的世界人
a92c99cc27 Update issue-management.yml (#4830)
* Update issue-management.yml

* Update issue-management.yml
2025-04-15 09:59:37 +08:00
自由的世界人
672263ff94 feat: create issue-management.yml (#4822) 2025-04-15 04:03:01 +08:00
Asurada
71200ad55c feat(Grok): add isGrokModel function and update systemMessage handling for Grok models (#4823) 2025-04-15 03:15:07 +08:00
Asurada
b415225881 feat(Miniapp): add Z.ai mini app with logo and migration support (#4820) 2025-04-15 01:43:56 +08:00
beyondkmp
d94b7b64ea update electron-builder to 26.0.13 2025-04-14 21:52:58 +08:00
kangfenmao
4afd1c512e refactor(ipc): remove Windows ARM update check from IPC handler and AboutSettings component 2025-04-14 20:04:48 +08:00
kangfenmao
bf037829f6 ci(after-build): move renameFilesWithSpaces call to the end of the process 2025-04-14 18:42:18 +08:00
kangfenmao
f8eaf2ad5f chore(version): 1.2.4 2025-04-14 17:30:41 +08:00
LiuVaayne
8aefe5cb74 feat: mcp custom headers (#4800)
* Add support for custom HTTP headers in MCP servers

Allow users to configure custom HTTP headers for SSE and streamable HTTP
MCP server connections. This enables authentication and other API
requirements.

* Add custom headers i18n strings
2025-04-14 17:17:13 +08:00
LiuVaayne
5cc28bff9f Feat/mcp tool response support image (#4787)
* Add typed MCPCallToolResponse interface and format converters

The commit introduces a structured response type for MCP tool calls with
proper handling for different content types (text, image, audio). It adds
provider-specific converter functions to transform tool responses into
the appropriate message format for OpenAI, Anthropic, and Gemini.

* Support vision models in tool call responses

Add isVisionModel parameter to tool response formatters to conditionally
handle content based on model capabilities. Non-vision models now receive
JSON stringified content, while vision models get proper multimedia parts.
2025-04-14 17:16:42 +08:00
kangfenmao
20a7f81c1e feat: add after-build script for renaming files and updating latest.yml
- Introduced a new script to rename files with spaces in the 'dist' directory.
- Updated 'latest.yml' to remove the first file entry and adjust paths accordingly.
- Enhanced build process for Windows to include the new script execution.
- Added js-yaml dependency for YAML file manipulation.
2025-04-14 17:14:45 +08:00
kangfenmao
95c680e8b2 fix: emoji icon empty 2025-04-14 17:10:55 +08:00
Teo
832d042824 feat: update icons in Inputbar and related components for consistency 2025-04-14 16:06:17 +08:00
fullex
d4b30b1e17 fix: quickAssistant transalte not work by key select 2025-04-14 10:31:52 +08:00
kangfenmao
de1f1975e7 feat: enhance styling and icon consistency across components 2025-04-14 09:34:13 +08:00
kangfenmao
257978a8aa feat(migrate, websearch): enable enhanceMode in websearch and update migration logic 2025-04-14 09:34:13 +08:00
fullex
736cdb5d87 fix: mac fullscreen changed when switch back through clicking dock icon 2025-04-13 23:34:55 +08:00
fullex
3c1de1cd92 fix: numpad enter not work 2025-04-13 23:34:20 +08:00
Reamd7
92023797be fix(MCPService): 增加获取系统 PATH 的功能, 修复 process.env.PATH 无法获取系统PATH的问题 (#4766) 2025-04-13 22:45:02 +08:00
LiuVaayne
9abfbff18f feat: Enhance web search with XML-based query extraction (#4770)
Add support for webpage summarization, direct URL references, and
better query processing using a structured XML format. Move web content
fetching to dedicated utility functions with improved error handling
and format options.
2025-04-13 22:42:14 +08:00
kangfenmao
0c3ec24508 fix(Sidebar): rename Sparkle icon to Sparkles for consistency 2025-04-13 22:05:32 +08:00
africa1207
839e1de332 feat: 优化webdav备份文件恢复管理功能 (#4699)
* feat: 优化webdav备份文件恢复管理功能

* fix: 恢复和删除操作更改为文字而非图标

* feat: 统一坚果云与webdav备份恢复功能
2025-04-13 21:52:16 +08:00
kangfenmao
1d7328909d style(Sidebar, Messages, ModelSettings): update icon styles and clean up unused imports
- Added 'icon' class to various icons in Sidebar for consistent styling.
- Removed unused loading state from Messages component.
- Cleaned up iconStyle variable in ModelSettings as it was no longer needed.
2025-04-13 21:29:48 +08:00
LiuVaayne
16687e06e0 feat(MCP): add resource management features and localization support (#4746)
* feat(MCP): add resource management features and localization support

* feat(MCP): enhance resource handling with improved error messages and response structure

* fix(MCPToolsButton): add missing useEffect import for resource handling

---------

Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2025-04-13 21:08:57 +08:00
Teo
33eacdab22 hotfix: 优化一些issue反馈 (#4758)
feat(Inputbar, Settings): add backspace delete model functionality and localization updates

- Implemented a new setting to enable backspace key functionality for deleting models/attachments in the Inputbar.
- Added corresponding localization strings for English, Japanese, Russian, Chinese (Simplified and Traditional) in the i18n files.
- Updated the QuickPanelBody styling to inherit border-radius.
- Migrated the new setting to the state management for persistence.

Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2025-04-13 21:07:00 +08:00
kangfenmao
56f93258f4 feat: new icon style 2025-04-13 21:03:19 +08:00
bjl101501
6315baec64 docs(README): Add 仿Claude样式主题 (#4751)
* Update README.md

* Add 仿Claude样式主题 in README.zh.md

* Add 仿Claude样式主题 in README.ja.md
2025-04-13 20:40:13 +08:00
George·Dong
f7db4cd39f fix: Update dashscoop provider configuration and enhance model editing functionality (#4748)
* fix(provider config): update dashscoop new links

* feat(EditModelsPopup): add grouping function for bailian

* fix(isWebSearchModel): Correctly handle the priority of manually setting model support for web search
2025-04-13 20:38:25 +08:00
kangfenmao
6008885006 fix(EditModelsPopup, ModelList): adjust avatar size and streamline model description rendering
- Reduced avatar size in ModelList for better alignment.
- Simplified rendering logic for model descriptions in EditModelsPopup to enhance readability.
2025-04-13 13:34:48 +08:00
kangfenmao
d2e635ef1c style(MCPSettings): adjust layout and spacing in NpxSearch and MainContainer
- Updated MainContainer to use flex display for better layout.
- Increased margin in NpxSearch component for improved spacing.
- Adjusted ResultList to use two columns instead of three for better content presentation.
2025-04-13 11:00:07 +08:00
kangfenmao
c32dd63e35 feat(Settings): implement assistant icon type selection and localization updates 2025-04-13 10:45:47 +08:00
Teo
2e6bafab22 feat(AssistantItem): add emoji support and improve icon display logic 2025-04-13 10:01:03 +08:00
Teo
92e0306d3e refactor(AgentPage): Refactor AgentPage UI (#4737)
* refactor(AgentPage): Refactor AgentPage UI

* style(AgentCard): update HeaderInfoEmoji styling for improved layout and visual consistency

* fix(AgentCard): conditionally render HeaderInfoEmoji to prevent rendering of undefined

* feat(AgentsPage): add handleAddAgent function to streamline agent addition process

* style(AgentsPage): remove unnecessary whitespace in title rendering
2025-04-13 09:58:46 +08:00
王叔叔
539f584601 Update LICENSE (#4744) 2025-04-13 08:00:41 +08:00
purefkh
2a77fddc14 fix(UI): Correct citation tooltip style in light theme (#4738) 2025-04-12 21:48:14 +08:00
kangfenmao
33f182b891 chore(version): 1.2.3 2025-04-12 20:47:08 +08:00
kangfenmao
3150abbe6b feat(Ipc): add architecture information and update check logic for Windows arm64 2025-04-12 20:42:20 +08:00
kangfenmao
18fb511c02 fix(SettingsTab): refine reasoning effort handling for Grok models
fix: #4735
2025-04-12 20:23:31 +08:00
kangfenmao
5fad4892ad feat(MCPSettings): enhance MCP server management and localization updates
- Added a new SVG icon for npm in the MCP settings.
- Introduced a custom hook `useMCPServer` for retrieving a specific MCP server by ID.
- Updated localization files to include new error messages for tool and prompt loading in English, Japanese, Russian, and Chinese.
- Refactored MCP settings components for improved navigation and state management, including the use of React Router for routing.
- Enhanced the Npx search functionality and UI for better user experience.
2025-04-12 19:47:36 +08:00
kangfenmao
8a965e69e7 style(SelectModelPopup): update background color animation for improved visual consistency 2025-04-12 17:02:17 +08:00
kangfenmao
b90a3c9d8e style(QuickPanel): update font sizes and line height for improved readability 2025-04-12 16:41:39 +08:00
kangfenmao
bde85de783 refactor(license.html): update structure and styling for improved readability and consistency 2025-04-12 16:41:26 +08:00
kangfenmao
699e43cc2b Revert "fix(ChatNavigation): improve navigation button collapse functionality"
This reverts commit a5a36b5d13.
2025-04-12 16:12:34 +08:00
kangfenmao
c239861cd5 feat(NewContextButton): add styled container for responsive design
- Introduced a styled container to the NewContextButton component to hide it on smaller screens (max-width: 800px).
- Ensured the tooltip and button functionality remain intact while enhancing the component's layout.
2025-04-12 16:11:00 +08:00
kangfenmao
1ba6649229 refactor(Inputbar, Messages): simplify clear topic functionality and improve message display logic
- Removed unused QuestionCircleOutlined icon and Popconfirm from Inputbar, replacing it with a direct button click for clearing topics.
- Refactored message display logic in Messages component to enhance clarity and maintainability, while preserving existing functionality.
2025-04-12 16:07:40 +08:00
kangfenmao
9da558a3c1 feat(CustomCollapse): enhance component with customizable styles and improve usage in EditModelsPopup 2025-04-12 15:57:50 +08:00
LiuVaayne
c499f119fe Feat/improve UI mcp settings (#4717)
* feat(MCPSettings): implement server selection and navigation with back button

* chore(ui)

* chore(UI): npx search padding

* feat(NpxSearch): add server selection and navigation; update styles

---------

Co-authored-by: eeee0717 <chentao020717Work@outlook.com>
2025-04-12 15:31:52 +08:00
王叔叔
3bed0673d5 docs: Update LICENSE (#4723) 2025-04-12 15:31:33 +08:00
Hao He
17eb98742f feat(MessageTools): add error handling and status indicator for tool responses (#4712)
* feat(MessageTools): add error handling and status indicator for tool responses

* feat(i18n): add error message for tool invocation in English, Japanese, and Russian locales
2025-04-12 10:33:14 +08:00
Herio
0a3d4fd4df fix(Messages): 调整ScrollContainer和Container的样式以减少底部空间 2025-04-12 10:28:06 +08:00
LiuVaayne
dbf943a9bf Feat/mcp support MCP prompt (#4675)
* Add MCP prompt listing and retrieval functionality

* Add generic caching mechanism for MCP service methods

Refactor caching strategy by implementing a higher-order withCache function
to centralize cache logic and reduce code duplication. Separate implementation
details from caching concerns in listTools, listPrompts and getPrompt methods.

# Conflicts:
#	src/main/services/MCPService.ts

* Add MCP prompts listing feature

- Add IPC handlers for listing and getting prompts
- Create UI component to display available prompts in settings tab
- Improve error handling in MCP service methods

* fix(McpService): add error handling for tool and prompt listing methods

* feat(MCPSettings): enhance prompts and tools sections with improved UI and reset functionality

* feat(i18n): add tabs and prompts sections to localization files

* feat(MCPToolsButton): add MCP prompt list functionality to Inputbar

* feat(McpSettings, NpxSearch): improve user feedback with success messages on server addition

* feat(MCPService, MCPToolsButton): enhance prompt handling with caching and improved selection logic

* feat(MCPToolsButton): enhance prompt handling with argument support and error management

---------

Co-authored-by: Teo <cheesen.xu@gmail.com>
2025-04-12 10:27:48 +08:00
robot-AI
cad8ffe8ad 重构了memory.ts,增加了文件写入锁,解决了并行写入导致记忆文件错误的问题; (#4671)
优化了memory.json文件的加载过程,只加载一次,其它涉及图谱的操作均在内存中完成,提高效率;
注意新引入了async-mutex软件包,需要yarn install安装。
2025-04-11 22:03:57 +08:00
kangfenmao
228fd872a9 chore(version): 1.2.2 2025-04-11 14:43:02 +08:00
kangfenmao
fa56cb8cae feat(websearch): initialize subscribeSources in migrateConfig and update WebSearchState interface 2025-04-11 14:42:35 +08:00
Chen Tao
dfcf40100e fix(llm): rename settingsSlice to llmSlice for clarity (#4688) 2025-04-11 11:32:30 +08:00
kangfenmao
75cf0ea485 fix(scripts): update download URLs and default versions for bun and uv binaries 2025-04-11 11:25:37 +08:00
kangfenmao
f523128382 feat(i18n): update subscription terminology in multiple languages for consistency 2025-04-10 22:12:27 +08:00
ousugo
a6dfef8398 refactor(SettingsTab): update reasoning effort change handler to use useCallback for performance optimization 2025-04-10 21:47:14 +08:00
ousugo
bf414e1dc0 feat(CodeBlock): add tooltips for collapse and copy buttons 2025-04-10 21:47:14 +08:00
ousugo
31ef75f34d feat(models): add grok-3 support to FUNCTION_CALLING_MODELS 2025-04-10 21:46:48 +08:00
Asurada
f5f7e2ad3c feat(xAI): Add support for Grok-3-mini and update reasoning effort logic (#4657)
* feat(models): add grok-3-mini support and update reasoning effort logic in SettingsTab and OpenAIProvider

* feat(settings): update reasoning effort logic for Grok models and enhance localization in multiple languages

* fix(models): correct spelling of reasoning in model support functions

* fix(settings): correct spelling of reasoning_effort in OpenAIProvider
2025-04-10 18:43:20 +08:00
Chen Tao
fdba90ec1e feat: support ublacklist subscribe (#2974)
* feat: support ublacklist subscribe

* Merge branch 'main' into feat-ublacklist

* chore

* chore
2025-04-10 17:25:38 +08:00
ousugo
e733a1ee4a refactor(CodeBlock): simplify header layout and adjust CollapseIcon position 2025-04-10 17:22:20 +08:00
LiuVaayne
18407a8081 Clean up MCPService connections on app quit (#4647)
* Clean up MCPService connections on app quit

* Improve application shutdown error handling
2025-04-10 17:19:02 +08:00
kangfenmao
b0f647b83e feat(models): add Qiniu models to SYSTEM_MODELS and update migration logic to initialize provider models
- Introduced new models for the Qiniu provider in SYSTEM_MODELS.
- Updated migration logic to populate Qiniu provider models if they are empty during state initialization.
2025-04-10 13:42:03 +08:00
kangfenmao
f5fc1ffa08 refactor(after-pack): rename function to keepArchNodeFiles and update logic for retaining architecture-specific node modules
close PR#4522
2025-04-10 13:15:41 +08:00
kangfenmao
f9cdf3cda6 feat(websearch): enhance web search provider settings and localization
- Updated web search provider settings to include API key and free status indicators.
- Improved localization for English, Japanese, Russian, Chinese, and Taiwanese languages to reflect new API key and free status fields.
- Refactored web search provider management to prevent duplicates and streamline provider addition during state migration.
- Adjusted UI components to conditionally render based on provider type, enhancing user experience.
2025-04-10 13:07:55 +08:00
LiuVaayne
e2e7d0f46f feat(search): support using google as default search provider (#4569)
* feat(websearch): implement search window functionality and enhance search service

* feat(DefaultProvider): integrate @mozilla/readability for improved content parsing

* Add LocalSearchProvider for web page scraping

AI: Change `provider` from private to protected in BaseWebSearchProvider and implement LocalSearchProvider for web searching with browser-based content extraction.

* Add web search provider management features

Implement addWebSearchProvider function to prevent duplicates,
automatically load default providers on initialization, fix
LocalSearchProvider implementation, and update local provider
identification logic.

* Improve web search with specialized search engine parsers

Add dedicated parsers for Google, Bing, and Baidu search results,
replacing the generic URL extraction approach. Enhance page loading
with proper wait mechanisms and window cleanup. Remove DuckDuckGo
provider as it's no longer supported.

* Simplify DefaultProvider to unimplemented placeholder

* Remove default search engine from initial state

* Improve web search providers config and display

Add configuration for local search providers, remove empty apiKey fields,
and enhance the UI by sorting providers alphabetically and showing
whether they require an API key.

* Add stderr logging for MCP servers

* Make search window initially hidden
2025-04-10 12:29:09 +08:00
司马琦昂
bd89110131 fix: O3 config text-embedding-3-small duplicate 2025-04-10 10:20:34 +08:00
fullex
a27a2bf928 fix: [mac] issues related to fullscreen mode (#4618) 2025-04-10 09:02:53 +08:00
自由的世界人
48dd35da9c feat: add model provider logo upload (#4408)
* feat: add model provider logo upload

* Update index.tsx

* fix: upload image delete
2025-04-09 23:52:42 +08:00
kangfenmao
5525118b14 refactor(ModelList): replace FileItem with ListItem and HStack for improved layout and styling 2025-04-09 20:42:36 +08:00
fullex
fbac933a79 fix:[mac] window level to show py input 2025-04-09 20:12:33 +08:00
Teo
1eac24f339 feat: Optimize QuickPanel (#4604)
* feat(QuickPanel): enhance close action options and improve input handling

- Added 'enter_empty' as a new close action option for QuickPanel.
- Refactored input handling to include a delay before clearing search text after panel closure.
- Updated keyboard event handling to prevent default actions for specific keys.
- Improved styling for selected and focused states in QuickPanel components.
- Enhanced AttachmentPreview to utilize a separate FileNameRender component for better readability and functionality.

* feat(AttachmentPreview): enhance file icon rendering and styling

* feat(CustomTag): add closable functionality and improve styling

- Enhanced CustomTag component to support closable tags with an onClose callback.
- Updated styling for better visual integration and added hover effects for the close icon.
- Refactored usage of CustomTag in AttachmentPreview, KnowledgeBaseInput, and MentionModelsInput components for consistency.

* feat(SelectModelPopup, QuickPanel): update tag component and enhance search functionality

* feat(Inputbar, SettingsTab): add enable quick panel triggers setting and update translations

* feat(QuickPanel): integrate color library for dynamic styling and update package dependencies
2025-04-09 17:00:34 +08:00
magicdmer
77f7141534 fix: 解决聊天页面图片复制失败的问题和点击编辑回复的时候,不显示图片url的问题 (#4496)
* fix: 解决聊天页面图片复制失败的问题和点击编辑回复的时候,不显示图片url的问题

* fix: 解决chat模式,gemini-2.0-flash-exp-image-generation返回base64图片,无法复制的问题

* fix(MessageImage): Update the image copying feature to process base64 and URL formatted images based on their type

---------

Co-authored-by: magicdmer <magicdmer@163.com>
Co-authored-by: eeee0717 <chentao020717Work@outlook.com>
2025-04-09 16:23:25 +08:00
fullex
516704e2c7 fix: missing ExportMenuOptions in persist leads to useSelector re-render a lot (#4593)
* fix: missing ExportMenuOptions in persist leads to useSelector re-render

* chore: cleanup
2025-04-09 13:54:15 +08:00
LiuVaayne
c341a22c02 feat(mcp): support MCP by prompt (#4476)
* feat: implement tool usage handling and system prompt building for AI providers

* refactor: streamline tool usage handling and remove unused code in OpenAIProvider and formats

* refactor: simplify tool usage handling in Anthropic and Gemini providers, and update prompt instructions

* refactor: remove unused function calling model checks and simplify MCP tools handling in Inputbar

* hidden tool use in message

* revert  import

* Add idx parameter to parseAndCallTools for unique tool IDs
2025-04-09 11:22:14 +08:00
Hao He
924356c77e feat(AssistantsTab): add sorting functionality by Pinyin and update translations (#4507) 2025-04-09 09:23:11 +08:00
Vaayne
9c1029cb6a fix(NpxSearch): update SearchResult type to use MCPServer type definition 2025-04-09 09:21:35 +08:00
Vaayne
d46f7d58e7 feat(MCP): add StreamableHTTPClientTransport and update server type handling 2025-04-09 09:21:35 +08:00
suyao
f3a77c9d8d feat(websearch): improve web search enablement logic 2025-04-09 09:19:42 +08:00
ZhuangYumin
55a2968abb fix: fix main-window fake show up in Wayland KDE 2025-04-09 00:12:33 +08:00
kangfenmao
a4f9306ccd chore(version): 1.2.1 2025-04-08 23:19:52 +08:00
kangfenmao
e6ead50c87 feat(ModelTagsWithLabel): enhance tag component styling and update layout
- Improved icon size handling in the ModelTagsWithLabel component for better visual consistency.
- Adjusted the layout of the tags to prevent wrapping and added horizontal scrolling for better usability.
- Updated the EditModelsPopup to increase its width for improved content display.
- Removed unnecessary CustomTag usage in ModelList for cleaner code.
2025-04-08 21:32:17 +08:00
kangfenmao
2b261092dc chore(version): 1.2.0 2025-04-08 20:29:54 +08:00
SuYao
7a917168e0 feat(websearch): add overwrite functionality for search service (#4530)
* feat(websearch): add overwrite functionality for search service

- Introduced new settings to allow users to override the default search service.
- Updated localization files for English, Japanese, Russian, Simplified Chinese, and Traditional Chinese to include new overwrite options and tooltips.
- Modified relevant components and services to support the new overwrite feature in the web search settings.

* feat(websearch): enhance web search model integration

* chore(websearch): unnecessary return
2025-04-08 20:07:00 +08:00
kangfenmao
e9258050b8 feat: update dangbei miniapp integration and version bump
- Added `bodered` property to the dangbei miniapp configuration.
- Refactored migration logic to utilize a new `addMiniApp` function for cleaner code.
- Incremented store version from 91 to 92 for migration compatibility.
2025-04-08 19:59:32 +08:00
DemonJun
a218ffdad2 feat: add dangbei miniapp (#4552)
* feat: add dangbei miniapp

* compressed logo file

---------

Co-authored-by: demonjun <demonjun@foxmail.com>
2025-04-08 19:46:26 +08:00
kangfenmao
a787e3729c feat(CustomCollapse, KnowledgeContent): enhance collapsible behavior and UI updates
- Added `activeKey` prop to `CustomCollapse` for better control over active panels.
- Updated styles in `CustomCollapse` for improved visual consistency.
- Refactored `KnowledgeContent` to include expand/collapse functionality for file and directory sections, enhancing user experience.
- Added translations for "collapse" in multiple languages.
- Minor style adjustments across various components for better UI consistency.
2025-04-08 19:38:15 +08:00
Teo
b15a1567cb style(ProviderSettings): Refactor ProviderSettings UI (#4475)
* chore(version): 1.1.19

* style(ProviderSettings): Refactor ProviderSettings UI

* style(CustomTag, ModelTagsWithLabel): enhance layout and styling for better UI consistency

* refactor(CustomTag, ModelTagsWithLabel, MentionModelsButton): update props handling and improve component usage

* feat(CustomTag, ModelTagsWithLabel): add tooltip support and improve label visibility based on container size

* fix(ModelTagsWithLabel): adjust maxWidth for non-Chinese languages to improve layout

* style(ModelList): add text overflow handling for list item names

* feat(ModelList): enhance group label with item count using CustomTag

* feat(FileItem): add style prop for customizable background color in FileItem component

* style(index.scss): update border color variables for improved UI consistency

* style(EditModelsPopup): update background color for model items to enhance visual distinction

* style(HealthCheckPopup): update button size for improved usability

* feat(CustomCollapse): add collapsible prop to customize collapse behavior

* chore: remove hover models color

---------

Co-authored-by: kangfenmao <kangfenmao@qq.com>
Co-authored-by: eeee0717 <chentao020717Work@outlook.com>
2025-04-08 19:37:11 +08:00
Vaayne
15d5c918c0 fix(McpService): improve client connection handling with error logging 2025-04-08 17:28:09 +08:00
suyao
72749628cb fix(formats): add optional chaining for grounding support properties to prevent errors 2025-04-08 17:27:06 +08:00
suyao
8b9f60345c fix(MessageContent): handle optional chaining for grounding metadata and citations 2025-04-08 17:27:06 +08:00
Hamm
3a415335d1 refactor(reranker): 重构重排序功能以提高可维护性 (#4539)
* refactor(reranker): 重构重排序功能以提高可维护性

- 将 BaseReranker 类中的公共逻辑提取到受保护的方法中
- 优化了 JinaReranker、SiliconFlowReranker 和 VoyageReranker 的实现
- 新增 getRerankUrl 和 getRerankResult 方法以提高代码复用性
- 简化了重排序结果的处理逻辑

* refactor(reranker): 将 formatErrorMessage 方法的访问权限改为受保护

- 将 formatErrorMessage 方法的访问权限从公共 (public) 改为受保护 (protected)
- 这一更改限制了方法的访问范围,仅允许子类访问该方法
- 有助于提高代码的封装性和安全性
2025-04-08 16:53:31 +08:00
one
0d0fc53681 fix: wrap inline code 2025-04-08 09:26:37 +08:00
MyPrototypeWhat
b53b6259be fix(NpxSearch): update search result mapping to use record name as ke… (#4491)
fix(NpxSearch): update search result mapping to use record name as key and handle optional search results

Co-authored-by: lizhixuan <zhixuan.li@banosuperapp.com>
2025-04-07 19:45:40 +08:00
kangfenmao
5b44e6a982 chore(version): 1.1.19 2025-04-07 16:04:48 +08:00
kangfenmao
7a9c41abf8 Revert "refactor(Navbar): replace FormOutlined with SearchOutlined and update tooltip functionality"
This reverts commit f32ed6628b.
2025-04-07 14:34:12 +08:00
kangfenmao
03bec81f1d feat(mcp): add automatic MCP server registration for auto-install tool
- Implemented functionality to automatically register MCP servers when the '@cherry/mcp-auto-install' tool is called.
- Utilized nanoid for unique server ID generation and dispatched the new server to the Redux store.
2025-04-07 14:33:43 +08:00
kangfenmao
11dfdd49cd refactor(mcp): move inMemory servers to npx search scope
- Updated error handling in FileSystemServer to throw errors instead of exiting the process.
- Enhanced MCPService to use a more flexible server name check and updated the path for MCP_REGISTRY_PATH.
- Refined Inputbar to conditionally set enabled MCPs only if they are not empty.
- Cleaned up MCPToolsButton and MCPSettings by removing unused imports and effects.
- Updated NpxSearch to include a new npm scope and improved search result handling.
- Enhanced builtin MCP server descriptions for better clarity.
2025-04-07 14:07:01 +08:00
fullex
54a56ec48a perf: remove unused codes related to minapp (#4444) 2025-04-07 09:51:10 +08:00
fullex
6d5c08129d fix: remove sidebar minapp animation to stop gpu high load 2025-04-07 09:37:10 +08:00
one
3fc97d273c perf: prevent unnecessary reflow 2025-04-07 09:36:46 +08:00
kangfenmao
0ab0df452c fix(WindowService): conditionally hide dock icon for macOS when closing to tray 2025-04-06 21:32:56 +08:00
kangfenmao
c8b02f31db feat(i18n): add user and system labels to multiple language files 2025-04-06 21:27:37 +08:00
one
e22094e384 fix: LRU cache import 2025-04-06 21:11:37 +08:00
eeee0717
72ef4df153 fix(websearch): improve error handling and response validation 2025-04-06 21:03:38 +08:00
kangfenmao
62031eb253 feat: add qiniu ai provider 2025-04-06 18:50:35 +08:00
Teo
53617d7ecc refactor(Inputbar): streamline Backspace handling and update knowledge base management 2025-04-06 18:49:50 +08:00
kangfenmao
cc1f6fde1c feat(MCPSettings): enhance server management with segmented control and improved layout 2025-04-06 16:59:09 +08:00
kangfenmao
bd76cbb0ca fix(useAssistant): ensure safe access to assistant ID in setModel callback 2025-04-06 14:40:32 +08:00
Shelly
9bf3e629cc fix: 🐛 LRUCache export name error (#4420)
BREAKING CHANGE: 🧨 SyntaxError: The requested module
'/@fs/Users/bary/code/tools/cherry-studio/node_modules/.vite/deps/lru-cache.js?v=9139ab94'
does not provide an export named 'LRUCache' (at
CodeCacheService.ts:2:10)
2025-04-06 12:41:30 +08:00
LiuVaayne
d6dcc5b216 bugfix(MCP): ensure memory path exists on initialization and remove unused… (#4418)
* bugfix: ensure memory path exists on initialization and remove unused everything mcp server

* refactor(factory): remove unused EverythingServer import and case

* fix(CodeCacheService): update import statement for LRUCache to default import

Error: src/renderer/src/services/CodeCacheService.ts(2,10): error TS2595: 'LRUCache' can only be imported by using a default import.
2025-04-06 12:40:51 +08:00
kangfenmao
a9a74f71e9 chore(dependencies): update libsql and add sindresorhus/is package
- Updated libsql patch reference in package.json.
- Added sindresorhus/is package to yarn.lock with version 7.0.1.
- Removed duplicate sindresorhus/is entry from yarn.lock.
2025-04-06 10:51:41 +08:00
kangfenmao
3aa28f0132 refactor(Inputbar, Markdown): optimize citation handling and improve performance
- Refactored AttachmentButton to use useMemo for extensions calculation.
- Simplified citation extraction in Markdown by moving logic to a new utility function.
- Updated TopicsTab dependencies for better performance and reactivity.
2025-04-06 10:49:52 +08:00
Sophon
c503e5eafd build: Add support for Windows ARM64 platform (#3431)
Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2025-04-06 09:35:08 +08:00
SuYao
79b724c264 feat(UI, OpenAI): support OpenAI-4o-web-search add support for web search citations (#3524)
* feat(UI, OpenAI): support  OpenAI 4o web search add support for web search citations

- refactor: Introduced a new CitationsList component to display citations in MessageContent.
- feat: Enhanced message handling to support web search results and annotations from OpenAI.
- refactor: Removed the deprecated MessageSearchResults component for cleaner code structure.
- refactor: Added utility functions for link conversion and URL extraction from Markdown.

* chore: remove debug logging from ProxyManager

* revert(OpenAIProvider): streamline reasoning check for stream output handling

* chore(OpenAIProvider): correct placement of webSearch in response object

* fix(patches): update OpenAI package version and remove patch references

- Integrated dayjs for dynamic date formatting in prompts.ts.

* feat(Citation, Favicon): enhance OpenAI web search support and citation handling

- Improved FallbackFavicon component to cache failed favicon URLs.
- Support all web search citation preview
- Added support for Hunyuan search model in OpenAIProvider and ApiService.

* refactor(provider/AI): move additional search parameters to AI Provider
2025-04-06 09:11:59 +08:00
kangfenmao
8d6c5e03ea fix(Markdown): Conditionally apply MarkdownShadowDOMRenderer for style components based on message content 2025-04-06 09:11:23 +08:00
PilgrimLyieu
2fec56980b feat: Support bottom anchor in message anchor line 2025-04-06 08:50:05 +08:00
George·Dong
02f4c615d0 refactor(export): 添加导出菜单选项设置、思维链导出功能 (#4168)
* refactor(settings): Add export menu setting & optimize data settings page

* feat: add dynamic export menu options from Redux state in MessageMenubar and TopicsTab

* feat(export): Add export to markdown with reasoning method

* feat(export): optimize reasoning style

* feat(export): Add export to markdown with reasoning to export menu

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

---------

Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2025-04-06 08:43:54 +08:00
one
79b6bdb762 perf(CodeBlock): improve long codeblock loading experience (#4167)
* perf(CodeBlock): improve long codeblock loading experience

* refactor: use requestIdleCallback rather than observer

* refactor: simplify setting expanded and unwrapped

* refactor: simplify logic

* refactor: revert to observer

* fix: turn mermaid listener to passive to avoid scrolling performance downgrade

* feat: add lru cache for syntax highlighting

* refactor: adjust cache options

* feat: add highlighter cache

* fix: highlighter should be loaded before highlighting

* refactor: reduce cache time

* refactor: adjust cache size and hash

* refactor: decrease cache size

* fix: restore the behaviour of ShowExpandButton

* fix: check streaming status

* fix: empty code

* refactor: improve streaming check

* fix: optimizeDeps excludes

* refactor: adjust cache policy

* feat: add a setting for code caching

* feat: add more settings for code cache

* fix: initialize service

* refactor: prevent accident cache reset, update settings

* refactor: update code cache service

* fix: revert unecessary changes

* refactor: adjust cache settings

* fix: update migrate version

* chore: update to shiki v3

* fix: import path

* refactor: remove highlighter cache, improve fallbacks

* fix: revert path changes

* style: fix lint errors

* style: improve readability

* style: improve readability

* chore: update migrate version

* chore: update packages
2025-04-06 08:38:02 +08:00
PeterWang-dev
1963bf8abe feat(icons): explicitly add icons in multiple resolutions to correct appimage icon path 2025-04-06 08:28:10 +08:00
kangfenmao
4d29bcde1e refactor(GraphRAG): Remove GraphRAG related files and references from the project 2025-04-06 08:11:10 +08:00
one
8b20941583 perf(QuickPanel): improve search responsiveness (#4406) 2025-04-06 01:06:54 +08:00
kangfenmao
13d2eb690a feat(database): Add version 6 with new 'files' store and update existing stores 2025-04-05 20:59:36 +08:00
kangfenmao
f5e432a494 feat(MCPSettings): Reset form change state on server ID change and disable server type selection for inMemory servers 2025-04-05 20:58:36 +08:00
kangfenmao
bd4ec7f9e1 refactor(Inputbar): Update file name handling in AttachmentPreview, adjust padding in Inputbar, and enhance textarea expansion logic 2025-04-05 20:33:44 +08:00
Teo
975ecf6b47 feat(QuickPanel): Optimize QuickPanel (#4404)
feat(QuickPanel): Add footer resizing and improve item action handling
2025-04-05 20:19:43 +08:00
kangfenmao
0461dbba91 feat: google analytics 2025-04-05 16:07:04 +08:00
Teo
526f9d67a3 feat(QuickPanel): Add new feature QuickPanel, unify input box operation. (#4356)
* feat(QuickPanel): Add new feature QuickPanel, unify input box operation.

* refactor(Inputbar): Remove unused quickPanelSymbol reference and update navigation action in KnowledgeBaseButton

* fix(Inputbar): Prevent translation action when input text is empty and reorder MentionModelsInput component

* refactor(Inputbar): Add resizeTextArea prop to QuickPhrasesButton for better text area management

* feat(i18n): Add translation strings for input actions and quick phrases in multiple languages

* feat(Inputbar): Enhance AttachmentButton to support ref forwarding and quick panel opening

* feat(i18n, Inputbar): Add upload file translation strings and enhance file count display in multiple languages

* style(QuickPanel): Update background color for QuickPanelBody and add dark theme support

* fix(Inputbar): Update upload label for vision model support

* feat(QuickPanel): Add outside click handling and update close action type

* feat(QuickPanel): Improve scrolling behavior with key press handling and add PageUp/PageDown support

* feat(i18n): Add translation strings for menu description in multiple languages

* refactor(QuickPhrasesButton): simplify phrase mapping by removing index-based disabling

* fix(QuickPanel): correct regex pattern for search functionality

* refactor(QuickPanel): remove searchText state and related logic for cleaner context management

* refactor(QuickPanel): enhance search text handling and input management

* refactor(Inputbar): update file name handling in AttachmentPreview and Inputbar components
2025-04-05 16:05:28 +08:00
LiuVaayne
92dfe0f50c feat(mcp): add in-memory MCP server support and configuration management (#4359) 2025-04-05 14:17:56 +08:00
kangfenmao
7953aa0605 lint: fix eslint error 2025-04-05 10:52:45 +08:00
Hamm
868db3a3f6 refactor(Constants): 优化一些常量和枚举值 (#3773)
* refactor(main): 使用枚举管理 IPC 通道

- 新增 IpcChannel 枚举,用于统一管理所有的 IPC 通道
- 修改相关代码,使用 IpcChannel 枚举替代硬编码的字符串通道名称
- 此改动有助于提高代码的可维护性和可读性,避免因通道名称变更导致的错误

* refactor(ipc): 将字符串通道名称替换为 IpcChannel 枚举

- 在多个文件中将硬编码的字符串通道名称替换为 IpcChannel 枚举值
- 更新了相关文件的导入,增加了对 IpcChannel 的引用
- 通过使用枚举来管理 IPC 通道名称,提高了代码的可维护性和可读性

* refactor(ipc): 调整 IPC 通道枚举和预加载脚本

- 移除了 IpcChannel 枚举中的未使用注释
- 更新了预加载脚本中 IpcChannel 的导入路径

* refactor(ipc): 更新 IpcChannel导入路径

- 将 IpcChannel 的导入路径从 @main/enum/IpcChannel 修改为 @shared/IpcChannel
- 此修改涉及多个文件,包括 AppUpdater、BackupManager、EditMcpJsonPopup 等
- 同时移除了 tsconfig.web.json 中对 src/main/**/* 的引用

* refactor(ipc): 添加 ReduxStoreReady 事件并更新事件监听

- 在 IpcChannel 枚举中添加 ReduxStoreReady 事件
- 更新 ReduxService 中的事件监听,使用新的枚举值

* refactor(main): 重构 ReduxService 中的状态变化事件处理

- 将状态变化事件名称定义为常量 STATUS_CHANGE_EVENT
- 更新事件监听和触发使用新的常量
- 优化了代码结构,提高了可维护性

* refactor(i18n): 优化国际化配置和语言选择逻辑

- 在多个文件中引入 defaultLanguage 常量,统一默认语言设置
- 调整 i18n 初始化和语言变更逻辑,使用新配置
- 更新相关组件和 Hook 中的语言选择逻辑

* refactor(ConfigManager): 重构配置管理器

- 添加 ConfigKeys 枚举,用于统一配置项的键名
- 引入 defaultLanguage,作为默认语言设置
- 重构 get 和 set 方法,使用 ConfigKeys 枚举作为键名
- 优化类型定义和方法签名,提高代码可读性和可维护性

* refactor(ConfigManager): 重命名配置键 ZoomFactor

将配置键 zoomFactor 重命名为 ZoomFactor,以符合命名规范。
更新了相关方法和属性以反映这一变更。

* refactor(shared): 重构常量定义并优化文件大小格式化逻辑

- 在 constant.ts 中添加 KB、MB、GB 常量定义
- 将 defaultLanguage 移至 constant.ts
- 更新 ConfigManager、useAppInit、i18n、GeneralSettings 等文件中的导入路径
- 优化 formatFileSize 函数,使用新定义的常量

* refactor(FileSize): 使用 GB/MB/KB 等常量处理文件大小计算

* refactor(ipc): 将字符串通道名称替换为 IpcChannel 枚举

- 在多个文件中将硬编码的字符串通道名称替换为 IpcChannel 枚举值
- 更新了相关文件的导入,增加了对 IpcChannel 的引用
- 通过使用枚举来管理 IPC 通道名称,提高了代码的可维护性和可读性

* refactor(ipc): 更新 IpcChannel导入路径

- 将 IpcChannel 的导入路径从 @main/enum/IpcChannel 修改为 @shared/IpcChannel
- 此修改涉及多个文件,包括 AppUpdater、BackupManager、EditMcpJsonPopup 等
- 同时移除了 tsconfig.web.json 中对 src/main/**/* 的引用

* refactor(i18n): 优化国际化配置和语言选择逻辑

- 在多个文件中引入 defaultLanguage 常量,统一默认语言设置
- 调整 i18n 初始化和语言变更逻辑,使用新配置
- 更新相关组件和 Hook 中的语言选择逻辑

* refactor(shared): 重构常量定义并优化文件大小格式化逻辑

- 在 constant.ts 中添加 KB、MB、GB 常量定义
- 将 defaultLanguage 移至 constant.ts
- 更新 ConfigManager、useAppInit、i18n、GeneralSettings 等文件中的导入路径
- 优化 formatFileSize 函数,使用新定义的常量

* refactor: 移除重复的导入语句

- 在 HomeWindow.tsx 和 useAppInit.ts 文件中移除了重复的 defaultLanguage导入语句
- 这个改动简化了代码结构,提高了代码的可读性和维护性
2025-04-04 19:07:23 +08:00
MyPrototypeWhat
8a29e848d6 refactor(MCPSettings): replace MainContent callback with useMemo for performance optimization 2025-04-04 18:59:54 +08:00
kangfenmao
f80b748c75 chore(version): 1.1.18 2025-04-04 12:07:05 +08:00
kangfenmao
e5fe52c4c0 feat(migrate): update migration logic to remove specific mini app from state and increment version to 89 2025-04-04 11:54:24 +08:00
kangfenmao
34b62677ea fix(SelectModelPopup): set popup width to 600 for improved layout 2025-04-04 11:49:59 +08:00
kangfenmao
f32ed6628b refactor(Navbar): replace FormOutlined with SearchOutlined and update tooltip functionality 2025-04-04 10:54:21 +08:00
kangfenmao
3f5a504952 fix(Inputbar): enhance message usage estimation and clean up code structure 2025-04-04 10:34:08 +08:00
LiuVaayne
c02748e520 feat: mcp tool permissions (#4348)
* feat(MCPSettings): add tool toggle functionality and update server configuration

* fix(McpSettings): improve server type handling and tool fetching logic
2025-04-04 09:57:54 +08:00
fullex
09148a842c feat: render markdown when show assistant prompt (#4365)
* feat: render markdown when show assistant prompt

* fix: polish user experience
2025-04-04 09:37:29 +08:00
George·Dong
a5a36b5d13 fix(ChatNavigation): improve navigation button collapse functionality 2025-04-04 00:07:36 +08:00
fullex
af7f4f1a92 fix: webdav backup resume and modal problem 2025-04-03 23:09:59 +08:00
ousugo
d8d803cc5a fix(TopicsTab): Topic prompt word modification does not take effect immediately 2025-04-03 23:03:32 +08:00
MyPrototypeWhat
7f6b88c006 feat(mcp): add registryUrl to initialState for improved package manag… (#4279)
* feat(mcp): add registryUrl to initialState for improved package management

* feat(mcp): initialize registryUrl in MCP server state for future enhancements

* fix(inputbar):mcp server list

* refactor(Inputbar): remove unused MCP server variable and console log for cleaner code

* fix(Inputbar): 还原

* fix(Inputbar): Add activedMcpServers to Inputbar component props
2025-04-03 18:51:29 +08:00
BlBana
a8ec721beb fix(Inputbar): Solve the problem that the initial state of assistant mcpServers is empty, and can not get enable mcp servers. 2025-04-03 17:45:14 +08:00
ousugo
5834eaea2e fix(minapps): remove AI Studio entry from default mini apps list 2025-04-03 17:41:13 +08:00
Asurada
9dafc45b11 feat(Anthropic): Enable Anthropic 128k context beta feature (#2887) 2025-04-03 17:16:36 +08:00
Camol
da449eca88 fix(nutstore): restore from nutstore #4318 (#4334)
Co-authored-by: kanweiwei <kanweiwei@nutstore.net>
2025-04-03 10:56:05 +08:00
Yuzhong Zhang
328ffe3421 fix(CodeBlock): incorrect behavior of message in multiple models (#4328)
* 修复多模型对比时的复制按钮sticky行为,并添加注释

* 同时修复横向滚动条消失的问题

* 增加布局判断
2025-04-03 01:01:04 +08:00
LiuVaayne
33f7ecdb7d fix(mcp-tools): enhance tool lookup to match by name in addition to ID (#4323) 2025-04-02 23:20:07 +08:00
Bowie He
4ea69b99c1 feat:add default doubao model to model list 2025-04-02 18:56:30 +08:00
kanweiwei
3d07f7b6fe fix(NutstoreService): Fix slash handling in path processing #4208 2025-04-02 13:38:29 +08:00
fullex
40acd88495 feat: miniWindow Pin/Resize (#3201)
feat: [#2030] miniWindow pin/resizable/copy toast/move optimized
2025-04-02 10:26:56 +08:00
shiquda
ce0c5ca98d fix(Knowledge): enable text selection in knowledge base search results (#4281) 2025-04-01 23:16:34 +08:00
kangfenmao
d644fb6f68 lint: Added an eslint disable comment in MinappPopupContainer to address 2025-04-01 21:05:36 +08:00
亢奋猫
e7d744a863 refactor(MCPService, process): Updated MCPService to conditionally set the NPM_CONFIG_REGISTRY
* refactor(MCPService, process): enhance registry URL handling and improve getBinaryPath function

- Updated MCPService to conditionally set the NPM_CONFIG_REGISTRY based on server name, improving flexibility for auto-install scenarios.
- Modified getBinaryPath function to handle optional name parameter, returning a default path when no name is provided, enhancing usability.

* refactor(MCPService, utils): add directory existence check for registry file

- Introduced makeSureDirExists utility function to ensure the specified directory exists, enhancing robustness.
- Updated MCPService to utilize this function when setting the registry URL for the mcp-auto-install server, improving error handling.

* feat:change MCP_REGISTRY_PATH

* refactor(MCPService): streamline environment variable setup for mcp-auto-install

- Updated MCPService to conditionally set NPM_CONFIG_REGISTRY and MCP_REGISTRY_PATH in a more concise manner.
- Enhanced readability by removing redundant code while maintaining functionality.

---------

Co-authored-by: lizhixuan <zhixuan.li@banosuperapp.com>
2025-04-01 20:57:56 +08:00
Chen Tao
02c84b7639 fix(KnowledgeContent): adjust VirtualList height based on item count (#4270) 2025-04-01 19:47:58 +08:00
kangfenmao
04d32ccb74 refactor(McpSettings): simplify args form item and adjust navbar padding for Windows
- Removed unnecessary validation rules from the args Form.Item in McpSettings for cleaner code.
- Updated McpSettingsNavbar to conditionally adjust padding based on the operating system.

close #4244
2025-04-01 17:03:27 +08:00
kangfenmao
8f7e3777ed feat(Inputbar, MCPToolsButton, AssistantMCPSettings): integrate active MCP server handling and UI updates
- Added active MCP server filtering in Inputbar for message sending.
- Updated MCPToolsButton to reflect availability of enabled MCPs.
- Refactored AssistantMCPSettings to streamline MCP server updates and adjusted UI styles for consistency.
2025-04-01 16:57:12 +08:00
Hobee Liu
3cb6cf6c73 feat: add chat navigation bar close (#4019)
* feat(聊天导航): 新增关闭、置顶和置底按钮并更新图标

在聊天导航组件中新增了关闭、置顶和置底按钮,并更新了相关图标以提升用户体验。同时,添加了点击关闭按钮时隐藏导航的功能。

* feat(消息导航): 添加手动关闭状态以避免误触

在 ChatNavigation 组件中添加 `manuallyClosedUntil` 状态,用于在用户手动关闭导航后,1分钟内不响应鼠标靠近事件。这可以防止用户在操作时误触导航栏,提升用户体验。

* refactor(ChatNavigation): 重命名函数并添加滚动处理逻辑

重命名 handleChatNavigationClick 为 handleCloseChatNavigation 以提高代码可读性,并添加 handleScrollToTop 和 handleScrollToBottom 函数以处理滚动逻辑

* fix: 修复滚动到顶部时位置不正确的问题

将 `scrollToTop` 函数中的 `top` 值从 `0` 改为 `-container.scrollHeight`,以确保滚动到顶部时位置正确

* docs(i18n): 添加新的翻译字符串以支持更多操作

在多个语言文件中添加了“回到顶部”、“回到底部”和“关闭”的翻译字符串,以支持更多用户界面操作。

* refactor: 移除未使用的变量以简化代码
```

解释:
- **类型**: `refactor`,因为这是代码重构,移除了未使用的变量,没有改变功能行为。
- **描述**: 移除了未使用的变量以简化代码,符合简洁和可维护性的原则。
2025-04-01 16:17:57 +08:00
Cherry
146b328b60 feat: One-click copy model id (#4190)
* feat:One-click copy model id

* fix:model id消失问题,样式问题
2025-04-01 16:11:06 +08:00
fullex
9f69401f97 fix: chat history dark theme (#4254) 2025-04-01 14:55:24 +08:00
LiuVaayne
4901c3b5f1 refactor: enhance mcp init (#4238)
* fix(MCPService): extend command support to include 'bun' and 'bunx', and improve environment variable handling

* fix(MCPService): enhance environment variable handling by incorporating default environment settings

* fix(hooks): simplify active MCP servers selection logic
2025-04-01 13:08:25 +08:00
kangfenmao
5ee5dee83c refactor: move websearch provider code to providers folder 2025-04-01 11:05:31 +08:00
kangfenmao
61bb4477f6 feat(i18n): add topic naming model support for message title generation in Japanese, Russian, and Traditional Chinese locales 2025-04-01 10:41:30 +08:00
kangfenmao
f8f012a3a6 fix(settings): enable clickAssistantToShowTopic by default 2025-04-01 10:06:24 +08:00
kangfenmao
9b10a02362 fix(Inputbar): simplify assistant state reset logic in useEffect 2025-04-01 09:57:21 +08:00
shiquda
3c48f670c4 feat: add support for title generation when exporting single message
#3992
2025-04-01 07:34:57 +08:00
MyPrototypeWhat
00b3c14b56 feat: add React Developer Tools extension support and optimize CodeBlock component 2025-04-01 07:33:16 +08:00
suyao
3695c3d493 fix(styles): set dropdown menu width to max-content for better layout 2025-03-31 23:25:10 +08:00
suyao
cc59fc1295 fix(styles): improve scrollbar visibility by adjusting opacity and background color on hover 2025-03-31 23:25:10 +08:00
suyao
5355ead4b9 fix(UI): enhance scrollbar visibility and dropdown menu overflow handling 2025-03-31 23:25:10 +08:00
SuYao
b81e252d2f refactor(MCP): enhance schema validation for gemini (#4153) 2025-03-31 21:13:59 +08:00
LiuVaayne
4a3c8ea279 feat(MCP): add registryUrl support for package management (#4200) 2025-03-31 21:13:20 +08:00
one
5ea1bec15c perf: improve modellist search bar responsiveness (and memorization) (#4221) 2025-03-31 21:11:46 +08:00
Yuzhong Zhang
df804c752b optimize: Sticky CopyButton in CodeBlock (#4205) 2025-03-31 21:11:28 +08:00
LiuVaayne
fa7ef62ba8 Feat/assistant level mcp (#4220) 2025-03-31 21:10:33 +08:00
fullex
6e2727c4b2 fix: Resolve a series of miniWindow display issues and improve app behavior across platforms (#3072) 2025-03-31 21:07:16 +08:00
MyPrototypeWhat
878802825b feat(MCP): add auto-install server configuration and migration for ve… (#4156)
* feat(MCP): add auto-install server configuration and migration for version 87

* update persistReducer version
2025-03-31 18:07:50 +08:00
fullex
afdc3e188a feat: minapp show&copy current REAL url and can open it 2025-03-31 18:01:10 +08:00
fullex
fadaaaf0e2 optimize: reduce animation gpu load of sidebar minapp 2025-03-31 17:47:41 +08:00
one
5affec1d7e perf(Tabs): improve responsiveness when switching items rapidly 2025-03-31 09:33:17 +08:00
fullex
f1fbcfc27d fix: zoomfactor should not change when resize (#4159)
* fix: zoomfactor should not change when resize

* add linux fallback support
2025-03-31 09:24:49 +08:00
suyao
dfde7353b2 fix(models): reorganize gemini websearch model lists 2025-03-30 23:52:58 +08:00
kangfenmao
732408bce6 chore(version): 1.1.17 2025-03-30 14:39:43 +08:00
kangfenmao
e46223932d refactor(BackupManager): switch to stream-based file writing for improved performance
* Updated BackupManager to use streams for writing data to temporary and backup files, enhancing efficiency and error handling.
* Replaced synchronous file writing with asynchronous stream operations to prevent blocking the event loop.
2025-03-30 14:37:20 +08:00
kangfenmao
2f613119f0 refactor(knowledge): enhance CustomCollapse component and improve UI consistency
* Updated CustomCollapse to accept React nodes for labels, allowing for more flexible content.
* Replaced static labels with CollapseLabel component to display item counts.
* Introduced EmptyView component for consistent empty state representation across collapsible sections.
* Removed unnecessary styles and improved button click handling to prevent event propagation.
2025-03-30 14:32:57 +08:00
kangfenmao
98284b1dcc chore(store): update migration logic and increment version to 87
* Updated migration functions to include error handling for provider additions.
* Incremented the version number in the persisted reducer configuration.
2025-03-30 14:08:14 +08:00
Hao He
d84bb77c06 feat: Add keyboard navigation and selection highlighting for AddAssistantPopup (#4022)
* feat(AddAssistantPopup): 添加键盘导航和选中项高亮功能

* feat(AddAssistantPopup): 为所有项添加相同宽度的透明边框,避免布局跳动。
2025-03-30 13:58:52 +08:00
Teo
c9057196f1 refactor(files): Reconstruct file system UI (#4100)
* refactor(files): Reconstruct file system UI

* refactor(knowledge): replace Card components with CustomCollapse for better UI structure

* refactor(files): update folder icon from FolderOpenOutlined to FolderOpenFilled

* feat(components): add CustomCollapse component for enhanced collapsible UI

* refactor(files): implement virtual scrolling in FileList and KnowledgeContent components
2025-03-30 13:56:34 +08:00
George·Dong
ae5a291b49 refactor(settings): 重构小程序设置 (#4092) 2025-03-30 08:48:23 +08:00
kangfenmao
5a8b78f436 feat(MCPService): enhance PATH management with platform-specific directories 2025-03-30 08:32:45 +08:00
kangfenmao
8d65f73f09 fix(MCPSettings): ensure server name is set when missing and reorder radio options 2025-03-30 08:26:01 +08:00
Vaayne
ef9575b09a fix(MCPService): clear cache on server close and refactor tool fetching logic 2025-03-30 07:42:27 +08:00
LiuVaayne
f0a9188f01 fix(MCPService): prefix tool IDs with 'f' for consistency (#4121) 2025-03-30 00:26:47 +08:00
fullex
df673beadd fix(UI/markdown): markdown not recognized ** as emphasis marks in CJK (#4119) 2025-03-29 23:56:41 +08:00
yangtb2024
ad2fba10cd feat(config): 增强模型支持 (#4085)
* feat(config): 添加对新模型的支持

- 新增 gemini-2.5 到 visionAllowedModels
- 新增 gpt-4.5 到 visionAllowedModels 和 FUNCTION_CALLING_MODELS
- 新增 o1 到 FUNCTION_CALLING_MODELS
- 从 visionExcludedModels 和 FUNCTION_CALLING_EXCLUDED_MODELS 中排除 o1-mini, o1-preview, AIDC-AI/Marco-o1

* feat(config): 添加对 deepseek-ai 函数调用的支持

- 新增 deepseek-ai 到 FUNCTION_CALLING_MODELS
2025-03-29 23:04:51 +08:00
one
e0c647ad10 fix: race condition in topic auto renaming 2025-03-29 22:58:38 +08:00
Herio
62efc95fc3 feat(ApiCheckPopup): 使用Promise.all并行处理API验证请求并更新状态 2025-03-29 22:00:21 +08:00
fullex
38ed8f986c fix: one-off minapp should not show minimize button 2025-03-29 21:59:03 +08:00
George·Dong
5202ceddb7 fix(ApiService): context clear failed 2025-03-29 21:43:29 +08:00
Chen Tao
a1e22768a0 fix: add base url for gemini (#4109) 2025-03-29 21:35:04 +08:00
Catwine
e84cfafe64 docs(config): fix typo in electron-builder.yml 2025-03-29 21:08:55 +08:00
kangfenmao
96ff67852a fix(WebviewContainer): update webview partition to use a generic identifier 2025-03-29 19:00:08 +08:00
kangfenmao
8a04a8e79d chore(version): 1.1.16 2025-03-29 15:29:28 +08:00
kangfenmao
c4d16002e1 fix(migrate): add error handling to migration functions and ensure state integrity during updates 2025-03-29 15:28:57 +08:00
kangfenmao
88b7ebf371 chore(version): 1.1.15 2025-03-29 15:00:02 +08:00
kangfenmao
4ddef410ac chore(version): 1.1.14 2025-03-29 08:05:56 +08:00
kangfenmao
230f9cf32c feat(i18n): add delete server confirmation messages in multiple languages 2025-03-29 08:00:51 +08:00
fullex
577dcdb70b feat: MinApp tabs on sidebar, we can keep MinApps alive and re-open it without loading again. 2025-03-29 07:29:45 +08:00
fullex
424b883681 refactor: MinAppType id required and only string 2025-03-29 07:29:45 +08:00
Chen Tao
94340bcb7f feat: support gpt-4o image generation (#4054)
* feat: support gpt-4o image generation

* clean code
2025-03-29 07:18:42 +08:00
suyao
63b8554261 feat(models): add support for new Gemini models 2025-03-29 07:17:40 +08:00
LiuVaayne
28c63e838a feat: mcp tools (#4069)
* feat(McpSettings): add MCP tools section and fetch tools on server activation

* refactor(McpService): improve client management and connection handling

* feat(McpService): add server management functions for restart and stop

* feat(McpTool): add tools section with input schema and availability messages

* feat(McpService): add unique IDs to tools and update function name mapping

* feat(McpService): implement caching for tool listings and enhance tool structure

* feat(McpToolsButton): streamline active server handling and update dropdown rendering

* fix(mcp-tools): update tool lookup to use unique IDs and add warning for missing tools
2025-03-29 07:16:59 +08:00
kangfenmao
850b55912a chore(version): 1.1.13 2025-03-28 21:49:09 +08:00
kangfenmao
684b5c9dc5 feat(Markdown): disallow iframe elements in Markdown rendering #4059 2025-03-28 21:46:37 +08:00
Teo
57f6fd14d6 fix: fix fold selected (#4058)
* fix: 修复foldSelected问题

* refactor: 优化布局定位
2025-03-28 21:22:45 +08:00
fullex
8ac75413e2 remove unnecessary css 2025-03-28 18:11:21 +08:00
fullex
703e746a48 fix: code block selection abnormal
- the reason is using display: table/table-row, which makes the selection behavior become table style.
- use display: flex/block to solve this problem, meanwhile the line number css also modified to fit the adjust
2025-03-28 18:11:21 +08:00
kangfenmao
d58e6dd857 feat(electron-builder): update release notes to include Nutstore login, SiYuan note export, and MCP improvements 2025-03-28 18:01:09 +08:00
kangfenmao
f0c47aeff6 chore(version): 1.1.12 2025-03-28 15:17:33 +08:00
Chris Wan
0be6c0349b feat(MessagesService): two or more adjacent messages have the same role as user, then only the last one should be kept 2025-03-28 15:11:52 +08:00
ousugo
aa6f37282f fix(TopicsTab): Topic prompts cannot be cleared 2025-03-28 15:09:01 +08:00
Teo
b115c586f1 refactor(mcp settings): enhance NpxSearch component layout and styling (#4053)
* refactor: mcp setting ui refactor

* refactor(mcp settings): enhance NpxSearch component layout and styling
2025-03-28 15:08:24 +08:00
nutstore-dev
e41987d138 fix(nutstore): fix the issue of not being able to customize the name of nutstore backup files. (#4050)
Co-authored-by: shlroland <shlroland1995@gmail.com>
2025-03-28 15:06:15 +08:00
kangfenmao
7a48da47ac feat(i18n): add "New Folder" button label to multiple locales 2025-03-28 13:42:14 +08:00
Teo
e3c5542d5b refactor: mcp setting ui refactor 2025-03-28 13:21:32 +08:00
kangfenmao
3c2d392376 chore(version): 1.1.11 2025-03-28 11:30:20 +08:00
kangfenmao
37cb188bf1 fix: mcp install ui 2025-03-28 11:15:49 +08:00
kangfenmao
9b9bed5bbd chore: remove useless code 2025-03-28 09:24:54 +08:00
kangfenmao
e3d81b49df refactor: mcp service 2025-03-28 04:24:10 +08:00
kangfenmao
807ae349a3 Revert "feat: Use logo instead of avatar"
This reverts commit 4f6780eda2.
2025-03-28 04:14:20 +08:00
Chen Tao
02e2d0a2d5 fix(Reranker): 修复rerank 400 and 完善错误信息 (#4013)
feat(Reranker): enhance error handling with detailed error messages and early return for empty results
2025-03-27 20:04:37 +08:00
MyPrototypeWhat
a45460eae9 feat: mcp auto server (#3996)
* feat: add configuration file management to MCPService

- Introduced methods to ensure the existence of a configuration file, load configurations from it, and save server configurations.
- Updated the MCPService class to handle server configurations more effectively, improving initialization and error handling.
- Added dependency on chokidar for file system watching.

* feat: enhance MCPService configuration handling

- Improved configuration management by adding compatibility for both old and new server formats.
- Updated methods to ensure configuration file existence, load configurations, and save server data more effectively.
- Refined server initialization logic to handle updates and notifications to Redux more efficiently.
- Removed unnecessary waiting for server data from Redux during initialization.

* feat: enhance MCPService default configuration handling

- Added logic to create a default configuration if none exists, improving the initialization process.
- Implemented migration of server configurations from Redux to file, ensuring data consistency.
- Updated methods to handle nested server structures and improved error handling during server updates.

* refactor: clean up MCPService by removing redundant console logs and unused updateServerInRedux method

- Eliminated unnecessary console log statements to improve code readability.
- Removed the unused updateServerInRedux method, streamlining the MCPService class.
- Maintained existing functionality while enhancing code clarity.
2025-03-27 17:15:16 +08:00
kangfenmao
d59d3f2ec4 lint: fix code format 2025-03-27 15:15:15 +08:00
kangfenmao
6dafcf003d feat(Messages): add foldSelected property to assistant messages for improved message handling 2025-03-27 15:15:01 +08:00
kangfenmao
a4fb1878ad refactor(Messages): update message group styling and improve grouped message handling 2025-03-27 14:07:19 +08:00
kangfenmao
9f9c5ad465 refactor(Scrollbar, Tabs): simplify component structure and improve styling 2025-03-27 13:40:09 +08:00
kangfenmao
6720b6a659 feat(i18n): update assistant settings titles and add new translations for multiple languages 2025-03-27 13:19:04 +08:00
MyPrototypeWhat
06ec7ea98a Perf/optimize rendering (#3923)
* optimize useMessageOperations

* chore: update dependencies and refactor React imports

- Added @ant-design/v5-patch-for-react-19 and rc-virtual-list to package.json.
- Updated React and ReactDOM types to version 19 in package.json and yarn.lock.
- Refactored ReactDOM usage to createRoot in main.tsx for better compatibility with React 18+.
- Changed useContext to use in SyntaxHighlighterProvider and ThemeProvider components.
- Adjusted flex-direction in Messages components to column for improved layout.
- Removed unused state in CodeBlock component.

* refactor(Messages): enhance scrolling behavior and introduce scroll utilities

- Added createScrollHandler and scrollToBottom utilities for improved scroll management.
- Updated Messages component to utilize new scroll utilities for better user experience.
- Refactored scroll handling logic to ensure smooth scrolling when new messages are added.
- Changed containerRef type to HTMLElement for better type safety.

* refactor(Messages): streamline message handling and introduce useTopicMessages hook

- Removed direct message selection from useMessageOperations and created a new useTopicMessages hook for better separation of concerns.
- Updated Messages component to utilize the new useTopicMessages hook for fetching messages.
- Enhanced message display logic with computeDisplayMessages function for improved message rendering.
- Refactored scrolling behavior to maintain a smooth user experience during message updates.

* refactor(Message Operations): introduce useTopicLoading hook for improved loading state management

- Removed loading state from useMessageOperations and created a new useTopicLoading hook for better separation of concerns.
- Updated components to utilize the new useTopicLoading hook for fetching loading states related to topics.
- Enhanced code organization and readability by streamlining message operations and loading state handling.

* refactor(Messages): replace updateMessage with updateMessageThunk for improved async handling

- Updated useMessageOperations and MessageAnchorLine components to utilize updateMessageThunk for message updates.
- Enhanced error handling and database synchronization in the new thunk implementation.
- Streamlined message update logic to improve code clarity and maintainability.

* refactor(SyntaxHighlighterProvider, MessageTools, AddMcpServerPopup): update styles and improve type safety

- Changed import statements to use TypeScript's type imports for better clarity and type safety.
- Updated MessageTools and AddMcpServerPopup components to replace bodyStyle with styles prop for consistent styling approach.
- Enhanced overall code organization and maintainability by adhering to TypeScript best practices.

* refactor(Messages): update layout and remove unnecessary prop

- Removed the hasChildren prop from the Messages component for cleaner code.
- Adjusted flex-direction in the mini chat Messages component to column-reverse for improved layout consistency.

* refactor: enhance type safety and component return types

- Updated functional components to return React.ReactElement instead of JSX.Element for better type consistency.
- Changed import statements to use TypeScript's type imports for improved clarity.
- Initialized useRef hooks with null for better type safety in various components.
- Adjusted props types to use HTMLAttributes for more accurate type definitions.

* chore: update package dependencies

- Removed outdated dependencies: @agentic/exa, @agentic/searxng, @agentic/tavily, and rc-virtual-list.
- Added back @ant-design/v5-patch-for-react-19 and rc-virtual-list with specified versions for improved compatibility.

* fix(useMessageOperations): ensure message retrieval from store when updating content
2025-03-27 12:06:47 +08:00
ousugo
2a5d6db998 feat(message): calculate token usage when message content is updated 2025-03-27 08:32:46 +08:00
ousugo
fa890b9c31 feat(models): add 'qwen2.5-omni' to allowed vision models 2025-03-27 08:31:58 +08:00
one
bffcb790c0 fix: open 'data' page by default after routing to data settings 2025-03-26 22:15:27 +08:00
one
47bacced2b fix(HealthCheck): exclude rerank models from being checked (#3969)
* fix(HealthCheck): exclude rerank models from being checked

* fix: info in en
2025-03-26 21:44:26 +08:00
OrzMiku
2dfcef54eb refactor(AgentCard): unify dropmenus 2025-03-26 21:17:24 +08:00
Sorades
1b58d3da3f feat(message): 将fold display mode的状态持久化 2025-03-26 19:21:39 +08:00
kangfenmao
0a854e0480 build: replace @llm-tools/embedjs with @cherrystudio/embedjs 2025-03-26 18:14:04 +08:00
purefkh
36c27d29a9 fix(UI): exclude rerank models from mention dropdown (#3958) 2025-03-26 16:17:07 +08:00
Yanhua Zheng
2c39e07fe4 docs(README): Add PaperMaterial Theme in README (#3955)
* Add PaperMaterial Theme

* Update README.md
2025-03-26 16:10:08 +08:00
africa1207
f532e3ff18 feat: 优化导出obsidian,自动选择库路径,不再需要手动配置 (#3854)
* feat: 优化导出obsidian,自动选择库路径,不再需要手动配置

* fix: eslint报错

* feat: 增加预设置默认仓库

* fix: 解决合并冲突
2025-03-25 21:31:22 +08:00
Teo
4f6780eda2 feat: Use logo instead of avatar 2025-03-25 21:30:49 +08:00
kangfenmao
ef446a7031 feat: update model identifiers and names in configuration
- Changed model ID from 'mixtral-8x7b-32768' to 'mistral-saba-24b' and updated its name to 'Mistral Saba 24B'.
- Updated model ID from 'gemma-7b-it' to 'gemma-9b-it' and changed its name to 'Gemma 9B'.
- Enhanced clarity and consistency in model naming conventions.
2025-03-25 20:18:14 +08:00
kangfenmao
a0cbe4ba6d Revert "feat: support acrylic effect for Windows"
This reverts commit bdd3ce8815.
2025-03-25 20:13:54 +08:00
kangfenmao
c912aa973d ci: fix eslint slow 2025-03-25 18:34:20 +08:00
kangfenmao
2de3b0e97e feat: update migration for settings auto-check update
Incremented version to 85 and updated migration logic to transition from manual to automatic update checks in settings, enhancing user experience.
2025-03-25 13:16:18 +08:00
wangxiaolong
6038ba3e25 feat: 更新自动检查更新功能易读性
将手动检查更新的设置更改为自动检查更新,更新相关的状态管理和界面文本,以提升用户体验。
2025-03-25 13:06:25 +08:00
d5v
fdb8ce5db8 feat: add Siyuan Note export functionality and configuration (#3845)
* feat(i18n): add Siyuan Note export functionality and configuration

- 增加导出到思源笔记。

* feat/Add document address

---------

Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2025-03-25 13:05:21 +08:00
nutstore-dev
e03efce235 feat: nutstore integration (#3461)
* feat(protocol): add custom protocol

* feat(webdav): add handler for checking webdav connection

* feat(webdav): abstract WebDAV modal components

* feat(nutstore): add nutstore sso

---------

Co-authored-by: shlroland <shlroland1995@gmail.com>
2025-03-25 11:40:11 +08:00
z-zeechung
2a5291b17f feat: Katex and MathJax blocks horizontally auto-scroll (#3806) 2025-03-25 09:44:35 +08:00
ousugo
89482aca59 fix(thinking): Claude think label recognition error problem 2025-03-25 08:57:49 +08:00
Chen Tao
68bbfdff9b feat(genmini): enhance (#3849) 2025-03-25 08:52:43 +08:00
RarityBrown
6443085941 feat: Update text-based file extensions for EDAs
远期可以进一步考虑直接自动使用 https://github.com/github-linguist/linguist/blob/main/lib/linguist/languages.yml 加上自定义扩展集的方式,减轻维护负担

Should consider directly and automatically using https://github.com/github-linguist/linguist/blob/main/lib/linguist/languages.yml along with a custom extension set to reduce the maintenance burden.
2025-03-25 08:51:30 +08:00
Hakadao
bdd3ce8815 feat: support acrylic effect for Windows 2025-03-25 08:50:24 +08:00
hobee
96a1bb0fd0 feat(主题): 添加settingTheme字段以增强主题切换功能
在ThemeProvider中添加settingTheme字段,用于在Sidebar组件中显示当前主题状态。这样用户可以更直观地了解当前主题设置
2025-03-25 08:50:03 +08:00
Teo
bff211e057 feat(pending-animation): 当消息处于后台pending时,助手头像跟话题显示脉冲动画效果 (#3867) 2025-03-25 08:48:26 +08:00
fullex
824ef87f80 fix: some shortcuts not enabled 2025-03-25 00:48:35 +08:00
hobee
359f282dea feat: 添加隐藏小程序功能
可以直接在小程序界面隐藏小程序
2025-03-25 00:32:39 +08:00
hobee
53a0344577 feat(i18n): 在侧边栏添加隐藏小工具的翻译
为多种语言添加了“隐藏小工具”的翻译,以支持新的功能需求。
2025-03-25 00:32:39 +08:00
kangfenmao
b2c19fa2ee feat(docs): add theme section to README files in multiple languages 2025-03-24 09:53:59 +08:00
kangfenmao
15def21054 feat(docs): add guide section and update contact email in README files 2025-03-24 09:41:47 +08:00
kangfenmao
38c5f285ec feat(docs): add Product Hunt badge to README files in multiple languages 2025-03-24 09:34:21 +08:00
kangfenmao
22d9c1daae feat(docs): add contact information to README files in multiple languages 2025-03-24 09:31:41 +08:00
Asurada
e576da8bae feat(SettingTab): add support for reasoning effort model check (#3842) 2025-03-24 09:23:32 +08:00
Pleasurecruise
53e294a700 fix: apikey input flickering 2025-03-23 22:45:33 +08:00
kangfenmao
8d99e942eb chore(version): 1.1.10 2025-03-23 19:31:49 +08:00
Chen Tao
96ef98e35c feat(knowledge): support Voyage AI (#3810)
* feat(knowledge): support Voyage AI

* chore
2025-03-23 19:31:18 +08:00
kangfenmao
58940ec983 fix(prompts): enhance FOOTNOTE_PROMPT for clarity and completeness
- Updated the FOOTNOTE_PROMPT to instruct the model to provide answers based on its knowledge when reference materials are irrelevant, ensuring responses are clearly structured and complete.
2025-03-23 14:25:04 +08:00
kangfenmao
ae4fed7e0b fix(ApiService): remove quotes from message summaries
- Updated the fetchMessagesSummary function to remove all quotes from the generated summaries, ensuring cleaner output for the user.
2025-03-23 14:19:28 +08:00
kangfenmao
29689318cf feat(i18n): add chat history localization for multiple languages
- Added chat history localization entries for English, Japanese, Russian, Simplified Chinese, Traditional Chinese, ensuring consistent user experience across languages.
- Removed redundant history entries from previous versions to streamline localization files.
2025-03-23 13:38:38 +08:00
africa1207
6f66fb8612 feat:增加聊天记录流程图,方便查看 (#3772)
* feat: 聊天记录流程图

* fix: 修复偶尔多标签切换不滚动的问题
2025-03-23 13:35:16 +08:00
kangfenmao
c048be53ca refactor(ipc): simplify launch on boot handling and improve WindowService logic
- Updated the IPC handler for setting launch on boot to directly use the boolean parameter for openAtLogin.
- Cleaned up the WindowService logic to enhance readability and maintainability, including minor adjustments to the tray behavior on macOS.
2025-03-23 13:22:54 +08:00
kangfenmao
3480ae5e2e feat(i18n): add machine translations for Greek, Spanish, French, and Portuguese
- Updated the translation script to output machine-generated translations for Greek, Spanish, French, and Portuguese.
- Adjusted file paths for translation outputs and ensured proper formatting in the translation prompts.
- Added a README file to indicate that the translations are machine-generated and should not be edited.
2025-03-22 23:41:17 +08:00
kangfenmao
c2deb2ff5a chore(version): 1.1.9 2025-03-22 23:22:41 +08:00
kangfenmao
17b5763c1a fix: i18n check 2025-03-22 23:21:45 +08:00
kangfenmao
24d24abcc7 chore: update package dependencies and clean up yarn.lock
- Reintroduced several dependencies in devDependencies that were previously removed from dependencies.
- Removed unused dependencies from both package.json and yarn.lock to streamline the project.
- Updated tslib version in yarn.lock to ensure compatibility.
2025-03-22 22:47:10 +08:00
kangfenmao
37174a2427 feat: add GenerateImageButton component to Inputbar for image generation functionality 2025-03-22 22:45:45 +08:00
kangfenmao
fdcc83248d fix: i18n and lint 2025-03-22 22:31:43 +08:00
z-zeechung
5a3a27acd6 i18n: 新增自动i18n脚本。新增阿拉伯文,希腊文,西班牙文,法文,葡萄牙文翻译 (#3792)
* added auto i18n script. added arab, greek, spanish, france, portuguese translation

* remove arabian
2025-03-22 22:20:09 +08:00
Chen Tao
eeb7f28a2f fix(knowledge): show more info (#3790)
* feat: remove rerank model from embedded model

* feat: add rerank model info

* fix: embedding and rerank model end without `/v1` bug
2025-03-22 22:14:25 +08:00
Chen Tao
de94569164 feat(provider): gemini-2.0-flash-exp image (#3421)
* feat: finish basic gemini-2.0-flash-exp generate image

* feat: support edit image

* chore

* fix: package https-proxy-agent-v5 version

* feat: throw finish message and add history messages

* feat: update generate image models

* chore

---------

Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2025-03-22 22:10:11 +08:00
one
c890f91ad1 feat: add a search bar to model list (#3788)
* feat: add a search bar to model list

* feat: make the search bar collapsible
2025-03-22 21:44:00 +08:00
kangfenmao
18d8a5453b fix: update placeholder text in localization files for tag input fields
- Removed unnecessary information about using pure numbers in tag placeholders across multiple languages.
2025-03-22 21:42:55 +08:00
one
cf803ac3e1 fix: make the setting icon style of non-system providers consistent with system providers 2025-03-22 19:44:39 +08:00
kangfenmao
3b3b221fca refactor: enhance model tags and localization for new model types
- Added support for rerank models in ModelTags component.
- Updated localization keys for model types in various icon components.
- Modified SelectModelPopup to filter out rerank models appropriately.
- Improved model identification logic in models configuration.
- Enhanced UI elements to reflect updated model types and their respective tooltips.
2025-03-22 19:38:00 +08:00
kangfenmao
eeb16dfe54 refactor: update rerank model support and configuration
- Changed provider configuration in dev-app-update.yml to use GitHub.
- Added SUPPORTED_REANK_PROVIDERS constant to filter available rerank models.
- Updated tooltip messages in localization files to indicate supported providers.
- Enhanced AddKnowledgePopup and KnowledgeSettingsPopup components to display supported providers in the UI.
2025-03-22 16:30:54 +08:00
kangfenmao
96ad092c93 fix: remove unnecessary dependency from useEffect in MessageAnchorLine component 2025-03-22 10:12:04 +08:00
Dawn-spring
d5bbe28504 refactor: 改进 Obsidian 导出,不再依赖 Obsidian 第三方插件 (#3637)
改进 Obsidian 导出,不在依赖 Obsidian 第三方插件
2025-03-22 10:11:49 +08:00
MyPrototypeWhat
983165fa10 refactor(NpxSearch): improve type safety and error handling
- Changed import of MCPServer to type import for better clarity.
- Enhanced error handling in async operations to manage unknown error types.
- Updated Table component to use ellipsis for long text in description and npm link.
- Adjusted column width for actions and ensured consistent styling in the component.
2025-03-22 10:09:40 +08:00
Xiangfang Chen
32998b56f0 add GLM-4V-Flash Models. 2025-03-22 10:06:19 +08:00
ousugo
09924db8f3 feat: add search input focus handling in EditModelsPopup 2025-03-22 10:05:34 +08:00
ousugo
bb9e628ab8 fix: update REASONING_REGEX to include 'hunyuan-t1' model 2025-03-22 10:04:57 +08:00
one
34535472b7 fix: reset topicId for branched messages 2025-03-22 03:08:50 +08:00
one
012c6bed99 fix: take messages with empty tool_calls as normal messages 2025-03-22 00:30:12 +08:00
suyao
10840c23c7 chore(ProxyManager): remove unnecessary console log 2025-03-22 00:28:07 +08:00
eeee0717
c8348d3168 fix 2025-03-21 20:21:19 +08:00
one
3235bdafcd fix: use messagesRef to avoid empty new branch 2025-03-21 19:39:03 +08:00
fullex
a63898e3a9 feat: Launch on boot, Minimize to tray on launch & on close / fix: Mac: don't show dock when close to tray (#2871)
* launch/tray feature enhance stashed

* feature: Issue #2754. launch on boot(win&mac, linux not supported now), min to tray when launch(not only boot), min to tray when close
bug-fix: Issue #2576. In Mac, if tray-on-close is set, MainWindow will not show on the dock when closed
bug-fix: MiniWindow will hide MainWindow when it shows first time and won't hide MainWindow later. The user will not open the MainWindow again if the tray is set to not show. The bug fixed by not hiding the MainWindow anytime the MiniWindow showed.

* migration version fix

* fix: enable universal shortcuts when launch to tray

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

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

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

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

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

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

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

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

* fix: finish_reason undefined

---------

Co-authored-by: LiuVaayne <10231735+vaayne@users.noreply.github.com>
Co-authored-by: kangfenmao <kangfenmao@qq.com>
2025-03-21 16:48:19 +08:00
one
ca273973af fix(HealthCheck): health checking local models without API keys 2025-03-21 16:27:07 +08:00
Teo
2b59af1e22 feat(Messages): 新增消息锚点功能,在右侧显示消息大纲 (#3674)
* feat(Messages): 添加消息线和分页按钮的设置选项

* feat(Messages): 将“消息线”更名为“对话锚点”,并更新相关设置和国际化文本

* fix(Messages): 调整消息透明度和缩放效果,优化消息项的样式和交互

* feat(Messages): 添加容器高度自适应功能,优化消息线样式和交互效果

* fix(Messages): 调整消息容器高度计算和样式,优化交互效果

* feat(settings): 更新消息导航相关翻译和设置
2025-03-21 16:21:12 +08:00
自由的世界人
0e802aa1ab fix: select and copy the translation part in the chat box (#3710)
* Update TranslatePage.tsx

* Update TranslatePage.tsx

我再也不点`webstorm`的quick fix了

* Update TranslatePage.tsx
2025-03-21 16:16:50 +08:00
ousugo
ffede8999c fix(MessageMenubar): handle assistant messages from reasoning models when copying and editing content 2025-03-21 16:16:10 +08:00
ousugo
e4e34aacac feat(MessageMenubar): Automatically hide tooltip when secondary popups appear
- Introduced state management for tooltips related to regenerate and delete actions in the MessageMenubar component.
- Updated Tooltip components to control visibility based on user interactions.
2025-03-21 16:09:27 +08:00
SuYao
0c2cffba4c revert(Proxy): remove proxyManager usage from multiple services (#3720)
* revert(Proxy): remove proxyManager usage from multiple services

* refactor(ProxyManager): streamline proxy configuration and management
2025-03-21 16:04:45 +08:00
kangfenmao
b4cf145ed4 refactor(Inputbar): reposition MentionModelsButton for improved accessibility
- Moved MentionModelsButton to a new position within the Inputbar component for better user experience.
- Ensured consistent functionality while enhancing the layout of the input toolbar.
2025-03-21 13:55:40 +08:00
kangfenmao
6463ebbc4d feat: update WebDAV integration and dependencies
- Added 'webdav' to the list of plugins in electron.vite.config.ts.
- Upgraded 'webdav' package from version 4.11.4 to 5.8.0 in package.json and yarn.lock.
- Introduced a utility function for formatting file sizes in WebDavSettings component.
- Updated file size display logic to use the new formatting utility.
2025-03-21 13:53:01 +08:00
fullex
170bde269c fix: miniWindow not sync with theme change (#3643)
* fix: miniWindow not sync theme change

* fix: mac: miniWindow theme display incorrect

* fix: mac: miniWindow display error when system dark+ app light
2025-03-21 13:11:21 +08:00
ousugo
c63cf33a5d fix(MessageMenubar): trim leading whitespace from message content before copying to clipboard 2025-03-21 13:00:53 +08:00
kangfenmao
742009cc68 feat(i18n): add WebDAV backup and restore translations for Japanese, Russian, and Traditional Chinese
- Updated localization files for ja-jp, ru-ru, and zh-tw to include new strings for WebDAV backup and restore modals.
- Enhanced user experience with additional prompts and confirmation messages for backup and restore actions.
2025-03-21 12:59:17 +08:00
kangfenmao
ef426d4217 feat: update ESLint config and add socks-proxy-agent dependency
- Added 'local/**' to ESLint ignores
- Included 'socks-proxy-agent' package in dependencies
- Refactored download function to improve readability and maintainability
- Cleaned up unused code in messages state management
2025-03-21 11:26:51 +08:00
one
97f4ccff23 feat: make webdav state persistent, improve webdav autosync (#3690)
* feat: persist webdav state

* feat: schedule autosync by taking the last autosync time

* fix: correct scheduling behaviour with last error, improve messages

* refactor: delay setting lastSyncTime

---------

Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2025-03-21 11:18:38 +08:00
zhsama
7ea3bfe1fb feat: enhance WebDAV backup and restore functionality (#2522)
Co-authored-by: zhsama <zhcf1ess@qq.com>
Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2025-03-21 11:13:44 +08:00
Chen Tao
2139d9205d feat: support jina reranker (#3658) 2025-03-20 22:32:54 +08:00
FischLu
918fbf4b32 fix(translate): 去除翻译页面中生成的翻译内容开始的空白行 (#3684)
fix(translate): trim whitespace from translated text before setting result
2025-03-20 21:31:13 +08:00
Hao He
7767d64421 fix: update file extensions for Fortran source files (#3683)
* Enhance update error logging and fix duplicate type import

- Improve error logging in AppUpdater with more detailed error information and timestamps
- Remove duplicate MCPServer type import in Inputbar component

* feat(constants): 添加 Fortran 源文件扩展名支持
2025-03-20 21:12:04 +08:00
SuYao
5fff3d006d fix(reranker): fix reranking API integration with own parameters (#3629) 2025-03-20 14:50:09 +08:00
deadmau5v
54264b641c feat(i18n): Fix MCP i18n issues (#3651)
* feat(i18n): Fix MCP i18n issues

* feat(i18n): fix new translations for 'expand' and 'tools' in multiple languages
2025-03-20 14:49:12 +08:00
SuYao
1f2cb2295d fix(KnowledgeBase): pass full knowledgeBase API parameters (#3628) 2025-03-20 14:40:59 +08:00
LiuVaayne
8afd416cdd fix[MCP]: enhance tool call handling in OpenAIProvider (#3642) 2025-03-20 11:51:25 +08:00
SuYao
d7b542bbc8 feat(MCP, Proxy): proxy uv/bun install script (#3621)
* WIP

* refactor(download):  improved socsk proxy download uv/bun
2025-03-20 11:21:49 +08:00
自由的世界人
fd42804df9 fix: readme number error 2025-03-20 00:32:32 +08:00
Suiji
8c067b65c7 fix: readme serial number error (#3624) 2025-03-19 23:39:00 +08:00
Suiji
c897ddc3ea update: readme mcp server (#3623) 2025-03-19 23:31:48 +08:00
Vaayne
2f61c9a851 fix: correct typo in properties variable and add null check 2025-03-19 22:43:03 +08:00
LiuVaayne
0a06f425f3 feat[MCP]: Optimize list tool performance. (#3598)
* refactor: remove unused filterMCPTools function calls from providers

* fix: ensure enabledMCPs is checked for length before processing tools

* feat: implement caching for tools retrieved from MCP server
2025-03-19 20:09:05 +08:00
fullex
741edaf972 feat: export to Joplin (#3607) 2025-03-19 20:07:53 +08:00
shiquda
8f96f5ee1a feat(MCP): add external MCP search website link in MCP settings 2025-03-19 20:07:29 +08:00
TangZhiZzz
a1ae7c3fe9 fix: Unknown event handler property onsuccess . (#3603)
* chore(version): 1.1.8

* Update OAuthButton.tsx

---------

Co-authored-by: kangfenmao <kangfenmao@qq.com>
2025-03-19 20:06:31 +08:00
Roland
8848fcf289 chore: upgrade eslint version to 9.x (#3608)
* chore(eslint): upgrade eslint version to 9.x

* style: enhance ESLint configuration for compatibility with ESLint 8.x
2025-03-19 20:04:33 +08:00
自由的世界人
df6c5d4b02 Update AddMcpServerPopup.tsx (#3604) 2025-03-19 19:17:41 +08:00
Asurada
4c1b3a6331 fix: update API URL for together provider (#3605) 2025-03-19 18:37:33 +08:00
one
3c1a3ffca5 fix: race condition in new context event 2025-03-19 17:57:52 +08:00
kangfenmao
a040af0117 chore(version): 1.1.8 2025-03-19 17:50:46 +08:00
yuna0x0
cd471969a1 fix(mcp-tools): Enhance object nested properties filtering (#3485)
- Improve filterPropertieAttributes to handle nested object and array types, preserving their structure while filtering attributes.

- Make parameters optional when no properties exist. (Fix #3270)
2025-03-19 17:16:37 +08:00
kangfenmao
8d53a0df33 chore: update electron-builder configuration for GitHub publishing
- Changed the publish provider from generic to GitHub, specifying the repository and owner for streamlined deployment.
2025-03-19 17:14:27 +08:00
kangfenmao
b7ee2a327d feat: add search enhance mode switch 2025-03-19 17:00:27 +08:00
Asurada
f0b0bd8959 fix: ensure active assistant is updated correctly on deletion (#3588)
- Modified the assistant deletion logic to check if the deleted assistant is the currently active one before updating the active assistant state. This prevents potential issues when the active assistant is removed.
2025-03-19 16:29:56 +08:00
kangfenmao
202894ab20 fix: reorder mac transparent window check in useNavBackgroundColor hook
- Moved the check for macTransparentWindow to ensure it is evaluated after minappShow, maintaining the intended logic for background color selection.
2025-03-19 16:10:48 +08:00
kangfenmao
806664646d feat: add custom provider settings popup 2025-03-19 16:10:48 +08:00
ousugo
8b558d0266 refactor: simplify new topic shortcut logic in Inputbar
- Removed loading check in the new topic shortcut to streamline the process of adding a new topic and focusing the textarea.
2025-03-19 16:03:47 +08:00
kangfenmao
75f07f4b1c feat: add advanced settings localization and improve existing translations
- Added "advanced_settings" key to English, Japanese, Russian, Chinese, and Traditional Chinese localization files for better user experience.
- Corrected translations for "chunk_size" and "chunk_overlap" in Chinese and Traditional Chinese localization files to enhance clarity.
2025-03-19 15:42:00 +08:00
kangfenmao
4ad1290379 fix: improve file content extraction logic in OpenAIProvider
- Updated the file content extraction method to check for non-empty file arrays, enhancing the handling of messages with files.
- Replaced the previous check for `message.files` with a more robust check using `isEmpty` from lodash to ensure proper validation.
2025-03-19 15:04:43 +08:00
kangfenmao
71c6a510dc chore: update configuration files for optimization and exclusion
- Added 'chunk-4X6ZJEXY.js' to the optimizeDeps exclusion list in electron.vite.config.ts to improve build performance.
- Updated .vscode/settings.json to exclude '.yarn/releases/**' from search results for better project organization.
2025-03-19 15:04:43 +08:00
kangfenmao
d6d3f9657f style: add margin to alerts in Github Copilot settings
- Updated the styling of alert components in the Github Copilot settings to include top and bottom margins for improved spacing and visual clarity.
2025-03-19 13:52:55 +08:00
kangfenmao
58bde32dc0 chore: update LLM providers and migration logic
- Incremented the version of the persisted reducer from 80 to 81.
- Introduced a new constant `INITIAL_PROVIDERS` to define the initial state of LLM providers.
- Refactored migration functions to utilize `INITIAL_PROVIDERS` for adding providers to the state, improving maintainability and readability.
- Updated migration logic to ensure new providers are added correctly during state migrations.
2025-03-19 13:48:41 +08:00
Chen Tao
4adc12cfb4 feat: support Github Copilot (#2432)
* feat: support Github Copilot

* feat: finish i18n translate

* fix: add safeStorage

* clean code

* chore: remove vision model

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

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

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

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

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

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

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

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

* fix: finish_reason undefined

* fix migrate

* feat: add rate limit and warning

* feat: add delete copilot token file

feat: add login message

feat: add default headers and change getCopilotToken algorithm

* fix

* feat: add rate limit

* chore: change apihost

* fix: remove duplicate apikey

* fix: change api host

* chore: add vertify first tooltip

---------

Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
Co-authored-by: LiuVaayne <10231735+vaayne@users.noreply.github.com>
2025-03-19 13:24:50 +08:00
Zhengfei Li
f581cdb5e0 opt: optimise local dev with fixed yarn (#3456) 2025-03-19 13:18:11 +08:00
d5v
f52e16f62e feat: image attachment copy and download (#3488) 2025-03-19 13:16:01 +08:00
yuna0x0
9b481e6f57 fix(GeminiProvider): filterEmptyMessages in Gemini provider 2025-03-19 13:14:29 +08:00
fullex
3adf8e6e7f fix: too many listeners 2025-03-19 13:10:53 +08:00
SuYao
0600de4285 feat: Support search info with search summary model (#2443)
* feat: Add search summary model and related functionality

- Introduce new search summary model configuration in settings
- Implement search summary prompt and model selection
- Add support for generating search keywords across providers
- Update localization files with new search summary model translations
- Enhance web search functionality with search summary generation

* refactor: Improve web search error handling and async flow

* fix: Update migration version for settings search summary prompt

* refactor(webSearch): Remove search summary model references from settings and localization files

- Deleted search summary model entries from English, Japanese, Russian, Chinese, and Traditional Chinese localization files.
- Refactored ModelSettings component to remove search summary model handling.
- Updated related services and settings to eliminate search summary model dependencies.

* refactor(llm): Remove search summary model from state and related hooks
2025-03-19 13:09:47 +08:00
shiquda
44b8873c38 feat: enable automatic conversion of math code to $$ during export 2025-03-19 13:08:13 +08:00
PilgrimLyieu
228641737c feat(PlantUML): Add zoom and copy functionality to PlantUML image component 2025-03-19 13:07:30 +08:00
schnee
86306f6fc3 docs: update the contributor guide link in readme 2025-03-19 12:47:23 +08:00
Chen Tao
69e93a0e0c fix: knowledgebase rerank undefined (#3561)
* fix: knowledgebase rerank undefined

* chore
2025-03-19 11:22:35 +08:00
Hao He
fa4b243f16 Fix/knowledge-file-ext-case (#3545) 2025-03-18 23:10:16 +08:00
eeee0717
fb319b792e chore: fetch rerank model and fix placeholder 2025-03-18 21:47:06 +08:00
eeee0717
0ba95353df feat(knowledge base): enhance knowledge base with rerank model 2025-03-18 21:47:06 +08:00
kangfenmao
52c3742f78 chore(version): 1.1.7 2025-03-18 20:29:20 +08:00
George·Dong
9c3e5ecb4d fix(NewContextButton): Incorrect relation to showInputEstimatedTokens setting 2025-03-18 20:14:43 +08:00
kangfenmao
5e3021648b refactor: implement useNavBackgroundColor hook for dynamic navbar background
- Replaced direct background color logic in Navbar and Sidebar components with useNavBackgroundColor hook for improved maintainability.
- Updated navbar background color variable in index.scss for consistency across components.
- Enhanced handling of background color based on window style and application state.
2025-03-18 19:53:11 +08:00
deadmau5v
fa7d3c540a feat(quick-assistant): Add setting - Auto-paste to Quick Assistant (#3484)
* feat(quick-assistant): Add setting - Auto-paste to Quick Assistant

* refactor(quick-assistant): Rename `auto_paste_to_quick_assistant` to `read_clipboard_at_startup`

- Rename the "auto_paste_to_quick_assistant" feature to "read_clipboard_at_startup"
2025-03-18 19:51:54 +08:00
fullex
142b64a198 fix: [ #3221 ] should not enable shortcut of quickAssistant when it's not available (#3228) 2025-03-18 18:06:08 +08:00
Chris Wan
469fb80eaf feat: add hunyuan to function calling models 2025-03-18 18:03:07 +08:00
kangfenmao
d241e48ee7 chore: update LICENSE agreement with clearer commercial use terms
- Revised commercial licensing section to specify conditions requiring written authorization for modifications, enterprise services, hardware bundling, large-scale procurement, and public cloud services.
- Enhanced clarity in contributor agreement terms regarding license adjustments and commercial usage of contributed code.
- Updated language for better understanding and compliance with Apache License 2.0.
2025-03-18 18:01:29 +08:00
kangfenmao
2cc2594886 fix: correct apiKey URL in provider configuration 2025-03-18 18:00:52 +08:00
ousugo
a2d967a055 refactor: add isNameManuallyEdited flag to topic management
- Introduced isNameManuallyEdited property to the Topic type for better tracking of manual edits.
- Updated topic update logic to set isNameManuallyEdited based on user actions in the TopicsTab.
- Enhanced autoRenameTopic function to respect manual edits and prevent automatic renaming when applicable.
2025-03-18 17:55:46 +08:00
Pleasurecruise
5522564dfb fix: update url 2025-03-18 17:38:53 +08:00
Konjac-XZ
13ef3f16aa fix: trim() in Translation may result in malformed Markdown output for certain models. 2025-03-18 17:33:32 +08:00
shiquda
95b4c51f93 feat: add support for citation preview (#3354)
* feat: add support for citation preview

#3217

* feat(MessageContent): Add HTML entity encoding to enhance the security of quoted data

* fix(MessageContent): recognize citation format like `[[1]]`
2025-03-18 16:48:07 +08:00
kangfenmao
a8833a4425 feat(i18n): add support for pasted text and images in message attachments across multiple languages
- Introduced new translations for "Pasted Text" and "Pasted Image" in English, Japanese, Russian, Simplified Chinese, and Traditional Chinese.
- Updated FileManager to format file names based on their type, enhancing user experience when handling pasted content.
2025-03-18 16:34:13 +08:00
kangfenmao
bc6aa43582 style: Add .selectable class to Container for improved text selection handling 2025-03-18 15:36:01 +08:00
MyPrototypeWhat
fc3860ffd1 style: Disable text selection globally with selective text input exceptions 2025-03-18 15:04:30 +08:00
PilgrimLyieu
48ce0dc1f3 fix(mermaid): Mermaid theme not change after theme toggling 2025-03-18 14:38:50 +08:00
kangfenmao
ee94a658be fix: mini window send message 2025-03-18 14:37:59 +08:00
happyZYM
ff6ddb5d43 fix: fix uv and bun install on linux (#3514) 2025-03-18 13:58:20 +08:00
kangfenmao
912e1fab05 refactor: enhance theme handling and style adjustments in MinApp and Navbar components
- Added theme context usage in MinApp for dynamic background styling based on the current theme.
- Updated Navbar component by removing the AssistantSettingsPopup and associated TitleText for a cleaner interface.
- Adjusted border radius in MessageHeader for a more consistent design across components.
2025-03-18 13:41:16 +08:00
kangfenmao
99c48da344 refactor: update styles and theme handling in Sidebar and MessageHeader components
- Removed box-shadow from container styles for a cleaner look.
- Adjusted color variables for better contrast and consistency across themes.
- Enhanced Sidebar component to utilize theme context for icon styling.
- Modified MessageHeader to change font size and apply a specific font family for better readability.
2025-03-18 13:11:40 +08:00
d5v
513ba6cd18 fix: MCP switch button display bug (#3481) 2025-03-18 12:06:07 +08:00
Vaayne
63226fcf44 refactor: update tool content handling for GPT and Dashscope models in OpenAIProvider 2025-03-18 10:53:25 +08:00
Vaayne
aa3a008ce7 refactor: handle tool content differently for doubao and deepseek models in OpenAIProvider 2025-03-18 10:53:25 +08:00
kangfenmao
00c4bb0dcd chore(version): 1.1.5 2025-03-17 18:12:30 +08:00
kangfenmao
0c3e623819 refactor: improve proxy configuration handling in IPC 2025-03-17 18:00:42 +08:00
kangfenmao
53b5efe140 lint: fix eslint 2025-03-17 17:56:26 +08:00
kangfenmao
0725b8343e refactor: enhance MCPService error handling and improve loading state in MCPSettings
- Updated MCPService to use a dedicated method for setting server active status upon activation errors, improving code clarity.
- Added loading state management in MCPSettings to provide user feedback during server activation toggles, enhancing the user experience.
2025-03-17 17:46:51 +08:00
kangfenmao
33ec827c5f refactor: improve installation scripts for bun and uv with success logging
- Updated the installation scripts for bun and uv to log success messages upon successful completion.
- Enhanced error handling to maintain existing functionality while providing clearer feedback during installation.
2025-03-17 17:38:37 +08:00
kangfenmao
210a55f515 refactor: simplify bun and uv installation scripts for improved clarity and functionality
- Removed the getLatestBunVersion and getLatestUvVersion functions to streamline version handling.
- Updated download functions to use temporary filenames and ensure proper cleanup of downloaded files.
- Enhanced directory management by ensuring the output directory is correctly referenced and cleaned up if empty.
- Refactored the install functions to directly use detected platform and architecture, improving readability and maintainability.
2025-03-17 17:25:56 +08:00
kangfenmao
462fcf6e82 refactor: update AttachmentButton styling and integrate into Inputbar
- Adjusted the font size of the PaperClipOutlined icon in the AttachmentButton for better visibility.
- Integrated the AttachmentButton into the Inputbar component, replacing the TranslateButton in one instance for improved functionality.
2025-03-17 15:40:41 +08:00
kangfenmao
67b9abbd5e refactor: update file type handling and sorting in FilesPage component
- Changed the default file type state to 'document' for better initial filtering.
- Introduced a temporary file sorting function to prioritize non-temporary files in the displayed list.
- Adjusted the file retrieval logic to apply sorting consistently for both 'all' and specific file types.
2025-03-17 15:24:26 +08:00
kangfenmao
481236b9a9 feat: add provider alayanew 2025-03-17 15:08:48 +08:00
Vaayne
cc64e4dbe2 feat: enhance OpenAIProvider to handle diverse content types in tool responses 2025-03-17 14:40:56 +08:00
kangfenmao
1421a38b0d refactor: streamline argument handling in MCPService activation method
- Updated the MCPService's activate method to handle server arguments more efficiently by using a fallback to an empty array if no arguments are provided.
- This change improves the clarity and robustness of the argument management within the service.
2025-03-17 14:02:13 +08:00
kangfenmao
cf7e1fb162 refactor: update MCPService and process utilities for improved binary management
- Refactored MCPService to streamline command handling for 'npx' and 'uvx', removing unnecessary installation checks and directly retrieving binary paths.
- Updated getBinaryPath and isBinaryExists functions to be asynchronous, enhancing their reliability in checking binary existence and paths.
- Cleaned up imports and removed unused dependencies for better code clarity.
2025-03-17 13:47:33 +08:00
kangfenmao
1223b2689d refactor: reorganize DisplaySettings component for improved layout
- Moved the assistant icon settings to a new position within the DisplaySettings component for better user experience.
- Cleaned up the code by removing redundant sections and ensuring consistent structure in the settings layout.
2025-03-17 13:11:38 +08:00
kangfenmao
58a000558d refactor: replace console.debug with console.log for improved logging consistency
- Updated various components and services to replace console.debug statements with console.log for better visibility in logs.
- This change enhances the logging approach across the application, ensuring that important messages are consistently logged.
2025-03-17 13:10:11 +08:00
kangfenmao
f5e4e7884c feat: enhance MCPSettings with server table and clean up NpxSearch component
- Added a debug log for MCP servers in MCPSettings.
- Refactored the MCPSettings component to streamline the server table rendering.
- Removed unnecessary styles from the NpxSearch component for cleaner layout.
2025-03-17 13:07:05 +08:00
kangfenmao
7078509c82 feat: update package.json dependencies and enhance webview handling
- Removed the outdated @electron-toolkit/preload dependency and re-added it with the correct version.
- Added a new event listener in WindowService to set the preload script for webviews.
- Updated the openExternal method in preload to handle potential null values.
- Enabled node integration for webviews in the MinApp component for improved functionality.
2025-03-17 12:55:34 +08:00
kangfenmao
f17d8e73c5 feat: update iconfont and enhance DataSettings with new Obsidian icon
- Updated iconfont CSS to include a new icon for Obsidian.
- Replaced the Obsidian image with the new icon in DataSettings for improved consistency.
- Adjusted layout styles in ListItem to center icons properly.
2025-03-17 12:55:34 +08:00
LiuVaayne
ba602892e5 feat: update npm scope default value and enhance error handling in MCP tool calls (#3440) 2025-03-17 12:45:35 +08:00
africa1207
1072352e18 feat: 增加导出到obsidian功能,可选择导出路径 (#3373)
* feat: 增加导出到obsidian功能,可选择导出路径

* feat: 增加将内容导出到已有md文件

* fix: 修复日文翻译
2025-03-17 12:08:50 +08:00
kangfenmao
26b3285a4d feat: update localization strings and add EditMcpJsonPopup component
- Replaced "JSON Schema" and "Normal mode" with "Edit JSON" in localization files for English, Japanese, Russian, Simplified Chinese, and Traditional Chinese.
- Introduced a new EditMcpJsonPopup component for editing MCP server configurations in JSON format, enhancing user experience and modularity in MCPSettings.
2025-03-17 12:04:29 +08:00
kangfenmao
5a9191af4d feat: add tar package and refactor binary installation scripts
- Added the `tar` package to handle extraction of `.tar.gz` files in the `install-uv.js` script.
- Implemented a new `downloadWithRedirects` function in both `install-bun.js` and `install-uv.js` for improved file downloading with redirect handling.
- Refactored the extraction process in both scripts to utilize Node.js file system methods and the `adm-zip` package for better file management and cleanup.
2025-03-17 11:20:49 +08:00
kangfenmao
667e4426a5 feat: refactor IPC handlers for binary management and update localization strings
commit 97d251569690462763810270ad850ad6b0057ac9
Author: kangfenmao <kangfenmao@qq.com>
Date:   Mon Mar 17 10:24:43 2025 +0800

    feat: refactor IPC handlers for binary management and update localization strings

    - Simplified IPC handlers for checking binary existence and retrieving binary paths by removing unnecessary await statements.
    - Updated localization strings in English, Japanese, Russian, Simplified Chinese, and Traditional Chinese to change "Install Dependencies" to "Install".
    - Removed the MCPSettings component, replacing it with a new InstallNpxUv component for better management of binary installations.

commit d0f6039c7659a0f4cc97555434999c731ea07f9f
Author: Vaayne <liu.vaayne@gmail.com>
Date:   Sun Mar 16 23:52:18 2025 +0800

    feat: enhance showAddModal to pre-fill form with server details

commit dde8253dc8bdffb482b9af19a07bc89886a19d3a
Author: Vaayne <liu.vaayne@gmail.com>
Date:   Sun Mar 16 23:27:17 2025 +0800

    feat: add binary management APIs and enhance MCP service for dependency installation

commit d8fda4b7b0e238097f1811850517bd56fe0de0df
Author: Vaayne <liu.vaayne@gmail.com>
Date:   Sun Mar 16 21:57:34 2025 +0800

    fix: improve error logging in MCPService and streamline tool call response handling in OpenAIProvider

commit e7af2085a66989d9be546701e4f5308e1008cb18
Author: Vaayne <liu.vaayne@gmail.com>
Date:   Sun Mar 16 15:14:32 2025 +0800

    fix: lint

commit 2ef7d16298a1270df26974158140015b8cbd91bc
Author: Vaayne <liu.vaayne@gmail.com>
Date:   Sat Mar 15 21:11:26 2025 +0800

    feat: implement uv binary installation script and integrate with MCP service

commit d318b4e5fc8b506e6d4b08490a9e7ceffe9add80
Author: Vaayne <liu.vaayne@gmail.com>
Date:   Sat Mar 15 20:28:58 2025 +0800

    feat: add uv binary installation script and enhance MCP service command handling
2025-03-17 10:25:48 +08:00
Chen Tao
1f9acd4e48 feat(mcp): add json import 2025-03-17 08:40:38 +08:00
kangfenmao
167ad2b6f3 feat: enhance AddAssistantPopup with loading state management 2025-03-17 00:12:46 +08:00
kangfenmao
4aa04158de feat: refactor MCPSettings and add new components for server management
- Introduced a new AddMcpServerPopup component for adding and editing MCP servers, improving modularity and reusability.
- Created NpxSearch component to handle npm package searches, integrating with the existing MCPSettings for enhanced functionality.
- Updated MCPSettings to utilize the new components, streamlining the server management interface.
- Added localization support for new UI elements in multiple languages, enhancing user experience.
2025-03-16 23:47:02 +08:00
MyPrototypeWhat
ffe4912e2d feat: mcp npx list (#3409)
* feat: add npm scope search functionality in MCPSettings

- Integrated npx-scope-finder to enable searching for npm packages by scope.
- Added UI elements for inputting npm scope and displaying search results in a table format.
- Enhanced user feedback with loading indicators and messages for search results.

* feat: add key property to package formatting in MCPSettings

- Added a key property to the package formatting logic to ensure unique identification of each package in the results.

* feat: enhance MCPSettings with NPX package list localization

- Added localization support for NPX package list in English, Japanese, Russian, Simplified Chinese, and Traditional Chinese.
- Updated UI elements in MCPSettings to utilize localized strings for package list features, including title, description, and various labels.
- Improved user experience by integrating translations for package-related actions and placeholders.
2025-03-16 23:09:40 +08:00
kangfenmao
afd7f92486 feat: add server restart functionality to MCPService
- Implemented a new method to restart MCP servers, enhancing server management capabilities.
- Updated the existing server activation logic to include a restart option when necessary.
- Ensured that server state is properly managed during the restart process.
2025-03-16 21:58:36 +08:00
kangfenmao
14bcb71358 feat: add active MCP servers filtering to useMCPServers hook and update MCPToolsButton
- Introduced activedMcpServers to filter and expose only active MCP servers in the useMCPServers hook.
- Updated MCPToolsButton to utilize activedMcpServers, rendering null if no active servers are present.
2025-03-16 21:34:29 +08:00
kangfenmao
59d931cc16 refactor: improve logging messages in MCPService and clean up useMCPServers hook
- Updated logging messages in MCPService for clarity and consistency.
- Removed unused dispatch and initial server loading logic from useMCPServers hook to streamline the code.
2025-03-16 21:29:58 +08:00
kangfenmao
2e65be93c6 feat: integrate MCP server initialization into app initialization process
- Added useInitMCPServers hook to manage MCP server state and communication with the main process.
- Updated useAppInit to include useInitMCPServers for improved server management during app initialization.
2025-03-16 21:05:24 +08:00
Asurada
62dd2ecbad feat: Enhanced the experience of the model selection popup (#3407)
* feat: enhance SelectModelPopup with menu item refs and layout effect

- Added useLayoutEffect to manage scrolling behavior for keyboard navigation.
- Introduced a mechanism to assign refs to menu items for improved accessibility.
- Refactored menu item processing to support recursive rendering with refs.

* feat: update SelectModelPopup to filter out pinned models when not in search mode

- Added logic to filter out pinned models when the popup is not in search state.
- Updated dependencies in useMemo to include pinnedModels for accurate filtering.

* refactor: update SelectModelPopup to clarify model selection logic

* refactor: enhance scrolling behavior in SelectModelPopup for keyboard navigation

- Added logic to scroll to the top of the container if the first model is selected.
- Updated dependencies in useLayoutEffect to include getVisibleModelItems for accurate scrolling behavior.

* refactor: improve scrolling logic in SelectModelPopup for better keyboard navigation

- Enhanced the scrolling behavior to account for group titles when navigating with the keyboard.
- Removed dependency on getVisibleModelItems in useLayoutEffect for a more streamlined effect.
2025-03-16 20:19:03 +08:00
George·Dong
762753fb7e chore(workflows): nightly build refactor (#3426)
* chore(workflows): Improve nightly build workflow

* chore(workflows): Improve nightly build workflow

* chore(workflows): Improve nightly build workflow for Windows build

* chore(workflows): Add checksum for nightly build summary

* chore(workflows): fix checksum calc

* chore(workflows): Modify summary title

* chore(workflows): Fix macOS build rename

* chore(workflows): Fix checksum output redirection in nightly build

* chroe(workflows): Add nightly build compress to save storage spending
2025-03-16 20:03:57 +08:00
suyao
386ea1e7da fix: correct proxy URL parsing in ProxyManager 2025-03-16 10:27:28 +08:00
shiquda
190eea5a80 feat: add copy function for mermaid diagram 2025-03-15 19:39:50 +08:00
eeee0717
d0f3c56504 fix: websearch multiple apikeys bug 2025-03-15 19:38:44 +08:00
kangfenmao
3ba33516f4 chore(version): 1.1.4 2025-03-15 19:18:03 +08:00
kangfenmao
ece72c7536 feat: emit send message event in Inputbar and clean up messages slice
- Added event emission for sending messages in the Inputbar component to enhance message handling.
- Removed redundant event emission from the messages slice to streamline the sendMessage function.
2025-03-15 18:47:02 +08:00
kangfenmao
ddb0025a86 refactor: clean up MessageMenubar and enhance message handling
- Removed unused lodash dependency and optimized message resend logic in MessageMenubar.
- Streamlined Popconfirm component for message deletion.
- Updated NewTopicButton styling for improved layout.
- Enhanced messages slice to ensure better state management and error handling.
2025-03-15 18:39:51 +08:00
kangfenmao
5374106d7e refactor: optimize Inputbar debounce logic and enhance NewTopicButton styling
- Simplified the debounce implementation in the Inputbar component by removing an unnecessary wrapper.
- Updated the NewTopicButton to utilize theme context for dynamic styling based on the current theme.
2025-03-15 16:30:51 +08:00
kangfenmao
b9f97a0de8 feat: add new topic button and update translations
- Introduced a NewTopicButton component to facilitate adding new topics.
- Updated translations for new topic functionality in English, Japanese, Russian, Simplified Chinese, and Traditional Chinese.
- Adjusted font size in TranslateButton for better UI consistency.
- Removed unused new topic shortcut from Inputbar component.
2025-03-15 16:12:02 +08:00
kangfenmao
43d63c7649 refactor: remove unused dependency from useEffect in Messages component 2025-03-15 15:21:33 +08:00
kangfenmao
40eb4e3ac7 refactor: streamline message editing and enhance error handling
- Removed unnecessary database update in useMessageOperations during message editing.
- Improved user feedback for missing original user messages by integrating localized error messages in multiple languages.
- Simplified event listener for message sending in Messages component.
- Enhanced message resend logic in messages slice to ensure proper error handling and state updates.
2025-03-15 15:11:41 +08:00
kangfenmao
a64a6f6b08 fix: lint warning 2025-03-15 15:11:41 +08:00
Vaayne
ae98b5d3d9 feat: send initial servers state to main process on MCP servers change 2025-03-15 13:50:56 +08:00
George·Dong
9bd82a4e32 chore(pre-commit): add pre-commit hook to enforce code style (#3351)
* chore(pre-commit): add pre-commit hook to enforce code style
- Added husky for managing Git hooks and lint-staged for pre-commit checks.
- Updated prettier version to 3.5.3.
- Configured lint-staged to format and lint JavaScript and JSON files before commits.

* chore(workflows): add lint check to CI

* fix: version not correct

* chore(workflow): bump GitHub Actions dependencies to latest versions
- @actions/setup-node: v3 -> v4
- @actions/cache: v3 -> v4
- @actions/upload-artifact: v3 -> v4

---------

Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2025-03-15 11:09:11 +08:00
shiquda
abb65b5338 feat: some improvement to Notion export feature (#2562)
* fix: use exportTopicToNotion instead of exportMarkdownToNotion when exporting topics

* refactor: improve Notion topic export to handle multi-page topics

* feat: integrate @tryfabric/martian for Markdown to Notion block conversion

* feat: add progress message for notion exporting
2025-03-15 11:06:41 +08:00
Chizard
e18635a315 fix api url display
Fix API URL length causing display style issues
2025-03-15 11:01:37 +08:00
duanyongcheng
78100d2ce3 feat: 🎸 在顶部的模型搜索框显示固定模型的供应商 2025-03-15 00:24:16 +08:00
kangfenmao
6aa6f0efcf feat: Enhance message clearing functionality in useMessageOperations
- Updated clearTopicMessagesAction to utilize TopicManager for clearing messages.
- Improved handling of topic IDs to ensure correct message clearing based on provided or default topic ID.
2025-03-14 18:00:41 +08:00
MyPrototypeWhat
3b42c8fe9a fix: messages pause bug (#3343)
* refactor: Simplify message resend logic and enhance abort controller handling

- Updated MessageMenubar to streamline message resend functionality.
- Improved abort controller management in BaseProvider and related services.
- Adjusted sendMessage to handle both single and multiple assistant messages.
- Enhanced logging for better debugging and tracking of message flow.

* feat: Enhance message handling and queue management

- Updated Inputbar to include mentions in dispatched messages.
- Introduced appendMessage action to manage message insertion at specific positions in the state.
- Improved sendMessage logic to handle mentions and maintain message order.
- Refactored getTopicQueue to accept options for better queue configuration.

* refactor: Improve abort handling and message operations

- Refactored useMessageOperations to streamline message pausing logic.
- Enhanced abort controller in BaseProvider to handle abort events more effectively.
- Updated OpenAIProvider to utilize new abort handling mechanism.
- Adjusted fetchChatCompletion to set message status based on abort conditions.
- Improved message dispatching in sendMessage for better queue management.

* refactor: Enhance signal promise handling in BaseProvider and OpenAIProvider

- Updated signal handling in BaseProvider to use a structured signalPromise object for better clarity and management.
- Adjusted error handling in OpenAIProvider to correctly catch and throw errors from the signalPromise.
- Improved overall abort handling logic to ensure robust message operations.

* fix:lint
2025-03-14 17:57:33 +08:00
Xunjin ZHENG
704dbc601f feat: Enhance API key verification and multi-key support for web search providers (#3346)
* feat(websearch): implement API key formatting and add WebSearchApiCheckPopup for multiple keys validation

- Introduced a new WebSearchApiCheckPopup component to validate multiple API keys.
- Added formatApiKeys function to standardize API key input.
- Updated WebSearchProviderSetting to utilize the new popup for checking multiple keys.
- Enhanced error handling and user feedback for API key validation.

* feat(settings): enhance API key validation for providers and web search

- Updated ApiCheckPopup to handle both provider and web search API key validation.
- Refactored key checking logic to differentiate between provider and web search types.
- Removed the obsolete WebSearchApiCheckPopup component and integrated its functionality into ApiCheckPopup.
- Adjusted WebSearchProviderSetting to utilize the updated ApiCheckPopup for checking multiple keys.
2025-03-14 17:41:38 +08:00
kangfenmao
4f3bccda59 docs: Update README and add development documentation
- Reformatted sections in README.md for better readability.
- Added new development documentation in docs/dev.md to guide setup and installation processes.
- Updated Japanese and Chinese README translations to reference the new development documentation.
2025-03-14 16:51:43 +08:00
kangfenmao
e55fe10a14 chore(workflows): Update Yarn version to 4.6.0 in CI and release workflows 2025-03-14 16:49:43 +08:00
George·Dong
492dbf8c43 refactor(actions): Add nightly and pr-ci workflows 2025-03-14 16:34:23 +08:00
eeee0717
98eff26d76 fix(websearch): add apihost check button and format apihost end without '/' 2025-03-14 14:51:25 +08:00
kangfenmao
402e6eef75 chore(version): 1.1.3 2025-03-14 14:19:03 +08:00
kangfenmao
a57da2b6c8 chore: Update package.json scripts for improved build and testing workflow
- Reorganized scripts to include a new build check that runs tests, type checks, and i18n checks before publishing.
- Restored and structured type checking and linting scripts for better clarity and usability.
- Ensured post-installation dependencies are correctly handled.
2025-03-14 14:18:38 +08:00
kangfenmao
30e831b9c8 refactor: Update message handling and improve Inputbar functionality
- Modified Inputbar to include a new resizeTextArea function for better text area management.
- Adjusted MessageGroup and MessageStream components to remove unnecessary props and streamline message handling.
- Enhanced message dispatching logic in the messages store for improved state management.
- Cleaned up unused imports and code in Message components to enhance readability and maintainability.
2025-03-14 13:41:17 +08:00
Hao He
5861068086 refactor: optimize file loader with switch-case structure
* Enhance update error logging and fix duplicate type import

- Improve error logging in AppUpdater with more detailed error information and timestamps
- Remove duplicate MCPServer type import in Inputbar component

* refactor: optimize file loader with switch-case structure
2025-03-14 13:30:21 +08:00
ousugo
31d60c856d feat(Inputbar): Add file type validation message for unsupported files
- Implemented a message notification for users when attempting to upload unsupported file types in the Inputbar component.
2025-03-14 13:20:19 +08:00
alexcodelf
560794ebb1 feat: add model Provider GPUStack 2025-03-14 13:04:03 +08:00
kangfenmao
6be8144e2d feat(i18n): Add baseUrlTooltip to multiple language files for improved user guidance 2025-03-14 12:35:56 +08:00
SuYao
ee47536565 feat(MCP): Support GLM-4-alltools (#3304)
- Added Gemma3 as a vision model.
- Improved functioncall model check logic.
- Introduced a new method to clean tool call arguments, ensuring proper formatting and extraction of parameters.
- Adjusted tool call handling in OpenAIProvider to accommodate new GLM-4-alltools model checks and argument processing.
2025-03-14 12:30:26 +08:00
Vaayne
19e2fa7c7e feat(prompts): Translate prompts to English and enhance clarity 2025-03-14 11:48:56 +08:00
ousugo
0ff8f9dd5e refactor(GeminiProvider): Enhance message handling for Gemma models 2025-03-14 11:47:03 +08:00
ousugo
2a235a2408 feat(GeminiProvider): Add isGemmaModel function and update model handling
Introduce isGemmaModel function to identify Gemma models and adjust system instruction handling in GeminiProvider based on model type. Ensure proper message formatting for Gemma models during chat initialization.
2025-03-14 11:47:03 +08:00
eeee0717
db5b611259 fix: exa return empty content 2025-03-14 11:46:32 +08:00
kangfenmao
e4b5b9ef01 feat(Inputbar): Introduce NewContextButton and refactor context handling
- Added NewContextButton component to manage new context creation with a dedicated button.
- Refactored Inputbar to utilize the new NewContextButton, improving code organization.
- Removed deprecated context shortcut handling from Inputbar.
- Enhanced MCPToolsButton visibility logic based on model type.
2025-03-14 10:54:36 +08:00
kangfenmao
c70409a7aa refactor: Update completions method signatures and enhance documentation
- Reordered parameters in completions methods across AiProvider, AnthropicProvider, GeminiProvider, and OpenAIProvider to improve consistency.
- Added detailed JSDoc comments for methods to clarify parameter usage and functionality.
- Ensured mcpTools parameter is consistently included in completions method signatures.
2025-03-14 10:44:03 +08:00
kangfenmao
d7843b23b4 feat(OpenAIProvider): Add file content extraction and enhance message handling
- Implemented a method to extract file content from messages, supporting text and document types.
- Updated message parameter handling to include file content when the model does not support files.
- Added detailed JSDoc comments for new methods and existing functionalities for better documentation.
2025-03-14 10:29:59 +08:00
Vaayne
7f7aace56e fix: enhance MCPToolResponse structure and improve argument parsing in tool calls 2025-03-14 09:36:02 +08:00
Yrom Wang
7aebd27ebf fix: tool call handling in OpenAIProvider (#2953) 2025-03-13 22:28:59 +08:00
Chris Wan
3b3ce88e49 fix(OpenAIProvider): Enhanced function arguments fault tolerance (#3267) 2025-03-13 21:40:02 +08:00
SuYao
d74e585f1f fix(models): Update function_call provider check to exclude embedding models (#3281) 2025-03-13 21:35:21 +08:00
George·Dong
da835570f9 feat(AddAgentPopup, AssistantPromptSettings): Add token count display for prompts
- Implement token counting functionality in both AddAgentPopup and AssistantPromptSettings components.
- Display the token count dynamically as the user types in the prompt text area.
- Refactor text area components to include a styled token count indicator.
2025-03-13 21:25:58 +08:00
Hao He
96cd207b1b Fix/fs-rmdir-deprecation (#3296) 2025-03-13 20:45:45 +08:00
Xat
65d7e24aef fix(settings): Change padding to margin in SettingHelpLink styling 2025-03-13 18:29:03 +08:00
George·Dong
2dcf1cf584 fix(BaseProvider, KnowledgeService): Enhance getMessageContent() & getKnowledgeBaseReferences()
- handle empty message content
2025-03-13 18:20:41 +08:00
beyondkmp
e465904a9c patch epub: replace zipfile with zipread 2025-03-13 18:01:39 +08:00
ousugo
c70832b255 fix(TopicsTab): Ensure active topic is updated correctly on deletion
- Added a check to update the active topic only if the deleted topic is currently active, preventing potential errors in topic navigation.
2025-03-13 17:58:07 +08:00
Carter Cheng
6d0c133550 fix(ui): improve chat navigation buttons UX and fix scroll interference
This commit enhances the chat navigation buttons with a more intelligent
visibility system that prevents interference with scrolling while maintaining
easy access to navigation controls.

Key improvements:
- Replace static trigger area with dynamic cursor position tracking to allow
  unobstructed scrolling
- Show navigation buttons only when cursor is near the button area or when
  actively interacting with them
- Add throttled mouse position detection (50ms) for better performance
- Use passive scroll event listeners for smoother scrolling
- Implement smarter auto-hide behavior with 1.5s timeout when cursor leaves
  the button area

This change resolves the issue where navigation buttons would interfere with
scrolling when the cursor was in the detection area, creating a more seamless
user experience.
2025-03-13 17:56:06 +08:00
ousugo
f582b095fc fix(export): Improve error handling and success messaging for markdown export
- Added result check after saving markdown files to ensure success messages are only shown when the save operation is successful.
- Standardized error message keys for consistency.
2025-03-13 17:51:51 +08:00
MyPrototypeWhat
6a2f06ca9d fix(MessageMenubar, useMessageOperations): Enhance loading state handling
- Added loading state checks in MessageMenubar to prevent actions during loading.
- Updated useMessageOperations to await database updates for message operations.
- Improved error handling for message edits and resends to ensure proper state management.
2025-03-13 17:51:17 +08:00
suyao
002abebc12 fix(OpenAIProvider): Add type property to thinking model 2025-03-13 17:32:51 +08:00
MyPrototypeWhat
6ccfef9b7e fix:Resolve bug where clearing context was invalid 2025-03-13 16:35:09 +08:00
MyPrototypeWhat
95aa95040f fix:https://github.com/CherryHQ/cherry-studio/issues/3249
- Removed ContextMenuOverlay component and integrated its styles directly into the Dropdown component for cleaner code.
2025-03-13 14:40:04 +08:00
牡丹凤凰
1a5bc8f5f6 Update README.ja.md 2025-03-13 14:16:41 +08:00
牡丹凤凰
8941c17ea2 Update README.zh.md 2025-03-13 14:16:19 +08:00
牡丹凤凰
0d0cf14fb9 Update README.md 2025-03-13 14:15:51 +08:00
kangfenmao
03ac07d5ea chore(version): 1.1.2 2025-03-13 07:57:34 +08:00
kangfenmao
3448bef638 fix(MCPSettings, OpenAIProvider): Update settings and content handling
- Prevent modal from closing on mask click in MCPSettings
- Ensure tool call response content is properly formatted as a string in OpenAIProvider
2025-03-13 00:43:41 +08:00
ousugo
75788ffd8e refactor(PaintingsList): Reposition new painting button
Move the NewPaintingButton component to be rendered before the DragableList and remove unnecessary margin-top styling
2025-03-13 00:03:14 +08:00
ousugo
c95da64fee feat(PaintingsStore): Modify painting addition order
Change addPainting method to use unshift instead of push, ensuring new paintings are added to the beginning of the list
2025-03-13 00:03:14 +08:00
Chris Wan
2cf842bc4f fix(MCPSettings): MCP server environment variables parsing error
If there is one or more equal (=) sign in value part, all would be lost
2025-03-13 00:02:04 +08:00
suyao
316f28488f refactor(Proxy): Improve system proxy monitoring and configuration handling 2025-03-13 00:01:17 +08:00
suyao
1bc0d32fa3 refactor(Proxy): Update proxy configuration handling 2025-03-13 00:01:17 +08:00
kangfenmao
f7edb5442d fix(package): update @modelcontextprotocol/sdk to use a patch for platform-specific shell handling 2025-03-12 23:59:18 +08:00
kangfenmao
a78f313a5a chore(version): 1.1.1 2025-03-12 20:31:41 +08:00
MyPrototypeWhat
61233fb524 fix: abortError handle 2025-03-12 20:19:48 +08:00
kangfenmao
bd98787da2 feat(ChatNavigation): Adjust navigation position based on topic settings
This reverts commit a8dd12ffe6.
2025-03-12 19:28:18 +08:00
kangfenmao
42b36e80f3 fix(MessagesService): Refine empty message filtering logic
- Update filterEmptyMessages to consider file presence
- Ensure messages with empty content and no files are filtered out
2025-03-12 19:19:02 +08:00
kangfenmao
5ed2014d72 feat(MCPService, ModelSettings): Enhance path handling and model filtering
- Add enhanced PATH generation for MCP service across different platforms
- Improve model filtering with new function calling model type
- Refactor MCP service type definitions and transport initialization
- Add platform-specific path handling for various development environments
2025-03-12 19:01:30 +08:00
ousugo
a8dd12ffe6 feat(ChatNavigation): Adjust navigation position based on topic settings
- Add dynamic positioning for navigation trigger area and container
- Integrate with useSettings hook to determine navigation position
- Support right-side topic layout by calculating navigation offset
2025-03-12 18:52:02 +08:00
Vaayne
28095b5492 fix(MCPService): Improve server addition and status update error handling; add localized error messages 2025-03-12 18:40:39 +08:00
kangfenmao
73bc990168 chore(version): 1.1.0 2025-03-12 12:04:35 +08:00
kangfenmao
506e82bd05 refactor(MessageOperations): Remove redundant stream messages selector
- Remove unused `selectStreamMessages` selector from store
- Update `pauseMessages` hook to directly access stream messages from store state
- Simplify dependencies in `pauseMessages` callback
2025-03-12 12:00:19 +08:00
kangfenmao
d7b81b4f25 fix(AssistantsStore): Clear messages when updating topics
Modify topic update logic to reset messages array when updating topics or individual topics in the assistants store
2025-03-12 11:55:53 +08:00
kangfenmao
1e423d7f3d fix(MessageGroup): Refine grouped message display condition
Modify isGrouped logic to ensure only assistant messages are considered when determining group status
2025-03-12 11:44:27 +08:00
kangfenmao
c2c3dc9aa6 feat(MessageOperations): Add local database synchronization for message updates 2025-03-12 11:22:00 +08:00
kangfenmao
2f836d9d7a refactor(MessageOperations): Improve stream message pause and selector handling 2025-03-12 11:09:52 +08:00
kangfenmao
1c8523763b feat(UI): Enhance ListItem and DataSettings with icons and styling improvements
- Add titleStyle prop to ListItem for custom text styling
- Reduce gap in ListItem and MenuList components
- Integrate icons for DataSettings menu items
- Add Notion icon to iconfont
- Improve visual hierarchy and spacing in settings navigation
2025-03-12 09:42:24 +08:00
MyPrototypeWhat
f2ee9641c6 fix(MessageOperations): Improve message pause functionality and error handling
- Update pauseMessage method to handle both askId and messageId
- Add loading state reset when pausing messages
- Enhance error handling in providers with abort error detection
- Modify ApiService to handle aborted requests gracefully
- Add comprehensive isAbortError utility function
2025-03-12 09:19:42 +08:00
kangfenmao
7d3941991e refactor(ChatNavigation): Optimize document element retrieval and remove unnecessary useMemo
- Remove useMemo for container element
- Dynamically retrieve container element in each method
- Simplify scroll and message finding logic
- Improve performance by avoiding unnecessary memoization
2025-03-11 20:57:42 +08:00
kangfenmao
3ce0b73121 feat(Topic): Implement auto-renaming topic with enhanced logic
- Add `autoRenameTopic` function in useTopic hook
- Support automatic topic naming with or without AI summary
- Integrate with store and event system for dynamic topic renaming
- Remove local implementation of auto-rename in Messages component
2025-03-11 20:44:06 +08:00
kangfenmao
3353c15d41 feat: add function call model type 2025-03-11 19:42:46 +08:00
ruichao.hu
f5bde3924c fix(sendMessage): optimize message slicing logic
- prevents empty context when message ID isn't found in history array
2025-03-11 19:37:35 +08:00
ousugo
67aa92256d feat(OpenAIProvider): Enhance model reasoning detection and stream output handling
- Update isOpenAIReasoning method to include 'o3' model prefix
- Rename isOpenAIo1 method to isOpenAIReasoning for clarity
2025-03-11 19:36:05 +08:00
MyPrototypeWhat
3743ebcc00 fix:message_status 2025-03-11 17:56:03 +08:00
xuanzhi33
f09f15db96 docs: fix the style and links in README.zh.md and README.ja.md (#3182)
* docs: fix style in README.zh.md

* docs: change language order in README.zh.md

* docs: fix style and link in README.ja.md

* docs: update the separators README.zh.md

* docs: update the separators in README.ja.md
2025-03-11 17:32:58 +08:00
MyPrototypeWhat
93b4db26df perf: optimize/message performance (#3181)
* feat: Add message pause and resume functionality

- Implement pauseMessage and pauseMessages methods in useMessageOperations hook
- Update Inputbar to use new pauseMessages method for stopping message generation
- Remove deprecated pause-related code from ApiService and store
- Simplify message generation and pause logic across providers
- Enhance message state management with more granular control over streaming messages

* feat: Enhance topic management with sequence-based sorting and lazy loading

- Add sequence field to topics for better sorting
- Implement lazy loading mechanism for topic messages
- Modify Redux store to support per-topic loading states
- Update database schema to use sequence as an auto-incrementing primary key
- Optimize message initialization and retrieval process

* refactor(database): Enhance topic management with timestamps and upgrade logic

- Modify database schema to include createdAt and updatedAt for topics
- Add database hooks for automatic timestamp handling
- Refactor topic upgrade process to support new timestamp fields
- Remove redundant upgradesV6.ts file
- Update topic retrieval to use updatedAt for sorting
- Improve database consistency and tracking of topic modifications

* refactor: Streamline message state management and remove unused code

- Remove commented-out code in multiple components
- Delete initializeMessagesState thunk from messages store
- Simplify message sending and streaming logic
- Remove unnecessary console logs
- Optimize MessageStream component with memo
- Using loading to control message generation within a single session
- Lift the restriction on not being able to switch topics in message generation

* refactor(database): Remove version 6 database version and hooks

- Remove version 6 database schema definition
- Delete automatic timestamp hooks for topics
- Clean up unused database upgrade and hook code

* refactor(Messages): Optimize message state management and remove redundant code

- Remove duplicate imports and redundant code blocks
- Simplify message sending and streaming logic in messages store
- Enhance throttling mechanism for message updates
- Remove commented-out code and unused function parameters
- Improve error handling and loading state management
- Optimize message synchronization with database

* fix:console
2025-03-11 17:31:44 +08:00
kangfenmao
e0bb9dcc75 feat(Localization): Add toggle error message for MCP servers across languages
- Update en-us, ja-jp, ru-ru, zh-cn, and zh-tw locale files
- Add 'toggleError' translation key for MCP server settings
- Improve error handling and user feedback for server toggle actions
2025-03-11 16:46:53 +08:00
kangfenmao
9ad4cd2c49 refactor(DataSettings): Modularize settings page with dynamic menu navigation
- Split DataSettings into separate components for Markdown Export, Notion, WebDAV, and Yuque settings
- Implement dynamic menu navigation with ListItem component
- Improve code organization and readability
- Add state management for menu selection
- Enhance settings page layout and user experience
2025-03-11 16:22:48 +08:00
kangfenmao
ee23126238 refactor(Migration): Clean up MiniApp icon state removal in migration steps
- Remove redundant calls to removeMiniAppIconsFromState in migration steps
- Consolidate MiniApp icon state removal in migration version 78
- Simplify migration configuration for state updates
2025-03-11 15:33:32 +08:00
kangfenmao
95f7e437eb feat(Messages): Implement topic branching and file reference tracking
- Add support for creating new topics from message branches
- Implement file reference count update when branching messages
- Enhance EventEmitter to handle NEW_BRANCH event
- Integrate database operations for topic and file management
2025-03-11 15:08:40 +08:00
kangfenmao
8e7d07fbce refactor(Providers): Optimize tool handling and message filtering
- Move MCP tool utilities to a dedicated utils folder
- Update import paths for MCP tool functions across providers
- Add isEmpty check for tools in Anthropic provider
- Enhance message filtering in OpenAI provider with filterEmptyMessages
- Simplify tool and message preparation logic
2025-03-11 13:53:06 +08:00
kangfenmao
f743b37a39 fix(Localization): Improve Chinese translation spacing and formatting 2025-03-11 13:52:48 +08:00
kangfenmao
5cefbbcdaa refactor(MCP): Simplify IPC handlers and improve server management 2025-03-11 13:52:36 +08:00
kangfenmao
f3cdf61962 feat(AnthropicProvider, MessagesService): Add empty message filtering and stream processing improvements
- Introduce filterEmptyMessages function to remove empty messages
- Update AnthropicProvider to use filterEmptyMessages in message preparation
- Refactor stream processing with minor improvements and return statement fixes
- Simplify tool response and message handling logic
2025-03-11 13:00:04 +08:00
kangfenmao
7389e9f9e9 refactor(ChatNavigation): Optimize scroll navigation and performance
- Improve scroll navigation with memoized container reference
- Add scrollToTop and scrollToBottom utility methods
- Remove message notifications for navigation limits
- Use useCallback and useMemo for better performance
- Simplify message navigation logic
2025-03-11 12:29:04 +08:00
MyPrototypeWhat
4db4a85056 pert: Optimize/message structure (#3136)
* refactor: Simplify message operations with new useMessageOperations hook

- Introduce useMessageOperations hook to centralize message-related actions
- Remove prop drilling for message deletion and management
- Refactor MessageMenubar, MessageGroup, and Messages components to use new hook
- Remove commented-out code and simplify message state management
- Improve type safety and reduce component complexity

* feat: Enhance topic management with sequence-based sorting and lazy loading

- Add sequence field to topics for better sorting
- Implement lazy loading mechanism for topic messages
- Modify Redux store to support per-topic loading states
- Update database schema to use sequence as an auto-incrementing primary key
- Optimize message initialization and retrieval process

* refactor: Simplify message operations with new useMessageOperations hook

- Introduce useMessageOperations hook to centralize message-related actions
- Remove prop drilling for message deletion and management
- Refactor MessageMenubar, MessageGroup, and Messages components to use new hook
- Remove commented-out code and simplify message state management
- Improve type safety and reduce component complexity

* refactor(database): Enhance topic management with timestamps and upgrade logic

- Modify database schema to include createdAt and updatedAt for topics
- Add database hooks for automatic timestamp handling
- Refactor topic upgrade process to support new timestamp fields
- Remove redundant upgradesV6.ts file
- Update topic retrieval to use updatedAt for sorting
- Improve database consistency and tracking of topic modifications

* fix: Improve message loading state management and UI synchronization

- Update Inputbar to use useMessageOperations hook for loading state
- Correct topic loading state management in Redux store
- Fix loading state synchronization in sendMessage action
- Remove unnecessary commented-out code
- Enhance error handling and loading state tracking

* refactor: Streamline message state management and remove unused code

- Remove commented-out code in multiple components
- Delete initializeMessagesState thunk from messages store
- Simplify message sending and streaming logic
- Remove unnecessary console logs
- Optimize MessageStream component with memo
- Using loading to control message generation within a single session
- Lift the restriction on not being able to switch topics in message generation
2025-03-11 11:43:22 +08:00
kangfenmao
c32c6af317 feat(Models, MCP, Localization): Add Qwen to tool calling models and enhance MCP server management
- Add 'qwen' to tool calling models list
- Refactor MCP server hooks to use window.api methods
- Add 'more' translation key across localization files
- Improve MCP settings modal with window.api and window.modal methods
2025-03-11 10:32:10 +08:00
kangfenmao
5d9089ff79 refactor(MCPService): Rename MCP service file and implement comprehensive server management 2025-03-11 10:08:38 +08:00
kangfenmao
383fdfc4bc feat(ReduxService): Implement comprehensive Redux state management service for main process 2025-03-11 10:07:29 +08:00
happyZYM
aeebf005bb feat: enable one-click export for simple markdown exporting (#3137)
* feat: enable one-click export for simple markdown exporting

* feat: optimize ui for simple markdown export
2025-03-11 09:59:54 +08:00
suyao
8639333ace feat(Proxy): Implement proxy management system
- Add ProxyManager service to handle system, custom, and no proxy configurations
- Integrate proxy support for Gemini, Knowledge, and WebDav services
- Add fetch-socks and undici for advanced proxy handling
- Enhance proxy configuration with environment variable and session management
2025-03-11 09:56:40 +08:00
Vaayne
037721e9d9 fix(mcpToolUtils): Update response text to include a newline character 2025-03-11 09:55:59 +08:00
Vaayne
ad3b13352f feat(MCPService): Implement IPC communication for server management and updates 2025-03-11 09:55:59 +08:00
Vaayne
f311169e13 refactor(GeminiProvider): remove unused tool filtering logic and update tools assignment 2025-03-11 09:44:34 +08:00
kangfenmao
3fc74b71df fix(MessageContent): Prevent mutation of original message object 2025-03-10 23:01:14 +08:00
kangfenmao
c71076df04 fix(AppsPage): Improve empty state rendering for apps list 2025-03-10 22:52:19 +08:00
kangfenmao
c41d7133a6 fix(ChatNavigation): Add unique keys to navigation info messages 2025-03-10 22:39:31 +08:00
George·Dong
54b8b7dd4b feat: Add chat navigation button 2025-03-10 22:37:06 +08:00
kangfenmao
1d6a459fb4 chore: sort i18n keys 2025-03-10 22:23:11 +08:00
kangfenmao
54c95547fe refactor(Sidebar): Simplify navigation and settings routing logic 2025-03-10 22:20:52 +08:00
kangfenmao
28a3cae89f fix(TranslatePage): Disable scroll sync by default 2025-03-10 18:01:40 +08:00
kangfenmao
2446406147 refactor(LLM): Reorganize system providers and add provider reordering utility 2025-03-10 17:54:45 +08:00
suyao
033208e8d8 feat(constants): Add BibTeX file extension to supported text files 2025-03-10 17:33:02 +08:00
ousugo
7014dee8d6 feat(Models): Add 'qvq' to vision allowed models list 2025-03-10 17:32:09 +08:00
ousugo
4f74837d81 fix: Refine special character removal in utility function 2025-03-10 17:09:33 +08:00
Chuqiao Feng
77d78b047e fix: #2957 improve topic auto renaming & remove special characters from file name when topic exported (#3132)
* fix: refine special character removal for topic auto renaming #2957

* fix: remove special characters in topic title when used as file name #2957
2025-03-10 17:09:02 +08:00
shiro-yama
68926233d4 fix: fix GeminiProvdier config tools has empty array or object make request 400 (#3090)
Co-authored-by: archer <archer@gmail.com>
2025-03-10 11:59:14 +08:00
Hao He
8710739bd5 Fix/improve file utils (#3116)
* Enhance update error logging and fix duplicate type import

- Improve error logging in AppUpdater with more detailed error information and timestamps
- Remove duplicate MCPServer type import in Inputbar component

* fix: ensure directory existence and optimize file operations
2025-03-10 11:47:09 +08:00
Vaayne
66fe274af4 fix(MCPToolsButton): Optimize useEffect dependencies for server enabling logic 2025-03-10 10:59:36 +08:00
kangfenmao
f8d7dfc5e9 chore: Update project metadata and repository details
- Change author email to support@cherry-ai.com
- Update homepage URL to reflect new GitHub organization
2025-03-10 10:38:02 +08:00
kangfenmao
e8697cb680 refactor(MCPToolsButton): Update icon and no servers text
- Replace ToolOutlined icon with CodeOutlined
- Update no servers placeholder text to use a more specific translation key
2025-03-10 10:04:16 +08:00
kangfenmao
c081d465f2 refactor(Messages): Remove Suggestions component from Messages view 2025-03-09 22:23:23 +08:00
kangfenmao
cff3628174 fix(Messages): Improve auto-rename topic logic with message filtering 2025-03-09 22:21:07 +08:00
kangfenmao
0e8faba9b5 refactor(MessageGroupModelList): Simplify display mode toggle interaction 2025-03-09 22:08:28 +08:00
kangfenmao
44431ef8f1 fix: Improve topic context in history search and messages
Update SearchMessage and TopicMessages components to pass topic context to MessageItem, ensuring proper rendering of messages with their associated topics
2025-03-09 22:04:35 +08:00
one
daec7d4505 feat(message): add a compact style for the model list in message groups (#2962)
* feat(message): add a compact style for the model list in message groups

* refactor: use button as action rather than state

---------

Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2025-03-09 22:04:18 +08:00
lbc123456
3bb82694a8 fix:add State Cloud models (#2971)
* feat: 模型服务添加天翼云模型

* feat:add website

* fix: id is duplicate

---------

Co-authored-by: 李保成 <libaocheng@cndatacom.com>
Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2025-03-09 22:02:28 +08:00
one
7a485ec6dc feat: synced scrolling for translation page 2025-03-09 21:35:32 +08:00
kangfenmao
8a4061f64a fix(MessageTools): Improve empty tool responses check
Use lodash's isEmpty for more robust null/undefined handling when checking MCP tool responses
2025-03-09 21:23:45 +08:00
自由的世界人
597da85212 fix: translate error handle (#3092) 2025-03-09 21:22:08 +08:00
kangfenmao
996e703db9 refactor(loader): Replace app.getPath with getTempDir in EpubLoader
Use the new getTempDir utility function from file.ts to generate temporary file paths, maintaining consistency with recent file path utility refactoring
2025-03-09 20:22:46 +08:00
George·Dong
aba738da03 fix: Correct MIME type for JPG images for Gemini 2.0 Pro 2025-03-09 17:37:02 +08:00
Hao He
bf931d2de7 feat(loader): optimize EpubLoader memory usage with file streams (#3074)
* Enhance update error logging and fix duplicate type import

- Improve error logging in AppUpdater with more detailed error information and timestamps
- Remove duplicate MCPServer type import in Inputbar component

* feat(loader): optimize EpubLoader memory usage with file streams

Replace in-memory arrays with file streams for EPUB processing to reduce
memory consumption when handling large e-books. Use temporary files for
chapter content, add completion logs, and ensure proper cleanup.

This prevents memory overflow issues with large EPUB files (>5MB).
2025-03-09 17:36:19 +08:00
kangfenmao
0d64965ef7 refactor: Extract file path utility functions
Move hardcoded file path generation logic to dedicated utility functions in file.ts, improving code modularity and reducing duplication across services and IPC handlers
2025-03-09 17:33:46 +08:00
kangfenmao
cf29afaa74 fix: Standardize file creation timestamp to ISO string format
Ensure consistent ISO string representation of file creation timestamps in both file utility and knowledge content upload
2025-03-09 17:28:00 +08:00
FunJim
7353edda3e feat: Enhance API Key Management in Provider Settings
- Add single key checking functionality
- Implement ability to remove individual API keys
- Improve UI with remove and check buttons for each key
- Disable actions during checking to prevent conflicts
- Add styled remove icon for key deletion
2025-03-09 17:26:07 +08:00
MyPrototypeWhat
8b155871db Fix/message refactor bug (#3087)
*  feat: add Model Context Protocol (MCP) support (#2809)

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

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

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

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

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

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

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

* fix: finish_reason undefined

* fix: Improve translation error handling in MessageMenubar

---------

Co-authored-by: LiuVaayne <10231735+vaayne@users.noreply.github.com>
Co-authored-by: kangfenmao <kangfenmao@qq.com>
2025-03-09 17:25:23 +08:00
kangfenmao
2813b65244 fix: Convert file created_at to ISO string format
Ensure consistent string representation of file creation timestamps across file storage and type definitions
2025-03-09 17:21:57 +08:00
kangfenmao
4f4194537d fix: Default MCP tools button state to disabled 2025-03-09 17:00:35 +08:00
kangfenmao
d04e8b578a refactor: Remove deprecated userData path update logic 2025-03-09 16:19:38 +08:00
kangfenmao
21fdf9b5b8 fix: Improve MCP tool response handling and logging
- Add more descriptive console logging for tool call responses
- Use cloneDeep when storing MCP tool responses to prevent reference issues
- Simplify upsertMCPToolResponse method calls
2025-03-09 13:37:37 +08:00
kangfenmao
529949ba58 Revert "fix(mcp): 修复了mcp无法调用功能的问题 (#3047)"
This reverts commit 4354f40fab.
2025-03-09 11:11:25 +08:00
kangfenmao
f80b512443 feat: Add support for enabled MCPs in message sending 2025-03-09 10:49:28 +08:00
kangfenmao
def0fd5d62 feat: Add "Tool Calling" localization across language files 2025-03-09 10:18:54 +08:00
juzheng
7e0ed91444 fix: file extension to lowercase when uploading 2025-03-09 10:12:57 +08:00
one
30130d5541 feat: Add health check to check all the models at one time (#2613)
* feat: Add health check to check all the models at one time

* fix: add model avatars to the health-check list

* style: Use segmented instead of switch

* fix: remove redundant timing reports

* refactor: Extract small functions

* refactor: use more hooks to make the main component clearer

* fix: mask API keys with asterisks

* refactor: split health check popup and model list

- rename ModelHealthCheckPopup to HealthCheckPopup
- add HealthCheckModelList
- add maskApiKey to utils

* refactor: compute latency in checkApi

* fix: remove unused i18n keys

* refactor: use checkModel instead of checkApi for better semantics

* fix: update comments

* refactor: extract health checking functions to services

* refactor: extract model list

* refactor: render statuses on the existing model list

* fix: reset button style on completion

* fix: disable model card while checking

- remove unused i18n keys
- better window message

* refactor: show provider name in messages

* refactor: change default values

* refactor: fully migrate model list from ProviderSetting to ModelList
2025-03-08 22:24:56 +08:00
kangfenmao
dfe11f18fa feat: Enhance SettingsTab UI with styled select components and type safety
- Replace default Select components with StyledSelect for improved visual design
- Add explicit type casting for various select onChange handlers
- Improve type safety for message style, multi-model style, code style, and other settings
- Introduce StyledSelect with custom styling for consistent UI appearance
2025-03-08 20:58:34 +08:00
George·Dong
894925a66e fix: number of context incorrect (#2653)
* fix: number of context incorrect

* feat: 优化上下文数显示样式

* fix: 上下文数显示不正确

修复无限上下文情况下,当前上下文数显示不正确的问题

* fix: slider display incorrect

* fix: Update infinity display style
2025-03-08 20:50:24 +08:00
kangfenmao
a955a7368c refactor: Optimize message handling and event management
- Introduce messagesRef to track messages without causing re-renders
- Simplify event listener management with more concise useEffect hooks
- Improve auto-rename topic logic with current messages reference
- Remove commented-out code and unused event listeners
- Enhance type safety and reduce dependency complexity
2025-03-08 20:45:28 +08:00
kangfenmao
ea4b906b88 feat: Add tool calling support for models
- Introduce ToolsCallingIcon component for tool calling models
- Add isToolCallingModel function in models config
- Update ModelTags to support showing tool calling icon
- Add tooltips to model icons for better UX
- Update Chinese localization with tool calling translation
- Modify Inputbar and SelectModelButton to accommodate new icon
2025-03-08 20:10:38 +08:00
one
f7c5d80eab feat: improve SelectModelPopup, fix model id concatenation (#2903)
* fix: correctly concatenate model id

* perf: delay model sorting

* feat: sticky provider name during model selection

* fix: model selector group title animation

* fix: add back opacity

---------

Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2025-03-08 17:17:47 +08:00
Yanwu
4354f40fab fix(mcp): 修复了mcp无法调用功能的问题 (#3047)
* fix(mcp): 修复了mcp无法调用功能的问题

* fix(mcp): 修复工具调用时inputSchema只读属性错误
2025-03-08 17:12:34 +08:00
Herio
869d5e4d1b Enhance update error logging and fix duplicate type import
- Improve error logging in AppUpdater with more detailed error information and timestamps
- Remove duplicate MCPServer type import in Inputbar component
2025-03-08 11:16:00 +08:00
ousugo
937e80612e fix(UX): Improve Enter key handling in PromptPopup input 2025-03-08 11:09:06 +08:00
Peter Dave Hello
3fad6cc5b3 Improve zh-tw Traditional Chinese locale 2025-03-08 06:24:39 +08:00
MyPrototypeWhat
2fe21c7d41 refactor: 重构message模块 (#2561)
* feat: Implement Redux-based message management with enhanced state handling

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

* feat: Implement streaming message handling in Redux store

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

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

* refactor: Simplify messages state management and initialization

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

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

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

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

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

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

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

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

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

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

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

* fix: finish_reason undefined

* refactor: Streamline message resending and state management

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

* refactor: Optimize message resending and event handling

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

* refactor: Enhance message translation and suggestions handling

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

* refactor: Optimize message streaming with throttled updates

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

* fix: Remove unnecessary await in message dispatch

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

* fix: Update Redux persist configuration for messages slice

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

* feat: Enhance message streaming and multi-model support

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

* feat: Implement file upload handling in message sending

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

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

*  feat: add MCP servers in chat input

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

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

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

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

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

---------

Co-authored-by: lizhixuan <zhixuan.li@banosuperapp.com>
Co-authored-by: lizhixuan <zhixuanli219643@sohu-inc.com>
Co-authored-by: LiuVaayne <10231735+vaayne@users.noreply.github.com>
Co-authored-by: kangfenmao <kangfenmao@qq.com>
2025-03-08 01:41:05 +08:00
kangfenmao
4870307401 fix(UI): Improve model selection popup keyboard navigation and selection
- Add dynamic selected keys for the model selection menu
- Ensure correct model is highlighted when pre-selected or navigated via keyboard
- Simplify selection logic in SelectModelPopup component
2025-03-08 01:09:34 +08:00
kangfenmao
e2c277ae42 🔧 refactor(UI): Consolidate dropdown styles and remove global styles
- Remove global style components from MentionModelsButton and MCPToolsButton
- Move dropdown styles to a centralized SCSS file
- Refactor components to use styled-components for localized styling
- Improve code organization and reduce redundant styling
- Adjust table column widths in MCPSettings for better layout
- Simplify dropdown rendering by removing unnecessary fragments
2025-03-08 00:34:02 +08:00
kangfenmao
e5ae9ecd23 🔧 refactor(UI): Optimize MentionModelsButton with performance improvements and styling updates
- Add useCallback for togglePin and handleModelSelect to prevent unnecessary re-renders
- Refactor dropdown menu styling with more specific CSS scoping
- Simplify dropdown open/close logic
- Improve performance by memoizing function dependencies
- Adjust dropdown overlay styling and animation
2025-03-07 23:01:34 +08:00
LiuVaayne
8c574c1800 feat(MCP): add support for enabling/disabling MCPServers per message (#2989)
*  feat: add MCP servers in chat input

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

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

- Added `enabledMCPs` property to the `Message` type to track enabled MCPServers.
- Modified `MCPToolsButton` to enable all active MCPServers by default using a new `enableAll` state.
- Introduced `filterMCPTools` utility to filter tools based on enabled MCPServers.
- Updated `AnthropicProvider`, `GeminiProvider`, and `OpenAIProvider` to filter tools using `filterMCPTools`.
- Enhanced `Inputbar` to include `enabledMCPs` in the message payload when set.
2025-03-07 19:17:29 +08:00
kangfenmao
1fbd57d61d chore: Add TypeScript ignore comment for provider property in BaseWebSearchProvider 2025-03-07 13:48:19 +08:00
Vaayne
581f94f228 🔧 feat: add mcp tool response visualization and handling
- Introduce `MessageTools` component for displaying tool responses
- Add handling and state management for tool invocation statuses
- Implement tool response collapsing, expanding and copying functionality
- Update multiple providers (Anthropic, Gemini, OpenAI) to handle tool responses
- Add `upsertMCPToolResponse` utility for managing tool response states
- Extend types and interfaces to support new tool response metadata
- Integrate tool response handling into chat completion process
- Add necessary styling for tool response UI components
2025-03-07 13:37:15 +08:00
eeee0717
9d4f50b601 fix bug 2025-03-07 13:34:25 +08:00
Carter Cheng
c6b8a7cf2d fix(ui): Add inner glow opacity variable for dropdown menu styling for better darkmode support and improve code quality by using global variables in scss rather than hardcoded variables 2025-03-07 13:32:53 +08:00
kangfenmao
930a7c8259 feat: Improve model group management UI in EditModelsPopup
- Add dynamic group management button that changes based on group's current state
- Simplify group add/remove logic with a single button
- Enhance visual feedback for group-level model management
2025-03-06 23:27:10 +08:00
one
b6100fa275 feat: a button to add a whole group of models (#2736)
* feat: a button a add a whole group of models

* feat: search as typing in EditModelsPopup

* feat: add a button to remove a whole group of models

* feat: add remove button for model group in the model list
2025-03-06 23:04:10 +08:00
Carter Cheng
56f0308c28 feat(ui): Enhance mention models dropdown with improved styling and scrollbar 2025-03-06 23:03:08 +08:00
one
22256b2ac6 fix: relieve text shaking while streaming 2025-03-06 22:56:34 +08:00
kangfenmao
097509c6ef fix: remove duplicate migration for web search providers
Resolve duplicate migration for adding Searxng and Exa web search providers by consolidating the migration logic into a single version
2025-03-06 22:54:07 +08:00
Chen Tao
0025b67cf5 feat: support exa engine (#2870)
* feat: support exa engine

* chore
2025-03-06 22:44:43 +08:00
Yasin
d64c57b4a4 Site title for rankings on OpenRouter
add "HTTP-Referer"  and "X-Title" to defaultHeaders
2025-03-06 22:42:13 +08:00
one
2af27ff824 fix: distinguish model mention sources 2025-03-06 22:41:35 +08:00
ousugo
63a3b324d4 feat:(REGEX): Resaoning models regex matching QWEN's qwq series models 2025-03-06 22:37:43 +08:00
kangfenmao
c2fa2c83c4 feat: Upgrade database schema and migrate web search metadata
- Add database version 5 with schema updates
- Create `upgradeToV5` function to migrate Tavily web search metadata to new format
- Update types to support new web search metadata structure
- Minor code cleanup and formatting improvements
2025-03-06 22:34:28 +08:00
LiuVaayne
a855fe1f48 feat(MCP): support gemini and claude models (#2936) 2025-03-06 19:32:34 +08:00
icinggslits
7ab7fbabde feat: Windows Control Overlay button hover effect 2025-03-06 19:29:10 +08:00
icinggslits
321254fc0e feat: Focus input on mouse click 2025-03-06 19:28:44 +08:00
eeee0717
43ea1b8617 fix bug when enabled removed 2025-03-06 19:26:42 +08:00
kangfenmao
e5bdaef536 feat: Refactor web search settings and remove enabled flag
- Remove `enabled` flag from WebSearchProvider type
- Add `hasObjectKey` utility function to check optional properties
- Update WebSearchService to check web search availability based on API key/host
- Modify WebSearchSettings and WebSearchProviderSetting components to support API key/host validation
- Add Searxng provider in migration script
- Simplify web search provider configuration and validation logic
2025-03-06 17:53:45 +08:00
Chen Tao
fc65f313ac feat: refactor web search logic and support searxng (#2543)
* feat: support searxng model and refactor web search provider

* feat: basic refactor

* stash: web search settings page

* chore: refactor general setting and provider page

* feat: finish basic refactor and add searxng search

* feat: finish refactor

* chore(version): 1.0.2

* feat: change blacklist match pattern

* Merge branch 'main' into feat-websearch

* chore: add migrate

* chore: add old version migrate

* refactor UI

* chore(version): 1.0.5

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

* chore: fix migrate bug

---------

Co-authored-by: kangfenmao <kangfenmao@qq.com>
2025-03-06 16:17:26 +08:00
luwux
a53f596b0c fix(mcp): add required to tool call parameters 2025-03-06 16:15:09 +08:00
ousugo
cb0313e0a6 feat: Translation does not show the thinking content 2025-03-06 16:13:44 +08:00
Carter Cheng
0776cda8b5 feat(i18n): Add expand and collapse translations for code blocks 2025-03-06 14:40:29 +08:00
Peter Dave Hello
1d1d624dce Improve zh-tw Traditional Chinese locale a bit 2025-03-06 13:47:32 +08:00
Pleasurecruise
696ad19422 feat: add navbar poptip 2025-03-06 11:35:29 +08:00
icinggslits
dcc51da70b feat: Improve devtools font on Windows 2025-03-06 11:35:29 +08:00
LiuVaayne
0efecbdb1e feat: support MCP sse client (#2880)
*  feat: add Model Context Protocol (MCP) server configuration (main)

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

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

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

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

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

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

* feat: Enhance MCPServer and MCPTool interfaces with optional properties and unique IDs

* fix(mcp): Refactor SSE transport initialization to use URL object

* fix(OpenAIProvider): correct inputSchema properties reference in tool parameters

* feat(MCPSettings): enhance server settings UI with new fields and improved layout

* feat(MCPSettings): add multilingual support for MCP server settings

* fix: remove unnecessary console log statements
2025-03-06 11:35:29 +08:00
kangfenmao
ad46a351c0 fix: finish_reason undefined 2025-03-06 11:35:29 +08:00
LiuVaayne
8fc69ec679 feat: add Model Context Protocol (MCP) support (#2809)
*  feat: add Model Context Protocol (MCP) server configuration (main)

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

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

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

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

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

* feat: implement streaming support for tool calls in OpenAIProvider and enhance message processing
2025-03-06 11:35:29 +08:00
ousugo
3216c7170d chore(version): 1.0.6 2025-03-05 21:54:39 +08:00
kangfenmao
4839167404 refactor(markdown): Optimize rendering with memoized components and dynamic imports #2889
- Memoize math engine selection
- Create dynamic components callback for markdown rendering
- Optimize import statements for KaTeX extensions
2025-03-05 21:14:29 +08:00
kangfenmao
1366cca1c4 fix(translate): Improve Enter key detection in translation input #2861 2025-03-05 17:16:05 +08:00
kangfenmao
7ca313c262 chore(version): 1.0.5 2025-03-05 15:53:08 +08:00
kangfenmao
3ebe1751bf feat(knowledge-base): Enhance file processing and localization
- Update useKnowledgeFiles hook to filter only completed processing files
- Improve localization messages for knowledge base file management
- Refactor delete and remove file button translations across locales
- Update confirmation messages to clarify file deletion behavior
2025-03-05 14:59:30 +08:00
kangfenmao
f728230793 feat(app-update): Refactor update handling and add manual update dialog
- Modify AppUpdater to separate update dialog logic
- Add new IPC handler for manually showing update dialog
- Update renderer hooks and store to track downloaded update state
- Switch import for UpdateInfo from electron-updater to builder-util-runtime
2025-03-05 14:33:10 +08:00
suyao
3bdb5ba7b1 fix(settings): Improve reasoning effort segmented control with 'off' option 2025-03-05 11:18:20 +08:00
ousugo
f8a534247a feat: Enable conditional settings shortcut based on user preferences 2025-03-05 11:17:34 +08:00
SuYao
3a5e8b7860 feat: support table and hyperlink when export to word (#2837)
* feat(export): Enhance markdown-to-docx export with table support

Add comprehensive table rendering capabilities to the ExportService, including:
- Support for table headers and body rows
- Configurable cell styling and alignment
- Handling of inline text formatting within table cells

* feat(export): Add hyperlink support in markdown-to-docx export

Enhance ExportService to handle hyperlinks during document export:
- Implement link detection in inline tokens
- Create ExternalHyperlink with proper styling
- Preserve link text and URL in exported document
2025-03-05 11:16:45 +08:00
kangfenmao
0b9e9c4c13 feat: Improve message filtering across providers
- Add new `filterUserRoleStartMessages` function in MessagesService
- Update Anthropic, Gemini, and OpenAI providers to use new message filtering
- Refactor message handling to ensure user messages start the conversation
- Remove redundant message filtering logic from individual providers
2025-03-05 11:11:02 +08:00
kangfenmao
452b0df476 feat: Enhance image upload and model-specific message handling
- Add vision model check before image upload in Inputbar
- Implement flexible message start forcing for specific models
- Improve provider-level message routing logic
2025-03-04 21:02:08 +08:00
kangfenmao
8dbc959616 feat(i18n): Add cherrycss.com link to custom CSS settings across locales 2025-03-04 17:48:06 +08:00
美兰十三
95f49543a0 feat(显示设置): 自定义css 增加cherrycss入口方便快速获取样式 (#2807)
* feat(显示设置): 自定义css 增加cherrycss入口方便快速获取样式

这是个无用的小辣鸡功能 = =、

* feat(显示设置): 自定义css 增加cherrycss入口方便快速获取样式

这是个无用的小辣鸡功能 = =、
2025-03-04 17:31:36 +08:00
Konjac-XZ
d5eb9dc37b fix: Token counter display issues when translating assistant messages. 2025-03-04 17:11:08 +08:00
kangfenmao
900a115940 chore: Move html-to-image package to dev dependencies 2025-03-04 15:42:38 +08:00
SuYao
97bda2f02b refactor: Replace html2canvas with html-to-image for improved sup element (#2739)
* refactor: Replace html2canvas with html-to-image for improved screenshot capture

* refactor: Simplify scrollable div capture method

* refactor: Simplify captureScrollableDivAsBlob method

* fix: Specify PNG format in captureScrollableDivAsBlob method

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

* fix: Reorder error messages in en-us.json locale file
2025-03-04 15:37:29 +08:00
Asurada
d1c3b26602 feat: Update model label format to include provider information (#2793)
* feat: Update model label format to include provider information

* feat: Improve AddModelPopup layout and button styling
2025-03-04 15:36:07 +08:00
SuYao
c4051ba99d feat: Add code block wrapping functionality (#2411)
Signed-off-by: suyao <sy20010504@gmail.com>
2025-03-04 12:30:22 +08:00
FischLu
e5bf286deb feat: add resize handle to input textarea with drag interaction (#2174)
* feat: add resize handle to input textarea with drag interaction

* handle auto size inputbar

* optimize auto resize function and add i18n

* fix: expand button bug in inputbar and rebase to latest main

* rebase to main
2025-03-04 11:44:52 +08:00
ousugo
9bba459849 feat: Save proxy setting 2025-03-04 11:27:15 +08:00
Wei GENG
d4dab18601 feat: Add Agent German Tutor (#2748) 2025-03-04 10:38:50 +08:00
kangfenmao
541204cc0f fix: Correct Tencent Cloud provider identifier and update UI styling
- Fixed typo in Tencent Cloud TI provider key from 'tentent-cloud-ti' to 'tencent-cloud-ti'
- Enhanced ProviderSettings search input with search icon and custom styling
- Adjusted button border radius for consistent UI design
2025-03-04 10:37:41 +08:00
fullex
12c3099bbb feat: add search function on provider list & optimize ui behaviors when dragging provider item (#2706)
* 添加“腾讯云TI”供应商及其支持的deepseek模型

* add search feature for model providers & adjust ui element behaviors when dragging

* dev merge fix

* merge fix
2025-03-04 10:27:18 +08:00
one
9ac73ff2d2 feat: improve SelectModelPopup (#2740)
* fix: do not match provider id for non-system models

* feat: match multiple words
2025-03-04 10:11:54 +08:00
kangfenmao
1e458951d1 feat: Add knowledge base file management functionality
- Implemented `useKnowledgeFiles` hook for managing knowledge base files
- Added localization support for knowledge base file management in multiple languages
- Created UI option to remove all knowledge base files in DataSettings
- Updated file size formatting utility function
- Modified ContentView and FilesPage to use file size correctly
2025-03-03 23:20:31 +08:00
kangfenmao
bce71b6535 feat: Implement comprehensive data restore functionality with progress tracking
- Added RestorePopup component for visualizing restore process
- Enhanced BackupManager with detailed restore progress tracking
- Implemented file copy progress and stage tracking during restore
- Updated localization files with restore progress translations
- Integrated restore progress reporting to renderer process
2025-03-03 22:32:55 +08:00
kangfenmao
6326d93928 feat: Add comprehensive backup progress tracking and UI
- Implemented detailed backup progress tracking in BackupManager
- Added new BackupPopup component for backup process visualization
- Enhanced backup process with file copy progress and stage tracking
- Updated localization files with backup progress translations
- Integrated backup progress reporting to renderer process
2025-03-03 22:22:29 +08:00
kangfenmao
3503f03169 refactor: Improve reasoning effort configuration for Claude models
- Refactored reasoning effort handling for Claude models
- Added type definition for ReasoningEffort
- Simplified budget token calculation
- Improved type safety and readability of the method
2025-03-03 18:44:18 +08:00
MyPrototypeWhat
0ec9107910 fix: shadow markdown (#1871)
问题:[Bug]: 当模型回复的html代码没有正确在代码框中时,html代码内容会影响到UI界面 #1767
原因:解析html之后css会污染应用样式
解决:将markdown完全放入shadow dom中,shadow dom天然隔绝样式,即可解决

* feat: Conditionally hide thinking loader for paused messages

* feat: Implement Shadow DOM for Markdown rendering

* feat: Add StyleProvider to Shadow DOM Markdown rendering

* fix: Refactor Markdown rendering with inline ShadowDOM component

Modify ReactMarkdown component to use style component for ShadowDOM rendering instead of wrapping component, simplifying the rendering approach

---------

Co-authored-by: lizhixuan <zhixuan.li@banosuperapp.com>
2025-03-03 18:23:18 +08:00
Asurada
1b88875584 feat: Added reset avatar feature and center align items in userpopup (#2658)
* feat: Add reset avatar functionality and update localization strings

* fix: Center align upload and reset avatar options in UserPopup
2025-03-03 17:58:15 +08:00
kangfenmao
aa2685a4e3 refactor: Update Tencent Cloud TI provider identifier and assets 2025-03-03 17:48:17 +08:00
fullex
6cbfe8733e feat: 添加“腾讯云TI”供应商及其支持的deepseek模型 (#2685) 2025-03-03 17:44:12 +08:00
kangfenmao
fdd1e238c4 refactor: Enhance message context menu with improved text selection and copying 2025-03-03 17:40:17 +08:00
Asurada
9fc2eeb907 feat: Add quote feature (#2657)
* feat: Add text quoting functionality to messages

* feat(i18n): add quote message to multiple language files
2025-03-03 17:25:34 +08:00
Konjac-XZ
41427b881c fix: Token estimate count cannot be updated on the UI when typing quickly. 2025-03-03 17:23:07 +08:00
one
12dcfb71f4 fix: show correct logo for qwen-omni-turbo (#2656)
* fix: show correct logo for qwen-omni-turbo

* fix: match omni in the middle
2025-03-03 17:17:25 +08:00
kangfenmao
eabf0513e1 refactor: Improve reasoning effort configuration for Anthropic models
- Refactored getReasoningEffort method to handle reasoning configuration more robustly
- Added type definitions for reasoning effort and configuration
- Simplified logic for calculating budget tokens
- Improved type safety and readability of the method
2025-03-03 17:12:50 +08:00
kangfenmao
0079bafb77 chore(version): 1.0.4 2025-03-02 21:35:49 +08:00
kangfenmao
344134876f fix: Adjust UI styling for consistent font sizes and layout spacing 2025-03-02 21:35:30 +08:00
kangfenmao
46caaa15b4 chore(version): 1.0.3 2025-03-02 20:54:41 +08:00
MyPrototypeWhat
40b79fb713 refactor: Improve Ellipsis component and usage (#2603)
* refactor: Improve Ellipsis component and usage

- Modify Ellipsis component to use children instead of text prop
- Add support for multi-line and single-line ellipsis with styled-components
- Update KnowledgeContent to use new Ellipsis component structure
- Enhance ClickableSpan styling for better text truncation

* fix: Improve text wrapping in Ellipsis component

Add overflow-wrap: break-word to ensure long words are properly truncated in multi-line ellipsis

* refactor: Improve link and tooltip rendering in KnowledgeContent

- Wrap links with ClickableSpan for better interaction and styling
- Adjust Tooltip and Ellipsis placement for improved readability
- Remove unnecessary inline styling for links in ItemInfo

---------

Co-authored-by: lizhixuan <zhixuan.li@banosuperapp.com>
2025-03-02 20:43:56 +08:00
kangfenmao
8ab15234a5 docs: Add comprehensive documentation for KnowledgeService concurrent processing mechanism
- Created detailed technical documentation explaining the KnowledgeService's task queue and workload management
- Added JSDoc comment to KnowledgeService.ts to provide high-level overview
- Documented key aspects of concurrent task processing, including workload evaluation, task state management, and resource optimization strategies
2025-03-02 20:36:13 +08:00
icinggslits
2cb61f9261 feat: Improve file upload for the knowledge base (#2544)
* feat: Improve file upload for the knowledge base

* feat: Improve file upload for the knowledge base

* feat: Improve file upload for the knowledge base

---------

Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2025-03-02 20:21:23 +08:00
kangfenmao
d19793c1e4 feat: Add Zhihu mini app to the platform
- Added Zhihu (知乎直答) mini app logo
- Updated minapps configuration to include Zhihu mini app
- Modified store migration to enable Zhihu mini app by default
2025-03-02 20:12:54 +08:00
kangfenmao
6bc4d2d275 feat: Add Cici mini app and update mini apps grid layout
- Added Cici mini app logo in WebP format
- Updated mini apps grid to display 8 columns instead of 6
- Updated store migration to include Cici in enabled mini apps
- Updated Cici app logo import path
2025-03-02 20:06:35 +08:00
Sharker
f85321f011 chore: revert test code 2025-03-02 20:00:35 +08:00
Sharker
198635ae18 feat: added cici for mini app 2025-03-02 20:00:35 +08:00
shiquda
fb4a894285 feat: add you.com miniapp 2025-03-02 19:58:36 +08:00
周子健
8113575285 feat: add Civil Engineer assistant (#2640) 2025-03-02 19:57:44 +08:00
PilgrimLyieu
c3c6bb261e feat: Add KaTeX copy-tex and mhchem support 2025-03-02 19:55:11 +08:00
suyao
abf029051f fix: Fix app quit exceptionally on MacOS's full screen mode add Add Escape key support for exiting fullscreen mode 2025-03-02 19:53:12 +08:00
kangfenmao
d38aaf4540 refactor: Extract StyleSheetManager into a separate context component
- Move StyleSheetManager logic from App.tsx to a new dedicated context component
- Simplify App.tsx by importing the new StyleSheetManager
- Preserve existing prop validation and filtering logic
2025-03-02 19:51:20 +08:00
MyPrototypeWhat
a8744fe812 feat: Enhance Styled Components configuration and prop handling
- Add Babel plugin for styled-components with performance and naming optimizations
- Integrate @emotion/is-prop-valid for improved prop filtering in StyleSheetManager
- Update Antd Input components to use variant="borderless" instead of deprecated bordered prop
- Add new dependencies for styled-components configuration
2025-03-02 19:47:11 +08:00
kangfenmao
c258ca74f2 fix: Improve metrics completion tokens handling 2025-03-02 19:41:06 +08:00
ZhuangYumin
64860aa498 fix: fix bug of metrics missing 2025-03-02 19:38:20 +08:00
hanzhao
75dd54b2a3 fix bug: #2306 2025-03-02 19:37:33 +08:00
kangfenmao
96a24bd210 feat: Conditionally render reasoning effort control for reasoning models 2025-03-02 09:23:39 +08:00
kangfenmao
379e92918d revert: some proxy errors in main process (#2294) 2025-03-01 23:17:44 +08:00
kangfenmao
a33c7329c5 refactor: Centralize emoji detection utility and improve avatar rendering 2025-03-01 23:16:12 +08:00
Pin Studios
ef3165b7e0 feat: Add emoji avatar support with image upload and picker & support i18n language (#2473) 2025-03-01 21:33:47 +08:00
SuYao
2eb01a3ed3 feat: Add reasoning effort control for Claude 3.7 (#2540)
* feat: Add reasoning effort control for Anthropic models with Anthropic Provider and OpenAI Provider

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

* fix: Extract o1-mini and o1-preview

* fix: Add OpenAI o-series model to ReasoningModel

* fix: Improve OpenAI o-series model detection

* style: Reduce font size

* fix: Add default token handling using DEFAULT_MAX_TOKENS

* fix: Add beta parameter for Anthropic reasoning models
2025-03-01 21:22:12 +08:00
George·Dong
bec2d62ac6 feat: add MessageGroupMenuBar Tooltip (#2600)
* feat: add MessageGroupMenuBar Tooltip

* feat: update MenuBar Tooltip i18n
2025-03-01 20:28:40 +08:00
Jorben
7acec21f2c feat: Add Hunyuan TurboS model (launched on February 26)
- Add hunyuan-turbos-latest
- Add hunyuan-embedding
- Fix the issue of the embedding model displaying the internet icon (when the provider fully supports web search)
2025-03-01 20:27:41 +08:00
kangfenmao
b6195cff5c chore(version): 1.0.2 2025-03-01 12:25:33 +08:00
kangfenmao
2e298a64b8 fix: Simplify model selection logic in message regeneration
Modify the model selection process to directly use the appropriate model based on the conversation context, removing redundant conditional logic
2025-03-01 11:20:58 +08:00
kangfenmao
ae10f564f1 fix: Improve ModelAvatar and AssistantItem styling for better layout and text handling
- Add min-width and min-height to ModelAvatar to ensure consistent sizing
- Separate AssistantName into a new styled component for better text overflow handling
- Refactor AssistantItem to improve text display and icon alignment
2025-03-01 10:41:24 +08:00
kangfenmao
96a166c40a style: Refine Segmented component styling with transparent background and rounded corners 2025-03-01 01:44:02 +08:00
kangfenmao
0cb58d6ffc feat: Sort model groups alphabetically in provider settings
- Implement alphabetical sorting for model groups
- Use lodash's sortBy and toPairs to order model groups
- Modify rendering to use sorted model groups
2025-03-01 01:00:44 +08:00
suyao
75dc5c2ac2 fix: The proxy configuration is not correctly passed. 2025-03-01 00:42:56 +08:00
kangfenmao
4828604d86 feat: Extract ModelEditContent into separate component and refine UI styling
- Create new ModelEditContent component in ProviderSettings
- Separate model editing logic from ProviderSetting
- Adjust styling for AssistantItem and TopicsTab list items
- Refine Segmented component styling with transparent background
- Improve modal layout and interaction for model type configuration
2025-03-01 00:40:55 +08:00
kangfenmao
2592fe04a8 feat: Add assistant icon display toggle in settings
- Implement new setting to show/hide model icons in assistant list
- Add localization support for new assistant settings
- Update UI to conditionally render model avatar in AssistantItem
- Modify settings store to include showAssistantIcon state
- Enhance display settings with new toggle switch for assistant icon
2025-03-01 00:18:47 +08:00
kangfenmao
d0c9752fed refactor: Simplify Segmented component styling
- Remove custom Segmented styling from AntdProvider
- Update HomeTabs Segmented component with refined styles
- Consolidate Segmented styling in a single location
- Improve visual consistency with rounded corners and transparent background
2025-02-28 23:25:36 +08:00
kangfenmao
95f9d649ff feat: Enhance UI styling and interaction details
- Update window vibrancy to 'sidebar' for better visual effect
- Refine input bar styling with softer background and rounded corners
- Adjust toolbar button sizes and styling
- Modify topic position selection to use Segmented component
- Tweak light theme background opacity
2025-02-28 23:25:36 +08:00
ousugo
5f5db71fc3 fix: Normal content is misidentified as chain of thought content 2025-02-28 22:06:08 +08:00
Asurada
669199683b feat: Added More Settings section with risk warnings in model type configuration (#2560)
* feat: add "More Settings" option in multiple languages and enhance model type selection UI

* feat: add "More Settings" option with warnings and confirmation prompts in multiple languages

* fix: improve modal close handling and reset model type visibility
2025-02-28 22:04:44 +08:00
kangfenmao
2772b45b30 chore: Update Xirang provider configuration and localization 2025-02-28 18:20:23 +08:00
lbc123456
e93eff4e34 feat: 模型服务添加天翼云模型 (#2238)
* feat: 模型服务添加天翼云模型

* feat:add website

* fix: id is duplicate

---------

Co-authored-by: 李保成 <libaocheng@cndatacom.com>
2025-02-28 17:40:57 +08:00
kangfenmao
dcb0597706 Revert "feat: allow o1 streaming"
This reverts commit 50220fe30b.
2025-02-28 14:20:37 +08:00
ZhuangYumin
d8ddabc04f feat: let quick assistant follow theme setting 2025-02-28 13:14:45 +08:00
Pres
4b65dc82f6 feat: add support for GPT 4.5 2025-02-28 13:14:05 +08:00
Pres
a5e615578f fix:Claude model name typo 2025-02-28 11:53:30 +08:00
kangfenmao
04daf28fea Revert "docs: remove Chinese issue templates for bug reports, feature requests, and questions"
This reverts commit 96e0dcc9bc.
2025-02-28 10:34:28 +08:00
xiaotianxt
daf5741884 fix: remove restrictions on mac alt+x shortcuts
Restrictions are introduced in earlier beta versions of MacOS Sequoia.
However, in the public release, Apple revoke this restrictions.

Alt+[Char] shortcut has no restrictions now.
2025-02-28 10:30:47 +08:00
onevcat
185a26a4b6 Remove unused protocol register and open url code 2025-02-28 08:19:04 +08:00
eeee0717
9642034639 fix bug: #2474 2025-02-28 08:18:14 +08:00
TW
bc7c74e0ea feat: Enhance Assistant and Topic components with title attributes for better accessibility 2025-02-28 08:17:01 +08:00
onevcat
c011d18c72 Switch to @use and module system for scss 2025-02-28 08:16:03 +08:00
onevcat
90ac88f5cc Use the Russian language label
This ensures the language label aligns with others (using its own language name instead of English).
2025-02-27 20:40:52 +08:00
Asurada
8379c0ed3a feat: Add model editing functionality to provider settings (#2243) 2025-02-27 17:00:01 +08:00
CherryLover
166e8f8473 feat: 为模型选择弹窗添加键盘导航功能 (#2057)
* feat: 为模型选择弹窗添加键盘导航功能

* fix(SelectModelPopup): 改进键盘导航和项目筛选
2025-02-27 16:58:11 +08:00
SuYao
f1e6f6b78f fix: some proxy errors in main process (#2294)
* formatter proxy config type

* fix: some proxy errors in main process

* chore: Remove debug logging in ProxyManager
2025-02-27 16:46:05 +08:00
ZhuangYumin
50220fe30b feat: allow o1 streaming 2025-02-27 16:42:11 +08:00
NJczh
31b1bed298 fix:修复备份恢复完成后可能无权限清理临时目录 (#2247) 2025-02-27 16:40:47 +08:00
xiaotianxt
21b326ee69 feat: Improve settings navigation hotkey behavior
- Add location check to prevent navigating to settings when already on settings page
- Enable hotkey on content editable and form elements
- Use useLocation to track current route
2025-02-27 16:39:52 +08:00
SuYao
a088023869 fix: favicon can't load error (#2426)
* feat: Implement robust favicon loading with fallback mechanisms

* refactor: Improve favicon loading state and use Promise Method

* refactor: Extract FallbackFavicon into a separate component

* feat: Add Splitbee favicon service to fallback favicon URLs
2025-02-27 16:38:14 +08:00
Cicada
f172a5464d docs: Convert Traditional Chinese to Simplified 2025-02-27 16:37:06 +08:00
yeongpin
87b78caf61 feat: Add GIF support for avatar uploads without compression 2025-02-27 15:02:02 +08:00
kangfenmao
e31701b446 docs: Update README files to mark networking and first official version as completed 2025-02-26 19:30:30 +08:00
kangfenmao
0415fec3fc chore(version): 1.0.1 2025-02-26 17:28:08 +08:00
kangfenmao
8e6901b360 fix: Adjust file upload and navbar styling for cross-platform compatibility
- Update Dragger component to use customRequest for file uploads
- Add Windows-specific padding adjustment for navbar right section
2025-02-26 13:33:21 +08:00
kangfenmao
aba084e14a feat: Add O3 provider and refactor migration logic 2025-02-26 13:33:11 +08:00
icinggslits
290b7a2fd7 feat: Add search button to the knowledge base, and adjusted the display for drag-and-drop uploads (#2365)
* feat: Add search button to the knowledge base, and adjusted the display for drag-and-drop uploads

* feat: Add search button to the knowledge base, and adjusted the display for drag-and-drop uploads
2025-02-26 12:06:34 +08:00
ZhuangYumin
88e640f278 feat: add better support for openrouter thinking format 2025-02-26 12:04:47 +08:00
首都爱护动物协会
5c32d41cd8 add o3 2025-02-26 12:03:08 +08:00
kangfenmao
f09d1b3d9a chore: Improve localization formatting for Notion and Yuque error messages
- Standardize spacing and capitalization in Chinese (Simplified and Traditional) locales
- Enhance readability of error and configuration messages
- Consistent formatting for API keys, database IDs, and URLs
2025-02-26 00:21:49 +08:00
kangfenmao
74c92ba794 feat: Enhance web search settings with blacklist and result configuration
- Update Tavily description across locales to emphasize AI agent capabilities
- Add blacklist functionality for web search results
- Introduce configurable maximum search results
- Improve localization for web search settings in multiple languages
2025-02-26 00:16:13 +08:00
kangfenmao
deb4545419 chore: Reorganize and clean up localization files
This commit involves minor reorganization and cleanup of translation files across multiple languages (en-us, ja-jp, ru-ru, zh-cn, zh-tw). Changes include:

- Reordering of some translation keys
- Removing duplicate entries
- Slight restructuring of nested translation objects
- Minor formatting adjustments
2025-02-26 00:02:03 +08:00
Chen Tao
09652b2e31 feat: add web search settings (#2314)
* fix: add time when using web search

* feat: add optional

* chore

* chore

* chore

* clean code

* feat: set search max results

* feat: add manual blacklist

* clean code

* chore

* chore

* clean
2025-02-25 23:46:51 +08:00
ousugo
ffac0d4c49 feat: Improve think tag processing with more robust parsing 2025-02-25 23:46:25 +08:00
kangfenmao
ab294d783c fix: Update favicon service for message citations 2025-02-25 23:43:22 +08:00
kangfenmao
c8490bf086 fix: assistant and agent emoji 2025-02-25 21:00:23 +08:00
kangfenmao
5664d84e2c refactor: Extract file drop handling logic to separate utility function 2025-02-25 19:53:04 +08:00
icinggslits
3068cdcf7a feat: Support more file drag and drop scenarios (#2278)
* feat: Support more file drag and drop scenarios

* feat: Support more file drag and drop scenarios
2025-02-25 19:46:32 +08:00
kangfenmao
83b3531306 chore: Remove social media links from About settings 2025-02-25 19:40:52 +08:00
kangfenmao
e8b19c409d fix: Standardize Notion connection error messages across locales 2025-02-25 19:34:15 +08:00
kangfenmao
3363d1507b fix: 修复深色模式下气泡样式的用户名样式错误问题
This reverts commit 704ddfd7cc.
2025-02-25 19:31:19 +08:00
icinggslits
d938531c31 fix: Export image in dark mode (#2332)
Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2025-02-25 19:20:11 +08:00
eeee0717
22c356062b fix bug: 深色模式对话导出渲染不正确 2025-02-25 19:12:44 +08:00
ousugo
a906097026 feat: Enhance reference prompt with language matching instruction 2025-02-25 19:09:56 +08:00
Yuankui Li
0559235744 feat: 知识库支持更多txt based格式 2025-02-25 19:07:06 +08:00
Aglargil
9ee915a34b feat: add export to Yuque 2025-02-25 19:06:37 +08:00
Godcoper
704ddfd7cc fix: 修复深色模式下气泡样式的用户名样式错误问题 2025-02-25 18:58:10 +08:00
suyao
5e4d507ab8 chore: Update Grok app logo and related images 2025-02-25 15:01:01 +08:00
kangfenmao
1cbf070275 refactor: Move fullscreen notification logic to a separate hook 2025-02-25 13:32:15 +08:00
ousugo
04ac04c94d feat: Add fullscreen mode notification with localized message 2025-02-25 13:28:29 +08:00
kangfenmao
947b7047a0 chore: Remove console logs and clean up code
This commit removes unnecessary console.log statements and makes minor code cleanup in several files:
- PlantUML component
- WebSearchSettings
- WebSearchService
- Store settings

Additionally, it updates the store migration to handle LM Studio provider addition and reverts the store version
2025-02-25 13:27:31 +08:00
Chen Tao
49db9bb6e5 fix: 网络搜索添加时间信息 (#2255)
* fix: add time when using web search

* feat: add optional

* chore

* chore

* chore

* clean code
2025-02-25 13:20:53 +08:00
zzsx
53752ee217 feat: 添加更多C++文件扩展名支持
在 `textExts` 数组中添加了以下C++文件扩展名:
- `.hpp`: C++ 头文件
- `.cc`: C++ 源文件
- `.cxx`: C++ 源文件
- `.cppm`: C++20 模块接口文件
- `.ipp`: 模板实现文件
- `.ixx`: C++20 模块实现文件
2025-02-25 13:19:32 +08:00
preszzz
7953f6bb86 feat: add new claude 3.7 model support 2025-02-25 13:17:09 +08:00
Alice39s
75ac31345c feat: Add support for Gemini 2.0 and update Yi model configurations
- Added `gemini-2.0` to `visionAllowedModels`.
- Introduced new Gemini models in `SYSTEM_MODELS`:
  - `gemini-1.5-flash-8b`
  - `gemini-2.0-flash`
- Updated Yi model configurations:
  - Renamed `yi-lightning` to "Yi Lightning".
  - Deprecated `yi-medium`, `yi-large`, and `yi-vision` (replaced by `yi-lightning` per documentation).
  - Added `yi-vision-v2` as a new version of Yi Vision.
2025-02-25 08:29:59 +08:00
ousugo
2aab0b497a feat: Adapt glmzeropreview thinking chain format, enhance message thought processing with flexible extractors, 2025-02-25 08:29:16 +08:00
自由的世界人
448b946ef4 fix: folder spelling change (#2242) 2025-02-25 08:26:25 +08:00
Zicheng Zhang
20ce7ccf26 fix: count reasoning content into token estimation (#2276) 2025-02-25 08:24:53 +08:00
eeee0717
dab9787d8c fix bug: uniqueIds is null when uploaded directory 2025-02-24 21:40:17 +08:00
kangfenmao
3b194d7b1a fix: Update Infini provider API URL to include '/maas' path 2025-02-24 18:08:22 +08:00
icinggslits
85cd8a0cf4 feat: add shortcut to home window of mini app 2025-02-24 12:58:40 +08:00
vic123
ce966425b6 fix: undesired assistant selection menu popup when no ' ' before '@' 2025-02-24 12:57:26 +08:00
SagoLu
0a0c3d0ac7 fix:修复在备份和恢复备份时由于无法删除临时目录导致的功能终止 (#2224)
* refactor: Remove chat settings toolbar button from input bar

* fix:修复在备份时,由于临时文件只读导致的备份失败

* fix:修复在恢复备份时,由于临时文件只读导致的备份失败

---------

Co-authored-by: kangfenmao <kangfenmao@qq.com>
2025-02-24 12:56:19 +08:00
Alice39s
146cabf768 feat: Improve support for the Codestral and additional Mistral models
- Added new image asset `codestral.png` for Codestral model.
- Updated `embedings.ts` to include the `mistral-embed` embedding model with `max_context: 8000`.
- Updated `models.ts` to:
  - Add support for Codestral model with `codestral-latest` ID.
  - Introduce new Mistral models, including:
    - `ministral-3b-latest`
    - `ministral-8b-latest`
    - `mistral-large-latest`
    - `mistral-small-latest`
    - `mistral-embed`
  - Organize models into appropriate groups (e.g., "Mistral Chat", "Mistral Code").
- Adjusted `getModelLogo` function to include Codestral and Ministral logos.
2025-02-24 12:55:28 +08:00
kangfenmao
442909104e refactor: Rename onResend to onResendUserMessage for clarity 2025-02-24 12:50:29 +08:00
Asurada
6a24364147 feat: Add remark function to knowledge url (#2210)
* chore: Update .gitignore to exclude .cursor/rules

* feat: Add remark function to knowledge url
2025-02-24 12:47:47 +08:00
dengshenkk
d2950e023d feat: 用户侧消息快捷重试功能 (#2221)
* Update MessageMenubar.tsx

用户发送消息可以重试, 方便在接口错误后进行重试

* Update MessageMenubar.tsx
2025-02-24 12:41:59 +08:00
ousugo
4c24418ec7 feat: Improve knowledge base creation popup input focus 2025-02-24 12:40:46 +08:00
ousugo
d9f581a375 feat: Enhance knowledge search popup input focus behavior 2025-02-24 12:40:46 +08:00
sijie-chan
8fc4cf4b4b fix: 添加多个目录到知识库多个进度之间展示混淆 2025-02-24 12:40:00 +08:00
牡丹凤凰
563ed2b549 Update README.ja.md 2025-02-24 07:23:23 +08:00
牡丹凤凰
ef623e1eee Update README.zh.md 2025-02-24 07:22:55 +08:00
牡丹凤凰
88b8fb3085 Update README.md (#2213) 2025-02-24 07:22:12 +08:00
kangfenmao
1b742b8a1b chore(version): 1.0.0 2025-02-23 15:10:24 +08:00
kangfenmao
820b4a2376 feat: Add Tavily dark mode logo and improve web search settings UI 2025-02-23 15:10:01 +08:00
kangfenmao
17d84a621f refactor: Rename AssistantItemComponent to AssistantItem and update imports 2025-02-23 14:30:17 +08:00
wnzzer
7f4bc5c80f fix:清空话题总是修复当前话题 (#2167) 2025-02-23 14:26:31 +08:00
kangfenmao
eba0d74eaa feat: Improve web search UI and localization 2025-02-23 14:22:09 +08:00
kangfenmao
0a89b09fc9 chore: Update Tavily core package and remove js-tiktoken dependency 2025-02-23 11:01:30 +08:00
kangfenmao
bbe89b6e41 feat: add web search 2025-02-23 11:01:29 +08:00
kangfenmao
bb624232f2 chore(version): 0.9.30 2025-02-23 07:02:00 +08:00
kangfenmao
8f4868af01 feat: Enhance assistant emoji and popup UI interactions 2025-02-23 06:45:35 +08:00
George·Dong
3874a1ee5d feat: 添加Notion导出自动分页功能 (#2098)
* fix: 长对话Notion导出失败(分页导出)

* feat: 添加Notion导出自动分页设置
2025-02-23 06:45:26 +08:00
ousugo
edc01ea0ba feat: Auto-select newly added knowledge base 2025-02-23 00:17:46 +08:00
kangfenmao
1c586b1060 chore(version): 0.9.29 2025-02-22 22:58:19 +08:00
ousugo
a34c6b19be fix: Regenerat messages don't use @ specified models 2025-02-22 22:35:02 +08:00
ousugo
f8947a7f34 fix: Restore textarea focus after selecting mention model via mouse 2025-02-22 22:34:16 +08:00
shijian
be654a8520 fix: 复制聊天信息按钮显示不全 2025-02-22 22:32:30 +08:00
kangfenmao
29afcfed7f fix: Remove LM Studio provider from initial state 2025-02-22 22:31:37 +08:00
kangfenmao
253da36210 fix: Remove duplicate empty LM Studio providers 2025-02-22 13:35:14 +08:00
aber0724
fbc3a29811 feat: Add Monica minapp 2025-02-22 11:27:30 +08:00
sijie-chan
de1999037f fix: 添加目录到知识库任意一个失败界面上会展示失败 2025-02-22 11:26:31 +08:00
kangfenmao
a314aba38f chore(version): 0.9.28 2025-02-21 18:25:30 +08:00
kangfenmao
9bb7b2751f feat: update miniapp logo 2025-02-21 18:25:23 +08:00
kangfenmao
596a73c5ec feat: Enhance topic message clearing functionality
关于“清空话题”的Bug反馈 #2107

close #2107
2025-02-21 16:48:04 +08:00
suyao
799b70f9d9 fix: add first message handling in mini home window 2025-02-21 16:32:56 +08:00
kangfenmao
807d3cfa9f feat: add export function to message 2025-02-21 16:27:07 +08:00
kangfenmao
93e5ed827e refactor: Remove chat settings toolbar button from input bar 2025-02-21 14:31:05 +08:00
kangfenmao
302a653010 chore: Upgrade Yarn and TypeScript patch versions 2025-02-21 14:18:16 +08:00
kangfenmao
7172c390a0 feat: Synchronize and clean up localization files
This commit involves several improvements to localization files across different languages:
- Reordered and cleaned up translation keys
- Removed redundant entries
- Ensured consistent ordering of keys
- Added missing translations for various features
- Normalized whitespace and formatting
2025-02-21 14:15:36 +08:00
落子
f22fc29cad feat: add "Copy as" options to topics right click menu (#2095)
* feat: Add copy topic as image and Markdown functionality

* add translation
2025-02-21 13:59:34 +08:00
Avan
c4747b0cd3 feat: baidu ai search 2025-02-21 13:58:19 +08:00
kangfenmao
bd2a4c3c22 feat: Add API host formatting utility function 2025-02-21 13:50:24 +08:00
MyPrototypeWhat
bb02ebe818 refactor: Move abort controller to utils and update imports 2025-02-21 12:50:18 +08:00
MyPrototypeWhat
01bf84b8ca feat: Add message completion abort functionality 2025-02-21 12:50:18 +08:00
kangfenmao
7f74e2a567 refactor: Simplify translation history clear button configuration 2025-02-21 11:17:41 +08:00
ousugo
b568dfef17 feat: Add newline tooltip for translation input 2025-02-21 11:16:02 +08:00
kangfenmao
f395bb32de refactor: Simplify embedding model regex pattern 2025-02-21 09:46:26 +08:00
kangfenmao
40ddf94224 refactor: Clean up MinAppsPopover component formatting 2025-02-20 15:35:51 +08:00
kangfenmao
a9ee9ec762 refactor: Simplify topic deletion interaction 2025-02-20 15:33:24 +08:00
ousugo
9189cdb8ff feat: Add direct topic deletion shortcut 2025-02-20 15:19:32 +08:00
ousugo
8d1ec04dd3 feat: Add confirmation dialog for topic deletion 2025-02-20 15:19:32 +08:00
Yrom
9eee9c42fa feat: add developer tools button in MinApp for development mode 2025-02-20 15:19:10 +08:00
ousugo
530aeb58b8 feat: Add emoji selection for assistant name 2025-02-20 15:17:04 +08:00
kangfenmao
4fa00baeae feat: Add C and C++ file extensions to supported text files
close #2066
2025-02-20 14:45:11 +08:00
kangfenmao
438b8cb08a fix: Update migration config to set default thought auto-collapse 2025-02-20 12:24:24 +08:00
ousugo
7861803814 feat: Add thought content auto-collapse setting 2025-02-20 12:22:45 +08:00
ousugo
adb5e4fc31 feat: Add copy functionality to message reasoning content 2025-02-20 12:22:45 +08:00
kangfenmao
58100ab822 refactor: Simplify translation page layout and styling 2025-02-20 12:16:38 +08:00
Chen Tao
b405d2e9ac feat: add shortcuts to open settings page (#1964)
* feat: add shortcuts to open settings page
* refactor: simplify code
* fix: change to useHotKeys
2025-02-20 12:10:16 +08:00
jtsang4
f1a9699be4 feat: Add backspace handling to remove last mentioned model 2025-02-20 12:08:25 +08:00
eeee0717
173e164d2b fix: knowledge base status problem 2025-02-20 12:07:05 +08:00
kangfenmao
54b7bfd663 fix: Improve null handling in code block and syntax highlighting 2025-02-20 12:04:29 +08:00
kangfenmao
7f3e6bb44d refactor: Remove default grid settings from migration config 2025-02-20 11:54:21 +08:00
littel_penguin66
e5dee7801e feat: add dify miniapp (#1999)
* add Dify miniapp

* add wpslingxi,lechat,abacus miniapps

* resize pic

* change png to webp

* update 71
2025-02-20 11:52:36 +08:00
FischLu
5503a2ccea fix: fix translation 2025-02-20 11:50:49 +08:00
onlyfeng
64a609cdf0 fix(KnowledgeBase): handle JSON parse failure by falling back to text file processing to avoid error display affecting normal progress indication 2025-02-20 11:44:36 +08:00
kangfenmao
34a5b89754 fix: Ignore hidden files when traversing directories 2025-02-20 11:43:01 +08:00
FischLu
c65d351a3d fix: fix the issue where the menu scrolls back to the top after clicking an option 2025-02-19 21:40:32 +08:00
kangfenmao
b5087639c0 docs: Update README files with comprehensive TODO list and minor formatting improvements 2025-02-19 20:07:10 +08:00
Teo
b0f74159dd feat: 添加翻译历史功能 2025-02-19 19:38:59 +08:00
Yrom
6c8b93c4d1 feat: Support dark theme for PlantUML 2025-02-19 18:37:05 +08:00
Yrom
d73d92e795 feat: Add PlantUML diagram support (via PlantUML official online server) 2025-02-19 18:37:05 +08:00
ousugo
598630b294 refactor: Simplify model type detection with utility functions 2025-02-19 18:33:51 +08:00
ousugo
aa3e1cc1e6 feat: Add Doubao provider support for model type detection
(cherry picked from commit 008b84e128484c98eb59c75d8f44cbc320509049)
2025-02-19 18:33:51 +08:00
ousugo
a9f34f12b9 feat: Add model generation check before narrow mode toggle 2025-02-19 18:33:16 +08:00
ousugo
3f5c83c5ea chore: Enhance issue templates with improved guidance and visual context 2025-02-19 17:19:15 +08:00
jiangjiwei
0e60ee47f1 feat: 为 Notion 导出添加可配置的页面名称 key 2025-02-19 17:18:45 +08:00
ousugo
d35e604462 fix: Ensure model is updated when setting default model 2025-02-19 17:13:52 +08:00
Teo
fd734e0810 refactor: 翻译页UI重构 2025-02-19 15:53:52 +08:00
kangfenmao
e960aac867 chore(version): 0.9.27 2025-02-19 10:21:12 +08:00
kangfenmao
aafb62cb2f feat: Add web search support for OpenRouter provider 2025-02-19 10:11:49 +08:00
icinggslits
08535924ce feature: Adaptive height of textarea on translation page 2025-02-19 09:57:26 +08:00
kangfenmao
76a02d184f feat: Add default API host for DMX provider in migration 2025-02-19 09:45:41 +08:00
kangfenmao
af461c9246 fix: Safely update topic with existing topic data 2025-02-19 09:35:10 +08:00
kangfenmao
8815b6248e fix: Improve knowledge base processing and deletion handling 2025-02-19 09:28:36 +08:00
kangfenmao
b832809b7a refactor: Simplify DragableList styling and remove unnecessary margins 2025-02-19 09:21:10 +08:00
suyao
88e36627f5 fix: update model identification with provider-specific uniqueness 2025-02-19 09:14:45 +08:00
ousugo
ac2a3156f8 feat: Add German language support to translation options 2025-02-19 08:21:00 +08:00
George·Dong
ff42b512cf feat: 添加Notion文档按钮Tooltip 2025-02-19 08:20:21 +08:00
George·Dong
ee1b8f95c3 fix: 修改导出到Notion的相关提示 2025-02-19 08:20:21 +08:00
icinggslits
856cd7d34f fix: Update language options promptly 2025-02-19 08:18:41 +08:00
首都爱护动物协会
64fb414e62 Updated provider information 2025-02-19 07:10:45 +08:00
kangfenmao
35b47ec640 fix: Add top margin to 'Add Assistant' button in AssistantsTab 2025-02-18 21:17:13 +08:00
Yrom
e4101fff49 feat: Enable search capability for Qwen commercial version model 2025-02-18 21:14:43 +08:00
kangfenmao
e6f3663e9b chore(version): 0.9.26 2025-02-18 20:55:04 +08:00
kangfenmao
64da3d32b8 fix: Update agent knowledge base field name and handling 2025-02-18 20:55:04 +08:00
Chen Tao
3da3ee0225 feat: artifacts add open external (#1812)
* feat: artifacts add open external

* fix: remove modal
2025-02-18 19:56:39 +08:00
Teo
6e4be783d7 fix: 解决生成过程中出现错误内容被清空覆盖问题 2025-02-18 19:46:50 +08:00
美兰十三
76267716c3 fix: 修复mac下快捷键注册control被替换成command的问题 2025-02-18 19:46:28 +08:00
eeee0717
10cf842224 feat: 目录进度可视化 2025-02-18 19:45:47 +08:00
kangfenmao
f735673f6d feat: Add 'off' option for reasoning effort in assistant settings 2025-02-18 18:16:14 +08:00
ousugo
edcf45d7c0 fix: Recalculate token consumption after modifying the message, resolve #1829 2025-02-18 16:34:52 +08:00
ousugo
4cfb6a9118 fix: Improve DragableList component styling and placeholder handling 2025-02-18 16:26:34 +08:00
lucifer9
73e48c045e adjust Notion database ID input width in DataSettings 2025-02-18 16:22:53 +08:00
lucifer9
d2139abcb9 Refactor WebDAV i18n and UI for improved flexibility and localization
- i18n Updates:
   - Refactored WebDAV-related translations into nested JSON structures for better organization.
   - Added support for pluralization in time intervals (minutes and hours) across all locales (en-us, ja-jp, ru-ru, zh-cn, zh-tw).

 - UI Enhancements:
   - Updated `DataSettings` and `WebDavSettings` components to use the new i18n keys for time intervals.
   - Improved the `Select` dropdown for sync intervals with dynamic pluralization based on locale.
   - Adjusted input field widths for better alignment and consistency.

 - Code Cleanup:
   - Removed redundant comments and unused code in `WebDavSettings.tsx`.
   - Simplified button and input styling for a cleaner layout.
2025-02-18 16:22:53 +08:00
ousugo
14680f98e4 fix: Clicking the taskbar icon while enable the Quick Assistant can't open the main window 2025-02-18 16:01:10 +08:00
ousugo
da67f2a863 feat: Add kimi-latest model support in vision and model logos 2025-02-18 15:50:01 +08:00
kangfenmao
040dcb836e style: Adjust horizontal message layout display property 2025-02-18 15:48:13 +08:00
Teo
59cbb894ea style: 优化聊天窗口UI (#1881) 2025-02-18 11:43:42 +08:00
MyPrototypeWhat
4c6cc4140c feat: Conditionally hide thinking loader for paused messages (#1875)
Co-authored-by: lizhixuan <zhixuan.li@banosuperapp.com>
2025-02-18 11:10:48 +08:00
kangfenmao
e5ace39a75 chore(version): 0.9.25 2025-02-18 10:41:44 +08:00
kangfenmao
75af101bbc feat: Add size prop to MessageThought Collapse component 2025-02-18 10:12:30 +08:00
kangfenmao
a8853a2322 fix: Handle undefined provider in model name generation 2025-02-18 09:56:26 +08:00
kangfenmao
cb381bda5e feat: Improve system prompt styling with theme-aware background 2025-02-18 09:42:52 +08:00
icinggslits
c519edce64 feat: Backspace deletes clipboard text in MiniApp 2025-02-18 08:13:56 +08:00
icinggslits
0521aa0bca fix: init zoom 2025-02-18 08:11:38 +08:00
ousugo
d4b49f5b56 refactor: Improve PromptPopup text area focus and cursor placement 2025-02-18 08:10:58 +08:00
ousugo
978306ab4e feat: Improve text edit popup focus and cursor placement 2025-02-18 08:10:58 +08:00
kangfenmao
5d82029e56 refactor: Extract message group menu bar into a separate component 2025-02-17 23:21:24 +08:00
kangfenmao
ea11591f75 fix: Adjust paragraph margin when followed by list 2025-02-17 23:08:17 +08:00
kangfenmao
ebe3980bac fix: Conditionally render message group border based on popover state 2025-02-17 23:02:49 +08:00
Chen Tao
d263d2078a feat: add knowledge base filter (#1822)
* feat: add search filter

* chore
2025-02-17 22:18:10 +08:00
kangfenmao
17891d20c7 refactor: Extract message group settings into a separate component 2025-02-17 22:14:47 +08:00
luwux
cfc9c42c8d improvement(shortcut): Supports Option + Space on Mac
Supports the Option (⌥) + Space shortcut, as it's the default shortcut for ChatGPT Desktop app to show popup.
2025-02-17 19:04:08 +08:00
ousugo
8f3e17a003 feat: Add page title for Cherry Studio, resolve #1222 2025-02-17 19:02:56 +08:00
rebecca554owen
25a3cd5073 fix 2025-02-17 18:38:22 +08:00
kangfenmao
83ddb8e161 feat: Add grid mode settings for message display 2025-02-17 18:35:36 +08:00
kangfenmao
43375058af feat: Enhance Notion settings with placeholders and help icon 2025-02-17 17:19:24 +08:00
kangfenmao
914f83183e feat: update knowledge base file upload hint text 2025-02-17 16:50:34 +08:00
FischLu
368177e587 feat: improve model mention autocomplete behavior under IME 2025-02-17 16:38:44 +08:00
duanyongcheng
ce421dbe78 feat: show provider in mesage 2025-02-17 16:38:00 +08:00
Chen Tao
2e8af9ef26 feat: allow knowledge base multiple search #1346 (#1773)
* feat: agent can select multiple knowledge bases

* feat: basic search multiple knowledge base

* fix bug: knowledge base is delete, assistants and agents sync delete

* fix bug: assistant and knowledge base button sync

* feat: allow to search multiple knowledge base

* chore: finish rebase to upstream/main
2025-02-17 16:36:25 +08:00
cl1107
194a2e1d3a feat: Add a new grid mode for message display. (#1626)
* chore(version): 0.9.23

* feat(renderer): 新增网格模式的消息展示方式

* feat(message): 新增消息网格展示相关设置

* 根据 gridPopoverTrigger 属性动态设置消息分组的样式

* 在 MessageMenubar 组件中,各个按钮 click 事件阻止事件冒泡,避免打开 popover

* 多模型回答样式添加网格模式并优化消息样式

---------

Co-authored-by: kangfenmao <kangfenmao@qq.com>
2025-02-17 16:36:01 +08:00
shniubobo
1043430568 fix: Rendering error with MathJax for Chinese text 2025-02-17 16:24:38 +08:00
首都爱护动物协会
f0ada3c9fe update provider info 2025-02-17 16:21:09 +08:00
ousugo
2842d439cd fix: open current webview URL when launching external link 2025-02-17 16:20:12 +08:00
ousugo
34ba72d1fa fix: Clicking the help button always opens a new webview
(cherry picked from commit 4939afafabcbfb294f00d21053939cad8238731e)
2025-02-17 16:19:31 +08:00
kangfenmao
96e0dcc9bc docs: remove Chinese issue templates for bug reports, feature requests, and questions 2025-02-17 12:02:07 +08:00
ousugo
8905f34350 fix: update Baidu API key URL in provider configuration, resolve #1794 2025-02-17 11:55:53 +08:00
George·Dong
8de58048c8 fix: 修复切换助手时无法正确切换到助手默认模型的问题 (#1776) 2025-02-17 11:28:17 +08:00
Shelly
532139f4cb fix: 修复同名模型选择问题 (#1772)
1. 同名模型显示的供应商名称问题
2. 同名模型不同供应商不能被同时选择

Co-authored-by: duanyongcheng <duanyongcheng77@gmail.com>
2025-02-17 09:47:01 +08:00
Wenwei Lin
616b95f8fa feat: support json and draftsExport file in knowledge base (#1717) 2025-02-17 08:25:07 +08:00
ousugo
51692ad3a4 feat: Expand reasoning model regex to include 'thinking' keyword 2025-02-17 08:16:47 +08:00
ousugo
35b9726b29 fix: sidebar navigation and active state handling
- 当固定在侧边栏的小程序被打开时,对应图标显示为被选中
- 修复点击两次主题切换按钮会导致当前 Webview 被错误关闭的问题
- 修复当 Webview 处于打开状态,点击侧边栏按钮无法立即跳转到对应界面的问题
- 修复打开帮助文档,其按钮没有显示为被选中的问题
- 修复在设置界面时打开帮助文档,设置按钮继续显示为被选中的问题
2025-02-17 08:15:03 +08:00
ousugo
3f8ac280e6 fix: correction of the capitalization of Perplexity names 2025-02-17 08:13:56 +08:00
ousugo
ed7eb361e3 fix: Fix the miniapp sorting problem, resolve #1725
- 修复小程序拖动排序不生效的问题
- 修复小程序拖动排序时列表滚动排序不生效的问题
2025-02-17 08:13:56 +08:00
Neal_Tan
7fe2bb4b90 docs: optimize issues (#1790) 2025-02-17 08:12:40 +08:00
kangfenmao
421540eec0 style: Enhance scrollbar appearance in mention models dropdown 2025-02-16 13:56:10 +08:00
FischLu
0937700537 refine code 2025-02-16 13:54:32 +08:00
FischLu
3f656ab202 feat: implement select mode menu autoscroll for long mode lists 2025-02-16 13:54:32 +08:00
kangfenmao
87bce69a13 Revert "fix: Improve the @ model list experience"
This reverts commit efba601f0f.
2025-02-16 13:54:09 +08:00
bfdyanshe
50cd93cf62 fix: Separate EPUB files into dedicated book file extension category 2025-02-16 13:46:52 +08:00
bC2y5tal
7a7f51d5f3 feat: Add EPUB file support to document loader 2025-02-16 13:46:52 +08:00
icinggslits
6a7ec6d8ba improvement(shortcut): Support more keyboard shortcuts 2025-02-16 13:45:03 +08:00
icinggslits
d4129816ce add usableEndKeys 2025-02-16 13:45:03 +08:00
kangfenmao
8605e9ae44 feat: Enhance topic handling and message prompt generation 2025-02-16 13:41:31 +08:00
kangfenmao
ba65ce74cc feat: Improve knowledge base threshold tooltip and input 2025-02-16 12:20:08 +08:00
kangfenmao
dbfdfa0655 chore: Update store migration for Coze minapp 2025-02-16 12:14:20 +08:00
Chen Tao
c3220a7d64 feat: 添加知识库匹配度阈值 (#1634)
* feat: 添加知识库匹配度阈值

* fix: 增加问答时知识库阈值

* feat: 当知识库未检索到数据时使用通用对话逻辑

* fix: add toast
2025-02-16 11:38:00 +08:00
Avan
912eb3c264 style: add bot.n.cn logo 2025-02-16 11:36:58 +08:00
Avan
1cd808a326 feat: add bot.n.cn 2025-02-16 11:36:58 +08:00
George·Dong
9dcc295ffc feat: Add Coze minapp 2025-02-16 10:38:28 +08:00
yangtb2024
ab4beb2d9b fix: 窗口较小时,工具显示适配问题 2025-02-16 10:35:45 +08:00
kassadin
97ea84a0a6 fix: unregister global shortcuts 2025-02-16 10:34:24 +08:00
jyeric
f4b4ef065b Fix: Font size and Latex problem, resolve CherryHQ#1034 CherryHQ#1596 (#1723) 2025-02-15 22:55:43 +08:00
Wenwei Lin
dc3c2ccb9c fix: add ellipsis in knowledge base item (#1718) 2025-02-15 22:51:07 +08:00
Wenwei Lin
9a38c97552 fix: support html file in knowledge base (#1703) 2025-02-15 22:50:05 +08:00
美兰十三
50727025c3 feature: add topic prompt (#1696)
* feat: 新增话题补充提示词

* feat: 新增话题补充提示词

* feat: 新增话题补充提示词

* feat: 新增话题补充提示词

* feat: 新增话题补充提示词
2025-02-15 08:21:59 +08:00
icinggslits
80a2fdc812 调整show_app快捷键功能的交互逻辑 2025-02-15 08:17:18 +08:00
kangfenmao
7cee1a2bbf Revert "fix: 网页链接附带中文标点解析错误"
This reverts commit eb9edc10b8.
2025-02-15 01:30:13 +08:00
kangfenmao
cab7318c77 fix: Improve handling of 'undefined' values in JSON parsing 2025-02-15 01:25:59 +08:00
eeee0717
eb9edc10b8 fix: 网页链接附带中文标点解析错误 2025-02-15 01:06:32 +08:00
kangfenmao
160872e1c4 feat: Add LM Studio and ModelScope as system LLM providers
- Update llm.ts to include LM Studio and ModelScope in initial system providers
- Modify migrate.ts to add migration logic for adding these new providers
- Ensure providers are added only if they don't already exist in the configuration
2025-02-15 01:03:09 +08:00
kangfenmao
3752dbd962 fix: Correct migration version configuration 2025-02-15 00:55:07 +08:00
Yihong Wang
0dab0fe437 feat: Add NotebookLM to MinApps solve #1679 2025-02-15 00:52:47 +08:00
eeee0717
9d4b6d07fd fix: 分组和非分组逻辑修改 2025-02-15 00:33:39 +08:00
eeee0717
25acc20a32 fix: Switching model does not work 2025-02-15 00:33:39 +08:00
ousugo
b0ba66f708 feat: Improve textarea cursor positioning on focus 2025-02-15 00:31:36 +08:00
ousugo
efba601f0f fix: Improve the @ model list experience
- 修复使用方向键上下移动时,列表不随之滚动的问题
- 添加滚动条
2025-02-15 00:29:32 +08:00
ousugo
a8d5258e38 feat: Add platform and version fields to all issue templates 2025-02-15 00:26:31 +08:00
Konjac-XZ
5b03d99655 fix: Translation error when passing empty user messages to certain models.(Refined) 2025-02-15 00:24:17 +08:00
kangfenmao
1f29aa0133 chore(version): 0.9.24 2025-02-14 15:04:59 +08:00
kangfenmao
6e889f4cca refactor: Improve provider removal logic in LLM store 2025-02-14 14:49:34 +08:00
ousugo
382b4570cf perf: Add new Infini AI models to system models list 2025-02-14 14:37:57 +08:00
ousugo
c83797fca4 feat: Add reasoning model filter in EditModelsPopup 2025-02-14 14:30:48 +08:00
kangfenmao
12c47102ea refactor: Improve provider settings and menu handling 2025-02-14 13:35:58 +08:00
kangfenmao
094d6f7dcd style: Adjust group menu bar styling 2025-02-14 13:18:16 +08:00
kangfenmao
b25137cfbb feat: Add ModelScope provider to LLM providers list 2025-02-14 13:13:32 +08:00
Col0ring
60205f1fa0 feat: add modelscope provider (#1563)
Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2025-02-14 13:12:46 +08:00
kangfenmao
fef2acf712 feat(notion): Add divider to Notion settings page 2025-02-14 13:08:47 +08:00
Trey Dong
f44e7e6a14 feat(notion): 添加 Notion连接检查功能 (#1620)
- 在 Notion 配置页面添加"检查"按钮
- 实现 Notion 连接检查逻辑
- 添加相关国际化文本
2025-02-14 10:52:16 +08:00
hehua2008
b1d577a0ac feat: Add LM Studio support (#1572)
Co-authored-by: hehua2008 <hegan2010@gmail.com>
Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2025-02-14 10:49:57 +08:00
FischLu
b532e19e68 feat: Implement circular selection in model selector 2025-02-14 10:40:03 +08:00
duanyongcheng77
417b75a066 chore: add ignore for .cursoerules 2025-02-14 10:38:51 +08:00
duanyongcheng77
4d749b8178 chore: 🤖 add aider gitignore 2025-02-14 10:38:51 +08:00
Asurada
2674cca6f0 feat: Add XiaoYi miniapp, resolve #1591 (#1595)
Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2025-02-14 10:37:42 +08:00
ousugo
810417a8fd fix: Solve the problem that eslint always reports line break errors on Windows 2025-02-14 10:36:07 +08:00
ousugo
fbd331fdf2 feat: Improve model search by adding name-based filtering, resolve #1520
搜索模型时,同时搜索模型的名字和 ID
2025-02-14 10:32:34 +08:00
kangfenmao
e449248846 chore: Update Vite config and remove deprecated migration code
- Exclude additional chunk in Electron Vite configuration
- Remove outdated migration logic for providers and MinApps
2025-02-14 10:31:24 +08:00
首都爱护动物协会
934b32fb46 add providers
新增服务商:
1.无问芯穹
2Perplexity
3.DMXAPI

补充部分embedding模型信息
2025-02-14 10:28:52 +08:00
shniubobo
412c449648 fix: Regression on reasoning time
PR #1253 fixed reasoning time calculation for APIs that return reasoning
content in `delta.content`, but introduced a regression for those
returning it in `delta.reasoning_content`. This commit fixes the
regression.

Fixes #1593
2025-02-14 10:26:54 +08:00
shniubobo
b846b809f2 fix: Remove trailing newline in codeblocks 2025-02-14 10:10:30 +08:00
Xin Rui
11e2a48f79 fix: translation error when passing empty user messages to certain models.. (#1612) 2025-02-14 10:09:47 +08:00
kangfenmao
2fb628aede chore(version): 0.9.23 2025-02-13 17:49:06 +08:00
kangfenmao
9b74e88884 feat: Enhance file processing and loader configuration
- Remove image loader from dependencies
- Update file loading to skip image, video, and audio files
- Add logging for knowledge base file processing
- Modify common file extensions list
- Add type ignore for LocalPathLoader to resolve TypeScript issues
2025-02-13 17:49:06 +08:00
kangfenmao
6889ddbefc feat: Add file type not supported error message in multiple languages 2025-02-13 16:41:48 +08:00
kangfenmao
a9ee7c1d2b fix: Reset MinApp onClose handler when closing the app 2025-02-13 16:10:46 +08:00
kangfenmao
bfd25a8c8c chore(version): 0.9.22 2025-02-13 14:02:45 +08:00
kangfenmao
6e16ef9cc6 refactor: Remove unused onMaxTokensChange function 2025-02-13 14:02:36 +08:00
kangfenmao
ef633fca62 feat: Add useSidebarIconShow hook to conditionally render sidebar icons 2025-02-13 13:38:46 +08:00
kangfenmao
c5e31c9dfa feat: Add documentation link to sidebar with multilingual support 2025-02-13 13:27:25 +08:00
kangfenmao
dc82b3b970 feat: Improve token limit settings and knowledge base URL handling
- Update OpenAI package to version 4.77.3
- Add confirmation modal for max tokens setting
- Modify max tokens input to use InputNumber instead of Slider
- Update localization strings for max tokens and URL input
- Enhance knowledge base URL input to support multiple URLs
- Improve error handling and input validation
2025-02-13 13:12:51 +08:00
kangfenmao
0d8b8cf7e7 style: code format 2025-02-13 11:40:55 +08:00
Chen Tao
65596a355d feat: knowledge base support more file types (#1300)
* feat: knowledge base support more file types

* chore: add common document types

* feat: finish basic odloader

* feat: finish open document loader

* feat: support more type from dictionary

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

* chore
2025-02-13 11:36:33 +08:00
Wenwei Lin
13a0fd0a65 fix: Label text was obscured in create agent page 2025-02-13 11:36:07 +08:00
Chen Tao
dab6271101 feat: add i18n sync script (#1538)
* feat: add i18n sync script

* chore
2025-02-13 11:34:23 +08:00
Asurada
c344261e17 feat: add google AI Studio minapp, resolve #832 (#1518)
* feat: add google AI Studio minapp, resolve #832

* fix: correct variable name for aistudio in migrateConfig
2025-02-13 11:28:51 +08:00
牡丹凤凰
938af94426 Update README.zh.md (#1516) 2025-02-12 23:10:50 +08:00
牡丹凤凰
48bf0e3a44 Update README.ja.md (#1515) 2025-02-12 23:10:10 +08:00
牡丹凤凰
3f0f61d66a Update README.zh.md (#1514) 2025-02-12 23:08:59 +08:00
牡丹凤凰
1f277e26a0 Update README.md (#1513) 2025-02-12 23:07:46 +08:00
kangfenmao
5229cef35f feat: update AIHubMix OAuth and release workflow configuration 2025-02-12 18:24:57 +08:00
kangfenmao
fc1c49213b fix(i18n): use translation for API key error message 2025-02-12 18:24:39 +08:00
kangfenmao
60b462ae9d feat: remove auto reset model feature #1435
close #1435
2025-02-12 16:58:33 +08:00
kangfenmao
299cda7d44 feat: expand embedding model regex to include more model identifiers #1481
close  #1481
2025-02-12 16:39:35 +08:00
kangfenmao
52026c0772 feat: switch default math rendering engine to KaTeX #1485 2025-02-12 16:34:24 +08:00
kangfenmao
f748a1b274 fix(i18n): model exist error tip 2025-02-12 16:11:01 +08:00
kangfenmao
23bd78cc9c fix: openai o1 models not support max_token params
close #1378
close #1378
close #1340
close #1197
close #491
2025-02-12 15:59:42 +08:00
kangfenmao
4fe306d393 fix: doubao not support files type 2025-02-12 15:41:24 +08:00
kangfenmao
3229918d20 feat: WebDAV data backup and restore secondary confirmation #1326
close #1326
2025-02-12 15:19:21 +08:00
kangfenmao
19c8b484fd fix: update Ollama API endpoint URL 2025-02-12 14:56:59 +08:00
kangfenmao
5784f5bbd5 chore: update store migration and LLM providers 2025-02-12 14:52:45 +08:00
kangfenmao
f0b5a75387 docs: change knowledge base documents chunk max limit 2025-02-12 14:36:56 +08:00
cnJasonZ
ea4ce0c17c feat: add new model provider PPIO (#1359) 2025-02-12 14:14:56 +08:00
方程
1c7e6b979a feat: add gitee ai provider (#1473)
* feat: add gitee ai provider

* feat: add gitee ai provider

---------

Co-authored-by: 方程 <fangcheng@oschina.cn>
2025-02-12 14:11:13 +08:00
ousugo
c32423769a feat(ISSUE_TEMPLATE): 添加Issue提交检查清单 2025-02-12 14:09:36 +08:00
亢奋猫
387393555a feat: 🎸 使用@呼出模型选择列表 #1317 #1324 (#1458)
* feat: 🎸 使用@呼出模型选择列表

输入第一个字符为@符号的时候可以呼出选择模型的列表

* feat: 🎸 Only one can be chosen at a time

一次只能选择一个模型,选择后自动关闭。选择过的模型不在出现在列表,避免删除模型的时候显示异常。

* fix: 🐛 When choosing the model, Enter will send a message

* feat: 🎸 选中的模型显示供应商

* feat: 🎸 pinned module show privoder

* feat: 🎸 only selected modle show provider

* feat: 🎸 删除@符号以后自动关闭

* feat: 🎸 增加模糊搜索

---------

Co-authored-by: duanyongcheng77 <duanyongcheng77@gmail.com>
2025-02-12 14:08:18 +08:00
牡丹凤凰
1d960993c7 Update embedings.ts 2025-02-12 08:31:00 +08:00
牡丹凤凰
43dc4e85a7 Update zh-tw.json
更正繁体中文当中关于Temperature的描述
2025-02-12 08:30:34 +08:00
airwish
df34c48757 feat: expanded web search models 2025-02-12 08:30:00 +08:00
牡丹凤凰
b9641cd612 Update zh-tw.json (#1433)
助手菜单名称显示不全
2025-02-12 08:25:14 +08:00
kangfenmao
d8d97ff637 feat: Add image loader to embedjs configuration 2025-02-11 22:55:49 +08:00
kangfenmao
e06a510e9c chore: Update embedjs dependencies to version 0.1.28 2025-02-11 22:36:34 +08:00
linauror
83d96c7927 fix:针对思考类模型的返回,总结标题仅截取</think>之后的内容 (#1415) 2025-02-11 18:05:09 +08:00
Trey Dong
29b83862b7 feat: add pin topic feature (#1408)
* feat: 新增导出至Notion的选项

* fix:添加多语言支持

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

* fix:修复多语言错误及调整UI样式统一

* feat:添加话题固定功能
2025-02-11 16:51:58 +08:00
kangfenmao
3635952697 fix: upload button tooltip 2025-02-11 16:34:26 +08:00
lucifer9
832247bb77 feat: add support for clickable citations in message content (#1381)
* Add support for clickable citations in message content

* update format
2025-02-11 16:21:20 +08:00
kshern
7333bc4476 fix: retain selected model when regenerating message (#1382)
* fix: retain selected model when regenerating message instead of reverting to default model

* fix: use props model

---------

Co-authored-by: Shern <shenkeji@corp.netease.com>
2025-02-11 14:12:56 +08:00
Trey Dong
fa5522bbff feat: 增加导出话题至Notion的功能 (#1331)
* feat: 新增导出至Notion的选项

* fix:添加多语言支持

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

* fix:修复多语言错误及调整UI样式统一
2025-02-11 11:27:01 +08:00
kangfenmao
0b3cef41ae Revert "feat: enable local network access on macOS #1178"
This reverts commit f8d9318dbc.
2025-02-11 11:18:33 +08:00
Chen Tao
488ec9bb03 fix: 数据库文档个数变为默认6个#1366 #1370 2025-02-11 10:05:34 +08:00
美兰十三
ffd1d47277 fix: 快捷键无法绑定空格 2025-02-11 09:25:42 +08:00
Peter Chen
470ec81827 Update MessageThought.tsx 2025-02-10 16:48:47 +08:00
kangfenmao
6f4f7ed170 fix: store migrate version 2025-02-10 14:40:30 +08:00
Chen Tao
c2ce72cf54 feat: add translate selection (#1010)
* feat: add translate selection

* chore: add default translate value

* feat: optimize trigger translation shotcut and add TanslateLanguageVarious

* fix

* fix: add database migrate version
2025-02-10 13:19:46 +08:00
郑恩
51fa93e01e feat: 优化思考过程显示的换行效果 2025-02-10 13:17:32 +08:00
Fadouse
ce20ed724f fix: correct thinking time calculation for deepseek r1 2025-02-09 21:29:21 +08:00
Wenwei Lin
be65d66b88 feat: 知识库文件支持 html 类型 2025-02-09 21:27:15 +08:00
kangfenmao
055173b2ef chore(version): 0.9.21 2025-02-09 10:20:03 +08:00
kangfenmao
b2e2f3b0f1 fix: Remove local network access switch and add insecure content loading 2025-02-09 10:14:35 +08:00
kangfenmao
32df17c229 fix: max chunk size 2025-02-09 09:32:40 +08:00
牡丹凤凰
193255cf54 Update embedings.ts
embedding models information
2025-02-09 09:31:01 +08:00
kangfenmao
9bca10774b chore(version): 0.9.20 2025-02-09 00:05:15 +08:00
kangfenmao
75d55e915c feat: Add support for SiliconFlow provider charge and knowledge base improvements 2025-02-08 23:53:28 +08:00
kangfenmao
0bce58e3b4 feat: Add HTTP error handling and localized error messages 2025-02-08 23:01:27 +08:00
kangfenmao
3e84a32199 feat: Make knowledge base reference document count configurable 2025-02-08 20:56:59 +08:00
kangfenmao
9313059aba feat: add knowledge base settings 2025-02-08 19:19:59 +08:00
kangfenmao
4d82d58752 feat: Add support for AIHubMix topup and charge functionality 2025-02-08 16:26:10 +08:00
magicdmer
ca02ac427f fix: 翻译的temperature改为0.7
improve: 模型特性默认支持的时候,打勾
2025-02-08 14:46:55 +08:00
kangfenmao
f8d9318dbc feat: enable local network access on macOS #1178 2025-02-08 10:58:12 +08:00
teaim
fb8baa5c09 fix: o3-mini markdown formatting #997 2025-02-08 07:33:27 +08:00
kangfenmao
c067b9f0dd feat: remove knowledge base references when deleting a base 2025-02-07 23:58:44 +08:00
kangfenmao
b67e907bc8 fix: update knowledge base button tooltip and input bar dependency 2025-02-07 23:38:25 +08:00
Chen Tao
e1cbb7d7f5 feat: add knowledge base settings to assistant (#1112)
* feat: #1047

* fix: allow clear
2025-02-07 23:20:22 +08:00
kangfenmao
1b00d5d3dc fix: sanitize error details by removing sensitive headers and stack trace 2025-02-07 23:05:27 +08:00
kangfenmao
27dd093043 fix: improve reasoning effort handling for different providers 2025-02-07 22:37:18 +08:00
kangfenmao
f62caba4e9 feat: add aihubmix oauth 2025-02-07 22:27:28 +08:00
kangfenmao
bf15207a2e chore: update @langchain/openai package dependency 2025-02-07 21:20:14 +08:00
Chris Wan
9fa5c7e8fa fix: temperature tip English translation 2025-02-07 18:34:27 +08:00
Yrom Wang
4f3aebe305 fix: KnowledgeSearchPopup keyword highlighting issue 2025-02-07 18:24:03 +08:00
kangfenmao
6c1768298d feat: expand supported Gemini models for web search #1096 2025-02-07 17:18:11 +08:00
kangfenmao
d906592431 feat: add baidu cloud provider 2025-02-07 16:47:29 +08:00
kangfenmao
98f21b0598 feat: Reposition ocoolAI provider in LLM store configuration 2025-02-07 13:29:07 +08:00
kangfenmao
05a0b0ff68 fix: remove QwenLM provider #1122
close #1122
close #886
2025-02-07 12:38:12 +08:00
牡丹凤凰
137b4a150a Update README.ja.md 2025-02-07 06:50:07 +08:00
牡丹凤凰
3df751897b Update README.zh.md 2025-02-07 06:49:17 +08:00
牡丹凤凰
1fbeb40104 Update README.md
readme增加相关项目one-api
2025-02-07 06:47:55 +08:00
gyuannn
f3d451fb23 feat: Improve handling of think tags 2025-02-06 13:43:06 +08:00
gyuannn
610171936c feat: optimize MessageThought to enhance user experience 2025-02-06 13:43:06 +08:00
牡丹凤凰
c3c35b80e9 Update README.ja.md 2025-02-06 01:50:54 +08:00
牡丹凤凰
eddb6935a3 Update README.zh.md 2025-02-06 01:50:25 +08:00
牡丹凤凰
e100b81dd0 Update README.md 2025-02-06 01:49:54 +08:00
kangfenmao
c5fae17677 chore(version): 0.9.19 2025-02-05 21:34:55 +08:00
kangfenmao
4114a44eaf feat: Add DeepSeek V3 model to Silicon provider 2025-02-05 21:34:55 +08:00
kangfenmao
d4ddcbfc5b feat: Enhance web search parameter handling for assistants #575 2025-02-05 20:35:25 +08:00
kangfenmao
62bcb0582e feat: Update VisionIcon from PictureOutlined to EyeOutlined 2025-02-05 20:21:26 +08:00
kangfenmao
9f101b614a feat: Add DeepSeek VL to vision allowed models #1015 2025-02-05 20:09:29 +08:00
kangfenmao
ee260230ff feat: Enhance model tags and icons with new reasoning and visual styles 2025-02-05 20:00:18 +08:00
shellming
f94a42a48f feat: Add 3MinTop to default mini apps 2025-02-05 16:16:37 +08:00
Gutsy Yuan
122171b03c feat: Add new model type for reasoning models & reasoning_effort setting (#992) 2025-02-05 16:15:31 +08:00
kangfenmao
9dadef6df3 feat: add support for o1 models and update provider configurations 2025-02-05 16:14:35 +08:00
kangfenmao
909e88f8a3 chore(version): 0.9.18 2025-02-04 22:37:31 +08:00
kangfenmao
8c1ae0b950 feat: improve error message display for embedding dimensions retrieval 2025-02-04 17:25:24 +08:00
kangfenmao
66a13b1132 feat: improve error handling and formatting across providers 2025-02-04 16:45:09 +08:00
kangfenmao
5211ed657a fix: oauth error 2025-02-04 16:45:03 +08:00
Lei Huang
e49b3e8173 fix: prompt-injection-like behavior in translation #956 (#974)
* fix: prompt-injection-like behavior in translation #956

* fix: edit translation prompt to embded text to system prompt
2025-02-04 15:49:17 +08:00
亢奋猫
76b9af20ce feat: add oauth for siliconflow (#976)
* wip: silicon oauth

* feat: Add custom protocol handler for SiliconFlow OAuth login

* feat: Improve SiliconFlow OAuth flow with dynamic key update

* feat: Enhance OAuth and Provider Settings UI

* feat: Refactor SiliconFlow OAuth and update localization strings

* chore: Update provider localization and system provider configuration

* feat: Add OAuth support for AIHubMix provider
2025-02-04 15:41:40 +08:00
kangfenmao
f4ac3bd2a8 feat: support for vba code mode #949
close #949
2025-02-04 13:22:41 +08:00
kangfenmao
c2c17230d0 feat: add mention model title to locales 2025-02-04 13:00:31 +08:00
kangfenmao
73a092ffe9 feat: reduce embedding batch size to 5 2025-02-04 12:35:42 +08:00
kangfenmao
7e94058199 feat: update text-to-image model regex to include Janus 2025-02-04 12:28:17 +08:00
kangfenmao
1f0d7687f1 feat: update text-to-image models with new FLUX and Stable Diffusion variants 2025-02-04 12:21:58 +08:00
kangfenmao
731bbfcda5 feat: add Janus model to vision allowed models 2025-02-04 12:11:14 +08:00
kangfenmao
e42d6d4219 feat: adjust translation assistant temperature 2025-02-04 12:06:06 +08:00
eeee0717
7f86e9ceeb feat: add Janus-Pro-7B for silicon 2025-02-04 00:13:41 +08:00
Kcalb35
966c2df6ba fix: translation issue #900 2025-02-03 17:26:31 +08:00
rebecca554owen
810f0981e6 GitHub Actions 工作流优化
升级 actions/checkout 从 v3 到 v4。
新增 Get release tag 步骤,支持手动触发和自动触发时动态获取发布标签:
手动触发时,使用 workflow_dispatch 输入的 tag 参数。
自动触发时,从 GITHUB_REF 中提取标签(如 v1.0.0)。
统一使用 secrets.GITHUB_TOKEN 替代 secrets.GH_TOKEN,遵循 GitHub 官方推荐的最佳实践。
2025-02-03 15:07:16 +08:00
Shenghang Tsai
7d6b5f8cce default use r1 in silicon 2025-02-03 15:06:50 +08:00
kangfenmao
9fac01c313 fix: reset knowledge base selection when switching assistants 2025-02-03 13:45:21 +08:00
kangfenmao
90b8d704c9 feat: add azure provider type #931 2025-02-03 13:37:09 +08:00
kangfenmao
99fd08184b feat: change DEFAULT_TEMPERATURE to 1.0 2025-02-03 11:57:26 +08:00
kangfenmao
8f18476f9a feat: openrouter reasoning field and include_reasoning key #863 2025-02-03 11:48:46 +08:00
kangfenmao
236f25df8a feat: add regenerate message button 2025-02-03 11:18:55 +08:00
kangfenmao
089375c822 fix: add model input max length 2025-02-03 10:52:21 +08:00
kangfenmao
ca5912b121 feat: add knowledge base settings popup 2025-02-03 09:22:59 +08:00
Wenwei Lin
6cf4349fcf fix: OpenAI o3-mini 无法使用 2025-02-02 00:17:00 +08:00
牡丹凤凰
3efdfcf816 Update models.ts
Match the avatar of the o3-mini
2025-02-01 04:38:25 +08:00
牡丹凤凰
5b033d43d6 Update README.ja.md 2025-01-31 22:33:52 +08:00
牡丹凤凰
5b8f648705 Update README.zh.md 2025-01-31 22:33:28 +08:00
牡丹凤凰
7b1ba8a747 Update README.md 2025-01-31 22:32:27 +08:00
牡丹凤凰
b4dabe6d95 Update README.ja.md 2025-01-29 17:29:19 +08:00
牡丹凤凰
0f764aca2d Update README.zh.md 2025-01-29 17:28:47 +08:00
牡丹凤凰
5045f09583 Update README.md 2025-01-29 17:27:30 +08:00
gyuannn
656d6da581 fix: 修复 mini-app 中无法使用 context-menu 的问题 2025-01-29 10:33:44 +08:00
Nanami
cdcb19320c feat: Support configurable chunk size and overlap for knowledge base 2025-01-27 12:30:22 +08:00
Nanami
d3e868550c feat: Support configurable chunk size and overlap for knowledge base 2025-01-27 12:30:22 +08:00
kangfenmao
e4639e818a docs: update Japanese and Chinese README files to include QQ group link 2025-01-24 18:16:51 +08:00
kangfenmao
164062d612 docs: update README files to include Discord link for community support
- Added a Discord link to the English, Japanese, and Chinese README files, encouraging users to join discussions and seek help alongside the existing Telegram group invitation.
- This change enhances community engagement options for Cherry Studio users.
2025-01-24 18:07:29 +08:00
kangfenmao
109d948680 chore(version): 0.9.17 2025-01-24 13:54:04 +08:00
kangfenmao
6d3eed2a6a feat: add delete group message confirm modal 2025-01-24 13:13:00 +08:00
kangfenmao
ba0db528f8 fix: resend message logic 2025-01-24 13:02:57 +08:00
kangfenmao
6ea456d452 fix: siliconflow image url with query params #844
close #844
2025-01-24 09:31:31 +08:00
kangfenmao
f361a498e1 feat(constants): add C# file extension to textExts array #835
- Updated the textExts array in constant.ts to include '.cs' for C# files, enhancing the file type recognition capabilities.
2025-01-23 13:22:17 +08:00
kangfenmao
1d274b0a99 chore(migration): update version and adjust provider type for QwenLM #833
- Incremented version from 60 to 61 in the persisted reducer configuration.
- Updated migration logic to change the provider type for 'qwenlm' from 'openai' to 'qwenlm', ensuring correct identification in the state management.
2025-01-23 13:20:15 +08:00
kangfenmao
d1465d43f6 docs: update README files to encourage community support
- Added a call-to-action in English, Japanese, and Chinese README files inviting users to star the project or sponsor its development.
- Enhanced visibility of community engagement options to foster support for Cherry Studio.
2025-01-23 11:59:15 +08:00
hxp0618
1b55dcc17b fix: apikey and ApiHost incorrectly set to empty 2025-01-23 08:30:07 +08:00
hobee
516f0bd383 feat: add new minimax model configuration 2025-01-23 08:29:48 +08:00
kangfenmao
9ed7d1f657 chore(version): 0.9.16 2025-01-22 16:32:57 +08:00
kangfenmao
7b7372e6ee fix: group message bugs 2025-01-22 16:29:05 +08:00
kangfenmao
de3fad0d6a feat: enhance message model handling and user display
- Updated Message component to fallback to message.model if model retrieval fails, improving robustness.
- Refactored MessageHeader to utilize getModelName for better user name display based on message role, enhancing clarity.
- Introduced getModelName function in ModelService to streamline model name retrieval, improving code modularity and readability.
2025-01-22 15:08:44 +08:00
kangfenmao
07d3d8518b feat: enhance agent management and UI in AddAssistantPopup and AgentsPage
- Updated AddAssistantPopup to improve layout and styling, ensuring better overflow handling and text display.
- Refactored AgentsPage to utilize a new utility function for grouping agents, enhancing data management and organization.
- Exported getAgentsFromSystemAgents function for better modularity and reusability across components.
2025-01-22 14:47:35 +08:00
kangfenmao
734a1a37b4 feat: enhance translation functionality in MessageMenubar
- Updated translateText function to accept an optional callback for handling translated text directly within the function.
- Refactored MessageMenubar to utilize the new callback mechanism, improving the flow of translated content handling.
- Enhanced error handling during translation to ensure better user feedback in case of failures.
2025-01-22 14:37:15 +08:00
kangfenmao
e35af87035 feat: add file reading functionality and integrate system agents
- Introduced FileService to handle file reading operations via IPC.
- Implemented a new IPC handler for reading files, enhancing the application's ability to access and manage data.
- Integrated system agents from a JSON file, allowing dynamic loading of agent data into the application.
- Updated the AgentsPage and AddAssistantPopup components to utilize the new system agents, improving user experience and functionality.
- Enhanced application state management by adding resourcesPath to the runtime state, ensuring proper resource handling across components.
2025-01-22 14:35:38 +08:00
kangfenmao
bc221904de refactor: unify message model handling across components
- Replaced direct usage of modelId with model object in Message, MessageHeader, MessageMenubar, and TranslatePage components for consistency.
- Introduced getMessageModelId utility function to streamline model retrieval from messages.
- Updated event handling in Messages component to align with new model structure.
- Enhanced code readability and maintainability by reducing redundancy in model handling.
2025-01-22 13:29:21 +08:00
kangfenmao
f6165060c7 feat: conditionally render resend button in MessageMenubar
- Updated MessageMenubar to display the resend button only for user messages, enhancing user experience and preventing unnecessary actions for other roles.
- Refactored the children prop of TextEditPopup to include conditional rendering logic based on message role.
2025-01-22 12:26:40 +08:00
kangfenmao
68a5608a14 feat: enhance message grouping and styling
- Added new styles for message thought containers and group message wrappers to improve UI layout.
- Updated MessageGroup component to dynamically set the selected message index based on message length.
- Introduced a new event for appending messages, enhancing message handling capabilities.
- Refactored MessageMenubar to support the new append message functionality.
- Adjusted multi-model message style setting to 'fold' for better user experience.
- Improved responsiveness of message grid layout for smaller screens.
2025-01-22 12:04:21 +08:00
kangfenmao
5a1f026271 feat: streamline language translation options in MessageMenubar
- Replaced hardcoded language translation options with a dynamic mapping from TranslateLanguageOptions.
- Improved maintainability and scalability of the translation feature by utilizing a centralized configuration for language options.
2025-01-22 10:18:19 +08:00
kangfenmao
c3691cb9e0 feat: add FlagOpen logo to model configuration
- Introduced a new image asset for the FlagOpen model in the assets directory.
- Updated the models configuration to include the FlagOpen logo, allowing for its use in the model logo mapping.
2025-01-22 10:05:50 +08:00
kangfenmao
91d363e6a3 refactor: improve message rendering and add reasoning content extraction
- Refactored `getMessageBackground` function for better readability.
- Updated `MessageContent` component to use a new `withMessageThought` utility for extracting reasoning content from messages.
- Changed fragment usage to `Fragment` for consistency in JSX.
- Enhanced message handling by separating reasoning content from the main message content.
2025-01-22 09:50:29 +08:00
duanyongcheng77
4fd0393b4d fix: 🐛 fixed bug #779
助手的预设消息保存逻辑的修改
2025-01-21 22:06:52 +08:00
kangfenmao
f3deea48ec feat: add group message action bar 2025-01-21 17:58:34 +08:00
Teo
77bf062f7a chore(version): update version to 60 and add migration for multiModelMessageStyle setting 2025-01-21 15:16:18 +08:00
Teo
00665179b0 refact: 多模型回答优化 2025-01-21 15:16:18 +08:00
kangfenmao
23a59578c3 fix: regenerate message not rewrite reasoning_content 2025-01-21 15:15:55 +08:00
kangfenmao
5c3afaa5ed chore(version): 0.9.15 2025-01-21 14:28:01 +08:00
kangfenmao
d4d769261d feat: add deepseek-reasoner model support 2025-01-21 14:28:01 +08:00
kangfenmao
5b214c1b94 feat(miniwindow): add up and down key switch menu #792 2025-01-21 10:11:42 +08:00
Cololi
af9a4e80c0 feat: add deepseek-reasoner & delete deepseek-coder 2025-01-21 10:05:21 +08:00
ousugo
0e28bb1e29 feat: add WebDAV backup hour options and optimize english hour translations 2025-01-21 08:38:08 +08:00
kangfenmao
757b1856db feat: update minapp url to 'https://grok.com' #791
close #791
2025-01-20 16:53:33 +08:00
kangfenmao
46296504fc docs: update readme.md 2025-01-20 15:32:01 +08:00
kangfenmao
2f7e0076f3 chore(version): 0.9.14 2025-01-20 13:56:52 +08:00
kangfenmao
fcaff8e3eb fix: added warning for manual download on failed auto updates, simplified window lifecycle 2025-01-20 13:56:25 +08:00
kangfenmao
42c6084c03 chore(version): 0.9.13 2025-01-20 13:11:26 +08:00
kangfenmao
9f268c7897 feat: add onclick event to login icon in footer component 2025-01-20 12:57:26 +08:00
kangfenmao
e577b79ecb feat: extended safety threshold check to include 'thinking-exp' model ids 2025-01-20 12:55:24 +08:00
kangfenmao
7c4555eed0 feat: update contact email address 2025-01-20 12:20:46 +08:00
kangfenmao
7845c676f1 chore(version): 0.9.12 2025-01-20 11:52:26 +08:00
kangfenmao
c6a501f8fb feat: added copy last message feature and translations 2025-01-20 11:09:57 +08:00
kangfenmao
f56d2b9661 feat: added utility function, sorting, and new shortcut 2025-01-20 10:29:44 +08:00
kangfenmao
adf8c34ded feat: enable pinned functionality for minapps and update 'flowith' configuration 2025-01-20 09:58:47 +08:00
kangfenmao
c67904b925 fix: prevent unnecessary route changes and trim input field on change 2025-01-20 09:52:58 +08:00
ousugo
80ad18e90f fix: conditionally render pin button based on app ID 2025-01-20 09:32:13 +08:00
ousugo
18a8ab9482 feat: add Flowith minapp, resolve #780 2025-01-20 09:31:34 +08:00
MrChen
276455d4c2 feat: add the shortcuts for 'clear' and 'new context' and fix (#786)
* Fix: ESC key to exit the expanded editor

* Add the shortcuts for 'clear' and 'new context' to the input bar
Clear Messages: Ctrl+L
New Context: Ctrl+R
https://github.com/CherryHQ/cherry-studio/issues/740
https://github.com/CherryHQ/cherry-studio/issues/766

* Fix: the paste issue when copying from an email (content was pasted as an image; ensure it is pasted as text). Prioritize the text in the clipboard during pasting.
2025-01-20 09:31:09 +08:00
kangfenmao
13ea20083d chore(version): 0.9.11 2025-01-19 20:50:33 +08:00
kangfenmao
30b1d12909 fix: quick assistant bugs 2025-01-19 20:03:45 +08:00
kangfenmao
6692f6035d feat: add a startup switch for quick assistant 2025-01-19 19:22:25 +08:00
kangfenmao
616a3672ba feat: translate support stream output 2025-01-19 16:56:35 +08:00
kangfenmao
80ebf768c3 feat: auto-scroll to selected menu item on model open 2025-01-19 15:47:19 +08:00
kangfenmao
596b30d4d9 refactor: add qwenlm provider 2025-01-19 15:39:48 +08:00
kangfenmao
6a79827fd7 fix: store minapp url use base64 data image 2025-01-19 15:35:17 +08:00
kangfenmao
0f3c7aa648 feat: add mini window 2025-01-19 13:59:32 +08:00
ousugo
71ccea9114 feat: add pinning functionality for MinApp component 2025-01-19 13:59:06 +08:00
ousugo
f5516ac322 fix: fix wrong NVIDIA official website link, fix #771 2025-01-19 13:59:06 +08:00
牡丹凤凰
1d2e94ba14 Delete .github/workflows/update-lmarena.yml 2025-01-19 13:59:06 +08:00
牡丹凤凰
f5bceb1079 Update update-lmarena.yml 2025-01-19 13:59:06 +08:00
牡丹凤凰
24e05f2bd3 Create update-lmarena.yml 2025-01-19 13:59:06 +08:00
kangfenmao
8f3c5b477b fix: remove default message for webdav backup initiation 2025-01-19 13:59:06 +08:00
kangfenmao
ce7b0fcc5a style: increased padding at the bottom of the sidebar component 2025-01-19 13:59:06 +08:00
kangfenmao
46641faf38 fix: WebDAV not automatic backup on app reopened #752 2025-01-19 13:59:06 +08:00
kangfenmao
9e4bf0214a feat: auto focs input textarea #759
close #759
2025-01-19 13:59:06 +08:00
kangfenmao
61f8af8910 feat: improved 'my agents' list rendering 2025-01-19 13:59:06 +08:00
magicdmer
65b60d7cfa perf: 优化智能体页面性能和体验 (#756)
* feat: improved model validation and error handling

* refactor: 优化智能体页面下拉流畅度和分类切换效果,让其更加顺畅自然

---------

Co-authored-by: kangfenmao <kangfenmao@qq.com>
Co-authored-by: magicdmer <magicdmer@163.com>
2025-01-19 13:59:06 +08:00
kangfenmao
f3c13a4070 refactor: improved code organization and reusability 2025-01-19 13:59:06 +08:00
kangfenmao
ad752900ba feat: improved model safety settings for geminiprovider class 2025-01-19 13:59:06 +08:00
magicdmer
551ec07a4a refactor: (GeminiProvider) optimize safety settings handling
- Extract safety threshold logic into getModelSafetySetting method
- gemini-exp-* models not support 'OFF', must use 'BLOCK_NONE'
2025-01-19 13:59:06 +08:00
kangfenmao
7893edf70e feat: update harmblockthreshold for harm_category_civic_integrity 2025-01-19 13:59:06 +08:00
kangfenmao
a8536cf296 feat: add civic integrity category to harm block settings in GeminiProvider 2025-01-19 13:59:06 +08:00
kangfenmao
2fd2ec8b6e feat: update safety settings for specific categories #696
Gemini安全设置是否没有完全关闭
2025-01-19 13:59:06 +08:00
kangfenmao
cdb7aaca4d feat: replaced visionicon with modeltags 2025-01-19 13:59:06 +08:00
kangfenmao
5ad8c19a0d feat: add 思维链(CoT) agent 2025-01-19 13:59:06 +08:00
kangfenmao
e17e9bfe40 fix: improved openai provider model id validation logic 2025-01-19 13:59:06 +08:00
magicdmer
da81b048dd fix: 修正o1模型无法使用的问题 2025-01-19 13:59:06 +08:00
kangfenmao
25448beb92 fix: remove specific unicode characters from removespecialcharacters function 2025-01-19 13:59:06 +08:00
Linjun
053dd647ec fix issue#762: upon clicking to resend, the conversation content is cleared.
If there is no subsequent message or if the next message is from the user, this message should be resent. delete the old message after processing is complete.
2025-01-19 12:26:55 +08:00
kangfenmao
6f21844603 feat: improved model validation and error handling 2025-01-16 10:14:32 +08:00
Nanami
70666df135 fix: qwenlm context error 2025-01-15 09:09:01 +08:00
kangfenmao
81191bcabd chore(version): 0.9.10 2025-01-15 08:57:05 +08:00
kangfenmao
ce605e42c5 fix: artifacts cannot preview 2025-01-14 23:27:54 +08:00
kangfenmao
70ae5044d2 refactor: improved type safety and consistency for file handling 2025-01-14 21:02:55 +08:00
kangfenmao
e07245d1d0 chore(version): 0.9.9 2025-01-14 20:57:16 +08:00
kangfenmao
da2bc3af17 refactor: update model group names and sync interval 2025-01-14 20:53:52 +08:00
kangfenmao
3be32e5f7e fix: fix model type logic based on provider properties 2025-01-14 20:32:04 +08:00
Nanami
82266800e6 feat: add support for qwenlm and image upload (#726)
* feat: add support for qwenlm and image upload

* fix: qwenlm return

* feat: add provider config
2025-01-14 18:59:19 +08:00
Teo
69f1f2ea71 feat: 添加模型提及功能,支持多个模型一起回答 2025-01-14 17:46:55 +08:00
kangfenmao
58d152ae9b feat: add release workflow behavior control option 2025-01-14 14:55:32 +08:00
kangfenmao
2d6b2acf1a chore(version): 0.9.8 2025-01-14 14:36:05 +08:00
kangfenmao
5aed454a62 chore: update store version and migration 2025-01-14 14:34:36 +08:00
kangfenmao
17e3a966dd style: update markdown link text color 2025-01-14 13:54:10 +08:00
kangfenmao
9f67973cdf chore(version): 0.9.7 2025-01-14 13:24:54 +08:00
kangfenmao
f860503d96 fix: improved input validation and debouncing for assistant settings updates 2025-01-14 13:18:34 +08:00
kangfenmao
b1b9898eb1 feat: add grounding source info to gemini message 2025-01-14 12:32:50 +08:00
kangfenmao
32a0047a1d feat: auto focus search input box #705
close #705
2025-01-13 18:09:59 +08:00
kangfenmao
fd7de97b12 feat: add native app regions support 2025-01-13 18:06:22 +08:00
kangfenmao
64e3da4225 style: update pinned apps style and refactor config model 2025-01-13 17:56:16 +08:00
kangfenmao
348d0fb06a feat: add refresh icon to knowledge base items #567
close #567
2025-01-13 17:42:59 +08:00
kangfenmao
662742c958 feat: added openai model configuration and search parameter logic 2025-01-13 16:42:53 +08:00
kangfenmao
d0cb1c5d86 feat: check api use selected model 2025-01-13 16:11:09 +08:00
kangfenmao
812ae5883c fix: enforce max tokens above 0 in assistantservice #530 2025-01-13 15:03:37 +08:00
kangfenmao
ae9b574567 feat: csv download #710
close #710
2025-01-13 14:44:30 +08:00
kangfenmao
93b5e628b3 refactor: update terminology to 'backup' throughout the application 2025-01-13 14:00:35 +08:00
kangfenmao
ac6faaf23e feat: add qwenlm minapp 2025-01-13 13:52:45 +08:00
kangfenmao
0aef439c08 refactor: sidebar minapps 2025-01-13 13:04:01 +08:00
hxp0618
4651412aa8 feat: MinApp added to the sidebar does not support direct hiding. 2025-01-13 10:13:47 +08:00
hxp0618
153d36fcbb feat: Adjust the order of settings 2025-01-13 10:13:34 +08:00
hxp0618
9423403c5c feat: minApp supports show/hide, add to the sidebar 2025-01-13 10:13:34 +08:00
王瑞
69ec906df4 feat: add Grok app logo and configuration 2025-01-12 22:33:46 +08:00
kangfenmao
aa73526ba4 chore(version): 0.9.6 2025-01-09 16:23:29 +08:00
kangfenmao
aa40df2cfd fix: create agent popup error 2025-01-09 09:15:16 +08:00
kangfenmao
7d393deda7 chore(version): 0.9.5 2025-01-08 16:52:03 +08:00
kangfenmao
1a4dc3aafd fix: window navbar layout 2025-01-08 14:35:48 +08:00
kangfenmao
be2d18be1d style: update container component styling and navbar responsiveness 2025-01-08 13:25:34 +08:00
kangfenmao
322ba29c8d feat: narrow layout 2025-01-08 12:44:01 +08:00
kangfenmao
ccd3becc87 style: adjusted padding and container gap styles 2025-01-08 11:06:51 +08:00
kangfenmao
17f1a24433 fix: removed unnecessary conditional logic for attachment button #667 2025-01-08 10:56:22 +08:00
kangfenmao
7fb9a34f7d Revert "fix:修复单行CodeBlock中显示sub"
This reverts commit d808b6dffc.
2025-01-08 10:46:35 +08:00
kangfenmao
cd5c1b4797 refactor: refactor upload component layout and styling for responsiveness #674
fix: 当插入文件过多的时候,无法看到输入框了。 close #674
2025-01-08 10:21:17 +08:00
kangfenmao
1229917e4c fix: update model filtering logic to exclude empty ids #493
close #493
2025-01-08 10:00:23 +08:00
kangfenmao
b8103110ae chore: standardize artifact names across platforms 2025-01-08 09:42:38 +08:00
kangfenmao
509566dc07 fix: @google/generative-ai local compilation issue #682
close #682
2025-01-07 23:18:18 +08:00
亢奋猫
169fb519e1 feature: customizable sidebar module #644 (#680)
* feat:对话的时候支持侧边栏拖拽调整宽度

* feat:对话的时候支持侧边栏拖拽调整宽度

* feat: 隐藏app sidebar 用户体验度提升,不支持隐藏对话

* fix:对话勾选知识库 国际化错误

* refactor: split the SidebarIconsManager module out of DisplaySettings

* style: update SidebarIconsManager style

* ci: fix typecheck

* Revert "feat:对话的时候支持侧边栏拖拽调整宽度"

This reverts commit 58072128f0.

* refactor: merge migrate versions

* refactor: simplify sidebarIcons data structure

* chore: move react-beautiful-dnd to dev dependencies

* chore: use @hello-pangea/dnd replace react-beautiful-dnd

* docs: update translation and formatting of input messages

---------

Co-authored-by: hxp0618 <1169924772@qq.com>
Co-authored-by: huang <hxp0618@gmail.com>
2025-01-07 19:11:12 +08:00
kangfenmao
b4da93da74 feat: add gemini files support 2025-01-07 16:49:11 +08:00
kangfenmao
952b912b8a feat: add optional free model tag display 2025-01-07 11:23:32 +08:00
kangfenmao
20ade3003e feat: enable web search for zhipu ai provider #657 2025-01-07 10:53:34 +08:00
kangfenmao
7cadb0017c fix: improved error message formatting in api service 2025-01-07 10:19:21 +08:00
kangfenmao
abf4d90f4e feat: add ModelTags component 2025-01-07 09:54:22 +08:00
kangfenmao
94291e0d6f feat: add support for 'aihubmix' models and aihubmix llm provider 2025-01-07 09:46:05 +08:00
kangfenmao
30ff19a78c feature: customizable sidebar module #644
close #644
2025-01-06 16:59:10 +08:00
kangfenmao
c2d5d54922 feat: add search message shortcut #366 2025-01-06 16:29:39 +08:00
kangfenmao
3f44e1e4ac fix: the minimum width limit of the window is too large #544
close #544
2025-01-06 16:25:00 +08:00
kangfenmao
5ffc581a0a fix: generating topic name after exporting prompt file name is invalid #641
close #641
2025-01-06 15:50:57 +08:00
kangfenmao
cf0aeb0735 fix: Ollama is unable to create a knowledge base using a local embedding model #630 2025-01-06 15:43:20 +08:00
kangfenmao
a0b3998d0c fix: turn off spell check #648
The next version will be released. close #648
2025-01-06 15:10:03 +08:00
kangfenmao
308bafe29e feat: added optional chaining for code variable 2025-01-06 14:54:04 +08:00
xx-moos
404dfb3fa4 fix: 修复 message 显示时间过长的问题 2025-01-06 14:43:31 +08:00
kangfenmao
b1ec4b0181 style: border radius use var 2025-01-04 22:50:44 +08:00
kangfenmao
e95673349b style: logo v3
# Conflicts:
#	src/renderer/src/assets/images/logo.png
2025-01-04 21:52:05 +08:00
huang
2e7f8f77f3 feat: 支持 mermaid 点击按钮放大缩小以及鼠标滑轮放大缩小 2025-01-04 19:17:39 +08:00
huang
368bff3e59 feat: 支持 mermaid 点击按钮放大缩小以及鼠标滑轮放大缩小 2025-01-04 19:17:39 +08:00
huang
248aae3f4b fix: 修复在macOS m1 中点击全屏幕后,点击关闭后黑屏的问题 2025-01-04 19:17:39 +08:00
kangfenmao
201a66b5b2 fix: Qwen2.5和Qwen的划分不合理 #633 2025-01-03 18:05:01 +08:00
huang
0239a03219 fix: 中文国际化错误 2025-01-03 17:35:17 +08:00
kangfenmao
f2fa786c19 chore(version): 0.9.4 2025-01-02 21:34:30 +08:00
kangfenmao
6f99a0b8fa feat: add translations and file management features 2025-01-02 18:29:36 +08:00
kangfenmao
a3be8a80d9 feat: update assistantmodelsettings to persist custom parameters 2025-01-02 17:21:33 +08:00
kangfenmao
2d8307a9df feat: improved form validation and model addition functionality 2025-01-02 16:58:58 +08:00
kangfenmao
6d191f86b6 refactor: improve model generation and handling functionality 2025-01-02 16:39:30 +08:00
kangfenmao
e63d360647 fix: 腾讯混元的联网开关 #575 2025-01-02 16:26:24 +08:00
kangfenmao
555e015836 feat: add more classname 2025-01-02 16:25:50 +08:00
kangfenmao
13a1e866e6 fix: 重新发送按钮无反应 #587 2025-01-02 15:42:47 +08:00
kangfenmao
35bf25c6be feat: paintings add prompt enhancement params 2025-01-02 14:51:52 +08:00
kangfenmao
c0d9805c45 feat: added error handling and knowledge base provider support 2025-01-02 14:16:37 +08:00
kangfenmao
64a1d95d08 feat: add new branch option to message menubar 2025-01-02 13:41:51 +08:00
kangfenmao
21e4a0acd2 style: adjusted padding and border styles in settingsgroup component 2025-01-02 13:37:04 +08:00
kangfenmao
fe58723b10 feat: custom parameters add json type 2025-01-02 13:34:21 +08:00
kangfenmao
c777436a81 feat: improved translation features and settings 2025-01-02 12:21:22 +08:00
zhouxl
d808b6dffc fix:修复单行CodeBlock中显示sub 2025-01-02 11:47:34 +08:00
kangfenmao
1b0830b4cc chore: update hika app assets and styles 2025-01-02 11:18:15 +08:00
kangfenmao
2ef62f21ab feat: add sync status show 2025-01-02 11:07:20 +08:00
YongHao Hu
f32bf7d4f2 feat: add hika minapp 2025-01-02 11:06:57 +08:00
kangfenmao
f97bd4d91f fix: reduce batch size for knowledge service and openai embeddings 2024-12-31 14:41:08 +08:00
kangfenmao
14a7e45a46 feat: add github auto assignment workflow 2024-12-31 00:43:16 +08:00
kangfenmao
9c99560f6e chore(version): 0.9.3 2024-12-31 00:38:20 +08:00
kangfenmao
5c587ef766 fix: 知识库无法向量化 MD 文件 #569 2024-12-31 00:11:51 +08:00
kangfenmao
4754bd0960 fix: Microsoft Visual C++ Redistributable #577 2024-12-30 15:07:31 +08:00
kangfenmao
b7cfb35dc0 feat: 增加保持并发送的功能 #527 2024-12-30 14:09:59 +08:00
kangfenmao
6bab09a669 feat: 增加genspark小程序 #578 2024-12-30 13:10:27 +08:00
juzeon
189e70b46d fix: 修复zh-tw语言文件中的乱码 (#579) 2024-12-30 11:49:40 +08:00
n2yt584v2t4nh7y
9595daf076 feat: 添加自定义API参数功能 (#564)
* add custom api parameters

* allow more data types for custom api parameters

* pass parameter to api payload

* add custom parameter settings to sidebar

* remove unnecessary object and array types

* extract API custom parameter method to BaseProvider

* add i18n for custom parameter settings

---------

Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
2024-12-29 20:19:07 +08:00
kangfenmao
c64fb00003 feat: 用户自定义话题总结Prompt #562
close #562
2024-12-29 10:20:45 +08:00
kangfenmao
c854b0ff16 feat: add release notes pages 2024-12-29 09:49:22 +08:00
littel_penguin66
e710937bd9 Fix incorrect synchronization behavior of webdav auto sync (#568) 2024-12-29 08:44:21 +08:00
kangfenmao
eb8651cbfa chore(version): 0.9.2 2024-12-27 23:03:17 +08:00
kangfenmao
397f8a6bc6 fix: 模型名后面标注一下服务商 #557 2024-12-27 18:09:22 +08:00
kangfenmao
dc13c182e3 fix: model settings params step size 2024-12-27 16:47:44 +08:00
kangfenmao
c08f854889 feat: add jina provider 2024-12-27 16:29:17 +08:00
kangfenmao
7efb278353 fix: 需要只发送图片功能 #538 2024-12-27 14:40:44 +08:00
sommermorgentraum
a74d43fd40 feat: Add capabilities for user to load custom CSS #548 2024-12-27 14:11:12 +08:00
kangfenmao
8bc100962b fix: azure openai embedding 2024-12-27 14:02:53 +08:00
kangfenmao
628d652c47 chore: update dependencies and improve project structure 2024-12-27 12:42:17 +08:00
kangfenmao
4c47c324ab fix: 小程序中增加 github copilot #547 2024-12-27 12:10:41 +08:00
kangfenmao
b1096b5387 fix: 某些输出包含 sub 无法正常显示 #545 2024-12-27 11:54:11 +08:00
kangfenmao
060302ab39 feat: added topic message update and search state management 2024-12-27 11:48:12 +08:00
kangfenmao
eeb46969cf feat: add windows platform support for node file detection and npm package download 2024-12-26 12:38:51 +08:00
kangfenmao
dbc806e925 chore(version): 0.9.1 2024-12-26 12:25:58 +08:00
kangfenmao
a7f098e4cc fix: build native module script 2024-12-26 12:25:58 +08:00
kangfenmao
4d5c4ddc4f feat: add embeding tag to settings 2024-12-26 12:25:58 +08:00
kangfenmao
dc657c4d49 refactor: knowledge base engine change to libsql 2024-12-26 10:00:37 +08:00
littel_penguin66
b706892d7a Add Japanese localization for i18n (#533) 2024-12-25 22:04:29 +08:00
kangfenmao
80fb1c0b13 fix: knowledge base bugs 2024-12-25 21:54:46 +08:00
kangfenmao
086475c883 refactor: knowledge base database engine 2024-12-25 17:42:03 +08:00
Tan Xiang
6e4db56028 fix: shortcut tips (#525) 2024-12-24 23:09:54 +08:00
kangfenmao
f9220d4fac fix: gemini web serach modal 400 request error 2024-12-24 18:00:25 +08:00
kangfenmao
67dda878ae revert: cloudflare-worker.js 2024-12-24 17:38:30 +08:00
kangfenmao
6d395fba09 build: download npm node native modules 2024-12-24 17:24:38 +08:00
kangfenmao
cbe6f4c35e fix: linux window title style 2024-12-24 14:43:32 +08:00
kangfenmao
f4efd118cb feat: update models inside 2024-12-24 13:27:40 +08:00
kangfenmao
b8fa613af5 fix: knowledge base bugs 2024-12-24 12:41:58 +08:00
kangfenmao
705db03290 patch: @llm-tools 2024-12-24 12:11:07 +08:00
kangfenmao
f9381607e6 feat: added webdav auto-sync settings synchronization and custom show message option 2024-12-24 10:25:19 +08:00
kangfenmao
95148db190 Merge branch 'knowledge' 2024-12-24 09:38:38 +08:00
little_penguin66
8fad34968d add autoSync in WebDav 2024-12-24 09:34:16 +08:00
kangfenmao
148033446d fix: check provider connection use the last model 2024-12-24 09:33:43 +08:00
kangfenmao
ecf45e0c00 chore(version): 0.9.0 2024-12-23 17:07:26 +08:00
kangfenmao
59f3375f44 build: reduce package size 2024-12-23 14:22:37 +08:00
kangfenmao
3e64fa2025 fix: knowledge bugs 2024-12-23 10:48:40 +08:00
kangfenmao
629a2b4902 chore: remove release and build workflow, update release workflow for macos-latest 2024-12-19 17:24:39 +08:00
kangfenmao
016027ac59 build: add matrix 2024-12-19 17:20:52 +08:00
kangfenmao
a0bc50b29c feat: remove knowledge queue 2024-12-19 13:45:11 +08:00
kangfenmao
7cb381be40 feat: knowledge base 2024-12-19 09:24:20 +08:00
tanxiang
f8fd1f1c5e feat(i18n): add "Switch Model" message to multiple locales and update tooltip in MessageMenubar 2024-12-18 13:35:39 +08:00
adfnekc
1f70ef399f feat: message 增加 metrics 字段 用以统计token生成速度和首字时延 (#479) 2024-12-16 17:10:36 +08:00
kangfenmao
98e29347bd chore(version): 0.8.27 2024-12-16 15:47:07 +08:00
kangfenmao
574c4d62ca feat: added long text paste control and threshold settings 2024-12-16 15:08:40 +08:00
kangfenmao
d875f72793 fix: o1模型支持流式输出 #439 2024-12-16 14:48:51 +08:00
kangfenmao
0d1fa453af feat: disable select menu text 2024-12-16 14:39:54 +08:00
kangfenmao
1cccf5e41e feat: add copy last message shortcuts 2024-12-16 14:13:59 +08:00
kangfenmao
82cfda45a1 feat: add thinkany minapp 2024-12-16 13:42:08 +08:00
kangfenmao
28b91a3a0d fix: mermaid图表代码一键复制功能 #460 2024-12-16 13:20:24 +08:00
kangfenmao
679f405697 fix: 输出不显示 markdown 的小圆点 #446 2024-12-16 12:58:31 +08:00
kangfenmao
c58722289a feat: added hotkey functionality and improved appstorepopover layout 2024-12-16 12:55:14 +08:00
kangfenmao
7033194368 feat: add svg preview 2024-12-16 12:35:39 +08:00
kangfenmao
e8eb04c57d feat: add display settings 2024-12-16 12:04:12 +08:00
kangfenmao
c5fe1d3bba feat: add miniapp icon to navbar right 2024-12-16 11:32:50 +08:00
kangfenmao
90ce930b0b feat: add n.cn to minapp list 2024-12-16 10:48:55 +08:00
kangfenmao
8bfd6534e6 fix: input bar default rows #431 2024-12-16 10:26:04 +08:00
duanyongcheng77
ef1fc300f0 feat: 🎸 可以多次点击上传文件按钮上传文件 2024-12-16 09:54:12 +08:00
kangfenmao
8069d9d969 fix: KaTeX引擎公式渲染错位 #473 2024-12-16 09:42:10 +08:00
kangfenmao
d6e21a77ce chore(version): 0.8.26 2024-12-15 18:03:36 +08:00
kangfenmao
50e6ea3310 feat: added setshowassistants function to useshowassistants hook and updated error handling logic 2024-12-13 16:37:48 +08:00
kangfenmao
2b661a9f7e fix: handle unknown models in iswebsearchmodel function 2024-12-13 10:28:09 +08:00
kangfenmao
444250c162 build: update electron version 2024-12-13 09:52:18 +08:00
Shelly
cbd0d15526 feat: 🎸 allowMarkdownLongTextToAutomaticallyWrap (#454)
Co-authored-by: duanyongcheng77 <duanyongcheng77@gmail.com>
2024-12-13 09:51:42 +08:00
kangfenmao
f5b7fe0c27 chore: update dependencies and remove unused code 2024-12-13 09:35:40 +08:00
kangfenmao
01df49b8b7 chore(version): 0.8.25 2024-12-12 18:24:06 +08:00
kangfenmao
a0c14fdfce feat: add web search for google gemini modal gemini-2.0-flash-exp 2024-12-12 14:26:52 +08:00
Shelly
a52e78693b feat: 🎸 add shortcut for command + enter (#443)
* feat: 🎸 add shortcut for command

* feat: 🎸 only command

---------

Co-authored-by: duanyongcheng77 <duanyongcheng77@gmail.com>
2024-12-12 14:22:41 +08:00
kangfenmao
c4bbe048e4 styles: use mac style 2024-12-11 20:02:15 +08:00
kangfenmao
6b982779ba fix: can not delete last message 2024-12-11 20:01:52 +08:00
kangfenmao
254e45f722 chore(version): 0.8.24 2024-12-11 11:41:16 +08:00
kangfenmao
78e9e87780 feat: add new social media translations and links 2024-12-10 20:36:37 +08:00
kangfenmao
4855226ba5 feat: add shortcut for assistant and topic show 2024-12-10 20:28:05 +08:00
kangfenmao
f5a1156b52 fix: reduced message counts for messages component 2024-12-10 19:53:14 +08:00
kangfenmao
6ff28602d7 feat: add enter key trigger for translate model prompt 2024-12-10 19:41:50 +08:00
kangfenmao
d785de1895 style: improved layout and styling 2024-12-10 19:39:00 +08:00
kangfenmao
21be791cf0 feat: add top-p settings #224 2024-12-10 19:24:30 +08:00
kangfenmao
5f7dbfd24d feat: sidebar shadow 2024-12-10 18:07:37 +08:00
kangfenmao
99f51e7897 fix: 清除上下文按钮容易误点 #426 2024-12-10 17:23:00 +08:00
kangfenmao
1ecdc6920a fix: support "ctrl+enter" as send shortcuts #244 2024-12-10 17:09:57 +08:00
kangfenmao
9ba0a4aa56 feat: add update info ui 2024-12-10 17:06:29 +08:00
牡丹凤凰
fb20522c21 Update models.ts 2024-12-10 05:23:13 +08:00
kangfenmao
9f9b2a4b37 refactor: improve llmodel group assignment logic and sorting 2024-12-09 11:26:02 +08:00
kangfenmao
55d0792161 fix: escaped special characters in code snippets #419 2024-12-09 09:50:15 +08:00
牡丹凤凰
6c9d062e90 Update cloudflare-worker.js 2024-12-07 15:28:57 +08:00
亢奋猫
15a3f00ab5 Merge pull request #418 from 1355873789/develop
历史消息懒加载
2024-12-07 14:41:48 +08:00
Amatsuka
2b37df08c6 elfix: Add the grok vision model and fix the incorrect marking of the grok beta model as a visual model. 2024-12-07 14:39:48 +08:00
首都爱护动物协会
0f0737b828 历史消息懒加载
性能优化
2024-12-07 12:27:16 +08:00
牡丹凤凰
79b69acd92 Merge branch 'kangfenmao:main' into develop 2024-12-07 12:21:15 +08:00
duanyongcheng77
4268b2b494 style: 💄 change chinese-traditional icon to hk 2024-12-06 17:03:28 +08:00
kangfenmao
554a1f9421 chore(version): 0.8.23 2024-12-06 00:12:07 +08:00
kangfenmao
e507afa311 fix: plain text render 2024-12-05 22:33:21 +08:00
kangfenmao
a85cc588de fix: check for update ui 2024-12-05 21:38:11 +08:00
kangfenmao
6cd2de6603 fix: register shortcut key error 2024-12-05 21:05:26 +08:00
kangfenmao
cbeb74d3dd feat: added translation support for non-english languages 2024-12-05 09:50:15 +08:00
kangfenmao
c6dba95fbc fix: add error handling and logging for shortcut registration failures, remove windows shortcut support 2024-12-04 19:37:37 +08:00
kangfenmao
778891941a chore(version): 0.8.22 2024-12-04 14:08:09 +08:00
kangfenmao
9e9ece6275 feat: added new issue templates for documentation and question issues 2024-12-04 09:32:52 +08:00
kangfenmao
9b9dd10ddb chore(version): 0.8.21 2024-12-03 20:45:30 +08:00
kangfenmao
92ee53ce51 fix: improved error handling with formatted json error messages 2024-12-03 20:42:13 +08:00
kangfenmao
422ef76a45 feat: change re-generage message logic 2024-12-03 20:32:18 +08:00
kangfenmao
52f478b350 docs: add chineses issue template 2024-12-03 19:02:41 +08:00
kangfenmao
278aa3530b feat: improved search functionality for agent page 2024-12-03 18:46:57 +08:00
kangfenmao
e9c4dde772 wip 2024-12-03 17:45:39 +08:00
kangfenmao
796d7d157d chore: cleaned up dependencies and database schema 2024-12-03 17:21:51 +08:00
kangfenmao
1a8da86704 fix: translate prompt and translateText funciton 2024-12-03 17:18:18 +08:00
kangfenmao
4d0880b182 chore: add github issue template 2024-12-03 16:06:17 +08:00
kangfenmao
40d74a01c1 chore(version): 0.8.20 2024-12-03 12:52:08 +08:00
kangfenmao
7ecf3f093c style: update api key input field formatting and validation 2024-12-03 12:24:25 +08:00
kangfenmao
97052f825f feat: implement automatic text translation functionality 2024-12-03 11:55:52 +08:00
kangfenmao
b73fa5a44f feat: add MessageErrorBoundary component 2024-12-03 11:15:35 +08:00
kangfenmao
647f464bef feat: added topic auto-renaming to messages page 2024-12-03 10:57:38 +08:00
kangfenmao
4edaa504a1 feat: add enable topic naming settings #399 2024-12-03 10:47:43 +08:00
kangfenmao
5a6d2652f0 refactor: shortcuts feature 2024-12-03 10:23:53 +08:00
kangfenmao
85a7401518 feat: add translations and reset functionality for new features 2024-12-02 22:29:18 +08:00
kangfenmao
e47311afd2 feat: add shortcut feature 2024-12-02 18:03:38 +08:00
kangfenmao
117fa4cb54 feat: add translated message content 2024-12-02 13:41:28 +08:00
kangfenmao
d1cae6c230 feat: auto translate input text 2024-11-30 22:37:33 +08:00
kangfenmao
a31a9963a9 feat: generate random seed for image generation in usepaintings hook 2024-11-30 20:22:07 +08:00
kangfenmao
f253ca4103 fix: update ipc handle to retrieve update information 2024-11-30 20:22:00 +08:00
kangfenmao
0150251de2 feat: added command shortcuts for new topic input 2024-11-30 14:18:38 +08:00
kangfenmao
62fa366205 style: update code block padding and topic position 2024-11-30 12:01:00 +08:00
kangfenmao
4d1e3963bc feat: add configurable request options to gemini provider 2024-11-26 13:15:25 +08:00
kangfenmao
b007f8a437 fix: proxy 2024-11-25 15:57:16 +08:00
kangfenmao
5fa98edf5f chore(version): 0.8.19 2024-11-25 14:16:33 +08:00
kangfenmao
463cdda25d fix: 链接失败警告不消失 #382
close #382
2024-11-25 14:14:03 +08:00
kangfenmao
44f7fa09e0 fix: 模型回答时可以新建对话 #369
close #369
2024-11-25 14:10:09 +08:00
kangfenmao
baaf37a8f4 fix: code block copy button missing 2024-11-25 13:56:41 +08:00
kangfenmao
b2a0e4eeaa feat: update input component and add translation features 2024-11-25 13:43:03 +08:00
kangfenmao
0ac523981d fix: auto update assistant model 2024-11-25 12:49:47 +08:00
kangfenmao
5831d69f2f feat: create assistant with search text 2024-11-25 12:30:46 +08:00
kangfenmao
4a37192961 feat: clear app cache 2024-11-25 11:16:24 +08:00
kangfenmao
1e2ebe5232 feat: add localization text and model type support #378 2024-11-25 10:31:57 +08:00
kangfenmao
d377376bae feat: add border to list item 2024-11-24 01:35:41 +08:00
kangfenmao
99757a1cc7 fix: 设置中有两个“代码风格”项 #373 2024-11-23 23:08:27 +08:00
kangfenmao
8d05bef4d4 chore(version): 0.8.18 2024-11-23 14:23:22 +08:00
kangfenmao
0581c347f6 feat: improve proxy configuration handling 2024-11-23 14:21:08 +08:00
kangfenmao
09c765cb0e build: add scripts/cloudflare-worker.js 2024-11-22 10:01:54 +08:00
kangfenmao
e205c021e0 feat: update electron configuration and add locale-based language selection #370 2024-11-21 18:14:27 +08:00
kangfenmao
a32df473a3 style: adjust window vibrancy style 2024-11-20 20:18:51 +08:00
kangfenmao
dbf5549106 chore(version): 0.8.17 2024-11-20 19:15:33 +08:00
kangfenmao
fe02baf2bd style: removed dark theme styles, updated search and ui 2024-11-20 19:14:09 +08:00
kangfenmao
8e2e3aab84 chore(version): 0.8.16 2024-11-20 18:50:27 +08:00
kangfenmao
77c834bef1 feat: implement new ui features and styles 2024-11-20 17:49:39 +08:00
kangfenmao
bc56746f3e Revert "feat: remove model settings from settings tab"
This reverts commit 4d56c841a3.

# Conflicts:
#	src/renderer/src/pages/home/Tabs/Settings.tsx
2024-11-20 17:38:10 +08:00
kangfenmao
7436e34b11 feat: add new model visionallowedmodels 2024-11-20 16:40:00 +08:00
kangfenmao
a827da19f0 style: update styles for improved visual consistency and layout 2024-11-20 16:37:52 +08:00
kangfenmao
4b77cb557a feat: added size attribute to preview and download buttons 2024-11-20 11:57:57 +08:00
kangfenmao
56300f259f feat: enable auto-update and auto-install of app updates 2024-11-20 11:04:42 +08:00
kangfenmao
5e25034e89 style: adjusted layout and styling for searchpopup component 2024-11-20 11:01:02 +08:00
kangfenmao
4b36f47c16 chore(version): 0.8.15 2024-11-19 23:46:22 +08:00
kangfenmao
eb2ac5e753 docs: visual updates to shortcutsettings page 2024-11-19 20:53:12 +08:00
kangfenmao
ba336fdc95 fix: 无法恢复备份文件 #341 2024-11-19 20:30:47 +08:00
kangfenmao
956a0479f3 feat: new settings ui 2024-11-19 19:54:18 +08:00
kangfenmao
518a3b26b6 feat: added data folder 2024-11-19 18:48:57 +08:00
kangfenmao
6d665fa926 fix: 编辑消息无效 #313 2024-11-19 15:34:03 +08:00
kangfenmao
2f865d463b style: update antdesign segmented styles 2024-11-19 15:17:54 +08:00
kangfenmao
8cd77fe72f feat: adjusted searchpopup dimensions and added assistant generation checks 2024-11-19 15:08:04 +08:00
kangfenmao
4fee12a22e style: update color scheme to darker shades of black 2024-11-19 14:45:22 +08:00
kangfenmao
0d28e6805c feat: add search popup 2024-11-19 14:17:38 +08:00
kangfenmao
5c178be6ff feat: improved agents page filtering and layout adjustments, added russian translations support 2024-11-19 12:04:01 +08:00
kangfenmao
d5d39c6458 style: update code block ui styling and logic 2024-11-19 11:49:35 +08:00
kangfenmao
6ca92da801 feat: validate html elements in markdown, refactor cursor type, disable markdown input rendering 2024-11-19 11:45:00 +08:00
kangfenmao
3288d5faea chore(version): 0.8.14 2024-11-19 11:13:38 +08:00
kangfenmao
4588921a2c fix: has unsafe elements 2024-11-19 11:13:16 +08:00
Emmanuel Ferdman
e9ad8f3494 docs: update license reference
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
2024-11-19 09:19:02 +08:00
首都爱护动物协会
a83ce8cc6b Update models.ts
douhbao matching rules update
2024-11-19 04:08:26 +08:00
kangfenmao
ec661ed9d6 feat: auto switch to topics 2024-11-18 17:51:17 +08:00
kangfenmao
91c1f6169e feat: code collapsible settings 2024-11-18 17:44:33 +08:00
kangfenmao
d7cb80d8ca wip 2024-11-18 17:16:55 +08:00
kangfenmao
8db549ebcd fix: 缩放快捷键不支持小键盘 #354 2024-11-18 17:05:50 +08:00
kangfenmao
1a6903e32e fix: 重启之后无法保存界面的缩放 #354 2024-11-18 17:00:26 +08:00
kangfenmao
1bd190e986 feat: added proxy settings and handling functionality 2024-11-18 14:05:17 +08:00
kangfenmao
17943cdf44 feat: add provider type 2024-11-18 13:04:46 +08:00
kangfenmao
fd5c425e8c feat: enabled provider after add model 2024-11-18 11:41:17 +08:00
kangfenmao
09b91296f4 feat: added gemini experimental to vision allowed models 2024-11-18 11:26:02 +08:00
injurka
ab37ec05c9 feat: russia locale 2024-11-13 08:21:13 +08:00
kangfenmao
dfa6651a1a chore: update release workflow with tag filtering 2024-11-12 19:59:44 +08:00
kangfenmao
94193246d4 chore(version): 0.8.13 2024-11-12 19:27:46 +08:00
kangfenmao
35067dc261 feat: add new button to inputbar component and remove unnecessary toolbar button 2024-11-12 19:27:46 +08:00
kangfenmao
187ab30897 fix: improved popup item filtering logic 2024-11-12 19:27:46 +08:00
kangfenmao
0bbbcc00a6 feat: add adaptive tray icon handling 2024-11-12 17:52:00 +08:00
kangfenmao
ed2a1fcc61 feat: remove tray behavior on app close, add platform detection and file extensions 2024-11-12 16:36:47 +08:00
kangfenmao
4c1b89b878 feat: added api connection validation and provider configuration 2024-11-12 13:56:03 +08:00
kangfenmao
b62d22f89a feat: update system_models to use gpt-4o-latest model 2024-11-12 13:28:40 +08:00
kangfenmao
bb61f8110f style: adjusted styling and layout for mac os and file list view 2024-11-12 12:09:34 +08:00
kangfenmao
b0a0a226e7 feat: improved pin model functionality and translations 2024-11-12 11:54:11 +08:00
kangfenmao
d73dd0e639 feat: handle sorted and filtered agent groups in agentspage 2024-11-12 11:26:09 +08:00
kangfenmao
c696af3885 feat: update system tray icon functionality and ui 2024-11-12 11:16:55 +08:00
kangfenmao
fe03f9d521 feat: add provider deletion functionality and related translations 2024-11-12 10:14:01 +08:00
kangfenmao
ae81ef8910 fix: fixed tiling window manager and password input handling issues 2024-11-12 10:00:58 +08:00
kangfenmao
67ea972c3d fix: 视觉模型识别错误 #329 2024-11-12 09:23:24 +08:00
kangfenmao
4d56c841a3 feat: remove model settings from settings tab 2024-11-12 00:50:13 +08:00
kangfenmao
ade4780c0e feat: update translations and display settings 2024-11-12 00:37:23 +08:00
kangfenmao
a0d60e6a9b feat: improved tray functionality and ui theme settings 2024-11-12 00:25:57 +08:00
kangfenmao
367e99d698 style: improved mermaid popup styling and positioning 2024-11-11 23:49:44 +08:00
injurka
bc479a999d feat: added settings for minimize to tray instead of closing 2024-11-11 23:49:18 +08:00
kangfenmao
ec44eba3e6 fix: fix select box issue with mermaid diagrams 2024-11-11 23:33:57 +08:00
kangfenmao
9f4245be61 style: improved chat window styling and accessibility 2024-11-11 23:26:45 +08:00
kangfenmao
b905747162 fix: adjusted tray icon size to match linux platform requirements 2024-11-11 18:03:03 +08:00
injurka
728b2532ea fix: the context menu is not displayed on linux 2024-11-11 17:58:20 +08:00
kangfenmao
b39d33c6ac feat: add loading indicator and disable check button while checking api keys 2024-11-11 17:57:48 +08:00
kangfenmao
7e169f8282 style: update bubble ui component styles 2024-11-11 17:41:53 +08:00
kangfenmao
2537109406 fix: message color 2024-11-11 13:40:25 +08:00
kangfenmao
adaaee5848 chore(version): 0.8.12 2024-11-11 11:18:43 +08:00
kangfenmao
b23b41dfd1 feat: rename images to paintings for consistency 2024-11-11 10:45:42 +08:00
kangfenmao
558b22baf5 feat: add check all keys popup 2024-11-11 10:41:43 +08:00
kangfenmao
fe8c1a4928 fix: removed macos window minimize event handler 2024-11-11 09:25:22 +08:00
kangfenmao
dc1c71bf02 chore(version): 0.8.11 2024-11-10 17:20:52 +08:00
kangfenmao
f59393547b style: update code formatting for markdown styles 2024-11-10 17:16:10 +08:00
kangfenmao
234751c538 feat: add mermaid preview and download feature 2024-11-10 17:09:18 +08:00
kangfenmao
36c99a7b3f fix: 加入账号轮询功能 #293 2024-11-09 23:18:56 +08:00
kangfenmao
aeba11737b feat: update sidebar menu with interactive tooltips and painting terminology 2024-11-09 22:26:35 +08:00
kangfenmao
c127790fd7 fix: removed theme dependency in syntaxhighlighterprovider, added mermaid delay 2024-11-09 15:02:38 +08:00
kangfenmao
e9e7e30f43 fix: 气泡默认界面显示异常 #308 2024-11-09 14:54:22 +08:00
kangfenmao
4af84d7b84 feat: add mermaid library and theme initialization 2024-11-09 14:51:39 +08:00
kangfenmao
47f906a974 fix: mermaid图渲染有问题 #310 2024-11-09 14:16:42 +08:00
kangfenmao
8b2e5f1676 style: improved syntax highlighting functionality and code loading 2024-11-09 10:05:34 +08:00
kangfenmao
b34de79ca3 feat: add the ability to display the application in tray #297 2024-11-09 08:42:09 +08:00
kangfenmao
1577a0ad7b fix: code style init value 2024-11-08 11:59:32 +08:00
injurka
db45f12daf fix: expand code syntax highlighting options (#307)
* added locale for context-menu

* fix: expand code syntax highlighting options

* fix: type for theme

---------

Co-authored-by: injurka <ikornilov.ext@prosebya.ru~>
2024-11-08 11:59:05 +08:00
kangfenmao
a81960bd7b chore(version): 0.8.10 2024-11-07 23:06:42 +08:00
kangfenmao
adaf7df57e fix: 添加自定义的模型的分组总是成为大写字母 #257 2024-11-07 22:51:37 +08:00
kangfenmao
f174aca5d3 fix: input token i18n 2024-11-07 22:51:37 +08:00
injurka
15e0df0e34 fix: when changing the values in the inputs in the tab Default Assisting, they do not change (#305)
* added locale for context-menu

* fix: when changing the values in the inputs in the tab Default Assisting, they do not change

---------

Co-authored-by: injurka <ikornilov.ext@prosebya.ru~>
2024-11-07 22:13:47 +08:00
kangfenmao
d506cda0ba feat: 添加DuckDuckGo AI Chat #271 2024-11-07 22:08:11 +08:00
kangfenmao
e8b455dd9e fix: 删除最后一组预设消息组后无法保存 #300 2024-11-07 18:11:45 +08:00
kangfenmao
d8cdd7eca9 fix: 气泡模式,代码框配色看不清楚 #302 2024-11-07 17:49:31 +08:00
kangfenmao
02a8c9feb8 fix: github models 不支持图片 #291 2024-11-07 17:32:37 +08:00
injurka
58e2e410cb fix type import 2024-11-06 22:09:28 +08:00
injurka
ddc39d1fd4 added locale for context-menu 2024-11-06 22:09:28 +08:00
kangfenmao
8ee12e7407 refactor: refactored capturescrollablediv function and updated chat and messages components 2024-11-06 15:56:48 +08:00
kangfenmao
1d98b897af chore: remove unused llm store model and migration config 2024-11-06 13:17:43 +08:00
首都爱护动物协会
92a491be15 Match the avatar for the Pixtral model. 2024-11-05 20:50:43 +08:00
首都爱护动物协会
9956593595 add pixtral avatar 2024-11-05 20:50:43 +08:00
亢奋猫
925b8791d6 Merge branch 'main' into develop 2024-11-05 20:50:25 +08:00
首都爱护动物协会
71010932b4 Match the avatar for the Pixtral model. 2024-11-05 17:26:04 +08:00
kangfenmao
e6efd3071b fix: fix shortcut registration and unregistration 2024-11-05 17:25:38 +08:00
首都爱护动物协会
8165f9cc06 add pixtral avatar 2024-11-05 17:22:24 +08:00
Hypered1
31bcab2384 Fix typo in zh-cn.json 2024-11-05 16:48:56 +08:00
首都爱护动物协会
eed51ea55b Add new model and provider avatars. 2024-11-05 16:48:07 +08:00
首都爱护动物协会
68fa18b59c Add Providers
1. Fix the naming error of the Grok model
2. Add new providers: Grok, Mistral, Jina, Hyperbolic
2024-11-05 16:48:07 +08:00
首都爱护动物协会
6ee1cf41a2 Add new model and provider avatars. 2024-11-05 16:04:30 +08:00
首都爱护动物协会
b44a527e94 Add Providers
1. Fix the naming error of the Grok model
2. Add new providers: Grok, Mistral, Jina, Hyperbolic
2024-11-05 15:56:36 +08:00
kangfenmao
c4831a8f55 chore(version): 0.8.9 2024-11-03 01:26:23 +08:00
kangfenmao
d6b9fb7e82 feat: remove image compress 2024-11-03 01:26:00 +08:00
kangfenmao
bddedb7759 refactor: main code 2024-11-02 23:32:59 +08:00
kangfenmao
2f05435ce6 feat: export to word 2024-11-02 21:45:23 +08:00
kangfenmao
e9b4614928 fix: 在对话中插入图片时,应该自动压缩一下 #132 2024-11-02 15:30:41 +08:00
kangfenmao
b4d5595b68 fix: Ctrl + - 缩放时 缩到最小 再缩的话会报错 #266 2024-11-02 15:13:43 +08:00
kangfenmao
5db5190e44 fix: 默认模型在模型服务中禁用后显示错误 #266 2024-11-02 15:11:36 +08:00
kangfenmao
c856b8d195 feat: add message card style switch 2024-11-01 21:50:40 +08:00
kangfenmao
b9de2e8bb3 fix: chat text color 2024-11-01 18:14:23 +08:00
kangfenmao
aa1225b6ec style(message): user message use black color 2024-11-01 17:43:21 +08:00
kangfenmao
05ecae7cfb chore(version): 0.8.8 2024-11-01 12:39:11 +08:00
kangfenmao
30c2cfb3c5 feat: set topic position to left 2024-11-01 12:28:13 +08:00
kangfenmao
4ce6975ed5 feat: dynamic handling for tab groups 2024-11-01 12:18:48 +08:00
kangfenmao
889d38d02a fix: ui and layout 2024-11-01 12:06:30 +08:00
kangfenmao
52951dd78c feat: added sorting functionality and updated translations 2024-11-01 11:46:11 +08:00
kangfenmao
77db2a1e2b feat: improved ui layout and added reusable add agent card component 2024-11-01 11:00:17 +08:00
kangfenmao
e8ac4b264d feat: topic position set default to left 2024-10-31 17:11:32 +08:00
Teo
01293b08b2 refactor(navbar): 移除未使用的代码 2024-10-31 16:51:38 +08:00
Teo
80f2aec2be refactor(navbar): 移除未使用的代码 2024-10-31 16:51:38 +08:00
Teo
3e7949d8b4 style(toggleTheme): 将主题切换按钮移到左下角菜单栏中 2024-10-31 16:51:38 +08:00
Teo
a5b9dc63d6 style(chat): 对话界面改为左右布局 2024-10-31 16:51:38 +08:00
Teo
70e680cf47 style(markdown): 小代码块不换行 2024-10-31 16:51:38 +08:00
kangfenmao
1c5b2b92dc chore(version): 0.8.7 2024-10-31 15:01:37 +08:00
kangfenmao
a551ae9142 style: update responsive container styling for paintingslist component 2024-10-31 14:39:27 +08:00
kangfenmao
2f420c0fcd feat: added new painting functionality with mac device restriction 2024-10-31 14:35:05 +08:00
kangfenmao
837d91aa61 chore(version): 0.8.6 2024-10-31 13:34:06 +08:00
kangfenmao
e1e9f26de7 feat: improved real-time painting generation support 2024-10-31 13:28:07 +08:00
kangfenmao
a895860376 feat: added translations and ui improvements 2024-10-31 13:18:35 +08:00
kangfenmao
aa4b197e3b feat: added translation options for opening all files 2024-10-31 12:17:27 +08:00
kangfenmao
c317d5caa8 feat: added translation functionality and chinese support 2024-10-31 12:11:30 +08:00
kangfenmao
8408f2ebb8 style: prevent drag on image preview switch 2024-10-31 11:38:37 +08:00
kangfenmao
8fd1855838 feat: improvedscrollbar component functionality and added internationalization support to agentspage component 2024-10-31 11:31:38 +08:00
首都爱护动物协会
b94948266b add new providers logo 2024-10-31 09:37:17 +08:00
首都爱护动物协会
e9e6078dd2 Agents Page Upgrade
1. Simplified the layout of the agents page for improved user experience.

2. Enhanced the design of agent cards for a more visually appealing look.
2024-10-31 09:37:17 +08:00
kangfenmao
ef9bb4d656 fix: painting no provider 2024-10-31 09:23:58 +08:00
kangfenmao
068d802bcc feat: files ui improvements 2024-10-30 20:45:48 +08:00
kangfenmao
509107fc1e refactor: services 2024-10-30 17:23:52 +08:00
kangfenmao
3a765fa0cd chore: remove useless files 2024-10-30 00:32:27 +08:00
kangfenmao
3b08ee2720 feat: added file download functionality and improved api 2024-10-30 00:32:27 +08:00
kangfenmao
46a1588ba1 feat: add paintaing page 2024-10-30 00:32:27 +08:00
AHpx-Lap
2fe0fbd69f feat: use auto theme as default 2024-10-30 00:31:56 +08:00
kangfenmao
1e497edcfc chore: update dependencies and electron version 2024-10-30 00:31:03 +08:00
kangfenmao
66c62f98ed feat: update feature list and documentation for improved user understanding 2024-10-29 16:12:16 +08:00
kangfenmao
a0e63c96a9 docs: update documentation to reflect project changes 2024-10-29 15:29:44 +08:00
kangfenmao
76e6e67d54 feat: add instance lock and second instance handling 2024-10-29 14:48:48 +08:00
kangfenmao
d88f41c6be chore(version): 0.8.5 2024-10-29 02:46:45 +08:00
kangfenmao
0b2a840ed9 feat: add chinese translations and improve ui 2024-10-29 02:26:10 +08:00
kangfenmao
d74d481cc4 feat: add keyborad shortcut settings 2024-10-29 01:55:11 +08:00
kangfenmao
e4bb79cd42 docs: update sponsorship links and qr code references 2024-10-29 00:45:26 +08:00
kangfenmao
afdaae4343 feat: enhanced search functionality with translation support 2024-10-29 00:40:44 +08:00
kangfenmao
4d81b51fcb fix: agents sort 2024-10-29 00:27:35 +08:00
kangfenmao
33738fa875 fix: add X-Api-Key headers #246 2024-10-28 23:33:20 +08:00
kangfenmao
0171b9acab fix: add claude-3-5-sonnet-latest support #247 2024-10-28 16:40:37 +08:00
kangfenmao
649008db5b fix: agents tabs not shown 2024-10-28 16:23:55 +08:00
首都爱护动物协会
18976238fd Update agents.json 2024-10-28 08:50:59 +08:00
kangfenmao
fd63666e77 feat: enhanced text wrapping and ant-input styling 2024-10-27 22:50:45 +08:00
kangfenmao
648cabf1c1 feat: update agents.json 2024-10-27 19:53:20 +08:00
kangfenmao
b1d9485c22 fix: fix stale state issue in chat component 2024-10-27 19:30:18 +08:00
kangfenmao
ab4445f59a feat: enhanced ui with translation and layout improvements 2024-10-27 19:13:54 +08:00
kangfenmao
1cbe342940 feat: use real file path 2024-10-27 18:58:23 +08:00
kangfenmao
7392d0aaa3 feat: scroll to bottom on messages page load 2024-10-27 18:33:01 +08:00
kangfenmao
01a201a79b fix: removed filter condition and messages from fetchchatcompletion() payload 2024-10-27 00:11:30 +08:00
kangfenmao
9fb91632be style: optimized performance and refined styles 2024-10-26 23:48:14 +08:00
kangfenmao
b4fdd1e8fa style: align tab content horizontally and ignore agents.json with prettier 2024-10-26 23:36:06 +08:00
kangfenmao
46e0b1c11e feat: update ui components with improved design and functionality 2024-10-26 23:14:33 +08:00
kangfenmao
d4ad748ef1 refactor: improved code readability for filtering agents 2024-10-26 22:38:31 +08:00
kangfenmao
cc6f5275b0 feat: add agents tabs and search 2024-10-26 22:33:47 +08:00
kangfenmao
03423a5600 feat: added icons to buttons for preview and download 2024-10-26 17:29:35 +08:00
kangfenmao
b2e73662eb refactor: messages completion 2024-10-26 17:12:06 +08:00
kangfenmao
279850ce79 fix: WebDAV 备份失败 maxBodyLength 限制 #243 2024-10-25 13:26:46 +08:00
kangfenmao
0e16aa1e86 docs: update documentation for a more inclusive environment and added japanese and chinese documentation 2024-10-25 00:09:01 +08:00
kangfenmao
aaea69e5fe chore(version): 0.8.4 2024-10-24 23:14:14 +08:00
kangfenmao
151127ab53 fix: 新的滚动条组件 2024-10-24 23:08:11 +08:00
kangfenmao
37f56c71e8 chore(version): 0.8.3 2024-10-24 18:47:20 +08:00
kangfenmao
95bda6fdfb docs: update translation and api url tip 2024-10-24 16:19:47 +08:00
kangfenmao
fe77161a70 fix: 添加默认助手会添加两个 #238 2024-10-24 15:46:08 +08:00
kangfenmao
b400819d6a fix: 公式显示问题 #239 2024-10-24 15:33:04 +08:00
kangfenmao
c497586be6 fix: 添加默认助手会添加两个 #238 2024-10-24 15:05:13 +08:00
kangfenmao
f5e9d92610 feat: scrollbar 2024-10-24 14:58:13 +08:00
kangfenmao
8eb5b6e821 build: update yarn.lock 2024-10-24 11:45:41 +08:00
Ikko Eltociear Ashimine
d64d8daccc docs: add Japanese README file
I created Japanese translated README.
2024-10-23 20:50:58 +08:00
kangfenmao
e0d7eceaff fix: 公式又不居中了 #231 2024-10-23 20:49:22 +08:00
kangfenmao
c42d941f09 fix: 修复数据库和 store 数据不一致问题 2024-10-23 14:08:48 +08:00
kangfenmao
ae79de1fc7 feat: add cherry-stuido-db project 2024-10-22 22:01:56 +08:00
kangfenmao
5546831d3f chore(version): 0.8.2 2024-10-22 20:06:11 +08:00
kangfenmao
cb69ba6fcb fix: 汉语新解卡片 css 2024-10-22 19:53:59 +08:00
kangfenmao
25b7410f7a feat: 话题分享功能 #103 2024-10-22 19:01:46 +08:00
kangfenmao
85d820e6c7 fix: 文件保存相关问题 #208 2024-10-22 17:37:22 +08:00
kangfenmao
1168b3f29c docs: CONTRIBUTING.md.md to CONTRIBUTING.md 2024-10-22 16:04:31 +08:00
kangfenmao
589702129e fix: scrollbar width 2024-10-22 16:03:13 +08:00
kangfenmao
31ff7000fd build: add pulish:artifacts command 2024-10-22 15:43:28 +08:00
XuQing Chai
c3fd640ea7 Modify the path of README.zh.md in README.md correctly 2024-10-21 23:27:18 +08:00
kangfenmao
09ab3d3a8c feat: 智能体改进:名称、上下文支持、模型参数支持 #59 2024-10-21 23:21:46 +08:00
kangfenmao
a8b5deacc0 feat: add qwen2-vl modal vision support 2024-10-18 13:21:11 +08:00
牡丹凤凰
790e09264a Merge pull request #205 from cawabj/develop
misc
2024-10-18 03:31:22 +08:00
首都爱护动物协会
517621ad65 misc 2024-10-18 03:30:05 +08:00
kangfenmao
b8a6a69849 style: improved layout and functionality for the prompt editing field. 2024-10-17 16:52:18 +08:00
kangfenmao
414e5dc6c3 docs: update readme documentation with telegram link and welcome message 2024-10-17 16:29:47 +08:00
kangfenmao
48018a6d59 docs: update community information and telegram 2024-10-17 16:22:19 +08:00
kangfenmao
b7d1c95c7c docs: add product hunt 2024-10-17 15:59:41 +08:00
kangfenmao
6dd193a861 fix: remove some file extensions 2024-10-17 15:13:18 +08:00
kangfenmao
e0480e4d5b fix: java 格式文件上传支持 #201
close #201
2024-10-17 14:26:08 +08:00
kangfenmao
3ed20f0ee8 docs: update LICENSE 2024-10-17 14:09:30 +08:00
kangfenmao
8e7f0f1e7b feat: Agents 页面改版 #198 2024-10-17 13:44:52 +08:00
kangfenmao
5e37bfc3b3 docs: update commercial use license terms 2024-10-17 13:36:20 +08:00
kangfenmao
b406b363a1 feat: added human-readable file size formatting and unit support 2024-10-17 13:35:51 +08:00
kangfenmao
4d36f32231 docs: update references to main branch 2024-10-17 10:06:21 +08:00
kangfenmao
34500deed5 fix: local package.json 2024-10-16 17:43:19 +08:00
kangfenmao
ffea63ecff fix: 检查更新按钮不生效 #184
close #184
2024-10-16 13:14:15 +08:00
kangfenmao
2da1aa60cd fix: removed unnecessary newline replacement
- Removed unnecessary newline replacement from input message content.
2024-10-16 11:23:58 +08:00
kangfenmao
90a69a12de fix: 点击清除上下文直接跳转到最下面 #192
close #192
2024-10-16 09:53:56 +08:00
kangfenmao
a5e1b93a8a chore: removed resources from excluded files
- Removed resources from excluded files.
2024-10-16 09:44:29 +08:00
kangfenmao
81a89069d6 chore(version): 0.8.1 2024-10-15 21:19:54 +08:00
kangfenmao
75a87039b0 feat: added new translations and api url handling features
- Added new translation strings for API URL actions and hints.
- Updated Chinese translations and added new provider API URL descriptions.
- Added new translations for API URL preview and reset tip.
- Added support for Open AI API settings preview and hint.
- Added a new isOpenAIProvider function to handle specific provider type checks.
- Added a new function to validate if a given URL has a valid non-root path.
2024-10-15 21:14:19 +08:00
kangfenmao
be247e75c9 feat: added conditional rendering to messagetokens component
- Added conditional rendering to MessageTokens component.
- Added parameter 'isLastMessage' to MessageTokens component to determine conditional rendering based on message position.
2024-10-15 20:22:01 +08:00
kangfenmao
5e14cacea3 fix: code font size 2024-10-15 19:21:18 +08:00
kangfenmao
bb035750d6 feat: add show line number in code 2024-10-15 19:18:12 +08:00
kangfenmao
ffaa16fa88 feat: add license.html 2024-10-15 19:02:53 +08:00
kangfenmao
f38461d4d0 feat: add data settings 2024-10-15 18:56:09 +08:00
kangfenmao
b1b83d2d72 fix: webdav备份恢复的逻辑似乎有点问题 #178 2024-10-15 17:48:48 +08:00
kangfenmao
96d9da1f27 feat: add success message on new branch creation
- Added new functionality to emit success message upon creating a new branch.
2024-10-15 17:13:41 +08:00
kangfenmao
dfd3d8f19d feat: update translations and add new topic functionality 2024-10-15 16:33:15 +08:00
kangfenmao
11c7cdc749 feat: add default timestamps for topic updates
- Added default values for createdAt and updatedAt timestamps when updating topics.
2024-10-15 16:19:38 +08:00
kangfenmao
efd89db1c0 feat: added drag and drop file upload feature #190
- Added drag and drop file uploading functionality to input bar.

close #190
2024-10-15 16:15:59 +08:00
kangfenmao
2961796fb9 feat: enhanced model search in popup
- Improved search functionality for selecting models in the popup by modifying the filter criteria to include both model and provider names.
2024-10-15 15:55:15 +08:00
kangfenmao
5c0390b433 feat: improved data display and scrolling experience
- Increased file list pagination size to improve data display.
- Disable inline styles for Markdown content.
- Removed overflow functionality for a smoother scrolling experience.
2024-10-15 15:15:58 +08:00
kangfenmao
8a65b0f993 docs: update readme 2024-10-15 15:15:45 +08:00
1355873789
dcda4423c2 新增:腾讯混元服务商 2024-10-15 01:58:17 +08:00
kangfenmao
ad0538c253 fix: 一次上传多个文件 #183
close #183
2024-10-14 22:52:35 +08:00
kangfenmao
6f99612acf chore(version): 0.8.0 2024-10-14 14:57:19 +08:00
kangfenmao
21a13d54c8 feat: add artifacts preview 2024-10-14 14:37:04 +08:00
kangfenmao
0026293e69 feat: add event listeners and topic handling improvements #181
- Added event listeners for estimated token count and add new topic events.
- Updated default topic handling when clearing messages.
- Removed feature to add new topics directly in Navbar and replaced it with emitting an event to create a new topic.
- Added the functionality to add new topics, clear messages, and handle topic switching with improved conditional logic.
- The event constants configuration has been updated to include two new event names.
2024-10-14 10:39:14 +08:00
kangfenmao
f2fe5ad4f5 feat: add clear message menu to topic context menu 2024-10-14 10:19:48 +08:00
kangfenmao
630a18efe2 fix: DashScope upgrade 2024-10-14 09:57:56 +08:00
1355873789
52c29861ac chore: 更新 provider 名称, Dashscope 更新为 Bailian 2024-10-14 09:17:01 +08:00
kangfenmao
5d193c0ed6 fix: text input token caused stuttering 2024-10-13 00:50:28 +08:00
kangfenmao
3d46052db5 style: improved visual separation and aesthetic
- Added a border radius to scrollbar thumb styles for improved aesthetic.
- Updated the Divider component to include a border for better visual separation.
- Added border to the divider in SelectModelPopup for improved visibility.
2024-10-13 00:38:13 +08:00
kangfenmao
3aabd7ba39 docs: remove uppercase filename docs 2024-10-12 23:24:00 +08:00
kangfenmao
ffaff5b209 fix: 长文本输入时生成文件后文本依旧保留 #179 2024-10-12 23:22:32 +08:00
kangfenmao
d88df2c331 fix: 使用滚动条显示不全 #176 2024-10-12 17:42:16 +08:00
kangfenmao
a80970bb77 fix: 移除 input 等输入标签的渲染 2024-10-12 17:37:56 +08:00
kangfenmao
895324befc chore(version): 0.7.16 2024-10-12 15:31:21 +08:00
kangfenmao
30df5ad027 fix: 修复无法正常选择文本文档的问题 2024-10-12 14:56:17 +08:00
kangfenmao
b3919ba46a chore(version): 0.7.15 2024-10-12 14:14:46 +08:00
kangfenmao
7b0ad46c23 fix: 一键返回到消息顶部 #166
close #166
2024-10-12 14:03:06 +08:00
kangfenmao
9911602106 fix: 自定义界面字体 #158 2024-10-12 13:57:45 +08:00
kangfenmao
1b4486ebfc refactor: renamed model display names and fixed logic
- Renamed the display of model names to show the exact model name instead of capitalized first letter.
- Fixed logic to handle model name retrieval for assistant messages.
- Renaming of model display name to use the model's original name instead of a capitalized version.
- Removed unnecessary import and corrected label formatting in the options array.
2024-10-12 13:52:17 +08:00
kangfenmao
f2f31fe03e fix: 黑暗模式的启动页是白色的 #118
close #118
2024-10-12 13:40:34 +08:00
kangfenmao
643b4595d2 fix: o1模型设置使用优化 #172 2024-10-12 13:28:42 +08:00
kangfenmao
ff14651479 feat: add document files support 2024-10-12 13:18:53 +08:00
kangfenmao
051d46bf5d fix: old version of the backup file cannot be restored. 2024-10-12 10:09:52 +08:00
kangfenmao
ba2829e276 feat: add event handling to blur current target element after showing popup
- Added event handling to the onSelectModel function to blur the current target element after showing the SelectModelPopup.
2024-10-12 10:00:03 +08:00
kangfenmao
e5100e9547 feat: update release notes and add image preview component
- Updated release notes to reflect changes including image preview and download.
- Added interactive image preview component with toolbar for rotation, zooming, and downloading.
- Added support for image previews in Markdown rendering.
- Added functionality to download files from a URL with automatic filename detection and handling.
2024-10-12 09:53:20 +08:00
kangfenmao
acba7d56eb chore(version): 0.7.14 2024-10-11 23:22:51 +08:00
kangfenmao
c5ab9c3e79 feat: update release notes and fix issues
- This commit updates release notes to include new features and fix existing issues.
- Removed non-essential keyboard shortcuts from context menu items.
2024-10-11 18:04:08 +08:00
kangfenmao
259c425893 feat: add bolt minapp 2024-10-11 14:15:37 +08:00
kangfenmao
2c1b343425 style: updated ui styles and translations
- Adjusted padding styles in AssistantModelSettings component.
- The addition of a close button to the Assistant Prompt Settings component to enhance its functionality.
- Added OK callback event to AssistantPromptSettings component.
- Added translations for new UI elements.
- Updated translation data for Chinese language.
- Added new translations and updated existing values in the language file to incorporate additional features.
2024-10-11 14:05:50 +08:00
kangfenmao
6624e7c7df refactor: regenerate model on selection
- Updated the logic in the `onSelectModel` function to regenerate the model when a selection is made.
2024-10-11 13:49:06 +08:00
kangfenmao
1d4b2f698b fix: azure openai model provider wrong 2024-10-11 13:42:36 +08:00
kangfenmao
db4004611d feat: quickly select model 2024-10-11 13:31:14 +08:00
kangfenmao
9fbd92656c refactor: latex解析不支持矩阵环境 #169 2024-10-11 10:15:46 +08:00
kangfenmao
a3fc49c811 chore(version): 0.7.13 2024-10-10 09:18:44 +08:00
kangfenmao
c2f7c7c46c fix: markdown表格目前还没有支持 br 换行 #160
close #160
2024-10-08 21:01:48 +08:00
kangfenmao
d284de0c2b feat: add azure openai provider 2024-10-08 20:14:50 +08:00
kangfenmao
ba16e6a84d chore(version): 0.7.12 2024-10-06 10:12:46 +08:00
kangfenmao
24f172a5a4 wip 2024-10-05 19:02:56 +08:00
kangfenmao
79c76bf95a feat: add topics history 2024-10-05 17:52:18 +08:00
亢奋猫
b229ad404e Update README.md 2024-09-30 22:42:06 +08:00
kangfenmao
49cb03fb40 chore(version): 0.7.11 2024-09-30 22:33:58 +08:00
kangfenmao
1b3c52a508 fix: together ai models 2024-09-30 20:45:51 +08:00
kangfenmao
42fdfd8e0c fix: webdav backup path 2024-09-30 18:15:15 +08:00
kangfenmao
d292a336ce fix: merge migration versions 2024-09-30 13:37:55 +08:00
牡丹凤凰
e4b2052500 新增:模型服务商together (#148)
* 新增:模型服务商together

新增:模型服务商together
修复:providers为null或undefined时会抛出错误。

* 新增服务商:fireworks、360智脑、英伟达

* 新增:若干模型头像

* 谷歌其他系列模型匹配头像

* 1

* version+
2024-09-30 13:30:09 +08:00
kangfenmao
b2278dc287 chore(version): 0.7.10 2024-09-29 23:29:28 +08:00
kangfenmao
90455e55f2 fix: add markdown rendering input msg switcher #143 #142 2024-09-29 23:21:31 +08:00
kangfenmao
8e1972bfcd fix: paste long text issue 2024-09-29 22:37:33 +08:00
kangfenmao
0abcaabdfe feat: add assistant setting popup 2024-09-29 22:31:07 +08:00
kangfenmao
dde77d03e2 feat: add webdav settings component and backup user data files #69 2024-09-29 16:44:18 +08:00
dray
3027af1239 feat: 添加 WebDAV 配置项
为应用程序添加了 WebDAV 配置项,包括主机、用户、密码和路径。这样用户就可以将备份文件定时上传到 WebDAV 服务器,并从 WebDAV 服务器恢复备份文件。

- 添加了新的依赖项 "webdav": "^5.7.1"
- 修改了 package.json 文件
- 修改了 zh-tw.json、zh-cn.json 和 en-us.json 文件
- 修改了 settings.ts 文件
- 修改了 GeneralSettings.tsx 文件

https://github.com/kangfenmao/cherry-studio/issues/129
2024-09-29 09:27:42 +08:00
kangfenmao
4f2d2991a3 fix: context count 2024-09-28 22:01:09 +08:00
牡丹凤凰
eed9a51718 Merge pull request #137 from 1355873789/develop
add new app(Felo)
2024-09-28 17:58:00 +08:00
1355873789
cfc17e4d6e add new app(Felo) 2024-09-28 17:58:30 +08:00
牡丹凤凰
52248cb887 Update models.ts
fix: Confusion between Minimax and Hailuo logos
2024-09-28 11:21:01 +08:00
kangfenmao
eccb3b6410 chore(version): 0.7.9 2024-09-28 00:45:05 +08:00
kangfenmao
f41f3dedcd fix: about page minapp logo 2024-09-27 22:44:45 +08:00
kangfenmao
4bddbb04ce feat: backup all files
1. remove window.api.compress window.api.decompress
2024-09-27 22:35:22 +08:00
kangfenmao
427d37a87a fix: minimax hailuo logo 2024-09-27 14:14:10 +08:00
牡丹凤凰
dc8d7a236d fix: correct display for non-vision GPT-4 models (#135)
* Update models.ts

feat: add matching rules for EMBEDDING_REGEX
fix: correct display for non-vision gpt-4 models

* Update models.ts

feat:add matching rules for gpt-4

* Update models.ts

feat:add matching rules for gpt-4

* Update models.ts

feat:add matching rules for gpt-4
2024-09-27 11:47:03 +08:00
kangfenmao
19821af7f9 refactor: MessageContent component 2024-09-27 00:25:45 +08:00
kangfenmao
b1ef0636fc docs: add dev docs 2024-09-27 00:13:24 +08:00
drfyup
3c6e443a71 doc: add dev docs (#133)
* Create PR_FAQ.md

* Create Code_DSC.md
2024-09-27 00:04:46 +08:00
kangfenmao
a9bc03dbb6 fix: 在提问时携带图片会卡住软件 #108 2024-09-27 00:01:35 +08:00
kangfenmao
6a50f5bd21 fix: Assistant 的 Prompt 过长时会超出组件 #95
close #95
2024-09-26 23:29:04 +08:00
kangfenmao
4056d61f69 feat: check update settings #131
close #131
2024-09-26 23:17:21 +08:00
kangfenmao
d7db307f8a feat: edit message 2024-09-26 22:45:59 +08:00
kangfenmao
29ee364fc5 feat: translate settings persist 2024-09-26 19:15:26 +08:00
kangfenmao
f146fd075c fix: filter unsupported models 2024-09-26 15:12:47 +08:00
kangfenmao
2d46ca8a9b fix: remove filter messages 2024-09-26 14:55:09 +08:00
亢奋猫
46083886b7 docs: new screenshot 2024-09-26 14:10:14 +08:00
kangfenmao
a988536855 docs: add sponsor 2024-09-26 13:55:30 +08:00
1355873789
4326bd1b9e 更新智谱清言APP logo 2024-09-26 08:40:07 +08:00
1355873789
8ad2cf613c 繁体中文支持 2024-09-26 08:40:07 +08:00
1355873789
4b9603d576 模型头像相关
修正部分模型头像错误
新增部分模型头像
2024-09-26 08:40:07 +08:00
牡丹凤凰
07dec23a02 Update providers.ts 2024-09-26 03:10:44 +08:00
kangfenmao
b35e37a170 chore(version): 0.7.8 2024-09-25 12:52:42 +08:00
kangfenmao
d1c70f2dc5 feat: auto-scroll to bottom on new messages, return null for empty suggestions
- Added functionality to automatically scroll to the bottom of the messages container upon receiving new messages.
- Return null when suggestions list is empty instead of displaying an empty container.
2024-09-25 12:33:03 +08:00
kangfenmao
bb43a99d4a feat: add hugging chat minapp 2024-09-25 12:09:51 +08:00
kangfenmao
fc528c7675 fix: auto scroll to bottom #120
close #120
2024-09-25 11:36:44 +08:00
kangfenmao
0a85b43c48 refactor: ant design styles separation 2024-09-25 11:29:38 +08:00
kangfenmao
dd60dfa872 feat: add streaming output options #93 2024-09-25 11:23:45 +08:00
kangfenmao
bf2005676d fix: gemini safety settings #110 2024-09-25 09:49:19 +08:00
kangfenmao
553d62c041 docs(README.md): update readme 2024-09-25 00:26:14 +08:00
kangfenmao
3452821fef feat: new providers logos 2024-09-25 00:21:20 +08:00
kangfenmao
e2367f1f0f feat: add ocoolai provider 2024-09-25 00:21:20 +08:00
kangfenmao
e23a525363 fix: transparent window 2024-09-25 00:21:20 +08:00
kangfenmao
3c9ed9f9a9 fix: windows ico icon 2024-09-25 00:20:10 +08:00
亢奋猫
3db4ffa115 Update README.md 2024-09-25 00:20:10 +08:00
亢奋猫
c12e16b076 docs(README.md): add contributors 2024-09-25 00:20:10 +08:00
牡丹凤凰
6f08169c1d docs(README.md): add banners
Delete docs/images/1.png

update
2024-09-25 00:19:52 +08:00
kangfenmao
60efe59a2d feat: improved layout and accessibility
- Added hidden overflow to HomePage content container for improved layout.
- Changed the upload list type to text to improve accessibility.
2024-09-25 00:00:34 +08:00
kangfenmao
8e48388c79 chore(version): 0.7.7 2024-09-25 00:00:34 +08:00
kangfenmao
86384cd8a7 style: removed background color from agentcard component
- Removed background color from AgentCard component.
2024-09-25 00:00:34 +08:00
kangfenmao
ad6770ceb5 feat: new vi logo 2024-09-25 00:00:34 +08:00
kangfenmao
5335ab555b fix: agent i18n tranlate 2024-09-25 00:00:34 +08:00
王叔叔
025ef074db Update README_zh.md 2024-09-25 00:00:20 +08:00
kangfenmao
7a6213f428 fix: appImage artifactName #112
close #112
2024-09-24 23:59:38 +08:00
kangfenmao
3728174208 docs: add docs folder 2024-09-24 23:59:38 +08:00
kangfenmao
eea0adbfcd fix: content container overflow 2024-09-24 23:59:38 +08:00
kangfenmao
32c03f9c83 feat: new model logo 2024-09-24 23:59:38 +08:00
kangfenmao
ef172e4446 feat: use rounded corner design 2024-09-24 23:59:38 +08:00
kangfenmao
b908a8f0f9 feat: fix siliconflow reset api url 2024-09-22 09:24:55 +08:00
kangfenmao
0300ef67d1 chore(version): 0.7.6 2024-09-22 00:44:47 +08:00
kangfenmao
95985b139b style: centered positioning and alignment added to modal and userpopup components
- Added centered positioning to Modal component in PromptPopup.
- Added centered alignment to UserPopup component.
2024-09-22 00:19:45 +08:00
kangfenmao
31626bde46 feat: export topic message as image #103 2024-09-22 00:16:36 +08:00
kangfenmao
d61b07dddf feat: add loading spinner #86
close #86
2024-09-21 21:07:50 +08:00
kangfenmao
7a5c72aab4 refactor: message component 2024-09-21 13:20:16 +08:00
kangfenmao
b9aeca7c13 feat: improved formula rendering with new escaping functions
- Improved formula rendering by removing unnecessary escaping of dollar numbers.
- Implemented two new string escaping functions to prevent incorrect LaTeX formula rendering.

#101
2024-09-21 10:27:32 +08:00
kangfenmao
9d45ea9e92 fix: After stopping content generation, messages cannot be cleared #66
close #66
2024-09-21 00:25:17 +08:00
kangfenmao
8420976c16 feat: improved input bar functionality and added text insertion feature
- Improved functionality for handling text input and file uploads in the input bar.
- Added functionality to insert text at cursor position in a text area.
2024-09-21 00:04:53 +08:00
kangfenmao
4372d7a4d0 fix: anthropic api url #97 2024-09-20 23:10:25 +08:00
kangfenmao
a9512c6214 chore(version): 0.7.5 2024-09-20 17:01:52 +08:00
kangfenmao
62072e4f66 feat: improved ui effects and rendering for components
- Added smooth all property transition effect to Icon component.
- Added hover effect and conditional rendering for Switch Topic Sidebar button on current assistant.
- Updated the existing conditional options array to consistently include both topic and settings options.
- Improved hover effects on topic list items.
2024-09-20 16:48:24 +08:00
kangfenmao
f26ebf44c7 feat: add new add topic button 2024-09-20 15:11:50 +08:00
kangfenmao
38697e3532 fix: attachment open handler 2024-09-20 11:38:30 +08:00
kangfenmao
1412ac9889 fix: improved api call validation
- Improved API call validation to account for additional usage properties.
2024-09-20 11:12:15 +08:00
kangfenmao
8470119adc style: removed unnecessary import and optimized sidebar styling
- Removed unnecessary import and optimized sidebar styling for improved performance.
2024-09-20 10:49:50 +08:00
kangfenmao
8943eda7a3 chore(version): 0.7.4 2024-09-20 00:15:24 +08:00
kangfenmao
25114f1325 feat: added minapp event handling and sidebar menu interactions #50
- Added functionality for handling MinApp window closure and provided a default close event handler.
- Added event listeners to Sidebar menus to interact with MinApp.
2024-09-19 23:28:06 +08:00
kangfenmao
079076d673 fix: Disable topic switching and movement during rendering.
- Added functionality to disable topic switching and movement when rendering is in progress.
2024-09-19 23:01:21 +08:00
kangfenmao
4c5cf6d977 feat: Improved layout and added file content filtering.
- Added a margin bottom to the Upload component in the MessageAttachments page for improved layout.
- Added support for not displaying file contents for specific providers.
2024-09-19 22:58:12 +08:00
kangfenmao
40702e8923 chore(version): 0.7.3 2024-09-19 18:20:52 +08:00
kangfenmao
6920f24856 fix: attachment select extension for windows 2024-09-19 17:40:45 +08:00
kangfenmao
43dcb40124 chore(version): 0.7.2 2024-09-19 16:56:58 +08:00
kangfenmao
14dd179e47 feat: Added translations, new column, and UI improvements.
- Added translations for a new field.
- Added new column for file count in the FilesPage view.
- Improved handling of message tokens in the UI.
- Added functionality to display message tokens for messages with specific roles.
- Added window style selection and styling adjustments to the General Settings page.
- Added support for vision models in OpenAIProvider.
2024-09-19 16:56:44 +08:00
kangfenmao
4465e654d6 fix: openai sdk request error 2024-09-19 15:21:24 +08:00
kangfenmao
f1d4da32dd fix: support \(...\) and \[...\] style math formula #78 2024-09-19 15:21:06 +08:00
kangfenmao
bbeca88b2b feat: add click assistant switch to topics settings 2024-09-19 13:55:44 +08:00
kangfenmao
1bc3484656 feat: enhanced user experience with layout adjustments.
- This commit addresses key feature enhancements and minor optimizations for improved user experience and functionality.
- Adjusted margin top for upload container to a positive value.
- Adjusted the max-height of the container to improve rendering on smaller screens.
2024-09-19 12:04:06 +08:00
kangfenmao
ca3150c6ed feat: Improved file management and added new features.
- Updated file manager to use FileManager class instead of File class.
- Improved file management functionality with features for finding duplicate files, file uploading, and storage management.
- Added styles to wrap and truncate text in a no-drag area.
- Added explicit file extensions to imageExts constant.
- Added the 'paste long text as file' input setting.
- Added image file display and UI improvements for file names and overflow.
- Improved file paste and long text handling functionality.
- awaited onSendMessage function call and added message to chat completion.
- Implemented new option to paste long text as file in the Settings page.
- Updated content display logic to include file origin name along with the file content for text files.
- Improved functionality for handling image and text file contents in the Gemini chat provider.
- Updated file content formatting logic for text files with origin name and content prefix.
- Added a new setting "pasteLongTextAsFile" and its corresponding action to the application settings.
2024-09-19 10:51:30 +08:00
kangfenmao
540f0126d8 feat: copy and paste files or images 2024-09-18 21:18:42 +08:00
kangfenmao
b9bb0c0f40 feat: add file attachment 2024-09-18 18:00:49 +08:00
kangfenmao
09f4ddd31c feat: estimate completion usage calculation added to chat.
- Estimated usage calculation has been added to chat completion fetching to track message usage.
- Added functionality to estimate completion usage tokens based on input and prompt data.
2024-09-17 14:56:10 +08:00
kangfenmao
53e315e265 feat: Added functionality to move topics between assistants.
- Added functionality to move topics between assistants.
- Updated i18n translations to improve user interface clarity and accessibility.
- Improved code organization and functionality to support moving topics between assistants.
2024-09-17 14:37:42 +08:00
kangfenmao
058b264c9a fix: dexie data upgrade 2024-09-16 18:04:46 +08:00
kangfenmao
d9205d08d7 chore(version): 0.7.1 2024-09-16 16:56:38 +08:00
kangfenmao
315b6d8c74 fix: clear database and restore specific data from backup
- Updated restore function now clears database and restores specific data from backup.
- Removed unused imports and refactored logic for item transformation in the '24' migration step.
2024-09-16 16:44:41 +08:00
kangfenmao
3e8a00f3a5 fix: backup and restore 2024-09-16 14:59:42 +08:00
kangfenmao
d37231dafe fix: Improved user experience by adding timeout to text area resize.
- Added timeout before resizing text area to improve user experience.
- Removed import of the unused `useProviderByAssistant` hook.
2024-09-16 13:03:29 +08:00
kangfenmao
868176ed57 feat: new message branch 2024-09-16 12:56:00 +08:00
kangfenmao
ff013c26ad feat: add copy button on message footer 2024-09-16 11:51:20 +08:00
kangfenmao
8912fde373 refactor: add topics and settings table
dexie
2024-09-16 10:19:06 +08:00
kangfenmao
576652b6b9 chore: Update package manager to yarn 4.5.0 and re-add notarize dependency.
- Updated the package manager to yarn version 4.5.0.
- Removed and re-added "electron/notarize" dependency with a specific patch version.
2024-09-15 14:20:58 +08:00
kangfenmao
808ade9615 feat: added vite_main_bundle_id config and improved code cleanliness 2024-09-15 10:35:02 +08:00
kangfenmao
2825165f77 chore(version): 0.7.0 2024-09-14 21:28:39 +08:00
kangfenmao
9e9738e3fe fix: removed dev tools, updated sidebar links, fixed file deletion.
- Removed ability to open developer tools in main window.
- Added and removed a link to the "/files" route in the Sidebar component.
- Fixed file deletion logic to correctly delete files from both the database and the file system.
2024-09-14 21:28:39 +08:00
kangfenmao
340667e926 fix: removed 'trigger' attribute from popover component 2024-09-14 17:22:03 +08:00
kangfenmao
2ca183b3e0 feat: add id to miniapp 2024-09-14 17:02:47 +08:00
kangfenmao
b85d314701 style: improved formatting in add agent popup.
- Improved formatting of prompt and fetched generated text in Add Agent Popup.
2024-09-14 16:53:22 +08:00
Aimer
fddd7c6858 Modified the prompt part Modified the minapp data part 2024-09-14 16:23:58 +08:00
kangfenmao
c5c9db44bf fix: remove trailing double spaces from markdown strings 2024-09-14 16:17:35 +08:00
kangfenmao
7eb56ef2d1 refactor: update file management to use filetype instead of filemetadata 2024-09-14 16:08:43 +08:00
kangfenmao
be6c2c14b7 refactor: remove sqlite3 use dexie 2024-09-14 15:25:56 +08:00
kangfenmao
d6cdac0895 chore: update build process and database configuration.
- Updated configuration to exclude additional directories from electron-builder's build process.
- Dropped the creation of the "files" table in the database schema.
- Improved code organization and extracted the data path into a reusable function.
- Updated database migration configuration to use a new migration manager.
- Added database migration to create a table for file management.
- A migration to remove the "files" table has been applied.
2024-09-13 17:03:26 +08:00
kangfenmao
1caec164fb feat: implemented vision model support and ui enhancements.
- Updated color palette settings have been implemented.
- Added VisionIcon component utilizing Ant Design icons and styled components for visual customization.
- Updated vision model regex to include additional models.
- Added support for multiple file columns in i18n resources.
- Added translations to column titles.
- Added support for vision models in the Select Model Button component.
- Added functionality to display a vision model icon next to the model name on dropdown items.
- Implemented changes to add vision model support to the Edit Models Popup.
- Added icon to display vision models in provider settings.
2024-09-13 15:46:48 +08:00
kangfenmao
f23f85523c feat: added attachment preview and upload/removal capabilities.
- Added functionality to display attachment preview with upload and removal capabilities.
- Added support for file attachments to the input bar.
2024-09-13 14:47:05 +08:00
kangfenmao
62973d8fd2 refactor: use sequelize replace better-sqlite3 2024-09-13 13:26:22 +08:00
kangfenmao
0a6ba48122 fix: Corrected image mime type in IPC message.
- Corrected image mime type in IPC message.
2024-09-13 13:26:22 +08:00
kangfenmao
f975953ba4 feat: Added tracking column to files table and updated FileMetadata interface.
- Added a "count" column with default value 1 to the "files" table for tracking purposes.
- Improved file duplication and deletion handling.
- Updated regular expression for vision models to include additional providers.
- Improved removal of topics for assistants from local storage.
- Added support for human-readable date formats in file metadata.
- Improved handling of messages with image attachments to include base64 encoded images in the response.
- Added new 'count' property to the FileMetadata interface.
2024-09-13 13:26:22 +08:00
kangfenmao
fa0cacda26 feat: Improved IPC image handling and added vision model support.
- Improved IPC image handling to return mime type and base64 encoded data alongside the image data.
- Updated type definition for `base64` method in image object to return an object with mime, base64, and data properties.
- Added support for vision models using new function and regex.
- Table cell size has been reduced on the FilesPage component.
- Added support for vision model attachments.
- Added model dependency to AttachmentButton component.
- Implemented new functionality to handle image messages in the GeminiProvider class.
- Update image base64 encoding to directly use API response data.
2024-09-13 13:26:22 +08:00
kangfenmao
11ab80f87d feat: add attachment files 2024-09-13 13:26:22 +08:00
kangfenmao
59c2a78c53 feat: add sqlite database manager 2024-09-13 13:26:22 +08:00
kangfenmao
2cb461db4e feat: added file management functionality and API operations
- Improved functionality for file management has been added.
- Added file system management functionality through IPC.
- Added functionality to interact with files including selection, upload, deletion, and batch operations.
- Added new file operations to the custom API, including file select, upload, delete, batch upload, and batch delete functions.
- Implemented feature to select and upload files via API.
2024-09-13 13:26:22 +08:00
kangfenmao
7beea24fc4 feat: add file class 2024-09-13 13:26:22 +08:00
kangfenmao
3acc24d40e feat: add files sidebar menu 2024-09-13 13:26:22 +08:00
kangfenmao
7330391813 refactor: renamed generate method to generateText for clarity and consistency 2024-09-13 10:03:30 +08:00
kangfenmao
75045a3e6f feat: add generate to ai provider api 2024-09-13 09:57:27 +08:00
kangfenmao
f71265442f chore(version): 0.6.14 2024-09-11 20:58:46 +08:00
kangfenmao
3401d66274 feat: Add new image file and Poe app support.
- Added a new image file.
- Added Poe app to the list of supported apps.
- Removed unused provider configuration.
2024-09-11 20:58:29 +08:00
kangfenmao
557d408957 docs: Update translations and UI for better readability.
- Updated English translations in internationalization resources to simplify search assistant placeholder.
- Removed unused import, improved text search UI and adjusted font sizes for better readability.
2024-09-11 19:39:27 +08:00
kangfenmao
621f3d4616 chore(version): 0.6.13 2024-09-11 19:22:34 +08:00
kangfenmao
dc9fa90d2d feat: Add Cohere model support and binary asset.
- Added new binary asset 'cohere.webp'.
- Added Cohere model support to the application.
2024-09-11 19:19:09 +08:00
kangfenmao
836095224e feat: Added GitHub provider support and models.
- Added a new SVG logo for the GitHub provider.
- Added a new social media platform provider to the SYSTEM_MODELS configuration.
- Added support for Github provider in the application configuration.
- Added two new translation keys: 'github' with 'GitHub Models' and updated the existing key 'graphrag-kylin-mountain'.
- Added width parameter to EditModelsPopup configuration.
- Added GitHub-specific model handling to OpenAIProvider class.
- Incremented the application version to 25.
- Added support for a new LLM model type.
- Added a new migration step to configure and enable a GitHub LLM provider.
2024-09-11 19:08:40 +08:00
kangfenmao
a70b86d426 docs: Update release notes for Electron application.
- Updated release notes for Electron application now include additional features and fixes.
2024-09-11 17:36:37 +08:00
kangfenmao
66ee19babb feat: Enhanced search functionality with user interaction and command shortcuts.
- Improved functionality to search Assistants with enhanced user interaction and command shortcuts.
- Implemented search functionality with runtime state management.
- Added functionality to return default assistant settings and updated conversion of agents to assistants to include default settings.
- Added a new 'searching' boolean field and corresponding state update action to the runtime store.
2024-09-11 17:29:46 +08:00
kangfenmao
b6a5a2a67d feat: Update temperature slider maximum value to 2 #62
- Increased the maximum temperature value in the settings slider.
- Increased the temperature slider maximum value from 1.2 to 2.
2024-09-11 16:24:07 +08:00
kangfenmao
d29904d359 feat: Added configurable Droppable component props to DragableList, updated translations and implemented search functionality.
- Added support for configurable Droppable component props to the DragableList component.
- Updated translations for multiple components and languages.
- Implemented search functionality in the Assistants page.
2024-09-11 16:14:06 +08:00
kangfenmao
0e4b3c730b fix: Corrected deletions and added API host reset for editable providers.
- Corrected deletions of the 'editable' property for multiple providers.
- Added ability to reset API host for editable providers when not empty.
2024-09-11 15:25:44 +08:00
kangfenmao
14180b8c06 feat: enable Math support in Markdown rendering.
- Enabled Math support in Markdown rendering without single dollar text math.
2024-09-10 15:31:32 +08:00
kangfenmao
3206dc29bc fix: disable math formula conversion in Markdown.
- Disabled math formula conversion in Markdown rendering.
2024-09-10 15:25:18 +08:00
kangfenmao
5ced4b6803 style: Refine UI styles and layout.
- Adjusted various font and layout styles to refine the user interface.
- Updated the minimum width of the NavbarRightContainer to match the var(--topic-list-width) setting.
- Added logic to synchronize local _activeTopic with activeTopic state.
- Improve logic for dynamically updating tab state in RightSidebar component based on position and topic settings.
- Removed unneeded console statement from font size slider's onChangeComplete event.
- Adjusted the width of the SettingMenus component to utilize the --settings-width variable.
2024-09-10 15:20:59 +08:00
kangfenmao
e2dc434dcc feat: Added platform-specific functionality to GeneralSettings page.
- Added platform-specific functionality to GeneralSettings page.
2024-09-10 13:52:50 +08:00
kangfenmao
f579e5c899 docs: Update agent-related translations to use 'assistant' term.
- "All agent-related translations have been updated to use the term 'assistant' instead of 'agent'."
2024-09-10 13:51:47 +08:00
kangfenmao
2ac2f90711 style: Updated component styles and layouts.
- Added new styles for the business smart assistant icon.
- Adjusted the sizes and positions of the ArrowRightButton components.
- Removed conditional style for NavbarLeft component.
- Implemented logic to resolve tab initialization based on component position.
2024-09-10 13:50:20 +08:00
kangfenmao
05ee42acc1 style: Adjusted layout and styling of right sidebar.
- Modified color border variable to a lighter grayish white.
- Adjusted the layout and styling of the right sidebar.
2024-09-10 13:28:34 +08:00
kangfenmao
ec272a841b chore(version): 0.6.12 2024-09-09 17:34:30 +08:00
kangfenmao
30fcf518ba style: Centered buttons and modals.
- Added the centered property to the OK button on the AgentsPage.
- Added centered option to modal confirmation dialog.
- Centred the delete button in the ProvidersList component.
- Added centered confirmation to reset modal.
2024-09-09 17:16:14 +08:00
kangfenmao
6fa0aa3d92 feat: Update release notes with new features and bug fixes. 2024-09-09 17:01:02 +08:00
kangfenmao
8093015810 style: Centered layout updates across components.
- Centered the 'Add Assistant' popup in the chat modal.
- Added centered alignment to the AssistantSettingPopup component.
- The text area prompt input field now has a larger height.
- Updated the positioning of the Manage Agents popup to be centered.
- Added a centered attribute to the AddModelPopup modal footer.
- Added centered positioning to ProviderSettings AddProviderPopup.
- Centered layout has been added to the SearchContainer.
2024-09-09 16:57:20 +08:00
kangfenmao
5d6cc22fec Revert "refactor: Migrate DeepSeek models to v2 naming convention"
This reverts commit 75a27d813c.
2024-09-09 16:33:29 +08:00
kangfenmao
1bbed36d51 style: Adjusted dropdown menu maxHeight to 55vh. #52
- Adjusted the maxHeight property of the dropdown menu to 55vh from 80vh.
2024-09-09 13:03:51 +08:00
kangfenmao
75a27d813c refactor: Migrate DeepSeek models to v2 naming convention
- Updated DeepSeek models to use version 2 naming convention.
2024-09-09 11:58:18 +08:00
kangfenmao
1917b52b19 feat: Add Zhihu app support and image asset.
- A new image file 'zhihu.png' has been added.
- Added support for Zhihu app in the minapp configuration.
2024-09-09 11:20:02 +08:00
kangfenmao
a0827a72e8 chore(version): 0.6.11 2024-09-08 22:59:12 +08:00
kangfenmao
43837b3b87 feat: Add list styling and optimize DragableList component
- Added list styling functionality to the DragableList component.
- Removed unused imports and updated container height to accommodate additional content.
2024-09-08 22:55:58 +08:00
kangfenmao
475290a204 feat: Show all topics on drag start
- Enforce the drag and drop functionality to show all topics on drag start.
2024-09-08 22:35:34 +08:00
kangfenmao
4d57f624b3 refactor: Simplify import and topic deletion logic
- Updated import statement to remove unused type reference.
- Improved handling of deleting a topic.
2024-09-08 22:25:56 +08:00
kangfenmao
7087b1c604 feat: Remove activeAssistant dependency, add assistant dependency
- Updated the `onEditAssistant` function to remove dependency on `activeAssistant` variable and add `assistant` as a dependency.
2024-09-08 20:57:49 +08:00
kangfenmao
c661b997c5 feat: Edit assistant settings with real-time sync.
- Added support for editing an assistant's settings with real-time synchronization to the agent.
2024-09-08 16:09:17 +08:00
kangfenmao
7e872edfda feat: Enhanced UI/UX with design updates, i18n, and feature enhancements.
- Updated design styles for segmented tabs and size adjustments for assistive elements.
- Added internationalization translations for English and Chinese.
- Removed unused import and functionality for switching topics sidebar.
- Added functionality to hide or show the right sidebar in the Chat page.
- Renamed Assistants component to RightSidebar.
- Improved functionality for showing and toggling topics and settings in the input bar.
- Removed unused imports and refactored Navbar component layout.
- Updated existing right sidebar functionality to allow for custom position and show topic settings.
- Removed inline styles for width from Settings component Container styles.
- Added new features for managing topics in the home page, including drag and drop functionality, a "show all" button for viewing more topics, and improved handling of large topic lists.
2024-09-08 15:56:16 +08:00
kangfenmao
7548f3c998 refactor: Improve code reusability and model service logic
- Improved code reusability in ModelSettings component by utilizing the hasModel function and Memoization.
- Refactored model service to include logic for checking if a model exists and retrieving its unique ID.
2024-09-08 10:13:15 +08:00
kangfenmao
73bfec7bb6 chore(version): 0.6.10 2024-09-07 18:21:30 +08:00
kangfenmao
a469dab4ce feat: Improved UI components and added new features
- Replaced 'CopyOutlined' icon with custom 'CopyIcon'.
- Replaced Topics component with RightSidebar component to match topicPosition settings.
- Removed unused imports and updated UI components in the Inputbar.
- Implemented a new Token Count component for displaying context and estimated token information in the input bar.
- Adjusted the height of code block header.
- Added functionality to toggle theme opacity.
- Added functionality to dynamically change the sidebar border style based on stored settings.
- Updated CSS styles for dynamic topic list width and padding adjustments.
- Removed unused import and styles to improve code efficiency and reduce clutter.
2024-09-07 18:11:27 +08:00
kangfenmao
69f93d167c feat: Improved model selection and unique id generation
- Improved dropdown menu selection logic for models.
- Changes improve ModelSettings component to use getModelUniqId function for model identifiers.
- Added modeling service functionality to generate unique model identifiers.
2024-09-07 18:11:13 +08:00
kangfenmao
286ad04a36 chore(version): 0.6.9 2024-09-06 18:04:11 +08:00
kangfenmao
7e179a407e feat: Add theme switching to Navbar
- Added a new theme switching functionality to the Navbar.
2024-09-06 18:03:06 +08:00
kangfenmao
669c56bcca feat: Enhanced code block styling in Markdown editor
- Added styles for code blocks in markdown to match the application's design.
- Improved the rendering of code blocks in the Markdown editor by adding a border and changing the default display in dark mode.
2024-09-06 17:58:15 +08:00
kangfenmao
bb907f4afc chore(version): 0.6.8 2024-09-06 15:54:44 +08:00
kangfenmao
faecbbb857 refactor: Remove unused CSS classes and optimize conditional styling
- Removed unused CSS classes and optimized code for conditional styling.
2024-09-06 15:53:58 +08:00
kangfenmao
1fd0a33500 feat: Update UI components and styling for consistency and readability.
- Updated icon font asset reference URL to reflect a new timestamp.
- Updated icon-fonts file asset.
- Updated markdown styling to adjust margins and padding of pre-formatted text elements.
- Added Windows-specific styling to the Inputbar component.
- Improved the rendering of code blocks with a focus on readability and theming consistency.
- Added new 'plain' attribute to Divider component for 'clear' message type.
- Minor adjustments made to the navigation bar styles and layout.
2024-09-06 15:41:46 +08:00
kangfenmao
2e0919ae88 feat: Update context count logic
- Updated logic for determining context count based on clear messages.
2024-09-06 14:17:22 +08:00
kangfenmao
c2a777246f style: Update toolbar button hover and active states
- Updated styles and icons for hover and active states of toolbar buttons.
2024-09-06 14:12:01 +08:00
kangfenmao
777a21dcc6 style: Update styling and input bar characters.
- Updated styling and characters added to input bar.
2024-09-06 14:07:45 +08:00
kangfenmao
fb7d23682f feat: Improved chat UI with context handling and filtering #43
- Updated default context count from 5 to 6.
- Updated string translations for multiple languages.
- Added functionality to handle new context and update context count in Inputbar component.
- Added support for displaying new chat context divider for 'clear' type messages.
- Added functionality to emit estimated token count with context count when the estimated token count event is triggered.
- Improved filtering and processing of user messages for the AnthropicProvider class.
- Updated message filtering logic with context consideration.
- Improved filtering of user messages to include only context-relevant messages.
- Updated logic to pass messages directly to AI.completions and AI.suggestions API requests instead of filtered messages.
- Added new event names for handling topic sidebar and context switching.
- Improved handling of message filtering and context counting.
- Added new valid value 'clear' to type option in Message type.
2024-09-06 13:54:48 +08:00
kangfenmao
e93c3f2d1b fix: Handle Enter key press event in input field
- Updated handling for Enter key press event in input field to match shortcut settings.
2024-09-06 11:34:55 +08:00
kangfenmao
f1bd7e1cbf feat: Update icon font and navigation buttons
- Updated icon font references and added new icon font glyphs.
- Updated icon font file for improved rendering.
- Updated icon font sizes and hover animations for navigation buttons.
- Removed border styles from styled Container component.
- Removed unused import and updated icon for '/settings/model' menu item.
2024-09-06 10:00:18 +08:00
kangfenmao
99654d995e chore(version): 0.6.7 2024-09-05 23:53:47 +08:00
kangfenmao
54d1de37fc feat: change topics position 2024-09-05 23:53:47 +08:00
kangfenmao
05a9d02a72 feat: Update Content-Security-Policy to allow file: frame-src #38
- Updated Content-Security-Policy directive to allow frame-src from file: in the HTML document.
2024-09-05 17:19:17 +08:00
kangfenmao
a90a119bfe refactor: renamed and refactored topic properties and added date-time tracking
- Renamed localforage topic item property from topic object to id.
- Added date-time tracking for assistant topics.
- Incremented the store version to 24.
- Refactored migrate function to add support for local storage and update topics timestamps.
- Added createdAt and updatedAt properties to Topic type.
2024-09-05 16:15:48 +08:00
kangfenmao
c0a1482983 docs(DragableList): improve types and props documentation for DragDropContext responders 2024-09-05 15:30:26 +08:00
kangfenmao
e939a150a1 feat: highlight acitve topic icon 2024-09-05 14:36:19 +08:00
kangfenmao
e427d020b6 feat: quickly edit the asistant on edit title #42 2024-09-05 13:41:47 +08:00
kangfenmao
961b336396 fix: anthropic first message must use the user role #39
{"type":"error","error":{"type":"invalid_request_error","message":"messages: first message must use the "user" role"}}
2024-09-05 13:35:16 +08:00
kangfenmao
08f74c5356 fix: assistant and topic list style 2024-09-05 00:04:35 +08:00
kangfenmao
7ebd4312ca chore(version): 0.6.6 2024-09-04 22:33:15 +08:00
kangfenmao
1e29f7dd9c fix: left sidebar icon 2024-09-04 22:31:39 +08:00
kangfenmao
ad76ef7af9 feat: remove hashtag title 2024-09-04 21:57:23 +08:00
kangfenmao
6ff768b72a chore(version): 0.6.5 2024-09-04 21:29:56 +08:00
kangfenmao
47fb43d469 feat: new chat style 2024-09-04 21:29:16 +08:00
kangfenmao
78c82b93c8 revert: fold topics 2024-09-04 15:37:39 +08:00
kangfenmao
5ec8c4b5f2 wip 2024-09-04 13:26:51 +08:00
kangfenmao
70e599e791 feat: transparent window settings 2024-09-04 11:23:45 +08:00
kangfenmao
c33f9228d3 feat: change assistant sidebar width 2024-09-03 23:37:40 +08:00
kangfenmao
303a446dee chore(version): 0.6.4 2024-09-03 22:14:12 +08:00
kangfenmao
195e7d8867 feat: double click to change assistat view 2024-09-03 22:13:25 +08:00
kangfenmao
c2a14c5c5a chore(version): 0.6.3 2024-09-03 20:50:46 +08:00
kangfenmao
a160426cb1 fix: assistant nav style 2024-09-03 20:50:37 +08:00
kangfenmao
26de164c26 feat: change default avatar 2024-09-03 20:39:27 +08:00
kangfenmao
a3f2f8c890 fix: inputbar height 2024-09-03 20:11:25 +08:00
kangfenmao
154ed1f519 feat: change default provider 2024-09-03 20:11:20 +08:00
kangfenmao
44e2c9e571 fix: backup and restore i18n 2024-09-03 19:30:21 +08:00
kangfenmao
af2186e629 refactor: provider sdk 2024-09-03 19:00:24 +08:00
kangfenmao
acde6f4499 refactor: remove modal enabled key 2024-09-03 13:17:55 +08:00
kangfenmao
2e68b27264 fix: use webview replace iframe 2024-09-03 13:17:38 +08:00
kangfenmao
dfc886b802 refactor: remove models config enabled 2024-09-03 11:40:46 +08:00
kangfenmao
5ce380c37a feat: merge assistant and topics 2024-09-03 11:36:57 +08:00
kangfenmao
8feab6a49d refactor: assistant drap and drop 2024-09-02 20:48:31 +08:00
kangfenmao
8c390475e2 feat: expand inputbar height 2024-09-02 15:38:48 +08:00
kangfenmao
ff4ca9d5e8 feat: auto change inputbar height 2024-09-02 14:09:03 +08:00
kangfenmao
ba71e9a11e feat: add attachment button 2024-09-01 23:22:21 +08:00
kangfenmao
47a9569e13 feat: hide entry for local ai 2024-08-28 18:11:35 +08:00
kangfenmao
47ea77418b fix: https://github.com/electron/notarize/issues/193 2024-08-27 19:42:39 +08:00
kangfenmao
e64c5bc7b5 fix: electron-builder files path 2024-08-27 19:42:32 +08:00
kangfenmao
f7514c0588 refactor: change env file path 2024-08-27 11:58:19 +08:00
kangfenmao
699ef6b80e feat: add local module 2024-08-27 11:31:05 +08:00
kangfenmao
e188ba603d chore(version): 0.6.2 2024-08-26 18:30:05 +08:00
kangfenmao
9754ba37ce fix: electron builder ignore files 2024-08-26 18:19:01 +08:00
kangfenmao
dadc0ab860 build: remove sentry 2024-08-26 18:06:07 +08:00
kangfenmao
69d7e9ae85 build: remove electron-devtools-installer 2024-08-26 18:02:20 +08:00
kangfenmao
51e0da5f3b fix: workspace config 2024-08-26 17:49:19 +08:00
kangfenmao
5bf3dd93e9 build: add yarn workspace config 2024-08-25 22:12:31 +08:00
kangfenmao
e3df8a82cc refactor: remove unnecessary logs 2024-08-25 21:37:13 +08:00
kangfenmao
460fa5a1c2 feat: update user data path 2024-08-25 18:39:53 +08:00
kangfenmao
d1184f0a7c fix: default assistant name 2024-08-23 21:41:16 +08:00
kangfenmao
bff07db732 feat: add devv referral code 2024-08-23 20:57:54 +08:00
kangfenmao
425d5cc72e chore(version): 0.6.1 2024-08-22 19:17:35 +08:00
kangfenmao
13309cb79a feat: more ai minapp 2024-08-22 18:45:06 +08:00
kangfenmao
ed3ec3a773 wip 2024-08-22 16:36:04 +08:00
kangfenmao
45e16b72f5 refactor: remove minapp.html 2024-08-22 13:04:24 +08:00
kangfenmao
9746c73cc5 chore(version): 0.6.0 2024-08-21 10:28:31 +08:00
kangfenmao
34f100454b feat: add minapps 2024-08-21 10:14:04 +08:00
kangfenmao
9c4af4b1f1 chore(version): 0.5.9 2024-08-20 13:42:50 +08:00
kangfenmao
d0f002bb3e fix: windows minapp control button 2024-08-18 23:37:09 +08:00
kangfenmao
26570a24bf feat: change sidebar width 2024-08-18 22:20:09 +08:00
kangfenmao
a4a0b07fe9 feat: new input status bar style 2024-08-18 20:44:55 +08:00
kangfenmao
c704b6c9e7 chore(version): 0.5.8 2024-08-18 18:06:56 +08:00
kangfenmao
109093f1b5 feat: add minimax provider 2024-08-18 18:06:21 +08:00
kangfenmao
868bbd689b fix: hmr recycle 2024-08-18 17:10:59 +08:00
kangfenmao
5d463ce562 fix: graph rag model id 2024-08-17 21:54:34 +08:00
kangfenmao
06c6f0deb0 fix: input text 2024-08-17 21:30:28 +08:00
kangfenmao
07e11e4915 fix: graphrag node url 2024-08-17 21:30:04 +08:00
kangfenmao
6051016684 feat: add minapp window 2024-08-17 17:11:48 +08:00
kangfenmao
0567a4f505 feat: add minapp window 2024-08-17 13:30:54 +08:00
kangfenmao
44cf2fcb26 feat: window.app add app path 2024-08-16 22:44:00 +08:00
kangfenmao
aa38e60b1d fix: minapp title null 2024-08-16 22:43:18 +08:00
kangfenmao
9fe14bc2aa chore(version): 0.5.7 2024-08-16 17:41:30 +08:00
kangfenmao
e976ec7b48 fix: windows frame background color 2024-08-16 17:41:14 +08:00
kangfenmao
0e5d9cf78e feat: add user edit modal & add prompt block 2024-08-16 17:19:18 +08:00
kangfenmao
242c39bbc5 chore(version): 0.5.6 2024-08-14 21:32:14 +08:00
kangfenmao
1a42e86010 feat: new windows and linux sidebar style 2024-08-14 21:28:44 +08:00
kangfenmao
1307aceec1 fix: anthropic message generating error 2024-08-14 20:35:57 +08:00
kangfenmao
e1c2457ca2 feat: add minapp popup 2024-08-14 19:47:58 +08:00
kangfenmao
168304fb63 chore(version): 0.5.5 2024-08-13 21:10:04 +08:00
kangfenmao
e4f79f76c5 fix(settings): provider list scroll 2024-08-13 21:04:04 +08:00
kangfenmao
c0c5cd9dc3 chore: remove ahooks 2024-08-13 20:50:54 +08:00
kangfenmao
bc31facaaf Revert "feat(translate): use full screen input"
This reverts commit ec112b98ec.
2024-08-13 20:48:51 +08:00
kangfenmao
b6839687c0 feat: add graphrag provider 2024-08-13 20:48:38 +08:00
kangfenmao
e2896b84f0 feat: add doubao provider 2024-08-13 19:41:01 +08:00
kangfenmao
e46b44338c feat: add stepfun provider 2024-08-13 18:02:00 +08:00
kangfenmao
3dd6dc7f92 feat: add gemini provider 2024-08-13 16:51:52 +08:00
kangfenmao
ec112b98ec feat(translate): use full screen input 2024-08-13 14:57:46 +08:00
kangfenmao
cd8d9a2c93 chore(version): 0.5.4 2024-08-12 22:37:09 +08:00
kangfenmao
6351fd99fe feat: change sidebar opacity 2024-08-12 22:35:35 +08:00
kangfenmao
4066d4ab6d feat: add font size options to assistant settings pannel 2024-08-12 22:21:47 +08:00
kangfenmao
f5616c0ac6 feat: about page add icons 2024-08-12 22:03:16 +08:00
kangfenmao
db91c3fb1a refactor: slider onChange event 2024-08-12 21:48:59 +08:00
kangfenmao
09b42c6c15 feat: enable anthropic api host edit 2024-08-12 21:31:32 +08:00
kangfenmao
d0bb082b91 feat: add change message font size feature #22
支持消息字体大小调节
2024-08-12 21:28:18 +08:00
kangfenmao
391ed005ee style(Inputbar): add width: auto to Textarea 2024-08-11 16:18:06 +08:00
kangfenmao
935ac1a031 fix: clear topic white generating 2024-08-11 16:11:31 +08:00
kangfenmao
78cb21519a refactor: code format 2024-08-11 15:49:08 +08:00
kangfenmao
c1429ad1c5 chore(version): 0.5.3 2024-08-09 18:58:58 +08:00
kangfenmao
299043b997 feat: new inputbar style 2024-08-09 18:56:45 +08:00
亢奋猫
db414e639d Update README.md 2024-08-09 11:30:56 +08:00
kangfenmao
8d254e6851 chore(version): 0.5.2 2024-08-08 23:53:18 +08:00
kangfenmao
94f647fc1a fix: windows style 2024-08-08 23:30:55 +08:00
kangfenmao
410cf689bb chore(version): 0.5.1 2024-08-08 18:13:47 +08:00
kangfenmao
a27937e170 fix: filter empty user messages 2024-08-08 18:13:15 +08:00
kangfenmao
02f0936832 feat(message): add error tips 2024-08-08 17:57:57 +08:00
kangfenmao
850fae6a1b fix: inputbar height 2024-08-08 17:21:00 +08:00
kangfenmao
4215b129b6 fix: model settings crash 2024-08-08 17:16:45 +08:00
kangfenmao
fa8914632d feat(AssistantSettings.tsx): fix reset functionality 2024-08-08 16:49:18 +08:00
kangfenmao
2bbc330336 feat(ModelSettings.tsx): sorting model names and capitalizing first letter 2024-08-08 16:36:36 +08:00
kangfenmao
03ff9ceb1e feat(AboutSettings.tsx): add GithubOutlined icon linking to project repository for better user navigation and project visibility 2024-08-08 16:12:42 +08:00
亢奋猫
aa755b8fd1 Update README.md 2024-08-08 15:43:01 +08:00
kangfenmao
bc92ade8bb docs(README.md): add star history chart for project visibility 2024-08-08 15:38:31 +08:00
kangfenmao
fd6fe0db3d fix: navbar style on linux 2024-08-08 14:50:36 +08:00
kangfenmao
e69ff8168d build: add linux target 2024-08-08 11:31:15 +08:00
kangfenmao
7b0ba6bdb9 fix(i18n): update default assistant emoji from 😀 to 🔆 2024-08-08 09:18:33 +08:00
kangfenmao
3e21af218d chore(version): 0.5.0 2024-08-07 21:55:51 +08:00
kangfenmao
0f4f1cebfb feat: fix add assistant search keywords format 2024-08-07 20:57:31 +08:00
kangfenmao
45654e7d27 feat: add max token limit #18 2024-08-07 20:49:21 +08:00
kangfenmao
f76761cc8d feat: use ubuntu font as default 2024-08-07 14:28:29 +08:00
kangfenmao
e260eba7d1 feat add agent popup #14 2024-08-07 13:23:29 +08:00
kangfenmao
53c6e50a7d chore(version): 0.4.9 2024-08-06 20:41:34 +08:00
kangfenmao
704edd02da feat: add ollama settings 2024-08-06 20:38:01 +08:00
kangfenmao
c2a8a6f786 feat: add custom agent #14 2024-08-06 19:18:17 +08:00
kangfenmao
462387999e fix(AboutSettings.tsx): handle errors in update check by setting loading state 2024-08-05 16:15:58 +08:00
kangfenmao
6f9eb468f5 chore(version): 0.4.8 2024-08-05 13:20:55 +08:00
kangfenmao
02c0fda301 feat(i18n): new topic 2024-08-05 13:14:57 +08:00
kangfenmao
bb3d044e21 fix: estimate history token count 2024-08-05 13:09:13 +08:00
kangfenmao
d172df1e52 feat: input status use tag 2024-08-05 13:00:18 +08:00
kangfenmao
39e836993e feat: @model regenerate message 2024-08-05 12:39:37 +08:00
kangfenmao
bc838b3643 feat: quick regenerate with new model 2024-08-04 14:04:11 +08:00
kangfenmao
ad9a77d37b fix: markdown link color 2024-08-04 13:30:15 +08:00
kangfenmao
29a3121cb4 fix: math code format 2024-08-04 13:23:35 +08:00
kangfenmao
a6364c3735 chore(release.yml): add CSC_LINK and CSC_KEY_PASSWORD environment variables for windows build to enable code signing 2024-08-02 15:17:21 +08:00
kangfenmao
f9e9728bf3 chore(version): 0.4.7 2024-08-02 11:32:29 +08:00
kangfenmao
e86a74b1cf fix: footnote style 2024-08-02 11:30:06 +08:00
kangfenmao
e042e5ee03 feat: enhance markdown style 2024-08-02 10:39:13 +08:00
kangfenmao
c5efc7c24a style: change import order 2024-08-02 10:11:18 +08:00
kangfenmao
ea55dbc05b feat(provider): sillicon api key use referrer link 2024-08-02 09:24:31 +08:00
kangfenmao
86ec6eb4b4 feat(provider): add gpt-4o-mini model 2024-08-02 09:24:00 +08:00
kangfenmao
1c17e104b1 perf(messages): usememo & usecallback message component 2024-08-01 23:55:51 +08:00
kangfenmao
cda105a568 chore(version): 0.4.6 2024-08-01 15:36:07 +08:00
kangfenmao
7c9f352c96 fix(SendMessageButton.tsx): remove unnecessary placement prop from SendMessageButton to prevent potential UI alignment issues 2024-08-01 15:23:12 +08:00
kangfenmao
60c2a6ccbd fix(SettingsTab.tsx): correct the temperature label 2024-08-01 15:19:45 +08:00
kangfenmao
16a5022594 feat: add markdown footnote 2024-08-01 15:18:09 +08:00
kangfenmao
f83364147a feat: add markdown plugins remark-gfm remark-math rehype-katex 2024-08-01 14:51:20 +08:00
kangfenmao
e22387117c feat: add link component 2024-08-01 14:28:18 +08:00
kangfenmao
73e132a3ed chore(version): 0.4.5 2024-08-01 00:05:16 +08:00
kangfenmao
43d8425128 style(Message.tsx): increase padding in MessageContainer 2024-08-01 00:04:47 +08:00
kangfenmao
2c9d45a885 feat: use poppins fonts 2024-07-31 23:20:28 +08:00
kangfenmao
e36131ffd0 fix: optimize interface display style 2024-07-31 21:04:09 +08:00
kangfenmao
b151279a2b feat: new window style 2024-07-31 17:30:17 +08:00
kangfenmao
67253ac9ab chore(version): 0.4.4 2024-07-31 13:54:04 +08:00
kangfenmao
922b0f1970 feat(Inputbar.tsx): change height to min-height for Inputbar 2024-07-31 13:41:02 +08:00
kangfenmao
aec619ea78 chore(package.json): add publish script to automate the release and patch version push process 2024-07-31 13:11:31 +08:00
kangfenmao
88861f0f54 chore(version): 0.4.3 2024-07-31 13:08:19 +08:00
kangfenmao
2682a02717 feat: add send message button 2024-07-31 13:07:02 +08:00
kangfenmao
50c99ec121 feat: default enable new added provider 2024-07-31 12:21:46 +08:00
kangfenmao
d47d9d4c49 feat: add message suggestions 2024-07-31 12:13:03 +08:00
kangfenmao
6ad8ad2308 chore(version): 0.4.2 2024-07-30 17:53:45 +08:00
kangfenmao
ae3d9f745d feat(AboutSettings): implement functionality to open license page from about settings 2024-07-30 16:33:58 +08:00
kangfenmao
e8664ac359 doc: update LICENSE 2024-07-30 16:13:32 +08:00
kangfenmao
eb77ffa7f3 docs: change offical website url 2024-07-30 15:31:17 +08:00
kangfenmao
e96d7fb38a remove: website 2024-07-30 15:30:35 +08:00
kangfenmao
436c42d6b1 fix: delete provider crash 2024-07-30 15:30:09 +08:00
kangfenmao
bf260471a6 chore(version): 0.4.1 2024-07-29 18:18:03 +08:00
kangfenmao
57cf3ad293 fix: model list text color 2024-07-29 18:17:50 +08:00
kangfenmao
11f7d578c9 fix(ProviderSDK.ts): translation message 2024-07-29 17:45:08 +08:00
kangfenmao
808c405c9f style(website): adjust border-radius of images to 20% 2024-07-29 17:36:27 +08:00
kangfenmao
bc68ed23e2 chore(version): 0.4.0 2024-07-29 17:33:09 +08:00
kangfenmao
16977cbace feat: add dark and light theme 2024-07-29 17:14:49 +08:00
kangfenmao
c64e529cb0 docs(index.html): update website URLs from easys.run to cherry-ai.com 2024-07-29 09:55:24 +08:00
kangfenmao
9e3e11176e chore(version): 0.3.9 2024-07-29 09:16:46 +08:00
kangfenmao
38a0752583 feat: add model logo on select model dropdown 2024-07-28 15:10:36 +08:00
kangfenmao
78474a1951 fix(Message.tsx): add optional chaining to assistant.name to prevent potential undefined errors 2024-07-28 11:16:16 +08:00
kangfenmao
6f887447e1 chore(version): 0.3.8 2024-07-28 02:28:48 +08:00
kangfenmao
0c8b21b609 refactor(TranslatePage.tsx): simplify OutputText styling for cleaner code structure 2024-07-28 02:28:48 +08:00
kangfenmao
cb2f0645b0 fix(index.html): update Content-Security-Policy to allow fonts 2024-07-28 01:37:43 +08:00
kangfenmao
f731b82937 feat(TranslatePage.tsx): add markdown style to handle whitespace properly in translation output 2024-07-28 01:32:03 +08:00
kangfenmao
6c4d98bb98 feat: add translation module 2024-07-28 01:07:15 +08:00
kangfenmao
c4bafc6f6a fix(markdown.scss): replace :first-of-type with :first-child for consistent styling of first elements 2024-07-26 18:02:50 +08:00
kangfenmao
06a5327b52 fix(api.ts): modify provider apiKey check to exclude 'ollama' provider 2024-07-26 18:02:32 +08:00
kangfenmao
953ae8a46b feat(markdown.scss): add white-space: pre-wrap to code elements 2024-07-26 17:22:48 +08:00
kangfenmao
76fa54dc30 chore(version): 0.3.7 2024-07-26 11:04:02 +08:00
kangfenmao
b094bbe7a7 feat(ProviderSetting.tsx): add remove icon for models to allow deletion 2024-07-26 10:40:53 +08:00
kangfenmao
8e7487fce2 feat(provider.ts): add API endpoint configuration for each provider with editable status 2024-07-26 10:34:55 +08:00
kangfenmao
37bae9baf5 fix(SettingsTab.tsx): reposition reset button to align with model settings title for better visibility 2024-07-26 10:10:34 +08:00
kangfenmao
a4ed16089b feat(NavigationCenter.tsx): add CodeSandboxOutlined icon to model selection 2024-07-26 10:04:59 +08:00
kangfenmao
cb058fd5e7 feat: add global _activeAssistant and_activeTopic variable to persist state across re-renders 2024-07-26 09:57:49 +08:00
kangfenmao
00a0b8df4d feat: save file to disk 2024-07-26 09:53:07 +08:00
kangfenmao
3aa4363f5b refactor: remove conditional devTools enabling 2024-07-25 18:04:12 +08:00
kangfenmao
38ca4700b2 fix(api.ts): add null return if provider apiKey is missing to prevent unauthorized requests 2024-07-25 18:00:32 +08:00
kangfenmao
04ad25b508 docs(assistants.json): simplify prompts for clarity and consistency #6 2024-07-25 17:50:26 +08:00
kangfenmao
de362fc8dc refactor: use —narbar-background 2024-07-25 15:55:23 +08:00
kangfenmao
535bdc310c fix: default assistant name is empty 2024-07-25 14:03:54 +08:00
kangfenmao
ca65bdab39 feat: set provider as default setting entry 2024-07-25 13:45:43 +08:00
kangfenmao
1bc97b6447 0.3.6 2024-07-24 19:19:35 +08:00
kangfenmao
e5481b7ad3 feat(ui): optimize messages ui styles 2024-07-24 19:17:58 +08:00
kangfenmao
b7e6711669 chore(version): v0.3.5 2024-07-24 18:37:48 +08:00
kangfenmao
81dbd6931b feat: switch topic tab on change assistant 2024-07-24 18:28:23 +08:00
kangfenmao
ba6c0b6558 perf(mermaid): lazy load mermaid 2024-07-24 18:19:43 +08:00
kangfenmao
b5672b6fb0 feat: add setting panel 2024-07-24 18:08:05 +08:00
kangfenmao
5544de2b56 feat(settings): add input status show switch 2024-07-24 13:08:30 +08:00
kangfenmao
5860e01df0 fix: sidebar mac style 2024-07-24 12:28:56 +08:00
kangfenmao
c42bb4d72e feat(settings): add messageFont setting 2024-07-24 12:25:36 +08:00
kangfenmao
361d1877e8 fix: prevent navigate to new url 2024-07-23 19:08:36 +08:00
亢奋猫
f5d14846cd Update README.md 2024-07-23 18:39:06 +08:00
亢奋猫
3ac966567e Update README.md 2024-07-23 18:24:12 +08:00
kangfenmao
668d7dbe0f 0.3.4 2024-07-23 18:10:33 +08:00
kangfenmao
6f7b0205b2 fix: message style 2024-07-23 18:10:25 +08:00
kangfenmao
b3246a6f8e feat: add Mermaid render 2024-07-23 18:05:14 +08:00
kangfenmao
b27295e851 feat: change message font 2024-07-23 17:42:52 +08:00
kangfenmao
017a451002 feat: optimize message style 2024-07-23 17:32:06 +08:00
kangfenmao
bbb6a22088 fix: windows title style 2024-07-23 16:55:32 +08:00
kangfenmao
32a3688e49 feat: hide window title 2024-07-23 16:40:06 +08:00
kangfenmao
3642f3b7ff feat: add username and message divider line settings 2024-07-23 15:16:34 +08:00
kangfenmao
139d1a71f3 feat: messages styles optimization 2024-07-23 14:59:09 +08:00
kangfenmao
11dadf7bb4 0.3.3 2024-07-23 12:37:40 +08:00
kangfenmao
25408b5fca fix: proxy check 2024-07-23 12:37:12 +08:00
kangfenmao
4cf06c871b feat: new navbar style 2024-07-23 12:29:20 +08:00
kangfenmao
e083902ca9 feat: change icons 2024-07-23 10:42:58 +08:00
kangfenmao
e252cb26a8 fix: inputbar setShowRightSidebar 2024-07-23 10:20:57 +08:00
kangfenmao
88b69a2145 feat(settings): add proxy setting 2024-07-23 00:28:41 +08:00
kangfenmao
2dc8810890 feat: add show or hide assistant sidebar 2024-07-22 21:57:39 +08:00
kangfenmao
5f49d63d89 feat(website): fetch github release info 2024-07-22 15:40:30 +08:00
kangfenmao
7c9e5af9c0 0.3.2 2024-07-22 14:52:54 +08:00
kangfenmao
f9d47981a3 feat: add contextCount to inputbar 2024-07-22 14:50:40 +08:00
kangfenmao
846be5c9b1 feat: add email to about titles 2024-07-22 14:26:35 +08:00
kangfenmao
42d97ea096 chore: remove change log component 2024-07-22 14:25:15 +08:00
kangfenmao
f96fecabec feat: new about page 2024-07-22 14:24:14 +08:00
kangfenmao
06e92fa1dd fix: disable switch while assistant generating message 2024-07-22 11:28:26 +08:00
kangfenmao
19caf0724a feat: add updateAssistantSettings to useAssistant hook 2024-07-22 11:15:10 +08:00
kangfenmao
199167a920 fix(ProviderSDK): clarify instruction for session summary to avoid punctuation marks and special characters 2024-07-22 10:49:10 +08:00
kangfenmao
e2052956e2 refactor: topic component code 2024-07-22 10:38:00 +08:00
kangfenmao
ea654fc455 fix: disabled switch topic while generating message 2024-07-22 10:22:47 +08:00
kangfenmao
cc69e28eec 0.3.1 2024-07-21 23:44:09 +08:00
kangfenmao
c89d6d3d96 fix: topic missing bug and delete assistant crash 2024-07-21 23:43:17 +08:00
kangfenmao
9ca5fad56e chore(version): 0.3.0 2024-07-21 22:03:49 +08:00
kangfenmao
999f534ff4 fix: assistant settings bugs 2024-07-21 21:57:08 +08:00
kangfenmao
65e075e1e6 feat: add asistant model temperature maxTokens contextCount 2024-07-21 17:50:50 +08:00
kangfenmao
ca6b435ac4 feat: change default assistant name
# Conflicts:
#	src/renderer/src/i18n/index.ts
2024-07-21 10:51:33 +08:00
亢奋猫
841cb1e6b6 Update README.md 2024-07-20 15:10:49 +08:00
kangfenmao
c8e08b733a 0.2.9 2024-07-20 12:47:29 +08:00
kangfenmao
abc8a112d0 chore(version): v0.2.9 2024-07-20 12:47:19 +08:00
kangfenmao
513b5779e2 fix: send message setting position 2024-07-20 11:34:52 +08:00
kangfenmao
dff7293ebd feat(provider): add AiHubMix provider 2024-07-20 11:29:24 +08:00
kangfenmao
9fc80b68d8 0.2.8 2024-07-20 00:57:02 +08:00
kangfenmao
8f8dc13e73 chore(version): v0.2.8 2024-07-20 00:56:52 +08:00
kangfenmao
f32d0716d9 feat: add custom llm provider 2024-07-20 00:50:46 +08:00
kangfenmao
ee4e4a880a 0.2.7 2024-07-19 15:57:16 +08:00
kangfenmao
0d9a16027a chore(version): 0.2.7 2024-07-19 15:52:52 +08:00
kangfenmao
61f5775152 refactor: ProviderSDK 2024-07-19 15:49:08 +08:00
kangfenmao
06511ab740 fix: use activeAssistant's id for fetching assistant and model data 2024-07-19 15:39:49 +08:00
kangfenmao
bd157d92a1 feat: add anthropic provider 2024-07-19 15:34:34 +08:00
kangfenmao
008901253d feat(settings/components): introduce password input for API key to enhance security 2024-07-19 13:38:44 +08:00
kangfenmao
d6b57dac18 feat(assistants.json): Introduce new assistants for translation and summarization 2024-07-19 13:34:21 +08:00
kangfenmao
3ad7379305 feat: add DashScope provider 2024-07-19 12:28:00 +08:00
kangfenmao
74a991fdcd Update Website 2024-07-19 09:38:29 +08:00
亢奋猫
96c62f89b2 Update README.md 2024-07-18 16:46:33 +08:00
亢奋猫
6c4aec355c Update README.md 2024-07-18 16:41:09 +08:00
kangfenmao
e8ccf69367 feat(website): cherry studio -> cherry ai 2024-07-18 13:02:46 +08:00
亢奋猫
c1ecffc7e7 Update README.md 2024-07-17 23:08:13 +08:00
kangfenmao
7799edfa54 0.2.6 2024-07-17 17:50:07 +08:00
kangfenmao
66f49b4b68 chore(version): 0.2.6 2024-07-17 17:49:47 +08:00
kangfenmao
5fef6ee251 feat: new agent center 2024-07-17 17:45:29 +08:00
kangfenmao
0f5749dd9f 0.2.5 2024-07-17 16:22:01 +08:00
kangfenmao
69ba3a7c57 chore(version): 0.2.5 2024-07-17 16:21:48 +08:00
kangfenmao
ad78ec06a9 refactor: assistants 2024-07-17 15:48:08 +08:00
kangfenmao
5778a5acb9 fix: delete all topic confirm button text 2024-07-17 12:47:26 +08:00
kangfenmao
1a504ada70 feat(provider): add baichuan provider 2024-07-17 12:44:01 +08:00
kangfenmao
5351ffc9a5 feat: update website 2024-07-16 21:04:18 +08:00
kangfenmao
76ad5adc3f ci: log notarized app name 2024-07-16 20:49:41 +08:00
kangfenmao
6397eaa535 0.2.4 2024-07-16 20:42:21 +08:00
kangfenmao
e9866a9fbb fix: process is not defined 2024-07-16 20:40:25 +08:00
kangfenmao
84257d86c1 feat: check update 2024-07-16 20:06:25 +08:00
kangfenmao
2d362a99c9 fix(about): changelog overflow 2024-07-16 17:27:16 +08:00
kangfenmao
537c5472b5 feat: add website 2024-07-16 17:08:10 +08:00
kangfenmao
b775f13c3e feat: add sentry integration 2024-07-16 17:08:04 +08:00
kangfenmao
3ac3568189 0.2.3 2024-07-16 11:02:53 +08:00
kangfenmao
983c99ee2e docs: update change log 2024-07-16 11:02:37 +08:00
kangfenmao
ec9bd25220 fix(i18n): provider name en 2024-07-16 10:52:23 +08:00
kangfenmao
9833d1d51a fix: zhipu provider default model data error 2024-07-16 10:40:28 +08:00
亢奋猫
12f954bd67 Update README.md 2024-07-16 10:22:24 +08:00
亢奋猫
5b5e0d14d0 Update README.md 2024-07-16 10:21:12 +08:00
kangfenmao
2ba79b7398 fix: provider model edit popup title 2024-07-15 18:07:04 +08:00
kangfenmao
56a4c55986 fix(llm): zhipu provider default models is wrong 2024-07-15 18:02:41 +08:00
kangfenmao
bcb4d04dfb fix: model checking error 2024-07-15 17:58:58 +08:00
kangfenmao
2a8d62e3fc 0.2.2 2024-07-15 17:32:04 +08:00
kangfenmao
002789df82 feat: update change log styles 2024-07-15 17:31:39 +08:00
kangfenmao
4b4af0f272 fix: default assistant name empty 2024-07-15 17:22:51 +08:00
kangfenmao
b861dfc3bf 0.2.1 2024-07-15 16:45:01 +08:00
kangfenmao
ef40014c26 feat: add changes log 2024-07-15 15:55:51 +08:00
kangfenmao
df2494e476 feat: add release note 2024-07-15 15:00:19 +08:00
kangfenmao
bbf5ef58b7 feat: add pause icon to pause chat completion 2024-07-15 14:21:36 +08:00
kangfenmao
5c297ad747 fix(i18n): reload after change language 2024-07-15 14:16:43 +08:00
kangfenmao
7c88b39098 feat: add keyv-storage 2024-07-15 13:13:42 +08:00
kangfenmao
79a481113c ci: remove any yml files from the release files 2024-07-15 12:39:03 +08:00
kangfenmao
ef99075fe8 build: fix artifactName with arch 2024-07-15 11:49:55 +08:00
kangfenmao
b7d4c477db ci(release): remove blockmap files 2024-07-15 11:49:33 +08:00
kangfenmao
466a162c6f feat: add x64 arch to mac dmg target 2024-07-15 11:25:32 +08:00
kangfenmao
1cbfe2a707 0.2.0 2024-07-14 22:21:08 +08:00
kangfenmao
b81ed70ea4 fix: auto update 2024-07-14 21:28:07 +08:00
kangfenmao
214da0212f feat:(sidebar): compact layout 2024-07-14 13:28:45 +08:00
kangfenmao
0c02b497fe feat: change assistant list item style 2024-07-14 13:04:01 +08:00
kangfenmao
12173c2b17 feat: remove assistant description 2024-07-14 12:09:48 +08:00
kangfenmao
4b6731a1ba fix: inputbar translation 2024-07-14 11:46:25 +08:00
kangfenmao
c9c906f383 fix: can not create new topic on message generation 2024-07-14 11:39:23 +08:00
kangfenmao
22089a83dc fix: auto updater 2024-07-13 21:26:56 +08:00
kangfenmao
13d31f3d9c 0.1.1 2024-07-13 20:54:34 +08:00
kangfenmao
6c576bb486 feat: add i18n 2024-07-13 20:50:39 +08:00
kangfenmao
efdbccae69 build: change yarn version 2024-07-13 00:31:07 +08:00
kangfenmao
7d00caf65d feat: prevent user sending messages during message generation 2024-07-13 00:29:53 +08:00
kangfenmao
55341384a6 build: disable devTools on prod mode 2024-07-13 00:29:53 +08:00
kangfenmao
4ad14997d2 feat: add autoUpdater 2024-07-12 16:39:44 +08:00
kangfenmao
28c3c8d585 fix: inputbar height 2024-07-12 15:33:21 +08:00
kangfenmao
250cebc7d3 fix(chat): system message empty error 2024-07-12 14:47:42 +08:00
kangfenmao
f45440edbf refactor(settings): title style 2024-07-12 14:30:59 +08:00
kangfenmao
6712dd03fe feat(setting): add api check 2024-07-12 14:27:27 +08:00
kangfenmao
d844f99f77 feat(settings): add website to provider settings 2024-07-12 13:50:22 +08:00
kangfenmao
85a6d83282 fix: markdown style h1 margin 2024-07-12 12:47:56 +08:00
kangfenmao
ae9a2370a2 fix: regenerate message logic 2024-07-11 23:08:55 +08:00
kangfenmao
0b4b434b6e feat: allow user select text 2024-07-11 23:07:38 +08:00
kangfenmao
339466b3ce feat: re-generage message 2024-07-11 21:17:58 +08:00
kangfenmao
6d7fbd365d feat: add token usage to message 2024-07-11 20:53:27 +08:00
kangfenmao
19f61976d7 feat: show modal info 2024-07-11 18:02:50 +08:00
kangfenmao
3c06428e67 feat: add model fetch and search 2024-07-11 17:41:51 +08:00
kangfenmao
33aa13bbfd refactor: remove model temperature 2024-07-11 16:49:01 +08:00
kangfenmao
a3b10703c3 feat: disable api host edit for system provider 2024-07-11 16:18:12 +08:00
kangfenmao
fe9f2cede0 feat: add openrouter provider 2024-07-11 16:13:11 +08:00
kangfenmao
6270afb434 feat: added drag and drop sorting for providers list 2024-07-11 15:35:09 +08:00
kangfenmao
0606e94e92 feat: add moonshot provider 2024-07-11 15:24:10 +08:00
kangfenmao
34b2e72352 chore(version): v0.1.0 2024-07-11 14:38:45 +08:00
kangfenmao
cd1890cfe4 fix: github release failed with status: 403 2024-07-10 20:48:39 +08:00
kangfenmao
4175a013e1 ci: remove ubuntu-latest build 2024-07-10 20:42:19 +08:00
kangfenmao
db95def60f ci: add github actions 2024-07-10 20:36:38 +08:00
kangfenmao
a4d50fe811 feat: add avatar for unknown model 2024-07-10 20:15:49 +08:00
kangfenmao
f615a5688f fix: assistant topic not exist 2024-07-10 20:07:50 +08:00
kangfenmao
0ccb92e7f6 fix: type missing 2024-07-10 17:32:09 +08:00
kangfenmao
638f2a317b feat: extend input area 2024-07-10 17:29:52 +08:00
kangfenmao
8b5e8a20b2 feat: added drag and drop sorting for topics list 2024-07-10 17:11:59 +08:00
kangfenmao
a15d82750c feat: added drag and drop sorting for assistants list 2024-07-10 16:53:39 +08:00
kangfenmao
c3f345da61 fix: message content not occupying full width 2024-07-10 16:28:07 +08:00
kangfenmao
c432ff41e0 fix: topic naming assistant using incorrect language model 2024-07-10 16:27:16 +08:00
kangfenmao
8cd61160f2 feat: add a loading status for messages 2024-07-10 16:05:52 +08:00
kangfenmao
fe2c61f453 feat: add a toggle for provider 2024-07-10 15:57:16 +08:00
kangfenmao
536e2fbfcb feat: add ollama provider 2024-07-10 15:26:44 +08:00
kangfenmao
271f973890 feat: add zhipu provider 2024-07-10 13:13:44 +08:00
kangfenmao
994f805ace feat: uppper case code bloack title 2024-07-10 12:33:10 +08:00
kangfenmao
b10953131a fix: remove google/gemma model 2024-07-10 09:41:25 +08:00
kangfenmao
b63cd6bcd3 build: for windows 2024-07-09 21:05:31 +08:00
kangfenmao
453cbf50c4 feat: add scrollbar style 2024-07-09 20:05:31 +08:00
kangfenmao
67adc287cc feat: add provider and model image 2024-07-09 19:29:47 +08:00
kangfenmao
7c9ebb241a fix: highlighter not working 2024-07-09 16:26:10 +08:00
kangfenmao
1c1a180a9c feat: edit user message 2024-07-09 16:17:46 +08:00
kangfenmao
d1ccd114c9 refactor: markdown render 2024-07-09 15:49:28 +08:00
kangfenmao
be6a93e2d0 feat: add error message 2024-07-09 11:24:59 +08:00
kangfenmao
f2e637a0c4 feat(chat): highlight selected model name 2024-07-08 13:53:37 +08:00
kangfenmao
57999d2600 feat: add 01-yi provider 2024-07-08 13:47:04 +08:00
kangfenmao
6a4d0b57b5 fix: dropdown modal list is empty 2024-07-08 13:00:55 +08:00
kangfenmao
7762f42a1a fix: remove silicon models 2024-07-08 13:00:24 +08:00
kangfenmao
fd3355b3a1 feat: auto scroll on send new message 2024-07-07 20:50:57 +08:00
kangfenmao
1645b50628 feat: show model name on message status bar 2024-07-07 20:19:43 +08:00
kangfenmao
fab80b3317 fix: useAppInitEffect not working 2024-07-06 22:59:09 +08:00
kangfenmao
68593d4f30 feat: add message and modal api to window object 2024-07-06 21:02:47 +08:00
kangfenmao
4f0a264aa0 fix(setting): topic naming modal wrong 2024-07-06 21:02:06 +08:00
kangfenmao
2c002a9665 feat: add more system assistant 2024-07-06 18:11:30 +08:00
kangfenmao
a78c7fe465 feat: duplicate assistant 2024-07-06 18:11:18 +08:00
kangfenmao
f11f10bc2b feat: fetch chat completion with history messages 2024-07-06 17:34:33 +08:00
kangfenmao
6844a973ac feat: add send message shortcut 2024-07-06 17:24:07 +08:00
kangfenmao
4a10b2b865 build: reduce bundle size 2024-07-05 21:52:01 +08:00
kangfenmao
cca074590c chore: remove statusbar 2024-07-05 17:04:37 +08:00
kangfenmao
d7bf7e9a47 refactor: product name 2024-07-05 17:03:58 +08:00
kangfenmao
6fd11b695f fix: store blacklist 2024-07-05 17:00:57 +08:00
kangfenmao
ff15b953ba feat(setting): avatar setting 2024-07-05 16:03:13 +08:00
kangfenmao
261f217dee refactor: rename conversation to messages 2024-07-05 14:35:41 +08:00
kangfenmao
2d6d59cc8d feat: first assistant message 2024-07-05 14:11:14 +08:00
kangfenmao
c97887e945 fix: defualt assistant model missing 2024-07-05 14:07:35 +08:00
kangfenmao
64361dccc4 fix: default assistant topic id 2024-07-05 13:51:36 +08:00
kangfenmao
f10fbe0218 feat(settings): default assistant settings 2024-07-05 13:30:48 +08:00
kangfenmao
e1b8fec2fd feat(settings): default modal settings 2024-07-05 13:17:54 +08:00
kangfenmao
695548f457 feat: update openai models 2024-07-05 11:30:09 +08:00
kangfenmao
43ceb4bcf3 feat: add app version 2024-07-05 11:29:56 +08:00
kangfenmao
c7332636b2 fix: fetch chat completion use default provider 2024-07-05 10:31:59 +08:00
kangfenmao
d68f3f5aa3 fix: select modal bugs 2024-07-05 10:19:32 +08:00
kangfenmao
8abb550526 feat: select model for assistant 2024-07-04 18:04:21 +08:00
kangfenmao
49b4c5a5f2 feat: add new topic use keyboard shortcut 2024-07-04 16:48:45 +08:00
kangfenmao
d6084d0314 feat: add models 2024-07-04 15:26:29 +08:00
kangfenmao
a6b1d3531e feat: remove assistant item menu 2024-07-03 13:45:30 +08:00
kangfenmao
1c7355066a feat: agent rename to assistant 2024-07-03 13:44:05 +08:00
kangfenmao
ef3799ec37 feat: add icons on context menu 2024-07-02 19:35:13 +08:00
kangfenmao
14526eee3d feat: clear conversation 2024-07-02 18:48:32 +08:00
kangfenmao
5c115dcd6a feat: delete all topic 2024-07-02 17:35:02 +08:00
kangfenmao
9bfbe9a929 feat: add agent prompt 2024-07-02 16:35:07 +08:00
kangfenmao
e794e1b1e1 feat: edit agent 2024-07-02 16:25:15 +08:00
kangfenmao
c0c9aa0041 feat: new theme color 2024-07-02 15:41:20 +08:00
kangfenmao
fc2b2364a0 feat: ai auto rename topic 2024-07-02 14:21:47 +08:00
kangfenmao
e5615f1a82 feat: rename topic 2024-07-02 10:31:03 +08:00
kangfenmao
afc882bad9 feat: switch topic 2024-07-01 17:41:33 +08:00
kangfenmao
1e8d7dc3c7 feat: add topic list items 2024-07-01 17:33:31 +08:00
kangfenmao
9d669ede60 feat: toggle topic list 2024-07-01 15:45:12 +08:00
kangfenmao
4c14a995a8 feat: add context menu 2024-07-01 14:44:44 +08:00
kangfenmao
25cee820b0 feat: add input toolbar 2024-07-01 14:19:53 +08:00
kangfenmao
2efa2fe64a feat: use ant.design 2024-06-30 17:13:31 +08:00
kangfenmao
dd15658176 refactor: thread -> agent 2024-06-28 15:19:04 +08:00
kangfenmao
d3c44dc1d8 feat(module): add new feature module
Add a new module called "module" that implements the following features:
- Implement feature A
- Provide API interface B
- Optimize performance issues

BREAKING CHANGE: This feature module introduces a new configuration option, requiring updates to the existing configuration files.
2024-06-18 21:01:44 +08:00
kangfenmao
b3ecf05c2f feat(module): add new feature module
Added a new functionality module named "module" which implements the following features:
- Implements feature A
- Provides API interface B
- Optimizes performance issues

BREAKING CHANGE: The new functionality module introduces a new configuration option, requiring updates to the existing configuration files.
2024-06-18 20:06:47 +08:00
kangfenmao
65bc571a76 feat: add electron-devtools-installer 2024-06-18 17:42:58 +08:00
kangfenmao
c3cc957a9d feat(deps): add new dependencies
- Added "@douyinfe/semi-ui" version "^2.60.0"
- Updated "tslib" from version "2.6.2" to "2.6.3"
- Added "@douyinfe/semi-animation-react" version "^2.60.0"
- Added "@douyinfe/semi-illustrations" version "^2.60.0"
- Added "@douyinfe/semi-theme-default" version "^2.60.0"
- Added "@douyinfe/semi-animation" version "2.60.0"

BREAKING CHANGE: The new dependencies may introduce breaking changes in the application. Please ensure compatibility and make necessary updates.

Closes #123
2024-06-18 16:41:04 +08:00
kangfenmao
c501c03b9d style(app): adjust styles for better layout and user experience
- Adjusted navbar and sidebar padding, height, and width
- Modified background color and scrollbar appearance for consistency
- Added input bar component for typing messages in chat
- Enhanced alignment and display of navbar elements

BREAKING CHANGE: Changes may affect layout and require UI adjustments.
2024-06-18 16:22:37 +08:00
kangfenmao
65371971f2 feat: add redux-persist 2024-05-31 15:53:55 +08:00
kangfenmao
e5ed0cad1d feat: add redux store 2024-05-31 14:38:19 +08:00
kangfenmao
bdd0c55630 style(css): update scrollbar styles
Updated scrollbar styles in App.css to customize appearance and behavior:
- Set width and height for scrollbar
- Defined background colors for track and thumb
- Added hover effect for scrollbar thumb

No breaking changes introduced.
2024-05-30 16:43:51 +08:00
kangfenmao
54f41d1278 feat: add localforage and conversations hook 2024-05-30 16:20:50 +08:00
kangfenmao
2a988b3d76 feat: add settings pages 2024-05-29 15:47:09 +08:00
kangfenmao
f4f65755cc refactor: add styled-component 2024-05-29 13:27:56 +08:00
kangfenmao
78b545702c chore(lint): Update ESLint and Prettier configurations 2024-05-24 16:33:26 +08:00
kangfenmao
6c7e30fdc2 style(config): update Prettier and VS Code settings 2024-05-24 12:45:41 +08:00
kangfenmao
b2b1899fa2 feat: add home page 2024-05-24 12:38:51 +08:00
kangfenmao
9e57c172ec feat(vscode): added new snippet for creating React function components 2024-05-24 12:38:16 +08:00
kangfenmao
5a8af12735 feat: add vite-electron template 2024-05-24 10:03:02 +08:00
亢奋猫
0618b30392 Initial commit 2024-05-24 09:56:26 +08:00
32 changed files with 7970 additions and 342 deletions

View File

@@ -73,6 +73,7 @@
"@agentic/tavily": "^7.3.3",
"@ant-design/v5-patch-for-react-19": "^1.0.3",
"@anthropic-ai/sdk": "^0.41.0",
"@cherrystudio/ai-core": "workspace:*",
"@cherrystudio/embedjs": "^0.1.31",
"@cherrystudio/embedjs-libsql": "^0.1.31",
"@cherrystudio/embedjs-loader-csv": "^0.1.31",

View File

@@ -0,0 +1,622 @@
# Cherry Studio AI Core 基于 Vercel AI SDK 的技术架构
## 1. 架构设计理念
### 1.1 设计目标
- **统一接口**:使用 Vercel AI SDK 统一不同 AI Provider 的接口差异
- **动态导入**:通过动态导入实现按需加载,减少打包体积
- **最小包装**:直接使用 AI SDK 的类型和接口,避免重复定义
- **插件系统**:基于钩子的插件架构,支持请求全生命周期扩展
- **类型安全**:利用 TypeScript 和 AI SDK 的类型系统确保类型安全
- **轻量级**:专注核心功能,保持包的轻量和高效
- **包级独立**:作为独立包管理,便于复用和维护
### 1.2 核心优势
- **标准化**AI SDK 提供统一的模型接口,减少适配工作
- **简化维护**:废弃复杂的 XxxApiClient统一为工厂函数模式
- **更好的开发体验**:完整的 TypeScript 支持和丰富的生态系统
- **性能优化**AI SDK 内置优化和最佳实践
- **模块化设计**:独立包结构,支持跨项目复用
- **可扩展插件**:基于钩子的插件系统,支持灵活的功能扩展和流转换
## 2. 整体架构图
```mermaid
graph TD
subgraph "Cherry Studio 主应用"
UI["用户界面"]
Components["React 组件"]
end
subgraph "packages/aiCore (AI Core 包)"
ApiClientFactory["ApiClientFactory (工厂类)"]
UniversalClient["UniversalAiSdkClient (统一客户端)"]
ProviderRegistry["Provider 注册表"]
PluginManager["插件管理器"]
end
subgraph "动态导入层"
DynamicImport["动态导入"]
end
subgraph "Vercel AI SDK"
AICore["ai (核心库)"]
OpenAI["@ai-sdk/openai"]
Anthropic["@ai-sdk/anthropic"]
Google["@ai-sdk/google"]
XAI["@ai-sdk/xai"]
Others["其他 19+ Providers"]
end
subgraph "插件生态"
FirstHooks["First Hooks (resolveModel, loadTemplate)"]
SequentialHooks["Sequential Hooks (transformParams, transformResult)"]
ParallelHooks["Parallel Hooks (onRequestStart, onRequestEnd, onError)"]
StreamHooks["Stream Hooks (transformStream)"]
end
UI --> ApiClientFactory
Components --> ApiClientFactory
ApiClientFactory --> UniversalClient
UniversalClient --> PluginManager
PluginManager --> ProviderRegistry
ProviderRegistry --> DynamicImport
DynamicImport --> OpenAI
DynamicImport --> Anthropic
DynamicImport --> Google
DynamicImport --> XAI
DynamicImport --> Others
UniversalClient --> AICore
AICore --> streamText
AICore --> generateText
PluginManager --> FirstHooks
PluginManager --> SequentialHooks
PluginManager --> ParallelHooks
PluginManager --> StreamHooks
```
## 3. 包结构设计
### 3.1 包级文件结构(当前简化版 + 规划)
```
packages/aiCore/
├── src/
│ ├── providers/
│ │ ├── registry.ts # Provider 注册表 ✅
│ │ └── types.ts # 核心类型定义 ✅
│ ├── clients/
│ │ ├── UniversalAiSdkClient.ts # 统一AI SDK客户端 ✅
│ │ └── ApiClientFactory.ts # 客户端工厂 ✅
│ ├── middleware/ # 插件系统 ✅
│ │ ├── types.ts # 插件类型定义 ✅
│ │ ├── manager.ts # 插件管理器 ✅
│ │ ├── examples/ # 示例插件 ✅
│ │ │ ├── example-plugins.ts # 示例插件实现 ✅
│ │ │ └── example-usage.ts # 使用示例 ✅
│ │ ├── README.md # 插件系统文档 ✅
│ │ └── index.ts # 插件模块入口 ✅
│ ├── services/ # 高级服务 (规划中)
│ │ ├── AiCoreService.ts # 统一服务入口
│ │ ├── CompletionsService.ts # 文本生成服务
│ │ ├── EmbeddingService.ts # 嵌入服务
│ │ └── ImageService.ts # 图像生成服务
│ └── index.ts # 包主入口文件 ✅
├── package.json # 包配置文件 ✅
├── tsconfig.json # TypeScript 配置 ✅
├── README.md # 包说明文档 ✅
└── AI_SDK_ARCHITECTURE.md # 本文档 ✅
```
**图例:**
- ✅ 已实现
- 规划中:设计完成,待实现
## 4. 核心组件详解
### 4.1 Provider 注册表 (`providers/registry.ts`)
统一管理所有 AI Provider 的注册和动态导入。
**主要功能:**
- 动态导入 AI SDK providers
- 提供统一的 Provider 创建接口
- 支持 19+ 官方 AI SDK providers
- 类型安全的 Provider 配置
**核心 API**
```typescript
export interface ProviderConfig {
id: string
name: string
import: () => Promise<any>
creatorFunctionName: string
}
export class AiProviderRegistry {
getProvider(id: string): ProviderConfig | undefined
getAllProviders(): ProviderConfig[]
isSupported(id: string): boolean
registerProvider(config: ProviderConfig): void
}
```
**支持的 Providers**
- OpenAI, Anthropic, Google, XAI
- Azure OpenAI, Amazon Bedrock, Google Vertex
- Groq, Together.ai, Fireworks, DeepSeek
- Cerebras, DeepInfra, Replicate, Perplexity
- Cohere, Fal AI, Vercel (19+ providers)
### 4.2 统一AI SDK客户端 (`clients/UniversalAiSdkClient.ts`)
将不同 AI providers 包装为统一接口。
**主要功能:**
- 异步初始化和动态加载
- 统一的 stream() 和 generate() 方法
- 直接使用 AI SDK 的 streamText() 和 generateText()
- 配置验证和错误处理
**核心 API**
```typescript
export class UniversalAiSdkClient {
async initialize(): Promise<void>
isInitialized(): boolean
async stream(request: any): Promise<any>
async generate(request: any): Promise<any>
validateConfig(): boolean
getProviderInfo(): { id: string; name: string; isInitialized: boolean }
}
```
### 4.3 客户端工厂 (`clients/ApiClientFactory.ts`)
统一创建和管理 AI SDK 客户端。
**主要功能:**
- 统一的客户端创建接口
- 智能缓存和复用机制
- 批量创建和健康检查
- 错误处理和重试
**核心 API**
```typescript
export class ApiClientFactory {
static async createAiSdkClient(providerId: string, options: any): Promise<UniversalAiSdkClient>
static getCachedClient(providerId: string, options: any): UniversalAiSdkClient | undefined
static clearCache(): void
static async healthCheck(): Promise<HealthCheckResult>
static getSupportedProviders(): ProviderInfo[]
}
```
### 4.4 钩子风格插件系统 ✅
基于钩子机制的插件架构设计,提供灵活的扩展系统。
**钩子类型:**
1. **First Hooks**:执行到第一个有效结果就停止
2. **Sequential Hooks**:按序链式执行,可变换数据
3. **Parallel Hooks**:并发执行,用于副作用
4. **Stream Hooks**:流转换,直接传递给 AI SDK
**优先级系统:**
- `pre`:前置处理(-100 到 -1
- `normal`标准处理0 到 99
- `post`后置处理100 到 199
**核心钩子:**
**First Hooks (第一个有效结果)**
- `resolveModel`:模型解析,返回第一个匹配的模型
- `loadTemplate`:模板加载,返回第一个找到的模板
**Sequential Hooks (链式变换)**
- `transformParams`:参数转换,依次变换请求参数
- `transformResult`:结果转换,依次变换响应结果
**Parallel Hooks (并发副作用)**
- `onRequestStart`:请求开始时触发
- `onRequestEnd`:请求结束时触发
- `onError`:错误发生时触发
**Stream Hooks (流转换)**
- `transformStream`:流转换,返回 AI SDK 转换函数
**插件 API 设计:**
```typescript
export interface Plugin {
name: string
enforce?: 'pre' | 'normal' | 'post'
// First hooks - 执行到第一个有效结果
resolveModel?(params: ResolveModelParams): Promise<string | null>
loadTemplate?(params: LoadTemplateParams): Promise<Template | null>
// Sequential hooks - 链式变换
transformParams?(params: any, context: PluginContext): Promise<any>
transformResult?(result: any, context: PluginContext): Promise<any>
// Parallel hooks - 并发副作用
onRequestStart?(context: PluginContext): Promise<void>
onRequestEnd?(context: PluginContext): Promise<void>
onError?(error: Error, context: PluginContext): Promise<void>
// Stream hooks - AI SDK 流转换
transformStream?(context: PluginContext): Promise<(readable: ReadableStream) => ReadableStream>
}
export interface PluginContext {
request: any
response?: any
metadata: Record<string, any>
provider: string
model: string
}
export class PluginManager {
use(plugin: Plugin): this
executeFirstHook<T>(hookName: string, ...args: any[]): Promise<T | null>
executeSequentialHook<T>(hookName: string, initialValue: T, context: PluginContext): Promise<T>
executeParallelHook(hookName: string, ...args: any[]): Promise<void>
collectStreamTransforms(context: PluginContext): Promise<Array<(readable: ReadableStream) => ReadableStream>>
}
```
### 4.5 统一服务接口 (规划中)
作为包的主要对外接口,提供高级 AI 功能。
**服务方法:**
- `completions()`: 文本生成
- `streamCompletions()`: 流式文本生成
- `generateObject()`: 结构化数据生成
- `generateImage()`: 图像生成
- `embed()`: 文本嵌入
**API 设计:**
```typescript
export class AiCoreService {
constructor(middlewares?: Middleware[])
async completions(request: CompletionRequest): Promise<CompletionResponse>
async streamCompletions(request: CompletionRequest): Promise<StreamCompletionResponse>
async generateObject<T>(request: ObjectGenerationRequest): Promise<T>
async generateImage(request: ImageGenerationRequest): Promise<ImageResponse>
async embed(request: EmbeddingRequest): Promise<EmbeddingResponse>
use(middleware: Middleware): this
configure(config: AiCoreConfig): this
}
```
## 5. 使用方式
### 5.1 多 Provider 支持
```typescript
import { createAiSdkClient, AiCore } from '@cherrystudio/ai-core'
// 检查支持的 providers
const providers = AiCore.getSupportedProviders()
console.log(`支持 ${providers.length} 个 AI providers`)
// 创建多个 provider 客户端
const openai = await createAiSdkClient('openai', { apiKey: 'openai-key' })
const anthropic = await createAiSdkClient('anthropic', { apiKey: 'anthropic-key' })
const google = await createAiSdkClient('google', { apiKey: 'google-key' })
const xai = await createAiSdkClient('xai', { apiKey: 'xai-key' })
```
### 5.2 在 Cherry Studio 中集成
```typescript
// 替换现有的 XxxApiClient
// 之前:
// const openaiClient = new OpenAIApiClient(config)
// const anthropicClient = new AnthropicApiClient(config)
// 现在:
import { createAiSdkClient } from '@cherrystudio/ai-core'
const createProviderClient = async (provider: CherryProvider) => {
return await createAiSdkClient(provider.id, {
apiKey: provider.apiKey,
baseURL: provider.baseURL
})
}
```
### 5.6 完整的工作流示例 (规划中)
```typescript
import {
createAiSdkClient,
AiCoreService,
MiddlewareChain,
PreRequestMiddleware,
StreamProcessingMiddleware,
PostResponseMiddleware
} from '@cherrystudio/ai-core'
// 创建完整的工作流
const createEnhancedAiService = async () => {
// 创建中间件链
const middlewareChain = new MiddlewareChain()
.use(
new PreRequestMiddleware({
validateApiKey: true,
checkRateLimit: true
})
)
.use(
new StreamProcessingMiddleware({
enableProgressTracking: true,
chunkTransform: (chunk) => ({
...chunk,
timestamp: Date.now()
})
})
)
.use(
new PostResponseMiddleware({
saveToHistory: true,
calculateMetrics: true
})
)
// 创建服务实例
const service = new AiCoreService(middlewareChain.middlewares)
return service
}
// 使用增强服务
const enhancedService = await createEnhancedAiService()
const response = await enhancedService.completions({
provider: 'anthropic',
model: 'claude-3-sonnet',
messages: [{ role: 'user', content: 'Write a technical blog post about AI middleware' }],
options: {
temperature: 0.7,
maxTokens: 2000
},
middleware: {
// 中间件特定配置
thinking: { recordSteps: true },
cache: { enabled: true, ttl: 1800 },
logging: { level: 'debug' }
}
})
```
## 6. 简化设计原则
### 6.1 最小包装原则
- 直接使用 AI SDK 的类型,不重复定义
- 避免过度抽象和复杂的中间层
- 保持与 AI SDK 原生 API 的一致性
### 6.2 动态导入优化
```typescript
// 按需加载,减少打包体积
const module = await import('@ai-sdk/openai')
const createOpenAI = module.createOpenAI
```
### 6.3 类型安全
```typescript
// 直接使用 AI SDK 类型
import { streamText, generateText } from 'ai'
// 避免重复定义,直接传递参数
return streamText({ model, ...request })
```
### 6.4 配置简化
```typescript
// 简化的 Provider 配置
interface ProviderConfig {
id: string // provider 标识
name: string // 显示名称
import: () => Promise<any> // 动态导入函数
creatorFunctionName: string // 创建函数名
}
```
## 7. 技术要点
### 7.1 动态导入策略
- **按需加载**:只加载用户实际使用的 providers
- **缓存机制**:避免重复导入和初始化
- **错误处理**:优雅处理导入失败的情况
### 7.2 依赖管理策略
- **核心依赖**`ai` 库作为必需依赖
- **可选依赖**:所有 `@ai-sdk/*` 包都是可选的
- **版本兼容**:支持 AI SDK v3-v5 版本
### 7.3 缓存策略
- **客户端缓存**:基于 provider + options 的智能缓存
- **配置哈希**:安全的 API key 哈希处理
- **生命周期管理**:支持缓存清理和验证
## 8. 迁移策略
### 8.1 阶段一:包基础搭建 (Week 1) ✅ 已完成
1. ✅ 创建简化的包结构
2. ✅ 实现 Provider 注册表
3. ✅ 创建统一客户端和工厂
4. ✅ 配置构建和类型系统
### 8.2 阶段二:核心功能完善 (Week 2) ✅ 已完成
1. ✅ 支持 19+ 官方 AI SDK providers
2. ✅ 实现缓存和错误处理
3. ✅ 完善类型安全和 API 设计
4. ✅ 添加便捷函数和工具
### 8.3 阶段三:集成测试 (Week 3) 🔄 进行中
1. 在 Cherry Studio 中集成测试
2. 功能完整性验证
3. 性能基准测试
4. 兼容性问题修复
### 8.4 阶段四:插件系统实现 ✅ 已完成
1. **插件核心架构**
- 实现 `PluginManager``PluginContext`
- 创建钩子风格插件接口和类型系统
- 建立四种钩子类型执行机制
2. **钩子系统**
- `First Hooks`:第一个有效结果执行
- `Sequential Hooks`:链式数据变换
- `Parallel Hooks`:并发副作用处理
- `Stream Hooks`AI SDK 流转换集成
3. **优先级和排序**
- `pre`/`normal`/`post` 优先级系统
- 插件注册顺序维护
- 错误处理和插件隔离
4. **集成到现有架构**
-`UniversalAiSdkClient` 中集成插件管理器
- 更新 `ApiClientFactory` 支持插件配置
- 创建示例插件和使用文档
### 8.5 阶段五:特性插件扩展 (规划中)
1. **Cherry Studio 特性插件**
- `ThinkingPlugin`:思考过程记录和提取
- `ToolCallPlugin`:工具调用处理和增强
- `WebSearchPlugin`:网络搜索集成
2. **高级功能**
- 插件组合和条件执行
- 动态插件加载系统
- 插件配置管理和持久化
### 8.6 阶段六:文档和发布 (Week 7) 📋 规划中
1. 完善使用文档和示例
2. 插件开发指南和最佳实践
3. 准备发布到 npm
4. 建立维护流程
### 8.7 阶段七:生态系统扩展 (Week 8+) 🚀 未来规划
1. 社区插件生态系统
2. 可视化插件编排工具
3. 性能监控和分析
4. 高级缓存和优化策略
## 9. 预期收益
### 9.1 开发效率提升
- **90%** 减少新 Provider 接入时间(只需添加注册表配置)
- **70%** 减少维护工作量
- **95%** 提升开发体验(统一接口 + 类型安全)
- **独立开发**:可以独立于主应用开发和测试
### 9.2 代码质量改善
- 完整的 TypeScript 类型安全
- 统一的错误处理机制
- 标准化的 AI SDK 接口
- 更好的测试覆盖率
### 9.3 架构优势
- **轻量级**:最小化的包装层
- **可复用**:其他项目可以直接使用
- **可维护**:独立版本管理和发布
- **可扩展**:新 provider 只需配置即可
### 9.4 生态系统价值
- 支持 AI SDK 的完整生态系统
- 可以独立发布到 npm
- 为开源社区贡献价值
- 建立统一的 AI 基础设施
## 10. 风险评估与应对
### 10.1 技术风险
- **AI SDK 版本兼容**:支持多版本兼容策略
- **依赖管理**:合理使用 peerDependencies
- **类型一致性**:直接使用 AI SDK 类型
- **性能影响**:最小化包装层开销
### 10.2 迁移风险
- **功能对等性**:确保所有现有功能都能实现
- **API 兼容性**:提供平滑的迁移路径
- **集成复杂度**:保持简单的集成方式
- **学习成本**:提供清晰的使用文档
## 11. 总结
简化的 AI Core 架构专注于核心价值:
### 11.1 核心价值
- **统一接口**:一套 API 支持 19+ AI providers
- **按需加载**:只打包用户实际使用的 providers
- **类型安全**:完整的 TypeScript 支持
- **轻量高效**:最小化的包装层
### 11.2 设计哲学
- **直接使用 AI SDK**:避免重复造轮子,充分利用原生能力
- **最小包装**:只在必要时添加抽象层,保持轻量高效
- **开发者友好**:简单易用的 API 设计,熟悉的钩子风格
- **生态兼容**:充分利用 AI SDK 生态系统和原生流转换
- **插件优先**:基于钩子的扩展模式,支持灵活组合
### 11.3 成功关键
1. **保持简单**:专注核心功能,避免过度设计
2. **充分测试**:确保功能完整性和稳定性
3. **渐进迁移**:平滑过渡,降低风险
4. **文档完善**:支持快速上手和深度使用
这个基于钩子的插件系统架构为 Cherry Studio 提供了一个轻量、高效、可维护的 AI 基础设施,通过熟悉的钩子模式和原生 AI SDK 集成,为开发者提供了强大而简洁的扩展能力,同时为社区贡献了一个高质量的开源包。

222
packages/aiCore/README.md Normal file
View File

@@ -0,0 +1,222 @@
# @cherrystudio/ai-core
Cherry Studio AI Core 是一个基于 Vercel AI SDK 的统一 AI Provider 接口包。
## 特性
- 🚀 统一的 AI Provider 接口
- 🔄 动态导入支持
- 💾 智能缓存机制
- 🛠️ TypeScript 支持
- 📦 轻量级设计
## 支持的 Providers
基于 [AI SDK 官方支持的 providers](https://ai-sdk.dev/providers/ai-sdk-providers)
**核心 Providers:**
- OpenAI
- Anthropic
- Google Generative AI
- Google Vertex AI
- Mistral AI
- xAI (Grok)
- Azure OpenAI
- Amazon Bedrock
**扩展 Providers:**
- Cohere
- Groq
- Together.ai
- Fireworks
- DeepSeek
- Cerebras
- DeepInfra
- Replicate
- Perplexity
- Fal AI
- Vercel
## 安装
```bash
npm install @cherrystudio/ai-core ai
```
还需要安装你要使用的 AI SDK provider:
```bash
npm install @ai-sdk/openai @ai-sdk/anthropic @ai-sdk/google
```
## 使用示例
### 基础用法
```typescript
import { createAiSdkClient } from '@cherrystudio/ai-core'
// 创建 OpenAI 客户端
const client = await createAiSdkClient('openai', {
apiKey: 'your-api-key'
})
// 流式生成
const result = await client.stream({
modelId: 'gpt-4',
messages: [{ role: 'user', content: 'Hello!' }]
})
// 非流式生成
const response = await client.generate({
modelId: 'gpt-4',
messages: [{ role: 'user', content: 'Hello!' }]
})
```
### 便捷函数
```typescript
import { createOpenAIClient, streamGeneration } from '@cherrystudio/ai-core'
// 快速创建 OpenAI 客户端
const client = await createOpenAIClient({
apiKey: 'your-api-key'
})
// 便捷流式生成
const result = await streamGeneration('openai', 'gpt-4', [{ role: 'user', content: 'Hello!' }], {
apiKey: 'your-api-key'
})
```
### 多 Provider 支持
```typescript
import { createAiSdkClient } from '@cherrystudio/ai-core'
// 支持多种 AI providers
const openaiClient = await createAiSdkClient('openai', { apiKey: 'openai-key' })
const anthropicClient = await createAiSdkClient('anthropic', { apiKey: 'anthropic-key' })
const googleClient = await createAiSdkClient('google', { apiKey: 'google-key' })
const xaiClient = await createAiSdkClient('xai', { apiKey: 'xai-key' })
```
### 使用 AI SDK 原生 Provider 注册表
> https://ai-sdk.dev/docs/reference/ai-sdk-core/provider-registry
除了使用内建的 provider 管理,你还可以使用 AI SDK 原生的 `createProviderRegistry` 来构建自己的 provider 注册表。
#### 基本用法示例
```typescript
import { createClient } from '@cherrystudio/ai-core'
import { createProviderRegistry } from 'ai'
import { createOpenAI } from '@ai-sdk/openai'
import { anthropic } from '@ai-sdk/anthropic'
// 1. 创建 AI SDK 原生注册表
export const registry = createProviderRegistry({
// register provider with prefix and default setup:
anthropic,
// register provider with prefix and custom setup:
openai: createOpenAI({
apiKey: process.env.OPENAI_API_KEY
})
})
// 2. 创建client,'openai'可以传空或者传providerId(内建的provider)
const client = PluginEnabledAiClient.create('openai', {
apiKey: process.env.OPENAI_API_KEY
})
// 3. 方式1使用内建逻辑传统方式
const result1 = await client.streamText('gpt-4', {
messages: [{ role: 'user', content: 'Hello with built-in logic!' }]
})
// 4. 方式2使用自定义注册表灵活方式
const result2 = await client.streamText({
model: registry.languageModel('openai:gpt-4'),
messages: [{ role: 'user', content: 'Hello with custom registry!' }]
})
// 5. 支持的重载方法
await client.generateObject({
model: registry.languageModel('openai:gpt-4'),
schema: z.object({ name: z.string() }),
messages: [{ role: 'user', content: 'Generate a user' }]
})
await client.streamObject({
model: registry.languageModel('anthropic:claude-3-opus-20240229'),
schema: z.object({ items: z.array(z.string()) }),
messages: [{ role: 'user', content: 'Generate a list' }]
})
```
#### 与插件系统配合使用
更强大的是,你还可以将自定义注册表与 Cherry Studio 的插件系统结合使用:
```typescript
import { PluginEnabledAiClient } from '@cherrystudio/ai-core'
import { createProviderRegistry } from 'ai'
import { createOpenAI } from '@ai-sdk/openai'
import { anthropic } from '@ai-sdk/anthropic'
// 1. 创建带插件的客户端
const client = PluginEnabledAiClient.create(
'openai',
{
apiKey: process.env.OPENAI_API_KEY
},
[LoggingPlugin, RetryPlugin]
)
// 2. 创建自定义注册表
const registry = createProviderRegistry({
openai: createOpenAI({ apiKey: process.env.OPENAI_API_KEY }),
anthropic: anthropic({ apiKey: process.env.ANTHROPIC_API_KEY })
})
// 3. 方式1使用内建逻辑 + 完整插件系统
await client.streamText('gpt-4', {
messages: [{ role: 'user', content: 'Hello with plugins!' }]
})
// 4. 方式2使用自定义注册表 + 有限插件支持
await client.streamText({
model: registry.languageModel('anthropic:claude-3-opus-20240229'),
messages: [{ role: 'user', content: 'Hello from Claude!' }]
})
// 5. 支持的方法
await client.generateObject({
model: registry.languageModel('openai:gpt-4'),
schema: z.object({ name: z.string() }),
messages: [{ role: 'user', content: 'Generate a user' }]
})
await client.streamObject({
model: registry.languageModel('openai:gpt-4'),
schema: z.object({ items: z.array(z.string()) }),
messages: [{ role: 'user', content: 'Generate a list' }]
})
```
#### 混合使用的优势
- **灵活性**:可以根据需要选择使用内建逻辑或自定义注册表
- **兼容性**:完全兼容 AI SDK 的 `createProviderRegistry` API
- **渐进式**:可以逐步迁移现有代码,无需一次性重构
- **插件支持**:自定义注册表仍可享受 Cherry Studio 插件系统的部分功能
- **最佳实践**:结合两种方式的优点,既有动态加载的性能优势,又有统一注册表的便利性
## License
MIT

View File

@@ -0,0 +1,124 @@
{
"name": "@cherrystudio/ai-core",
"version": "1.0.0",
"description": "Cherry Studio AI Core - Unified AI Provider Interface Based on Vercel AI SDK",
"main": "src/index.ts",
"types": "src/index.ts",
"scripts": {
"build": "tsdown",
"dev": "tsc -w",
"clean": "rm -rf dist"
},
"keywords": [
"ai",
"sdk",
"openai",
"anthropic",
"google",
"cherry-studio",
"vercel-ai-sdk"
],
"author": "Cherry Studio",
"license": "MIT",
"dependencies": {
"@ai-sdk/amazon-bedrock": "^2.2.10",
"@ai-sdk/anthropic": "^1.2.12",
"@ai-sdk/azure": "^1.3.23",
"@ai-sdk/cerebras": "^0.2.14",
"@ai-sdk/cohere": "^1.2.10",
"@ai-sdk/deepinfra": "^0.2.15",
"@ai-sdk/deepseek": "^0.2.14",
"@ai-sdk/fal": "^0.1.12",
"@ai-sdk/fireworks": "^0.2.14",
"@ai-sdk/google": "^1.2.19",
"@ai-sdk/google-vertex": "^2.2.24",
"@ai-sdk/groq": "^1.2.9",
"@ai-sdk/mistral": "^1.2.8",
"@ai-sdk/openai": "^1.3.22",
"@ai-sdk/openai-compatible": "^0.2.14",
"@ai-sdk/perplexity": "^1.1.9",
"@ai-sdk/replicate": "^0.2.8",
"@ai-sdk/togetherai": "^0.2.14",
"@ai-sdk/vercel": "^0.0.1",
"@ai-sdk/xai": "^1.2.16",
"@openrouter/ai-sdk-provider": "^0.1.0",
"ai": "^4.3.16",
"anthropic-vertex-ai": "^1.0.2",
"ollama-ai-provider": "^1.2.0",
"qwen-ai-provider": "^0.1.0",
"zhipu-ai-provider": "^0.1.1"
},
"peerDependenciesMeta": {
"@ai-sdk/amazon-bedrock": {
"optional": true
},
"@ai-sdk/anthropic": {
"optional": true
},
"@ai-sdk/azure": {
"optional": true
},
"@ai-sdk/cerebras": {
"optional": true
},
"@ai-sdk/cohere": {
"optional": true
},
"@ai-sdk/deepinfra": {
"optional": true
},
"@ai-sdk/deepseek": {
"optional": true
},
"@ai-sdk/fal": {
"optional": true
},
"@ai-sdk/fireworks": {
"optional": true
},
"@ai-sdk/google": {
"optional": true
},
"@ai-sdk/google-vertex": {
"optional": true
},
"@ai-sdk/groq": {
"optional": true
},
"@ai-sdk/mistral": {
"optional": true
},
"@ai-sdk/openai": {
"optional": true
},
"@ai-sdk/perplexity": {
"optional": true
},
"@ai-sdk/replicate": {
"optional": true
},
"@ai-sdk/together": {
"optional": true
},
"@ai-sdk/vercel": {
"optional": true
},
"@ai-sdk/xai": {
"optional": true
}
},
"devDependencies": {
"tsdown": "^0.12.8",
"typescript": "^5.0.0"
},
"files": [
"dist"
],
"exports": {
".": {
"types": "./src/index.ts",
"import": "./src/index.ts",
"require": "./src/index.ts"
}
}
}

1526
packages/aiCore/pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,223 @@
/**
* API Client Factory
* 整合现有实现的改进版API客户端工厂
*/
import type { ImageModelV1 } from '@ai-sdk/provider'
import { type LanguageModelV1, LanguageModelV1Middleware, wrapLanguageModel } from 'ai'
import { aiProviderRegistry } from '../providers/registry'
import { type ProviderId, type ProviderSettingsMap } from './types'
// 客户端配置接口
export interface ClientConfig {
providerId: string
options?: any
}
// 错误类型
export class ClientFactoryError extends Error {
constructor(
message: string,
public providerId?: string,
public cause?: Error
) {
super(message)
this.name = 'ClientFactoryError'
}
}
/**
* API Client Factory
* 统一管理和创建AI SDK客户端
*/
export class ApiClientFactory {
/**
* 创建 AI SDK 模型实例
* 对于已知的 Provider 使用严格类型检查,未知的 Provider 默认使用 openai-compatible
*/
static async createClient<T extends ProviderId>(
providerId: T,
modelId: string,
options: ProviderSettingsMap[T],
middlewares?: LanguageModelV1Middleware[]
): Promise<LanguageModelV1>
static async createClient(
providerId: string,
modelId: string,
options: ProviderSettingsMap['openai-compatible'],
middlewares?: LanguageModelV1Middleware[]
): Promise<LanguageModelV1>
static async createClient(
providerId: string,
modelId: string = 'default',
options: any,
middlewares?: LanguageModelV1Middleware[]
): Promise<LanguageModelV1> {
try {
// 对于不在注册表中的 provider默认使用 openai-compatible
const effectiveProviderId = aiProviderRegistry.isSupported(providerId) ? providerId : 'openai-compatible'
// 获取Provider配置
const providerConfig = aiProviderRegistry.getProvider(effectiveProviderId)
if (!providerConfig) {
throw new ClientFactoryError(`Provider "${effectiveProviderId}" is not registered`, providerId)
}
// 动态导入模块
const module = await providerConfig.import()
// 获取创建函数
const creatorFunction = module[providerConfig.creatorFunctionName]
if (typeof creatorFunction !== 'function') {
throw new ClientFactoryError(
`Creator function "${providerConfig.creatorFunctionName}" not found in the imported module for provider "${effectiveProviderId}"`
)
}
// 创建provider实例
const provider = creatorFunction(options)
// 返回模型实例
if (typeof provider === 'function') {
let model: LanguageModelV1 = provider(modelId)
// 应用 AI SDK 中间件
if (middlewares && middlewares.length > 0) {
model = wrapLanguageModel({
model: model,
middleware: middlewares
})
}
return model
} else {
throw new ClientFactoryError(`Unknown model access pattern for provider "${effectiveProviderId}"`)
}
} catch (error) {
if (error instanceof ClientFactoryError) {
throw error
}
throw new ClientFactoryError(
`Failed to create client for provider "${providerId}": ${error instanceof Error ? error.message : 'Unknown error'}`,
providerId,
error instanceof Error ? error : undefined
)
}
}
static async createImageClient<T extends ProviderId>(
providerId: T,
modelId: string,
options: ProviderSettingsMap[T]
): Promise<ImageModelV1>
static async createImageClient(
providerId: string,
modelId: string,
options: ProviderSettingsMap['openai-compatible']
): Promise<ImageModelV1>
static async createImageClient(providerId: string, modelId: string = 'default', options: any): Promise<ImageModelV1> {
try {
if (!aiProviderRegistry.isSupported(providerId)) {
throw new ClientFactoryError(`Provider "${providerId}" is not supported`, providerId)
}
const providerConfig = aiProviderRegistry.getProvider(providerId)
if (!providerConfig) {
throw new ClientFactoryError(`Provider "${providerId}" is not registered`, providerId)
}
if (!providerConfig.supportsImageGeneration) {
throw new ClientFactoryError(`Provider "${providerId}" does not support image generation`, providerId)
}
const module = await providerConfig.import()
const creatorFunction = module[providerConfig.creatorFunctionName]
if (typeof creatorFunction !== 'function') {
throw new ClientFactoryError(
`Creator function "${providerConfig.creatorFunctionName}" not found in the imported module for provider "${providerId}"`
)
}
const provider = creatorFunction(options)
if (provider && typeof provider.image === 'function') {
return provider.image(modelId)
} else {
throw new ClientFactoryError(`Image model function not found for provider "${providerId}"`)
}
} catch (error) {
if (error instanceof ClientFactoryError) {
throw error
}
throw new ClientFactoryError(
`Failed to create image client for provider "${providerId}": ${error instanceof Error ? error.message : 'Unknown error'}`,
providerId,
error instanceof Error ? error : undefined
)
}
}
/**
* 获取支持的 Providers 列表
*/
static getSupportedProviders(): Array<{
id: string
name: string
}> {
return aiProviderRegistry.getAllProviders().map((provider) => ({
id: provider.id,
name: provider.name
}))
}
/**
* 获取 Provider 信息
*/
static getClientInfo(providerId: string): {
id: string
name: string
isSupported: boolean
effectiveProvider: string
} {
const effectiveProviderId = aiProviderRegistry.isSupported(providerId) ? providerId : 'openai-compatible'
const provider = aiProviderRegistry.getProvider(effectiveProviderId)
return {
id: providerId,
name: provider?.name || providerId,
isSupported: aiProviderRegistry.isSupported(providerId),
effectiveProvider: effectiveProviderId
}
}
}
// 便捷导出函数
export function createClient<T extends ProviderId>(
providerId: T,
modelId: string,
options: ProviderSettingsMap[T]
): Promise<LanguageModelV1>
export function createClient(
providerId: string,
modelId: string,
options: ProviderSettingsMap['openai-compatible']
): Promise<LanguageModelV1>
export function createClient(providerId: string, modelId: string = 'default', options: any): Promise<LanguageModelV1> {
return ApiClientFactory.createClient(providerId, modelId, options)
}
export const createImageClient = (providerId: string, modelId: string, options: any): Promise<ImageModelV1> =>
ApiClientFactory.createImageClient(providerId, modelId, options)
export const getSupportedProviders = () => ApiClientFactory.getSupportedProviders()
export const getClientInfo = (providerId: string) => ApiClientFactory.getClientInfo(providerId)

View File

@@ -0,0 +1,381 @@
/**
* AI Client - Cherry Studio AI Core 的主要客户端接口
* 默认集成插件系统,提供完整的 AI 调用能力
*
* ## 使用方式
*
* ```typescript
* import { AiClient } from '@cherrystudio/ai-core'
*
* // 创建客户端(默认带插件系统)
* const client = AiClient.create('openai', {
* name: 'openai',
* apiKey: process.env.OPENAI_API_KEY
* }, [LoggingPlugin, ContentFilterPlugin])
*
* // 使用方式与 UniversalAiSdkClient 完全相同
* const result = await client.generateText('gpt-4', {
* messages: [{ role: 'user', content: 'Hello!' }]
* })
* ```
*/
import { generateObject, generateText, LanguageModelV1Middleware, streamObject, streamText } from 'ai'
import { AiPlugin, createContext, PluginManager } from '../plugins'
import { isProviderSupported } from '../providers/registry'
import { ApiClientFactory } from './ApiClientFactory'
import { type ProviderId, type ProviderSettingsMap } from './types'
import { UniversalAiSdkClient } from './UniversalAiSdkClient'
/**
* Cherry Studio AI Core 的主要客户端
* 默认集成插件系统,提供完整的 AI 调用能力
*/
export class PluginEnabledAiClient<T extends ProviderId = ProviderId> {
private pluginManager: PluginManager
private baseClient: UniversalAiSdkClient<T>
private middlewares: LanguageModelV1Middleware[] = []
constructor(
private readonly providerId: T,
private readonly options: ProviderSettingsMap[T],
plugins: AiPlugin[] = []
) {
this.pluginManager = new PluginManager(plugins)
this.baseClient = UniversalAiSdkClient.create(providerId, options)
this.updateMiddlewares()
}
/**
* 添加单个插件
*/
use(plugin: AiPlugin): this {
this.pluginManager.use(plugin)
this.updateMiddlewares()
return this
}
/**
* 批量添加插件
*/
usePlugins(plugins: AiPlugin[]): this {
plugins.forEach((plugin) => this.pluginManager.use(plugin))
this.updateMiddlewares()
return this
}
/**
* 移除插件
*/
removePlugin(pluginName: string): this {
this.pluginManager.remove(pluginName)
this.updateMiddlewares()
return this
}
/**
* 重新计算并更新中间件列表
* 这是一个原子操作,以确保中间件列表总是最新的
*/
private updateMiddlewares(): void {
const pluginMiddlewares = this.pluginManager.collectAiSdkMiddlewares()
this.middlewares = pluginMiddlewares
}
/**
* 获取插件统计信息
*/
getPluginStats() {
return this.pluginManager.getStats()
}
/**
* 获取插件列表
*/
getPlugins() {
return this.pluginManager.getPlugins()
}
/**
* 执行插件处理的通用逻辑
* 1-5步骤的通用处理
*/
private async executeWithPlugins<TParams, TResult>(
methodName: string,
modelId: string,
params: TParams,
executor: (finalModelId: string, transformedParams: TParams) => Promise<TResult>
): Promise<TResult> {
// 创建请求上下文
const context = createContext(this.providerId, modelId, params)
try {
// 1. 触发请求开始事件
await this.pluginManager.executeParallel('onRequestStart', context)
// 2. 解析模型别名
const resolvedModelId = await this.pluginManager.executeFirst<string>('resolveModel', modelId, context)
const finalModelId = resolvedModelId || modelId
// 3. 转换请求参数
const transformedParams = await this.pluginManager.executeSequential('transformParams', params, context)
// 4. 执行具体的 API 调用
const result = await executor(finalModelId, transformedParams)
// 5. 转换结果(对于非流式调用)
const transformedResult = await this.pluginManager.executeSequential('transformResult', result, context)
// 6. 触发完成事件
await this.pluginManager.executeParallel('onRequestEnd', context, transformedResult)
return transformedResult
} catch (error) {
// 7. 触发错误事件
await this.pluginManager.executeParallel('onError', context, undefined, error as Error)
throw error
}
}
/**
* 执行流式调用的通用逻辑
* 流式调用的特殊处理(支持流转换器)
*/
private async executeStreamWithPlugins<TParams, TResult>(
methodName: string,
modelId: string,
params: TParams,
executor: (finalModelId: string, transformedParams: TParams, streamTransforms: any[]) => Promise<TResult>
): Promise<TResult> {
// 创建请求上下文
const context = createContext(this.providerId, modelId, params)
try {
// 1. 触发请求开始事件
await this.pluginManager.executeParallel('onRequestStart', context)
// 2. 解析模型别名
const resolvedModelId = await this.pluginManager.executeFirst<string>('resolveModel', modelId, context)
const finalModelId = resolvedModelId || modelId
// 3. 转换请求参数
const transformedParams = await this.pluginManager.executeSequential('transformParams', params, context)
// 4. 收集流转换器
const streamTransforms = this.pluginManager.collectStreamTransforms()
// 5. 执行流式 API 调用
const result = await executor(finalModelId, transformedParams, streamTransforms)
// 6. 触发完成事件(注意:对于流式调用,这里触发的是开始流式响应的事件)
await this.pluginManager.executeParallel('onRequestEnd', context, { stream: true })
return result
} catch (error) {
// 7. 触发错误事件
await this.pluginManager.executeParallel('onError', context, undefined, error as Error)
throw error
}
}
/**
* 获取注入了中间件的 AI SDK 模型实例
* 这是应用原生中间件的关键
*/
private async getModelWithMiddlewares(modelId: string) {
const middlewares = this.middlewares
// 3. 如果有中间件,创建一个新的、注入了中间件的客户端实例
return await ApiClientFactory.createClient(
this.providerId,
modelId,
this.options,
middlewares.length > 0 ? middlewares : undefined
)
}
/**
* 流式文本生成
*/
async streamText(
modelId: string,
params: Omit<Parameters<typeof streamText>[0], 'model'>
): Promise<ReturnType<typeof streamText>>
async streamText(params: Parameters<typeof streamText>[0]): Promise<ReturnType<typeof streamText>>
async streamText(
modelIdOrParams: string | Parameters<typeof streamText>[0],
params?: Omit<Parameters<typeof streamText>[0], 'model'>
): Promise<ReturnType<typeof streamText>> {
if (typeof modelIdOrParams === 'string') {
// 传统方式:使用内建逻辑
return this.executeStreamWithPlugins(
'streamText',
modelIdOrParams,
params!,
async (finalModelId, transformedParams, streamTransforms) => {
const model = await this.getModelWithMiddlewares(finalModelId)
const experimental_transform =
params?.experimental_transform ?? (streamTransforms.length > 0 ? streamTransforms : undefined)
return await streamText({
model,
...transformedParams,
experimental_transform
})
}
)
} else {
// 外部 registry 方式:直接使用用户提供的 model
return await streamText(modelIdOrParams)
}
}
/**
* 生成文本
* 可能不需要了,因为内置模拟非流中间件
*/
async generateText(
modelId: string,
params: Omit<Parameters<typeof generateText>[0], 'model'>
): Promise<ReturnType<typeof generateText>> {
return this.executeWithPlugins('generateText', modelId, params, async (finalModelId, transformedParams) => {
const model = await this.getModelWithMiddlewares(finalModelId)
return await generateText({ model, ...transformedParams })
})
}
/**
* 生成结构化对象
*/
async generateObject(
modelId: string,
params: Omit<Parameters<typeof generateObject>[0], 'model'>
): Promise<ReturnType<typeof generateObject>>
async generateObject(params: Parameters<typeof generateObject>[0]): Promise<ReturnType<typeof generateObject>>
async generateObject(
modelIdOrParams: string | Parameters<typeof generateObject>[0],
params?: Omit<Parameters<typeof generateObject>[0], 'model'>
): Promise<ReturnType<typeof generateObject>> {
if (typeof modelIdOrParams === 'string') {
// 传统方式:使用内建逻辑
return this.executeWithPlugins(
'generateObject',
modelIdOrParams,
params!,
async (finalModelId, transformedParams) => {
const model = await this.getModelWithMiddlewares(finalModelId)
return await generateObject({ model, ...transformedParams })
}
)
} else {
// 外部 registry 方式:直接使用用户提供的 model
return await generateObject(modelIdOrParams)
}
}
/**
* 流式生成结构化对象
*/
async streamObject(
modelId: string,
params: Omit<Parameters<typeof streamObject>[0], 'model'>
): Promise<ReturnType<typeof streamObject>>
async streamObject(params: Parameters<typeof streamObject>[0]): Promise<ReturnType<typeof streamObject>>
async streamObject(
modelIdOrParams: string | Parameters<typeof streamObject>[0],
params?: Omit<Parameters<typeof streamObject>[0], 'model'>
): Promise<ReturnType<typeof streamObject>> {
if (typeof modelIdOrParams === 'string') {
// 传统方式:使用内建逻辑
return this.executeWithPlugins(
'streamObject',
modelIdOrParams,
params!,
async (finalModelId, transformedParams) => {
return await this.baseClient.streamObject(finalModelId, transformedParams)
}
)
} else {
// 外部 registry 方式:直接使用用户提供的 model
return await streamObject(modelIdOrParams)
}
}
/**
* 获取客户端信息
*/
getClientInfo() {
return this.baseClient.getClientInfo()
}
/**
* 获取底层客户端实例(用于高级用法)
*/
getBaseClient(): UniversalAiSdkClient<T> {
return this.baseClient
}
// === 静态工厂方法 ===
/**
* 创建 OpenAI Compatible 客户端
*/
static createOpenAICompatible(
config: ProviderSettingsMap['openai-compatible'],
plugins: AiPlugin[] = []
): PluginEnabledAiClient<'openai-compatible'> {
return new PluginEnabledAiClient('openai-compatible', config, plugins)
}
/**
* 创建标准提供商客户端
*/
static create<T extends ProviderId>(
providerId: T,
options: ProviderSettingsMap[T],
plugins?: AiPlugin[]
): PluginEnabledAiClient<T>
static create(
providerId: string,
options: ProviderSettingsMap['openai-compatible'],
plugins?: AiPlugin[]
): PluginEnabledAiClient<'openai-compatible'>
static create(providerId: string, options: any, plugins: AiPlugin[] = []): PluginEnabledAiClient {
if (isProviderSupported(providerId)) {
return new PluginEnabledAiClient(providerId as ProviderId, options, plugins)
} else {
// 对于未知 provider使用 openai-compatible
return new PluginEnabledAiClient('openai-compatible', options, plugins)
}
}
}
/**
* 创建 AI 客户端的工厂函数(默认带插件系统)
*/
export function createClient<T extends ProviderId>(
providerId: T,
options: ProviderSettingsMap[T],
plugins?: AiPlugin[]
): PluginEnabledAiClient<T>
export function createClient(
providerId: string,
options: ProviderSettingsMap['openai-compatible'],
plugins?: AiPlugin[]
): PluginEnabledAiClient<'openai-compatible'>
export function createClient(providerId: string, options: any, plugins: AiPlugin[] = []): PluginEnabledAiClient {
return PluginEnabledAiClient.create(providerId, options, plugins)
}
/**
* 创建 OpenAI Compatible 客户端的便捷函数
*/
export function createCompatibleClient(
config: ProviderSettingsMap['openai-compatible'],
plugins: AiPlugin[] = []
): PluginEnabledAiClient<'openai-compatible'> {
return PluginEnabledAiClient.createOpenAICompatible(config, plugins)
}

View File

@@ -0,0 +1,228 @@
/**
* Universal AI SDK Client
* 统一的AI SDK客户端实现
*
* ## 使用方式
*
* ### 1. 官方提供商
* ```typescript
* import { UniversalAiSdkClient } from '@cherrystudio/ai-core'
*
* // OpenAI
* const openai = UniversalAiSdkClient.create('openai', {
* name: 'openai',
* apiHost: 'https://api.openai.com/v1',
* apiKey: process.env.OPENAI_API_KEY
* })
*
* // Anthropic
* const anthropic = UniversalAiSdkClient.create('anthropic', {
* name: 'anthropic',
* apiHost: 'https://api.anthropic.com',
* apiKey: process.env.ANTHROPIC_API_KEY
* })
* ```
*
* ### 2. OpenAI Compatible 第三方提供商
* ```typescript
* // LM Studio (本地运行)
* const lmStudio = UniversalAiSdkClient.createOpenAICompatible({
* name: 'lm-studio',
* baseURL: 'http://localhost:1234/v1'
* })
*
* // Ollama (本地运行)
* const ollama = UniversalAiSdkClient.createOpenAICompatible({
* name: 'ollama',
* baseURL: 'http://localhost:11434/v1'
* })
*
* // 自定义第三方 API
* const customProvider = UniversalAiSdkClient.createOpenAICompatible({
* name: 'my-provider',
* apiKey: process.env.CUSTOM_API_KEY,
* baseURL: 'https://api.customprovider.com/v1',
* headers: {
* 'X-Custom-Header': 'value',
* 'User-Agent': 'MyApp/1.0'
* },
* queryParams: {
* 'api-version': '2024-01'
* }
* })
* ```
*
* ### 3. 使用客户端进行 AI 调用
* ```typescript
* // 流式文本生成
* const stream = await client.streamText('gpt-4', {
* messages: [{ role: 'user', content: 'Hello!' }]
* })
*
* // 生成文本
* const { text } = await client.generateText('gpt-4', {
* messages: [{ role: 'user', content: 'Hello!' }]
* })
*
* // 生成结构化对象
* const { object } = await client.generateObject('gpt-4', {
* messages: [{ role: 'user', content: 'Generate a user profile' }],
* schema: z.object({
* name: z.string(),
* age: z.number()
* })
* })
* ```
*/
import { experimental_generateImage as generateImage, generateObject, generateText, streamObject, streamText } from 'ai'
import { ApiClientFactory } from './ApiClientFactory'
import { type ProviderId, type ProviderSettingsMap } from './types'
/**
* 通用 AI SDK 客户端
* 为特定 AI 提供商创建的客户端实例
*/
export class UniversalAiSdkClient<T extends ProviderId = ProviderId> {
constructor(
private readonly providerId: T,
private readonly options: ProviderSettingsMap[T]
) {}
/**
* 流式文本生成
* 直接使用 AI SDK 的 streamText 参数类型
*/
async streamText(
modelId: string,
params: Omit<Parameters<typeof streamText>[0], 'model'>
): Promise<ReturnType<typeof streamText>> {
const model = await ApiClientFactory.createClient(this.providerId, modelId, this.options)
return streamText({
model,
...params
})
}
/**
* 生成文本
* 直接使用 AI SDK 的 generateText 参数类型
*/
async generateText(
modelId: string,
params: Omit<Parameters<typeof generateText>[0], 'model'>
): Promise<ReturnType<typeof generateText>> {
const model = await ApiClientFactory.createClient(this.providerId, modelId, this.options)
return generateText({
model,
...params
})
}
/**
* 生成结构化对象
* 直接使用 AI SDK 的 generateObject 参数类型
*/
async generateObject(
modelId: string,
params: Omit<Parameters<typeof generateObject>[0], 'model'>
): Promise<ReturnType<typeof generateObject>> {
const model = await ApiClientFactory.createClient(this.providerId, modelId, this.options)
return await generateObject({
model,
...params
})
}
/**
* 流式生成结构化对象
* 直接使用 AI SDK 的 streamObject 参数类型
*/
async streamObject(
modelId: string,
params: Omit<Parameters<typeof streamObject>[0], 'model'>
): Promise<ReturnType<typeof streamObject>> {
const model = await ApiClientFactory.createClient(this.providerId, modelId, this.options)
return streamObject({
model,
...params
})
}
async generateImage(
modelId: string,
params: Omit<Parameters<typeof generateImage>[0], 'model'>
): Promise<ReturnType<typeof generateImage>> {
const model = await ApiClientFactory.createImageClient(this.providerId, modelId, this.options)
return generateImage({
model,
...params
})
}
/**
* 获取客户端信息
*/
getClientInfo() {
return ApiClientFactory.getClientInfo(this.providerId)
}
// === 静态工厂方法 ===
/**
* 创建 OpenAI Compatible 客户端
* 用于那些实现 OpenAI API 的第三方提供商
*/
static createOpenAICompatible(
config: ProviderSettingsMap['openai-compatible']
): UniversalAiSdkClient<'openai-compatible'> {
return new UniversalAiSdkClient('openai-compatible', config)
}
/**
* 创建标准提供商客户端
* 对于已知的 Provider 使用严格类型检查,未知的 Provider 默认使用 openai-compatible
*/
static create<T extends ProviderId>(providerId: T, options: ProviderSettingsMap[T]): UniversalAiSdkClient<T>
static create(
providerId: string,
options: ProviderSettingsMap['openai-compatible']
): UniversalAiSdkClient<'openai-compatible'>
static create(providerId: string, options: any): UniversalAiSdkClient {
if (providerId in ({} as ProviderSettingsMap)) {
return new UniversalAiSdkClient(providerId as ProviderId, options)
} else {
// 对于未知 provider使用 openai-compatible
return new UniversalAiSdkClient('openai-compatible', options)
}
}
}
/**
* 创建客户端实例的工厂函数
*/
export function createUniversalClient<T extends ProviderId>(
providerId: T,
options: ProviderSettingsMap[T]
): UniversalAiSdkClient<T>
export function createUniversalClient(
providerId: string,
options: ProviderSettingsMap['openai-compatible']
): UniversalAiSdkClient<'openai-compatible'>
export function createUniversalClient(providerId: string, options: any): UniversalAiSdkClient {
return UniversalAiSdkClient.create(providerId, options)
}
/**
* 创建 OpenAI Compatible 客户端的便捷函数
*/
export function createOpenAICompatibleClient(
config: ProviderSettingsMap['openai-compatible']
): UniversalAiSdkClient<'openai-compatible'> {
return UniversalAiSdkClient.createOpenAICompatible(config)
}

View File

@@ -0,0 +1,42 @@
import { generateObject, generateText, streamObject, streamText } from 'ai'
import type { ProviderSettingsMap } from '../providers/registry'
// ProviderSettings 是所有 Provider Settings 的联合类型
export type ProviderSettings = ProviderSettingsMap[keyof ProviderSettingsMap]
export type StreamTextParams = Omit<Parameters<typeof streamText>[0], 'model'>
export type GenerateTextParams = Omit<Parameters<typeof generateText>[0], 'model'>
export type StreamObjectParams = Omit<Parameters<typeof streamObject>[0], 'model'>
export type GenerateObjectParams = Omit<Parameters<typeof generateObject>[0], 'model'>
// 重新导出 ProviderSettingsMap 中的所有类型
export type {
AmazonBedrockProviderSettings,
AnthropicProviderSettings,
AnthropicVertexProviderSettings,
AzureOpenAIProviderSettings,
CerebrasProviderSettings,
CohereProviderSettings,
DeepInfraProviderSettings,
DeepSeekProviderSettings,
FalProviderSettings,
FireworksProviderSettings,
GoogleGenerativeAIProviderSettings,
GoogleVertexProviderSettings,
GroqProviderSettings,
MistralProviderSettings,
OllamaProviderSettings,
OpenAICompatibleProviderSettings,
OpenAIProviderSettings,
OpenRouterProviderSettings,
PerplexityProviderSettings,
ProviderId,
ProviderSettingsMap,
QwenProviderSettings,
ReplicateProviderSettings,
TogetherAIProviderSettings,
VercelProviderSettings,
XaiProviderSettings,
ZhipuProviderSettings
} from '../providers/registry'

View File

@@ -0,0 +1,214 @@
/**
* Cherry Studio AI Core Package
* 基于 Vercel AI SDK 的统一 AI Provider 接口
*/
// 导入内部使用的类和函数
import { ApiClientFactory } from './clients/ApiClientFactory'
import { createClient } from './clients/PluginEnabledAiClient'
import { type ProviderSettingsMap } from './clients/types'
import { createUniversalClient } from './clients/UniversalAiSdkClient'
import { aiProviderRegistry, isProviderSupported } from './providers/registry'
// ==================== 主要客户端接口 ====================
// 默认使用集成插件系统的客户端
export {
PluginEnabledAiClient as AiClient,
createClient,
createCompatibleClient
} from './clients/PluginEnabledAiClient'
// 为了向后兼容,也导出原名称
export { PluginEnabledAiClient } from './clients/PluginEnabledAiClient'
// ==================== 插件系统 ====================
export type { AiPlugin, AiRequestContext, HookResult, HookType, PluginManagerConfig } from './plugins'
export { createContext, definePlugin, PluginManager } from './plugins'
// ==================== 底层客户端(高级用法) ====================
// 不带插件系统的基础客户端,用于需要绕过插件系统的场景
export {
createOpenAICompatibleClient as createBasicOpenAICompatibleClient,
createUniversalClient,
UniversalAiSdkClient
} from './clients/UniversalAiSdkClient'
// ==================== 低级 API ====================
export { ApiClientFactory } from './clients/ApiClientFactory'
export { aiProviderRegistry } from './providers/registry'
// ==================== 类型定义 ====================
export type { ClientFactoryError } from './clients/ApiClientFactory'
export type {
GenerateObjectParams,
GenerateTextParams,
ProviderSettings,
StreamObjectParams,
StreamTextParams
} from './clients/types'
export type { ProviderConfig } from './providers/registry'
export type { ProviderError } from './providers/types'
export * as aiSdk from 'ai'
// ==================== AI SDK 常用类型导出 ====================
// 直接导出 AI SDK 的常用类型,方便使用
export type {
CoreAssistantMessage,
// 消息相关类型
CoreMessage,
CoreSystemMessage,
CoreToolMessage,
CoreUserMessage,
// 通用类型
FinishReason,
GenerateObjectResult,
// 生成相关类型
GenerateTextResult,
InvalidToolArgumentsError,
LanguageModelUsage, // AI SDK 4.0 中 TokenUsage 改名为 LanguageModelUsage
LanguageModelV1Middleware,
LanguageModelV1StreamPart,
// 错误类型
NoSuchToolError,
StreamTextResult,
// 流相关类型
TextStreamPart,
// 工具相关类型
Tool,
ToolCall,
ToolExecutionError,
ToolResult
} from 'ai'
export { defaultSettingsMiddleware, extractReasoningMiddleware, simulateStreamingMiddleware, smoothStream } from 'ai'
// 重新导出所有 Provider Settings 类型
export type {
AmazonBedrockProviderSettings,
AnthropicProviderSettings,
AnthropicVertexProviderSettings,
AzureOpenAIProviderSettings,
CerebrasProviderSettings,
CohereProviderSettings,
DeepInfraProviderSettings,
DeepSeekProviderSettings,
FalProviderSettings,
FireworksProviderSettings,
GoogleGenerativeAIProviderSettings,
GoogleVertexProviderSettings,
GroqProviderSettings,
MistralProviderSettings,
OllamaProviderSettings,
OpenAICompatibleProviderSettings,
OpenAIProviderSettings,
OpenRouterProviderSettings,
PerplexityProviderSettings,
ProviderId,
ProviderSettingsMap,
QwenProviderSettings,
ReplicateProviderSettings,
TogetherAIProviderSettings,
VercelProviderSettings,
XaiProviderSettings,
ZhipuProviderSettings
} from './clients/types'
// ==================== 工具函数 ====================
export { createClient as createApiClient, getClientInfo, getSupportedProviders } from './clients/ApiClientFactory'
export { getAllProviders, getProvider, isProviderSupported, registerProvider } from './providers/registry'
// ==================== 包信息 ====================
export const AI_CORE_VERSION = '1.0.0'
export const AI_CORE_NAME = '@cherrystudio/ai-core'
// ==================== 便捷 API ====================
// 主要的便捷工厂类
export const AiCore = {
version: AI_CORE_VERSION,
name: AI_CORE_NAME,
// 创建主要客户端(默认带插件系统)
create(providerId: string, options: any = {}, plugins: any[] = []) {
return createClient(providerId, options, plugins)
},
// 创建基础客户端(不带插件系统)
createBasic(providerId: string, options: any = {}) {
return createUniversalClient(providerId, options)
},
// 获取支持的providers
getSupportedProviders() {
return ApiClientFactory.getSupportedProviders()
},
// 检查provider支持
isSupported(providerId: string) {
return isProviderSupported(providerId)
},
// 获取客户端信息
getClientInfo(providerId: string) {
return ApiClientFactory.getClientInfo(providerId)
}
}
export const createOpenAIClient = (options: ProviderSettingsMap['openai'], plugins?: any[]) => {
return createClient('openai', options, plugins)
}
export const createAnthropicClient = (options: ProviderSettingsMap['anthropic'], plugins?: any[]) => {
return createClient('anthropic', options, plugins)
}
export const createGoogleClient = (options: ProviderSettingsMap['google'], plugins?: any[]) => {
return createClient('google', options, plugins)
}
export const createXAIClient = (options: ProviderSettingsMap['xai'], plugins?: any[]) => {
return createClient('xai', options, plugins)
}
// ==================== 调试和开发工具 ====================
export const DevTools = {
// 列出所有注册的providers
listProviders() {
return aiProviderRegistry.getAllProviders().map((p) => ({
id: p.id,
name: p.name
}))
},
// 测试provider连接
async testProvider(providerId: string, options: any) {
try {
const client = createClient(providerId, options)
const info = client.getClientInfo()
return {
success: true,
providerId: info.id,
name: info.name,
isSupported: info.isSupported
}
} catch (error) {
return {
success: false,
providerId,
error: error instanceof Error ? error.message : 'Unknown error'
}
}
},
// 获取provider详细信息
getProviderDetails() {
const providers = aiProviderRegistry.getAllProviders()
return {
supportedProviders: providers.length,
registeredProviders: providers.length,
providers: providers.map((p) => ({
id: p.id,
name: p.name
}))
}
}
}

View File

@@ -0,0 +1,259 @@
# AI Core 插件系统
支持四种钩子类型:**First**、**Sequential**、**Parallel** 和 **Stream**
## 🎯 设计理念
借鉴 Rollup/Vite 的成熟插件思想:
- **语义清晰**:不同钩子有不同的执行语义
- **类型安全**TypeScript 完整支持
- **性能优化**First 短路、Parallel 并发、Sequential 链式
- **易于扩展**`enforce` 排序 + 功能分类
## 📋 钩子类型
### 🥇 First 钩子 - 首个有效结果
```typescript
// 只执行第一个返回值的插件,用于解析和查找
resolveModel?: (modelId: string, context: AiRequestContext) => string | null
loadTemplate?: (templateName: string, context: AiRequestContext) => any | null
```
### 🔄 Sequential 钩子 - 链式数据转换
```typescript
// 按顺序链式执行,每个插件可以修改数据
transformParams?: (params: any, context: AiRequestContext) => any
transformResult?: (result: any, context: AiRequestContext) => any
```
### ⚡ Parallel 钩子 - 并行副作用
```typescript
// 并发执行,用于日志、监控等副作用
onRequestStart?: (context: AiRequestContext) => void
onRequestEnd?: (context: AiRequestContext, result: any) => void
onError?: (error: Error, context: AiRequestContext) => void
```
### 🌊 Stream 钩子 - 流处理
```typescript
// 直接使用 AI SDK 的 TransformStream
transformStream?: () => (options) => TransformStream<TextStreamPart, TextStreamPart>
```
## 🚀 快速开始
### 基础用法
```typescript
import { PluginManager, createContext, definePlugin } from '@cherrystudio/ai-core/middleware'
// 创建插件管理器
const pluginManager = new PluginManager()
// 添加插件
pluginManager.use({
name: 'my-plugin',
async transformParams(params, context) {
return { ...params, temperature: 0.7 }
}
})
// 使用插件
const context = createContext('openai', 'gpt-4', { messages: [] })
const transformedParams = await pluginManager.executeSequential(
'transformParams',
{ messages: [{ role: 'user', content: 'Hello' }] },
context
)
```
### 完整示例
```typescript
import {
PluginManager,
ModelAliasPlugin,
LoggingPlugin,
ParamsValidationPlugin,
createContext
} from '@cherrystudio/ai-core/middleware'
// 创建插件管理器
const manager = new PluginManager([
ModelAliasPlugin, // 模型别名解析
ParamsValidationPlugin, // 参数验证
LoggingPlugin // 日志记录
])
// AI 请求流程
async function aiRequest(providerId: string, modelId: string, params: any) {
const context = createContext(providerId, modelId, params)
try {
// 1. 【并行】触发请求开始事件
await manager.executeParallel('onRequestStart', context)
// 2. 【首个】解析模型别名
const resolvedModel = await manager.executeFirst('resolveModel', modelId, context)
context.modelId = resolvedModel || modelId
// 3. 【串行】转换请求参数
const transformedParams = await manager.executeSequential('transformParams', params, context)
// 4. 【流处理】收集流转换器AI SDK 原生支持数组)
const streamTransforms = manager.collectStreamTransforms()
// 5. 调用 AI SDK这里省略具体实现
const result = await callAiSdk(transformedParams, streamTransforms)
// 6. 【串行】转换响应结果
const transformedResult = await manager.executeSequential('transformResult', result, context)
// 7. 【并行】触发请求完成事件
await manager.executeParallel('onRequestEnd', context, transformedResult)
return transformedResult
} catch (error) {
// 8. 【并行】触发错误事件
await manager.executeParallel('onError', context, undefined, error)
throw error
}
}
```
## 🔧 自定义插件
### 模型别名插件
```typescript
const ModelAliasPlugin = definePlugin({
name: 'model-alias',
enforce: 'pre', // 最先执行
async resolveModel(modelId) {
const aliases = {
gpt4: 'gpt-4-turbo-preview',
claude: 'claude-3-sonnet-20240229'
}
return aliases[modelId] || null
}
})
```
### 参数验证插件
```typescript
const ValidationPlugin = definePlugin({
name: 'validation',
async transformParams(params) {
if (!params.messages) {
throw new Error('messages is required')
}
return {
...params,
temperature: params.temperature ?? 0.7,
max_tokens: params.max_tokens ?? 4096
}
}
})
```
### 监控插件
```typescript
const MonitoringPlugin = definePlugin({
name: 'monitoring',
enforce: 'post', // 最后执行
async onRequestEnd(context, result) {
const duration = Date.now() - context.startTime
console.log(`请求耗时: ${duration}ms`)
}
})
```
### 内容过滤插件
```typescript
const FilterPlugin = definePlugin({
name: 'content-filter',
transformStream() {
return () =>
new TransformStream({
transform(chunk, controller) {
if (chunk.type === 'text-delta') {
const filtered = chunk.textDelta.replace(/敏感词/g, '***')
controller.enqueue({ ...chunk, textDelta: filtered })
} else {
controller.enqueue(chunk)
}
}
})
}
})
```
## 📊 执行顺序
### 插件排序
```
enforce: 'pre' → normal → enforce: 'post'
```
### 钩子执行流程
```mermaid
graph TD
A[请求开始] --> B[onRequestStart 并行执行]
B --> C[resolveModel 首个有效]
C --> D[loadTemplate 首个有效]
D --> E[transformParams 串行执行]
E --> F[collectStreamTransforms]
F --> G[AI SDK 调用]
G --> H[transformResult 串行执行]
H --> I[onRequestEnd 并行执行]
G --> J[异常处理]
J --> K[onError 并行执行]
```
## 💡 最佳实践
1. **功能单一**:每个插件专注一个功能
2. **幂等性**:插件应该是幂等的,重复执行不会产生副作用
3. **错误处理**:插件内部处理异常,不要让异常向上传播
4. **性能优化**使用合适的钩子类型First vs Sequential vs Parallel
5. **命名规范**:使用语义化的插件名称
## 🔍 调试工具
```typescript
// 查看插件统计信息
const stats = manager.getStats()
console.log('插件统计:', stats)
// 查看所有插件
const plugins = manager.getPlugins()
console.log(
'已注册插件:',
plugins.map((p) => p.name)
)
```
## ⚡ 性能优势
- **First 钩子**:一旦找到结果立即停止,避免无效计算
- **Parallel 钩子**:真正并发执行,不阻塞主流程
- **Sequential 钩子**:保证数据转换的顺序性
- **Stream 钩子**:直接集成 AI SDK零开销
这个设计兼顾了简洁性和强大功能,为 AI Core 提供了灵活而高效的扩展机制。

View File

@@ -0,0 +1,192 @@
import type { AiPlugin } from '../types'
/**
* 【First 钩子示例】模型别名解析插件
*/
export const ModelAliasPlugin: AiPlugin = {
name: 'model-alias',
enforce: 'pre',
async resolveModel(modelId) {
const aliases: Record<string, string> = {
gpt4: 'gpt-4-turbo-preview',
claude: 'claude-3-sonnet-20240229',
gemini: 'gemini-pro'
}
return aliases[modelId] || null
}
}
/**
* 【Sequential 钩子示例】参数验证和转换插件
*/
export const ParamsValidationPlugin: AiPlugin = {
name: 'params-validation',
async transformParams(params) {
// 参数验证
if (!params.messages || !Array.isArray(params.messages)) {
throw new Error('Invalid messages parameter')
}
// 参数转换:添加默认配置
return {
...params,
temperature: params.temperature ?? 0.7,
max_tokens: params.max_tokens ?? 4096,
stream: params.stream ?? true
}
},
async transformResult(result, context) {
// 结果后处理:添加元数据
return {
...result,
metadata: {
...result.metadata,
processedAt: new Date().toISOString(),
provider: context.providerId,
model: context.modelId
}
}
}
}
/**
* 【Parallel 钩子示例】日志记录插件
*/
export const LoggingPlugin: AiPlugin = {
name: 'logging',
async onRequestStart(context) {
console.log(`🚀 AI请求开始: ${context.providerId}/${context.modelId}`, {
requestId: context.requestId,
timestamp: new Date().toISOString()
})
},
async onRequestEnd(context, result) {
const duration = Date.now() - context.startTime
console.log(`✅ AI请求完成: ${context.requestId} (${duration}ms)`, {
provider: context.providerId,
model: context.modelId,
hasResult: !!result
})
},
async onError(error, context) {
const duration = Date.now() - context.startTime
console.error(`❌ AI请求失败: ${context.requestId} (${duration}ms)`, {
provider: context.providerId,
model: context.modelId,
error: error.message,
stack: error.stack
})
}
}
/**
* 【Parallel 钩子示例】性能监控插件
*/
export const PerformancePlugin: AiPlugin = {
name: 'performance',
enforce: 'post',
async onRequestEnd(context) {
const duration = Date.now() - context.startTime
// 记录性能指标
const metrics = {
requestId: context.requestId,
provider: context.providerId,
model: context.modelId,
duration,
timestamp: context.startTime,
success: true
}
// 发送到监控系统(这里只是示例)
// await sendMetrics(metrics)
console.log('📊 性能指标:', metrics)
},
async onError(error, context) {
const duration = Date.now() - context.startTime
const metrics = {
requestId: context.requestId,
provider: context.providerId,
model: context.modelId,
duration,
timestamp: context.startTime,
success: false,
errorType: error.constructor.name
}
console.log('📊 错误指标:', metrics)
}
}
/**
* 【Stream 钩子示例】内容过滤插件
*/
export const ContentFilterPlugin: AiPlugin = {
name: 'content-filter',
transformStream() {
return () =>
new TransformStream({
transform(chunk, controller) {
// 过滤敏感内容
if (chunk.type === 'text-delta') {
const filtered = chunk.textDelta.replace(/\b(敏感词|违禁词)\b/g, '***')
controller.enqueue({
...chunk,
textDelta: filtered
})
} else {
controller.enqueue(chunk)
}
}
})
}
}
/**
* 【First 钩子示例】模板加载插件
*/
export const TemplatePlugin: AiPlugin = {
name: 'template-loader',
async loadTemplate(templateName) {
const templates: Record<string, any> = {
chat: {
systemPrompt: '你是一个有用的AI助手',
temperature: 0.7
},
coding: {
systemPrompt: '你是一个专业的编程助手,请提供清晰、高质量的代码',
temperature: 0.3
},
creative: {
systemPrompt: '你是一个创意写作助手,请发挥想象力',
temperature: 0.9
}
}
return templates[templateName] || null
}
}
/**
* 示例插件组合
*/
export const defaultPlugins: AiPlugin[] = [
ModelAliasPlugin,
TemplatePlugin,
ParamsValidationPlugin,
LoggingPlugin,
PerformancePlugin,
ContentFilterPlugin
]

View File

@@ -0,0 +1,255 @@
import { openai } from '@ai-sdk/openai'
import { streamText } from 'ai'
import { PluginEnabledAiClient } from '../../clients/PluginEnabledAiClient'
import { createContext, PluginManager } from '../'
import { ContentFilterPlugin, LoggingPlugin } from './example-plugins'
/**
* 使用 PluginEnabledAiClient 的推荐方式
* 这是最简单直接的使用方法
*/
export async function exampleWithPluginEnabledClient() {
console.log('=== 使用 PluginEnabledAiClient 示例 ===')
// 1. 创建带插件的客户端 - 链式调用方式
const client = PluginEnabledAiClient.create('openai-compatible', {
name: 'openai',
baseURL: 'https://api.openai.com/v1',
apiKey: process.env.OPENAI_API_KEY || 'sk-test'
})
.use(LoggingPlugin)
.use(ContentFilterPlugin)
// 2. 或者在创建时传入插件(也可以这样使用)
// const clientWithPlugins = PluginEnabledAiClient.create(
// 'openai-compatible',
// {
// name: 'openai',
// baseURL: 'https://api.openai.com/v1',
// apiKey: process.env.OPENAI_API_KEY || 'sk-test'
// },
// [LoggingPlugin, ContentFilterPlugin]
// )
// 3. 查看插件统计信息
console.log('插件统计:', client.getPluginStats())
try {
// 4. 使用客户端进行 AI 调用(插件会自动生效)
console.log('开始生成文本...')
const result = await client.generateText('gpt-4', {
messages: [{ role: 'user', content: 'Hello, world!' }],
temperature: 0.7
})
console.log('生成的文本:', result.text)
// 5. 流式调用(支持流转换器)
console.log('开始流式生成...')
const streamResult = await client.streamText('gpt-4', {
messages: [{ role: 'user', content: 'Tell me a short story about AI' }]
})
console.log('开始流式响应...')
for await (const textPart of streamResult.textStream) {
process.stdout.write(textPart)
}
console.log('\n流式响应完成')
return result
} catch (error) {
console.error('调用失败:', error)
throw error
}
}
/**
* 创建 OpenAI Compatible 客户端的示例
*/
export function exampleOpenAICompatible() {
console.log('=== OpenAI Compatible 示例 ===')
// Ollama 示例
const ollama = PluginEnabledAiClient.createOpenAICompatible(
{
name: 'ollama',
baseURL: 'http://localhost:11434/v1'
},
[LoggingPlugin]
)
// LM Studio 示例
const lmStudio = PluginEnabledAiClient.createOpenAICompatible({
name: 'lm-studio',
baseURL: 'http://localhost:1234/v1'
}).use(ContentFilterPlugin)
console.log('Ollama 插件统计:', ollama.getPluginStats())
console.log('LM Studio 插件统计:', lmStudio.getPluginStats())
return { ollama, lmStudio }
}
/**
* 动态插件管理示例
*/
export function exampleDynamicPlugins() {
console.log('=== 动态插件管理示例 ===')
const client = PluginEnabledAiClient.create('openai-compatible', {
name: 'openai',
baseURL: 'https://api.openai.com/v1',
apiKey: 'your-api-key'
})
console.log('初始状态:', client.getPluginStats())
// 动态添加插件
client.use(LoggingPlugin)
console.log('添加 LoggingPlugin 后:', client.getPluginStats())
client.usePlugins([ContentFilterPlugin])
console.log('添加 ContentFilterPlugin 后:', client.getPluginStats())
// 移除插件
client.removePlugin('content-filter')
console.log('移除 content-filter 后:', client.getPluginStats())
return client
}
/**
* 完整的低级 API 示例(原有的 example-usage.ts 的方式)
* 这种方式适合需要精细控制插件生命周期的场景
*/
export async function exampleLowLevelApi() {
console.log('=== 低级 API 示例 ===')
// 1. 创建插件管理器
const pluginManager = new PluginManager([LoggingPlugin, ContentFilterPlugin])
// 2. 创建请求上下文
const context = createContext('openai', 'gpt-4', {
messages: [{ role: 'user', content: 'Hello!' }]
})
try {
// 3. 触发请求开始事件
await pluginManager.executeParallel('onRequestStart', context)
// 4. 解析模型别名
const resolvedModel = await pluginManager.executeFirst('resolveModel', 'gpt-4', context)
console.log('Resolved model:', resolvedModel || 'gpt-4')
// 5. 转换请求参数
const params = {
messages: [{ role: 'user' as const, content: 'Hello, AI!' }],
temperature: 0.7
}
const transformedParams = await pluginManager.executeSequential('transformParams', params, context)
// 6. 收集流转换器关键AI SDK 原生支持数组!)
const streamTransforms = pluginManager.collectStreamTransforms()
// 7. 调用 AI SDK直接传入转换器工厂数组
const result = await streamText({
model: openai('gpt-4'),
...transformedParams,
experimental_transform: streamTransforms // 直接传入工厂函数数组
})
// 8. 处理结果
let fullText = ''
for await (const textPart of result.textStream) {
fullText += textPart
console.log('Streaming:', textPart)
}
// 9. 转换最终结果
const finalResult = { text: fullText, usage: await result.usage }
const transformedResult = await pluginManager.executeSequential('transformResult', finalResult, context)
// 10. 触发完成事件
await pluginManager.executeParallel('onRequestEnd', context, transformedResult)
return transformedResult
} catch (error) {
// 11. 触发错误事件
await pluginManager.executeParallel('onError', context, undefined, error as Error)
throw error
}
}
/**
* 流转换器数组的其他使用方式
*/
export function demonstrateStreamTransforms() {
console.log('=== 流转换器示例 ===')
const pluginManager = new PluginManager([
ContentFilterPlugin,
{
name: 'text-replacer',
transformStream() {
return () =>
new TransformStream({
transform(chunk, controller) {
if (chunk.type === 'text-delta') {
const replaced = chunk.textDelta.replace(/hello/gi, 'hi')
controller.enqueue({ ...chunk, textDelta: replaced })
} else {
controller.enqueue(chunk)
}
}
})
}
}
])
// 获取所有流转换器
const transforms = pluginManager.collectStreamTransforms()
console.log(`收集到 ${transforms.length} 个流转换器`)
// 可以单独使用每个转换器
transforms.forEach((factory, index) => {
console.log(`转换器 ${index + 1} 已准备就绪`)
const transform = factory({ stopStream: () => {} })
console.log('Transform created:', transform)
})
return transforms
}
/**
* 运行所有示例
*/
export async function runAllExamples() {
console.log('🚀 开始运行所有示例...\n')
try {
// 1. PluginEnabledAiClient 示例(推荐)
await exampleWithPluginEnabledClient()
console.log('✅ PluginEnabledAiClient 示例完成\n')
// 2. OpenAI Compatible 示例
exampleOpenAICompatible()
console.log('✅ OpenAI Compatible 示例完成\n')
// 3. 动态插件管理示例
exampleDynamicPlugins()
console.log('✅ 动态插件管理示例完成\n')
// 4. 流转换器示例
demonstrateStreamTransforms()
console.log('✅ 流转换器示例完成\n')
// 5. 低级 API 示例
// await exampleLowLevelApi()
console.log('✅ 低级 API 示例完成\n')
console.log('🎉 所有示例运行完成!')
} catch (error) {
console.error('❌ 示例运行失败:', error)
}
}

View File

@@ -0,0 +1,23 @@
// 核心类型和接口
export type { AiPlugin, AiRequestContext, HookResult, HookType, PluginManagerConfig } from './types'
import type { AiPlugin, AiRequestContext } from './types'
// 插件管理器
export { PluginManager } from './manager'
// 工具函数
export function createContext(providerId: string, modelId: string, originalParams: any): AiRequestContext {
return {
providerId,
modelId,
originalParams,
metadata: {},
startTime: Date.now(),
requestId: `${providerId}-${modelId}-${Date.now()}-${Math.random().toString(36).slice(2)}`
}
}
// 插件构建器 - 便于创建插件
export function definePlugin(plugin: AiPlugin): AiPlugin {
return plugin
}

View File

@@ -0,0 +1,189 @@
import type { LanguageModelV1Middleware, TextStreamPart, ToolSet } from 'ai'
import { AiPlugin, AiRequestContext } from './types'
/**
* 插件管理器 - 基于 Rollup 钩子分类设计
*/
export class PluginManager {
private plugins: AiPlugin[] = []
constructor(plugins: AiPlugin[] = []) {
this.plugins = this.sortPlugins(plugins)
}
/**
* 添加插件
*/
use(plugin: AiPlugin): this {
this.plugins = this.sortPlugins([...this.plugins, plugin])
return this
}
/**
* 移除插件
*/
remove(pluginName: string): this {
this.plugins = this.plugins.filter((p) => p.name !== pluginName)
return this
}
/**
* 插件排序pre -> normal -> post
*/
private sortPlugins(plugins: AiPlugin[]): AiPlugin[] {
const pre: AiPlugin[] = []
const normal: AiPlugin[] = []
const post: AiPlugin[] = []
plugins.forEach((plugin) => {
if (plugin.enforce === 'pre') {
pre.push(plugin)
} else if (plugin.enforce === 'post') {
post.push(plugin)
} else {
normal.push(plugin)
}
})
return [...pre, ...normal, ...post]
}
/**
* 执行 First 钩子 - 返回第一个有效结果
*/
async executeFirst<T>(
hookName: 'resolveModel' | 'loadTemplate',
arg: string,
context: AiRequestContext
): Promise<T | null> {
for (const plugin of this.plugins) {
const hook = plugin[hookName]
if (hook) {
const result = await hook(arg, context)
if (result !== null && result !== undefined) {
return result as T
}
}
}
return null
}
/**
* 执行 Sequential 钩子 - 链式数据转换
*/
async executeSequential<T>(
hookName: 'transformParams' | 'transformResult',
initialValue: T,
context: AiRequestContext
): Promise<T> {
let result = initialValue
for (const plugin of this.plugins) {
const hook = plugin[hookName]
if (hook) {
result = await hook(result, context)
}
}
return result
}
/**
* 执行 Parallel 钩子 - 并行副作用
*/
async executeParallel(
hookName: 'onRequestStart' | 'onRequestEnd' | 'onError',
context: AiRequestContext,
result?: any,
error?: Error
): Promise<void> {
const promises = this.plugins
.map((plugin) => {
const hook = plugin[hookName]
if (!hook) return null
if (hookName === 'onError' && error) {
return (hook as any)(error, context)
} else if (hookName === 'onRequestEnd' && result !== undefined) {
return (hook as any)(context, result)
} else if (hookName === 'onRequestStart') {
return (hook as any)(context)
}
return null
})
.filter(Boolean)
// 使用 Promise.all 而不是 allSettled让插件错误能够抛出
await Promise.all(promises)
}
/**
* 收集所有流转换器返回数组AI SDK 原生支持)
*/
collectStreamTransforms<TOOLS extends ToolSet>(): Array<
(options: {
tools?: TOOLS
stopStream: () => void
}) => TransformStream<TextStreamPart<TOOLS>, TextStreamPart<TOOLS>>
> {
return this.plugins.map((plugin) => plugin.transformStream?.()).filter(Boolean) as Array<
(options: {
tools?: TOOLS
stopStream: () => void
}) => TransformStream<TextStreamPart<TOOLS>, TextStreamPart<TOOLS>>
>
}
/**
* 收集所有 AI SDK 原生中间件
*/
collectAiSdkMiddlewares(): LanguageModelV1Middleware[] {
return this.plugins.flatMap((plugin) => plugin.aiSdkMiddlewares || [])
}
/**
* 获取所有插件信息
*/
getPlugins(): AiPlugin[] {
return [...this.plugins]
}
/**
* 获取插件统计信息
*/
getStats() {
const stats = {
total: this.plugins.length,
pre: 0,
normal: 0,
post: 0,
hooks: {
resolveModel: 0,
loadTemplate: 0,
transformParams: 0,
transformResult: 0,
onRequestStart: 0,
onRequestEnd: 0,
onError: 0,
transformStream: 0
}
}
this.plugins.forEach((plugin) => {
// 统计 enforce 类型
if (plugin.enforce === 'pre') stats.pre++
else if (plugin.enforce === 'post') stats.post++
else stats.normal++
// 统计钩子数量
Object.keys(stats.hooks).forEach((hookName) => {
if (plugin[hookName as keyof AiPlugin]) {
stats.hooks[hookName as keyof typeof stats.hooks]++
}
})
})
return stats
}
}

View File

@@ -0,0 +1,87 @@
import type { LanguageModelV1Middleware, TextStreamPart, ToolSet } from 'ai'
/**
* 生命周期阶段定义
*/
export enum LifecycleStage {
PRE_REQUEST = 'pre-request', // 请求预处理
REQUEST_EXECUTION = 'execution', // 请求执行
STREAM_PROCESSING = 'stream', // 流式处理(仅流模式)
POST_RESPONSE = 'post-response', // 响应后处理
ERROR_HANDLING = 'error' // 错误处理
}
/**
* 生命周期上下文
*/
export interface LifecycleContext {
currentStage: LifecycleStage
startTime: number
stageStartTime: number
completedStages: Set<LifecycleStage>
stageDurations: Map<LifecycleStage, number>
metadata: Record<string, any>
}
/**
* AI 请求上下文
*/
export interface AiRequestContext {
providerId: string
modelId: string
originalParams: any
metadata: Record<string, any>
startTime: number
requestId: string
}
/**
* 借鉴 Rollup 的钩子分类设计
*/
export interface AiPlugin {
name: string
enforce?: 'pre' | 'post'
// 【First】首个钩子 - 只执行第一个返回值的插件
resolveModel?: (modelId: string, context: AiRequestContext) => string | null | Promise<string | null>
loadTemplate?: (templateName: string, context: AiRequestContext) => any | null | Promise<any | null>
// 【Sequential】串行钩子 - 链式执行,支持数据转换
transformParams?: (params: any, context: AiRequestContext) => any | Promise<any>
transformResult?: (result: any, context: AiRequestContext) => any | Promise<any>
// 【Parallel】并行钩子 - 不依赖顺序,用于副作用
onRequestStart?: (context: AiRequestContext) => void | Promise<void>
onRequestEnd?: (context: AiRequestContext, result: any) => void | Promise<void>
onError?: (error: Error, context: AiRequestContext) => void | Promise<void>
// 【Stream】流处理 - 直接使用 AI SDK
transformStream?: <TOOLS extends ToolSet>() => (options: {
tools?: TOOLS
stopStream: () => void
}) => TransformStream<TextStreamPart<TOOLS>, TextStreamPart<TOOLS>>
// AI SDK 原生中间件
aiSdkMiddlewares?: LanguageModelV1Middleware[]
}
/**
* 插件管理器配置
*/
export interface PluginManagerConfig {
plugins: AiPlugin[]
context: Partial<AiRequestContext>
}
/**
* 钩子执行器类型
*/
export type HookType = 'first' | 'sequential' | 'parallel' | 'stream'
/**
* 钩子执行结果
*/
export interface HookResult<T = any> {
value: T
stop?: boolean
}

View File

@@ -0,0 +1,376 @@
/**
* AI Provider 注册表
* 静态类型 + 动态导入模式:所有类型静态导入,所有实现动态导入
*/
// 静态导入所有 AI SDK 类型
import { type AmazonBedrockProviderSettings } from '@ai-sdk/amazon-bedrock'
import { type AnthropicProviderSettings } from '@ai-sdk/anthropic'
import { type AzureOpenAIProviderSettings } from '@ai-sdk/azure'
import { type CerebrasProviderSettings } from '@ai-sdk/cerebras'
import { type CohereProviderSettings } from '@ai-sdk/cohere'
import { type DeepInfraProviderSettings } from '@ai-sdk/deepinfra'
import { type DeepSeekProviderSettings } from '@ai-sdk/deepseek'
import { type FalProviderSettings } from '@ai-sdk/fal'
import { type FireworksProviderSettings } from '@ai-sdk/fireworks'
import { type GoogleGenerativeAIProviderSettings } from '@ai-sdk/google'
import { type GoogleVertexProviderSettings } from '@ai-sdk/google-vertex'
import { type GroqProviderSettings } from '@ai-sdk/groq'
import { type MistralProviderSettings } from '@ai-sdk/mistral'
import { type OpenAIProviderSettings } from '@ai-sdk/openai'
import { type OpenAICompatibleProviderSettings } from '@ai-sdk/openai-compatible'
import { type PerplexityProviderSettings } from '@ai-sdk/perplexity'
import { type ReplicateProviderSettings } from '@ai-sdk/replicate'
import { type TogetherAIProviderSettings } from '@ai-sdk/togetherai'
import { type VercelProviderSettings } from '@ai-sdk/vercel'
import { type XaiProviderSettings } from '@ai-sdk/xai'
import { type OpenRouterProviderSettings } from '@openrouter/ai-sdk-provider'
import { type AnthropicVertexProviderSettings } from 'anthropic-vertex-ai'
import { type OllamaProviderSettings } from 'ollama-ai-provider'
import { type QwenProviderSettings } from 'qwen-ai-provider'
import { type ZhipuProviderSettings } from 'zhipu-ai-provider'
// 类型安全的 Provider Settings 映射
export type ProviderSettingsMap = {
openai: OpenAIProviderSettings
'openai-compatible': OpenAICompatibleProviderSettings
anthropic: AnthropicProviderSettings
google: GoogleGenerativeAIProviderSettings
'google-vertex': GoogleVertexProviderSettings
mistral: MistralProviderSettings
xai: XaiProviderSettings
azure: AzureOpenAIProviderSettings
bedrock: AmazonBedrockProviderSettings
cohere: CohereProviderSettings
groq: GroqProviderSettings
together: TogetherAIProviderSettings
fireworks: FireworksProviderSettings
deepseek: DeepSeekProviderSettings
cerebras: CerebrasProviderSettings
deepinfra: DeepInfraProviderSettings
replicate: ReplicateProviderSettings
perplexity: PerplexityProviderSettings
fal: FalProviderSettings
vercel: VercelProviderSettings
ollama: OllamaProviderSettings
qwen: QwenProviderSettings
zhipu: ZhipuProviderSettings
'anthropic-vertex': AnthropicVertexProviderSettings
openrouter: OpenRouterProviderSettings
}
export type ProviderId = keyof ProviderSettingsMap
// 统一的 Provider 配置接口(所有都使用动态导入)
export interface ProviderConfig {
id: string
name: string
// 动态导入函数
import: () => Promise<any>
// 创建函数名称
creatorFunctionName: string
// 是否支持图片生成
supportsImageGeneration?: boolean
}
/**
* AI SDK Provider 注册表
* 管理所有支持的 AI Providers 及其动态导入
*/
export class AiProviderRegistry {
private static instance: AiProviderRegistry
private registry = new Map<string, ProviderConfig>()
private constructor() {
this.initializeProviders()
}
public static getInstance(): AiProviderRegistry {
if (!AiProviderRegistry.instance) {
AiProviderRegistry.instance = new AiProviderRegistry()
}
return AiProviderRegistry.instance
}
/**
* 初始化所有支持的 Providers
* 基于 AI SDK 官方文档: https://ai-sdk.dev/providers/ai-sdk-providers
*/
private initializeProviders(): void {
const providers: ProviderConfig[] = [
// 官方 AI SDK Providers (19个)
{
id: 'openai',
name: 'OpenAI',
import: () => import('@ai-sdk/openai'),
creatorFunctionName: 'createOpenAI',
supportsImageGeneration: true
},
{
id: 'openai-compatible',
name: 'OpenAI Compatible',
import: () => import('@ai-sdk/openai-compatible'),
creatorFunctionName: 'createOpenAICompatible'
},
{
id: 'anthropic',
name: 'Anthropic',
import: () => import('@ai-sdk/anthropic'),
creatorFunctionName: 'createAnthropic',
supportsImageGeneration: false
},
{
id: 'google',
name: 'Google Generative AI',
import: () => import('@ai-sdk/google'),
creatorFunctionName: 'createGoogleGenerativeAI',
supportsImageGeneration: true
},
{
id: 'google-vertex',
name: 'Google Vertex AI',
import: () => import('@ai-sdk/google-vertex'),
creatorFunctionName: 'createVertex',
supportsImageGeneration: true
},
{
id: 'mistral',
name: 'Mistral AI',
import: () => import('@ai-sdk/mistral'),
creatorFunctionName: 'createMistral',
supportsImageGeneration: false
},
{
id: 'xai',
name: 'xAI (Grok)',
import: () => import('@ai-sdk/xai'),
creatorFunctionName: 'createXai',
supportsImageGeneration: true
},
{
id: 'azure',
name: 'Azure OpenAI',
import: () => import('@ai-sdk/azure'),
creatorFunctionName: 'createAzure',
supportsImageGeneration: true
},
{
id: 'bedrock',
name: 'Amazon Bedrock',
import: () => import('@ai-sdk/amazon-bedrock'),
creatorFunctionName: 'createAmazonBedrock',
supportsImageGeneration: false
},
{
id: 'cohere',
name: 'Cohere',
import: () => import('@ai-sdk/cohere'),
creatorFunctionName: 'createCohere',
supportsImageGeneration: false
},
{
id: 'groq',
name: 'Groq',
import: () => import('@ai-sdk/groq'),
creatorFunctionName: 'createGroq',
supportsImageGeneration: false
},
{
id: 'together',
name: 'Together.ai',
import: () => import('@ai-sdk/togetherai'),
creatorFunctionName: 'createTogetherAI',
supportsImageGeneration: true
},
{
id: 'fireworks',
name: 'Fireworks',
import: () => import('@ai-sdk/fireworks'),
creatorFunctionName: 'createFireworks',
supportsImageGeneration: true
},
{
id: 'deepseek',
name: 'DeepSeek',
import: () => import('@ai-sdk/deepseek'),
creatorFunctionName: 'createDeepSeek',
supportsImageGeneration: false
},
{
id: 'cerebras',
name: 'Cerebras',
import: () => import('@ai-sdk/cerebras'),
creatorFunctionName: 'createCerebras',
supportsImageGeneration: false
},
{
id: 'deepinfra',
name: 'DeepInfra',
import: () => import('@ai-sdk/deepinfra'),
creatorFunctionName: 'createDeepInfra',
supportsImageGeneration: false
},
{
id: 'replicate',
name: 'Replicate',
import: () => import('@ai-sdk/replicate'),
creatorFunctionName: 'createReplicate',
supportsImageGeneration: true
},
{
id: 'perplexity',
name: 'Perplexity',
import: () => import('@ai-sdk/perplexity'),
creatorFunctionName: 'createPerplexity',
supportsImageGeneration: false
},
{
id: 'fal',
name: 'Fal AI',
import: () => import('@ai-sdk/fal'),
creatorFunctionName: 'createFal',
supportsImageGeneration: false
},
{
id: 'vercel',
name: 'Vercel',
import: () => import('@ai-sdk/vercel'),
creatorFunctionName: 'createVercel'
},
// 社区 Providers (5个)
{
id: 'ollama',
name: 'Ollama',
import: () => import('ollama-ai-provider'),
creatorFunctionName: 'createOllama',
supportsImageGeneration: false
},
{
id: 'qwen',
name: 'Qwen',
import: () => import('qwen-ai-provider'),
creatorFunctionName: 'createQwen',
supportsImageGeneration: false
},
{
id: 'zhipu',
name: 'Zhipu AI',
import: () => import('zhipu-ai-provider'),
creatorFunctionName: 'createZhipu',
supportsImageGeneration: false
},
{
id: 'anthropic-vertex',
name: 'Anthropic Vertex AI',
import: () => import('anthropic-vertex-ai'),
creatorFunctionName: 'createAnthropicVertex',
supportsImageGeneration: false
},
{
id: 'openrouter',
name: 'OpenRouter',
import: () => import('@openrouter/ai-sdk-provider'),
creatorFunctionName: 'createOpenRouter',
supportsImageGeneration: false
}
]
// 注册所有 providers (总计24个)
providers.forEach((config) => {
this.registry.set(config.id, config)
})
}
/**
* 获取所有已注册的 Providers
*/
public getAllProviders(): ProviderConfig[] {
return Array.from(this.registry.values())
}
/**
* 根据 ID 获取 Provider 配置
*/
public getProvider(id: string): ProviderConfig | undefined {
return this.registry.get(id)
}
/**
* 检查 Provider 是否支持(是否已注册)
*/
public isSupported(id: string): boolean {
return this.registry.has(id)
}
/**
* 注册新的 Provider用于扩展
*/
public registerProvider(config: ProviderConfig): void {
this.registry.set(config.id, config)
}
/**
* 清理资源
*/
public cleanup(): void {
this.registry.clear()
}
/**
* 获取兼容现有实现的注册表格式
*/
public getCompatibleRegistry(): Record<string, { import: () => Promise<any>; creatorFunctionName: string }> {
const compatibleRegistry: Record<string, { import: () => Promise<any>; creatorFunctionName: string }> = {}
this.getAllProviders().forEach((provider) => {
compatibleRegistry[provider.id] = {
import: provider.import,
creatorFunctionName: provider.creatorFunctionName
}
})
return compatibleRegistry
}
}
// 导出单例实例
export const aiProviderRegistry = AiProviderRegistry.getInstance()
// 便捷函数
export const getProvider = (id: string) => aiProviderRegistry.getProvider(id)
export const getAllProviders = () => aiProviderRegistry.getAllProviders()
export const isProviderSupported = (id: string) => aiProviderRegistry.isSupported(id)
export const registerProvider = (config: ProviderConfig) => aiProviderRegistry.registerProvider(config)
// 兼容现有实现的导出
export const PROVIDER_REGISTRY = aiProviderRegistry.getCompatibleRegistry()
// 重新导出所有类型供外部使用
export type {
AmazonBedrockProviderSettings,
AnthropicProviderSettings,
AnthropicVertexProviderSettings,
AzureOpenAIProviderSettings,
CerebrasProviderSettings,
CohereProviderSettings,
DeepInfraProviderSettings,
DeepSeekProviderSettings,
FalProviderSettings,
FireworksProviderSettings,
GoogleGenerativeAIProviderSettings,
GoogleVertexProviderSettings,
GroqProviderSettings,
MistralProviderSettings,
OllamaProviderSettings,
OpenAICompatibleProviderSettings,
OpenAIProviderSettings,
OpenRouterProviderSettings,
PerplexityProviderSettings,
QwenProviderSettings,
ReplicateProviderSettings,
TogetherAIProviderSettings,
VercelProviderSettings,
XaiProviderSettings,
ZhipuProviderSettings
}

View File

@@ -0,0 +1,47 @@
/**
* Provider 相关核心类型定义
* 只定义必要的接口,其他类型直接使用 AI SDK
*/
// Provider 配置接口(简化版)
export interface ProviderConfig {
id: string
name: string
import: () => Promise<any>
creatorFunctionName: string
}
// API 客户端工厂接口
export interface ApiClientFactory {
createAiSdkClient(providerId: string, options?: any): Promise<any>
getCachedClient(providerId: string, options?: any): any
clearCache(): void
}
// 客户端配置
export interface ClientConfig {
providerId: string
apiKey?: string
baseURL?: string
[key: string]: any
}
// 错误类型
export class ProviderError extends Error {
constructor(
message: string,
public providerId: string,
public code?: string,
public cause?: Error
) {
super(message)
this.name = 'ProviderError'
}
}
// 缓存统计信息
export interface CacheStats {
size: number
keys: string[]
lastCleanup?: Date
}

View File

@@ -0,0 +1,26 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "ESNext",
"moduleResolution": "node",
"declaration": true,
"outDir": "./dist",
"rootDir": "./src",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
"noEmitOnError": false,
"experimentalDecorators": true,
"emitDecoratorMetadata": true
},
"include": [
"src/**/*"
],
"exclude": [
"node_modules",
"dist"
]
}

View File

@@ -0,0 +1,284 @@
/**
* AI SDK 到 Cherry Studio Chunk 适配器
* 用于将 AI SDK 的 fullStream 转换为 Cherry Studio 的 chunk 格式
*/
import { TextStreamPart } from '@cherrystudio/ai-core'
import { Chunk, ChunkType } from '@renderer/types/chunk'
export interface CherryStudioChunk {
type: 'text-delta' | 'text-complete' | 'tool-call' | 'tool-result' | 'finish' | 'error'
text?: string
toolCall?: any
toolResult?: any
finishReason?: string
usage?: any
error?: any
}
/**
* AI SDK 到 Cherry Studio Chunk 适配器类
* 处理 fullStream 到 Cherry Studio chunk 的转换
*/
export class AiSdkToChunkAdapter {
constructor(private onChunk: (chunk: Chunk) => void) {}
/**
* 处理 AI SDK 流结果
* @param aiSdkResult AI SDK 的流结果对象
* @returns 最终的文本内容
*/
async processStream(aiSdkResult: any): Promise<string> {
// 如果是流式且有 fullStream
if (aiSdkResult.fullStream) {
await this.readFullStream(aiSdkResult.fullStream)
}
// 使用 streamResult.text 获取最终结果
return await aiSdkResult.text
}
/**
* 读取 fullStream 并转换为 Cherry Studio chunks
* @param fullStream AI SDK 的 fullStream (ReadableStream)
*/
private async readFullStream(fullStream: ReadableStream<TextStreamPart<any>>) {
const reader = fullStream.getReader()
const final = {
text: '',
reasoning_content: ''
}
try {
while (true) {
const { done, value } = await reader.read()
if (done) {
break
}
// 转换并发送 chunk
this.convertAndEmitChunk(value, final)
}
} finally {
reader.releaseLock()
}
}
/**
* 转换 AI SDK chunk 为 Cherry Studio chunk 并调用回调
* @param chunk AI SDK 的 chunk 数据
*/
private convertAndEmitChunk(chunk: any, final: { text: string; reasoning_content: string }) {
console.log('AI SDK chunk type:', chunk.type, chunk)
switch (chunk.type) {
// === 文本相关事件 ===
case 'text-delta':
final.text += chunk.textDelta || ''
this.onChunk({
type: ChunkType.TEXT_DELTA,
text: chunk.textDelta || ''
})
break
case 'reasoning':
this.onChunk({
type: ChunkType.THINKING_DELTA,
text: chunk.textDelta || ''
})
break
case 'redacted-reasoning':
this.onChunk({
type: ChunkType.THINKING_DELTA,
text: chunk.data || ''
})
break
case 'reasoning-signature':
this.onChunk({
type: ChunkType.THINKING_COMPLETE,
text: chunk.text || '',
thinking_millsec: chunk.thinking_millsec || 0
})
break
// === 工具调用相关事件 ===
case 'tool-call-streaming-start':
// 开始流式工具调用
this.onChunk({
type: ChunkType.MCP_TOOL_CREATED,
tool_calls: [
{
id: chunk.toolCallId,
name: chunk.toolName,
args: {}
}
]
})
break
case 'tool-call-delta':
// 工具调用参数的增量更新
this.onChunk({
type: ChunkType.MCP_TOOL_IN_PROGRESS,
responses: [
{
id: chunk.toolCallId,
tool: {
id: chunk.toolName,
// TODO: serverId,serverName
serverId: 'ai-sdk',
serverName: 'AI SDK',
name: chunk.toolName,
description: '',
inputSchema: {
type: 'object',
title: chunk.toolName,
properties: {}
}
},
arguments: {},
status: 'invoking',
response: chunk.argsTextDelta,
toolCallId: chunk.toolCallId
}
]
})
break
case 'tool-call':
// 完整的工具调用
this.onChunk({
type: ChunkType.MCP_TOOL_CREATED,
tool_calls: [
{
id: chunk.toolCallId,
name: chunk.toolName,
args: chunk.args
}
]
})
break
case 'tool-result':
// 工具调用结果
this.onChunk({
type: ChunkType.MCP_TOOL_COMPLETE,
responses: [
{
id: chunk.toolCallId,
tool: {
id: chunk.toolName,
// TODO: serverId,serverName
serverId: 'ai-sdk',
serverName: 'AI SDK',
name: chunk.toolName,
description: '',
inputSchema: {
type: 'object',
title: chunk.toolName,
properties: {}
}
},
arguments: chunk.args || {},
status: 'done',
response: chunk.result,
toolCallId: chunk.toolCallId
}
]
})
break
// === 步骤相关事件 ===
// case 'step-start':
// this.onChunk({
// type: ChunkType.LLM_RESPONSE_CREATED
// })
// break
case 'step-finish':
this.onChunk({
type: ChunkType.BLOCK_COMPLETE,
response: {
text: final.text || '',
reasoning_content: final.reasoning_content || '',
usage: {
completion_tokens: chunk.usage.completionTokens || 0,
prompt_tokens: chunk.usage.promptTokens || 0,
total_tokens: chunk.usage.totalTokens || 0
},
metrics: chunk.usage
? {
completion_tokens: chunk.usage.completionTokens || 0,
time_completion_millsec: 0
}
: undefined
}
})
break
case 'finish':
this.onChunk({
type: ChunkType.TEXT_COMPLETE,
text: final.text || '' // TEXT_COMPLETE 需要 text 字段
})
this.onChunk({
type: ChunkType.LLM_RESPONSE_COMPLETE,
response: {
text: final.text || '',
reasoning_content: final.reasoning_content || '',
usage: {
completion_tokens: chunk.usage.completionTokens || 0,
prompt_tokens: chunk.usage.promptTokens || 0,
total_tokens: chunk.usage.totalTokens || 0
},
metrics: chunk.usage
? {
completion_tokens: chunk.usage.completionTokens || 0,
time_completion_millsec: 0
}
: undefined
}
})
break
// === 源和文件相关事件 ===
case 'source':
// 源信息,可以映射到知识搜索完成
this.onChunk({
type: ChunkType.KNOWLEDGE_SEARCH_COMPLETE,
knowledge: [
{
id: Number(chunk.source.id) || Date.now(),
content: chunk.source.title || '',
sourceUrl: chunk.source.url || '',
type: 'url'
}
]
})
break
case 'file':
// 文件相关事件,可能是图片生成
this.onChunk({
type: ChunkType.IMAGE_COMPLETE,
image: {
type: 'base64',
images: [chunk.base64]
}
})
break
case 'error':
this.onChunk({
type: ChunkType.ERROR,
error: {
message: chunk.error || 'Unknown error'
}
})
break
default:
// 其他类型的 chunk 可以忽略或记录日志
console.log('Unhandled AI SDK chunk type:', chunk.type, chunk)
}
}
}
export default AiSdkToChunkAdapter

View File

@@ -0,0 +1,229 @@
/**
* Cherry Studio AI Core - 新版本入口
* 集成 @cherrystudio/ai-core 库的渐进式重构方案
*
* 融合方案:简化实现,专注于核心功能
* 1. 优先使用新AI SDK
* 2. 失败时fallback到原有实现
* 3. 暂时保持接口兼容性
*/
import {
AiClient,
AiCore,
createClient,
type OpenAICompatibleProviderSettings,
type ProviderId,
smoothStream,
StreamTextParams
} from '@cherrystudio/ai-core'
import { isDedicatedImageGenerationModel } from '@renderer/config/models'
import type { GenerateImageParams, Model, Provider } from '@renderer/types'
// 引入适配器
import AiSdkToChunkAdapter from './AiSdkToChunkAdapter'
// 引入原有的AiProvider作为fallback
import LegacyAiProvider from './index'
import { AiSdkMiddlewareConfig, buildAiSdkMiddlewares } from './middleware/aisdk/AiSdkMiddlewareBuilder'
import { CompletionsResult } from './middleware/schemas'
// 引入参数转换模块
/**
* 将现有 Provider 类型映射到 AI SDK 的 Provider ID
* 根据 registry.ts 中的支持列表进行映射
*/
function mapProviderTypeToAiSdkId(providerType: string): string {
// Cherry Studio Provider Type -> AI SDK Provider ID 映射表
const typeMapping: Record<string, string> = {
// 需要转换的映射
grok: 'xai', // grok -> xai
'azure-openai': 'azure', // azure-openai -> azure
gemini: 'google', // gemini -> google
vertexai: 'google-vertex' // vertexai -> google-vertex
}
return typeMapping[providerType]
}
/**
* 将 Provider 配置转换为新 AI SDK 格式
*/
function providerToAiSdkConfig(provider: Provider): {
providerId: ProviderId | 'openai-compatible'
options: any
} {
console.log('provider', provider)
// 1. 先映射 provider 类型到 AI SDK ID
const mappedProviderId = mapProviderTypeToAiSdkId(provider.id)
// 2. 检查映射后的 provider ID 是否在 AI SDK 注册表中
const isSupported = AiCore.isSupported(mappedProviderId)
console.log(`Provider mapping: ${provider.type} -> ${mappedProviderId}, supported: ${isSupported}`)
// 3. 如果映射的 provider 不支持,则使用 openai-compatible
if (isSupported) {
return {
providerId: mappedProviderId as ProviderId,
options: {
apiKey: provider.apiKey
}
}
} else {
console.log(`Using openai-compatible fallback for provider: ${provider.type}`)
const compatibleConfig: OpenAICompatibleProviderSettings = {
name: provider.name || provider.type,
apiKey: provider.apiKey,
baseURL: provider.apiHost
}
return {
providerId: 'openai-compatible',
options: compatibleConfig
}
}
}
/**
* 检查是否支持使用新的AI SDK
*/
function isModernSdkSupported(provider: Provider, model?: Model): boolean {
// 目前支持主要的providers
const supportedProviders = ['openai', 'anthropic', 'gemini', 'azure-openai', 'vertexai']
// 检查provider类型
if (!supportedProviders.includes(provider.type)) {
return false
}
// 检查是否为图像生成模型(暂时不支持)
if (model && isDedicatedImageGenerationModel(model)) {
return false
}
return true
}
export default class ModernAiProvider {
private modernClient?: AiClient
private legacyProvider: LegacyAiProvider
private provider: Provider
constructor(provider: Provider) {
this.provider = provider
this.legacyProvider = new LegacyAiProvider(provider)
// 初始化时不构建中间件,等到需要时再构建
const config = providerToAiSdkConfig(provider)
this.modernClient = createClient(config.providerId, config.options)
}
public async completions(
modelId: string,
params: StreamTextParams,
middlewareConfig: AiSdkMiddlewareConfig
): Promise<CompletionsResult> {
// const model = params.assistant.model
// 检查是否应该使用现代化客户端
// if (this.modernClient && model && isModernSdkSupported(this.provider, model)) {
// try {
return await this.modernCompletions(modelId, params, middlewareConfig)
// } catch (error) {
// console.warn('Modern client failed, falling back to legacy:', error)
// fallback到原有实现
// }
// }
// 使用原有实现
// return this.legacyProvider.completions(params, options)
}
/**
* 使用现代化AI SDK的completions实现
* 使用建造者模式动态构建中间件
*/
private async modernCompletions(
modelId: string,
params: StreamTextParams,
middlewareConfig: AiSdkMiddlewareConfig
): Promise<CompletionsResult> {
if (!this.modernClient) {
throw new Error('Modern AI SDK client not initialized')
}
try {
// 合并传入的配置和实例配置
const finalConfig: AiSdkMiddlewareConfig = {
...middlewareConfig,
provider: this.provider,
// 工具相关信息从 params 中获取
enableTool: params.tools !== undefined && Array.isArray(params.tools) && params.tools.length > 0
}
// 动态构建中间件数组
const middlewares = buildAiSdkMiddlewares(finalConfig)
console.log(
'构建的中间件:',
middlewares.map((m) => m.name)
)
// 创建带有中间件的客户端
const config = providerToAiSdkConfig(this.provider)
const clientWithMiddlewares = createClient(config.providerId, config.options, middlewares)
if (middlewareConfig.onChunk) {
// 流式处理 - 使用适配器
const adapter = new AiSdkToChunkAdapter(middlewareConfig.onChunk)
const streamResult = await clientWithMiddlewares.streamText(modelId, {
...params,
experimental_transform: smoothStream({
delayInMs: 80,
// 中文3个字符一个chunk,英文一个单词一个chunk
chunking: /([\u4E00-\u9FFF]{3})|\S+\s+/
})
})
const finalText = await adapter.processStream(streamResult)
return {
getText: () => finalText
}
} else {
// 流式处理但没有 onChunk 回调
const streamResult = await clientWithMiddlewares.streamText(modelId, params)
const finalText = await streamResult.text
return {
getText: () => finalText
}
}
} catch (error) {
console.error('Modern AI SDK error:', error)
throw error
}
}
// 代理其他方法到原有实现
public async models() {
return this.legacyProvider.models()
}
public async getEmbeddingDimensions(model: Model): Promise<number> {
return this.legacyProvider.getEmbeddingDimensions(model)
}
public async generateImage(params: GenerateImageParams): Promise<string[]> {
return this.legacyProvider.generateImage(params)
}
public getBaseURL(): string {
return this.legacyProvider.getBaseURL()
}
public getApiKey(): string {
return this.legacyProvider.getApiKey()
}
}
// 为了方便调试,导出一些工具函数
export { isModernSdkSupported, providerToAiSdkConfig }

View File

@@ -0,0 +1,188 @@
import { AiPlugin, simulateStreamingMiddleware } from '@cherrystudio/ai-core'
import { isReasoningModel } from '@renderer/config/models'
import type { Model, Provider } from '@renderer/types'
import type { Chunk } from '@renderer/types/chunk'
import thinkingTimeMiddleware from './ThinkingTimeMiddleware'
/**
* AI SDK 中间件配置项
*/
export interface AiSdkMiddlewareConfig {
streamOutput?: boolean
onChunk?: (chunk: Chunk) => void
model?: Model
provider?: Provider
enableReasoning?: boolean
enableTool?: boolean
enableWebSearch?: boolean
}
/**
* 具名的 AI SDK 中间件
*/
export type NamedAiSdkMiddleware = AiPlugin
/**
* AI SDK 中间件建造者
* 用于根据不同条件动态构建中间件数组
*/
export class AiSdkMiddlewareBuilder {
private middlewares: NamedAiSdkMiddleware[] = []
/**
* 添加具名中间件
*/
public add(namedMiddleware: NamedAiSdkMiddleware): this {
this.middlewares.push(namedMiddleware)
return this
}
/**
* 在指定位置插入中间件
*/
public insertAfter(targetName: string, middleware: NamedAiSdkMiddleware): this {
const index = this.middlewares.findIndex((m) => m.name === targetName)
if (index !== -1) {
this.middlewares.splice(index + 1, 0, middleware)
} else {
console.warn(`AiSdkMiddlewareBuilder: 未找到名为 '${targetName}' 的中间件,无法插入`)
}
return this
}
/**
* 检查是否包含指定名称的中间件
*/
public has(name: string): boolean {
return this.middlewares.some((m) => m.name === name)
}
/**
* 移除指定名称的中间件
*/
public remove(name: string): this {
this.middlewares = this.middlewares.filter((m) => m.name !== name)
return this
}
/**
* 构建最终的中间件数组
*/
public build(): NamedAiSdkMiddleware[] {
return [...this.middlewares]
}
/**
* 清空所有中间件
*/
public clear(): this {
this.middlewares = []
return this
}
/**
* 获取中间件总数
*/
public get length(): number {
return this.middlewares.length
}
}
/**
* 根据配置构建AI SDK中间件的工厂函数
* 这里要注意构建顺序,因为有些中间件需要依赖其他中间件的结果
*/
export function buildAiSdkMiddlewares(config: AiSdkMiddlewareConfig): NamedAiSdkMiddleware[] {
const builder = new AiSdkMiddlewareBuilder()
// 1. 思考模型且有onChunk回调时添加思考时间中间件
if (config.onChunk && config.model && isReasoningModel(config.model)) {
builder.add({
name: 'thinking-time',
aiSdkMiddlewares: [thinkingTimeMiddleware()]
})
}
// 2. 可以在这里根据其他条件添加更多中间件
// 例如工具调用、Web搜索等相关中间件
// 3. 根据provider添加特定中间件
if (config.provider) {
addProviderSpecificMiddlewares(builder, config)
}
// 4. 根据模型类型添加特定中间件
if (config.model) {
addModelSpecificMiddlewares(builder, config)
}
// 5. 非流式输出时添加模拟流中间件
if (config.streamOutput === false) {
builder.add({
name: 'simulate-streaming',
aiSdkMiddlewares: [simulateStreamingMiddleware()]
})
}
return builder.build()
}
/**
* 添加provider特定的中间件
*/
function addProviderSpecificMiddlewares(builder: AiSdkMiddlewareBuilder, config: AiSdkMiddlewareConfig): void {
if (!config.provider) return
// 根据不同provider添加特定中间件
switch (config.provider.type) {
case 'anthropic':
// Anthropic特定中间件
break
case 'openai':
// OpenAI特定中间件
break
case 'gemini':
// Gemini特定中间件
break
default:
// 其他provider的通用处理
break
}
}
/**
* 添加模型特定的中间件
*/
function addModelSpecificMiddlewares(builder: AiSdkMiddlewareBuilder, config: AiSdkMiddlewareConfig): void {
if (!config.model) return
// 可以根据模型ID或特性添加特定中间件
// 例如:图像生成模型、多模态模型等
// 示例:某些模型需要特殊处理
if (config.model.id.includes('dalle') || config.model.id.includes('midjourney')) {
// 图像生成相关中间件
}
}
/**
* 创建一个预配置的中间件建造者
*/
export function createAiSdkMiddlewareBuilder(): AiSdkMiddlewareBuilder {
return new AiSdkMiddlewareBuilder()
}
/**
* 创建一个带有默认中间件的建造者
*/
export function createDefaultAiSdkMiddlewareBuilder(config: AiSdkMiddlewareConfig): AiSdkMiddlewareBuilder {
const builder = new AiSdkMiddlewareBuilder()
const defaultMiddlewares = buildAiSdkMiddlewares(config)
defaultMiddlewares.forEach((middleware) => {
builder.add(middleware)
})
return builder
}

View File

@@ -0,0 +1,140 @@
# AI SDK 中间件建造者
## 概述
`AiSdkMiddlewareBuilder` 是一个用于动态构建 AI SDK 中间件数组的建造者模式实现。它可以根据不同的条件如流式输出、思考模型、provider类型等自动构建合适的中间件组合。
## 使用方式
### 基本用法
```typescript
import { buildAiSdkMiddlewares, type AiSdkMiddlewareConfig } from './AiSdkMiddlewareBuilder'
// 配置中间件参数
const config: AiSdkMiddlewareConfig = {
streamOutput: false, // 非流式输出
onChunk: chunkHandler, // chunk回调函数
model: currentModel, // 当前模型
provider: currentProvider, // 当前provider
enableReasoning: true, // 启用推理
enableTool: false, // 禁用工具
enableWebSearch: false // 禁用网页搜索
}
// 构建中间件数组
const middlewares = buildAiSdkMiddlewares(config)
// 创建带有中间件的客户端
const client = createClient(providerId, options, middlewares)
```
### 手动构建
```typescript
import { AiSdkMiddlewareBuilder, createAiSdkMiddlewareBuilder } from './AiSdkMiddlewareBuilder'
const builder = createAiSdkMiddlewareBuilder()
// 添加特定中间件
builder.add({
name: 'custom-middleware',
aiSdkMiddlewares: [customMiddleware()]
})
// 检查是否包含某个中间件
if (builder.has('thinking-time')) {
console.log('已包含思考时间中间件')
}
// 移除不需要的中间件
builder.remove('simulate-streaming')
// 构建最终数组
const middlewares = builder.build()
```
## 支持的条件
### 1. 流式输出控制
- **streamOutput = false**: 自动添加 `simulateStreamingMiddleware`
- **streamOutput = true**: 使用原生流式处理
### 2. 思考模型处理
- **条件**: `onChunk` 存在 && `isReasoningModel(model)` 为 true
- **效果**: 自动添加 `thinkingTimeMiddleware`
### 3. Provider 特定中间件
根据不同的 provider 类型添加特定中间件:
- **anthropic**: Anthropic 特定处理
- **openai**: OpenAI 特定处理
- **gemini**: Gemini 特定处理
### 4. 模型特定中间件
根据模型特性添加中间件:
- **图像生成模型**: 添加图像处理相关中间件
- **多模态模型**: 添加多模态处理中间件
## 扩展指南
### 添加新的条件判断
`buildAiSdkMiddlewares` 函数中添加新的条件:
```typescript
// 例如:添加缓存中间件
if (config.enableCache) {
builder.add({
name: 'cache',
aiSdkMiddlewares: [cacheMiddleware(config.cacheOptions)]
})
}
```
### 添加 Provider 特定处理
`addProviderSpecificMiddlewares` 函数中添加:
```typescript
case 'custom-provider':
builder.add({
name: 'custom-provider-middleware',
aiSdkMiddlewares: [customProviderMiddleware()]
})
break
```
### 添加模型特定处理
`addModelSpecificMiddlewares` 函数中添加:
```typescript
if (config.model.id.includes('custom-model')) {
builder.add({
name: 'custom-model-middleware',
aiSdkMiddlewares: [customModelMiddleware()]
})
}
```
## 中间件执行顺序
中间件按照添加顺序执行:
1. **simulate-streaming** (如果 streamOutput = false)
2. **thinking-time** (如果是思考模型且有 onChunk)
3. **provider-specific** (根据 provider 类型)
4. **model-specific** (根据模型类型)
## 注意事项
1. 中间件的执行顺序很重要,确保按正确顺序添加
2. 避免添加冲突的中间件
3. 某些中间件可能有依赖关系,需要确保依赖的中间件先添加
4. 建议在开发环境下启用日志,以便调试中间件构建过程

View File

@@ -0,0 +1,67 @@
import { LanguageModelV1Middleware, LanguageModelV1StreamPart } from '@cherrystudio/ai-core'
import { ChunkType, ThinkingCompleteChunk } from '@renderer/types/chunk'
/**
* 一个用于统计 LLM "思考时间"Time to First Token的 AI SDK 中间件。
*
* 工作原理:
* 1. 在 `stream` 方法被调用时,记录一个起始时间。
* 2. 它会创建一个新的 `TransformStream` 来代理原始的流。
* 3. 当第一个数据块 (chunk) 从原始流中到达时,记录结束时间。
* 4. 计算两者之差,即为 "思考时间"
* 这里只处理了thinking_complete
*/
export default function thinkingTimeMiddleware(): LanguageModelV1Middleware {
return {
wrapStream: async ({ doStream }) => {
let hasThinkingContent = false
let thinkingStartTime = 0
let accumulatedThinkingContent = ''
const { stream, ...reset } = await doStream()
const transformStream = new TransformStream<LanguageModelV1StreamPart, any>({
transform(chunk, controller) {
if (chunk.type === 'reasoning' || chunk.type === 'redacted-reasoning') {
if (!hasThinkingContent) {
hasThinkingContent = true
thinkingStartTime = Date.now()
}
accumulatedThinkingContent += chunk.textDelta || ''
} else {
if (hasThinkingContent && thinkingStartTime > 0) {
const thinkingTime = Date.now() - thinkingStartTime
const thinkingCompleteChunk = {
type: 'reasoning-signature',
text: accumulatedThinkingContent,
thinking_millsec: thinkingTime
}
controller.enqueue(thinkingCompleteChunk)
hasThinkingContent = false
thinkingStartTime = 0
accumulatedThinkingContent = ''
}
}
// 将所有 chunk 原样传递下去
controller.enqueue(chunk)
},
flush(controller) {
// 如果流的末尾都是 reasoning也需要发送 complete 事件
if (hasThinkingContent && thinkingStartTime > 0) {
const thinkingTime = Date.now() - thinkingStartTime
const thinkingCompleteChunk: ThinkingCompleteChunk = {
type: ChunkType.THINKING_COMPLETE,
text: accumulatedThinkingContent,
thinking_millsec: thinkingTime
}
controller.enqueue(thinkingCompleteChunk)
}
controller.terminate()
}
})
return {
stream: stream.pipeThrough(transformStream),
...reset
}
}
}
}

View File

@@ -0,0 +1,110 @@
/**
* Cherry Studio 参数转换插件
* 专门处理 Cherry Studio 特有的消息格式、文件处理、Assistant 设置等
*/
import { definePlugin } from '@cherrystudio/ai-core'
import type { Assistant, MCPTool, Message, Model } from '@renderer/types'
import {
buildStreamTextParams,
convertMessagesToSdkMessages,
getCustomParameters,
getTemperature,
getTopP
} from '../transformParameters'
/**
* Cherry Studio 核心转换插件
* 负责将 Cherry Studio 的数据结构转换为 AI SDK 兼容格式
*/
export const cherryStudioTransformPlugin = definePlugin({
name: 'cherry-studio-transform',
/**
* 转换请求参数
* 将 Cherry Studio 的 Assistant + Messages 转换为 AI SDK 格式
*/
transformParams: async (params: any, context) => {
// 检查是否有 Cherry Studio 特有的数据结构
const cherryData = context.metadata?.cherryStudio
if (!cherryData) {
return params // 不是 Cherry Studio 调用,直接返回
}
const { assistant, messages, mcpTools, enableTools } = cherryData
try {
// 1. 转换 Cherry Studio 消息为 AI SDK 消息
const sdkMessages = await convertMessagesToSdkMessages(messages as Message[], assistant.model as Model)
// 2. 构建完整的 AI SDK 参数
const { params: transformedParams } = await buildStreamTextParams(sdkMessages, assistant as Assistant, {
mcpTools: mcpTools as MCPTool[],
enableTools,
requestOptions: {
signal: params.abortSignal,
headers: params.headers
}
})
// 3. 合并原始参数和转换后的参数
return {
...params,
...transformedParams,
// 保留原始的一些关键参数
abortSignal: params.abortSignal,
headers: params.headers
}
} catch (error) {
console.error('Cherry Studio 参数转换失败:', error)
return params // 转换失败时返回原始参数
}
}
})
/**
* Cherry Studio Assistant 设置插件
* 专门处理 Assistant 的温度、TopP、自定义参数等设置
*/
export const cherryStudioSettingsPlugin = definePlugin({
name: 'cherry-studio-settings',
transformParams: async (params: any, context) => {
const cherryData = context.metadata?.cherryStudio
if (!cherryData?.assistant) {
return params
}
const { assistant } = cherryData
const model = assistant.model as Model
return {
...params,
temperature: getTemperature(assistant as Assistant, model),
topP: getTopP(assistant as Assistant, model),
...getCustomParameters(assistant as Assistant)
}
}
})
/**
* 便捷函数:为 Cherry Studio 调用准备上下文元数据
*/
export function createCherryStudioContext(
assistant: Assistant,
messages: Message[],
options: {
mcpTools?: MCPTool[]
enableTools?: boolean
} = {}
) {
return {
cherryStudio: {
assistant,
messages,
mcpTools: options.mcpTools,
enableTools: options.enableTools
}
}
}

View File

@@ -0,0 +1,311 @@
/**
* AI SDK 参数转换模块
* 统一管理从各个 apiClient 提取的参数处理和转换功能
*/
import type { CoreMessage, StreamTextParams } from '@cherrystudio/ai-core'
import {
isGenerateImageModel,
isNotSupportTemperatureAndTopP,
isOpenRouterBuiltInWebSearchModel,
isReasoningModel,
isSupportedDisableGenerationModel,
isSupportedFlexServiceTier,
isSupportedReasoningEffortModel,
isSupportedThinkingTokenModel,
isWebSearchModel
} from '@renderer/config/models'
import { getAssistantSettings, getDefaultModel } from '@renderer/services/AssistantService'
import type { Assistant, MCPTool, Message, Model } from '@renderer/types'
import { FileTypes } from '@renderer/types'
import { findFileBlocks, findImageBlocks, getMainTextContent } from '@renderer/utils/messageUtils/find'
import { buildSystemPrompt } from '@renderer/utils/prompt'
import { defaultTimeout } from '@shared/config/constant'
/**
* 获取温度参数
*/
export function getTemperature(assistant: Assistant, model: Model): number | undefined {
return isNotSupportTemperatureAndTopP(model) ? undefined : assistant.settings?.temperature
}
/**
* 获取 TopP 参数
*/
export function getTopP(assistant: Assistant, model: Model): number | undefined {
return isNotSupportTemperatureAndTopP(model) ? undefined : assistant.settings?.topP
}
/**
* 获取超时设置
*/
export function getTimeout(model: Model): number {
if (isSupportedFlexServiceTier(model)) {
return 15 * 1000 * 60
}
return defaultTimeout
}
/**
* 构建系统提示词
*/
export async function buildSystemPromptWithTools(
prompt: string,
mcpTools?: MCPTool[],
assistant?: Assistant
): Promise<string> {
return await buildSystemPrompt(prompt, mcpTools, assistant)
}
// /**
// * 转换 MCP 工具为 AI SDK 工具格式
// * 注意:这里返回通用格式,实际使用时需要根据具体 provider 转换
// TODO: 需要使用ai-sdk的mcp
// */
// export function convertMcpToolsToSdkTools(mcpTools: MCPTool[]): Pick<StreamTextParams, 'tools'> {
// return mcpTools.map((tool) => ({
// type: 'function',
// function: {
// name: tool.id,
// description: tool.description,
// parameters: tool.inputSchema || {}
// }
// }))
// }
/**
* 提取文件内容
*/
export async function extractFileContent(message: Message): Promise<string> {
const fileBlocks = findFileBlocks(message)
if (fileBlocks.length > 0) {
const textFileBlocks = fileBlocks.filter(
(fb) => fb.file && [FileTypes.TEXT, FileTypes.DOCUMENT].includes(fb.file.type)
)
if (textFileBlocks.length > 0) {
let text = ''
const divider = '\n\n---\n\n'
for (const fileBlock of textFileBlocks) {
const file = fileBlock.file
const fileContent = (await window.api.file.read(file.id + file.ext)).trim()
const fileNameRow = 'file: ' + file.origin_name + '\n\n'
text = text + fileNameRow + fileContent + divider
}
return text
}
}
return ''
}
/**
* 转换消息为 AI SDK 参数格式
* 基于 OpenAI 格式的通用转换,支持文本、图片和文件
*/
export async function convertMessageToSdkParam(message: Message, isVisionModel = false): Promise<any> {
const content = getMainTextContent(message)
const fileBlocks = findFileBlocks(message)
const imageBlocks = findImageBlocks(message)
// 简单消息(无文件无图片)
if (fileBlocks.length === 0 && imageBlocks.length === 0) {
return {
role: message.role === 'system' ? 'user' : message.role,
content
}
}
// 复杂消息(包含文件或图片)
const parts: any[] = []
if (content) {
parts.push({ type: 'text', text: content })
}
// 处理图片(仅在支持视觉的模型中)
if (isVisionModel) {
for (const imageBlock of imageBlocks) {
if (imageBlock.file) {
try {
const image = await window.api.file.base64Image(imageBlock.file.id + imageBlock.file.ext)
parts.push({
type: 'image_url',
image_url: { url: image.data }
})
} catch (error) {
console.warn('Failed to load image:', error)
}
} else if (imageBlock.url && imageBlock.url.startsWith('data:')) {
parts.push({
type: 'image_url',
image_url: { url: imageBlock.url }
})
}
}
}
// 处理文件
for (const fileBlock of fileBlocks) {
const file = fileBlock.file
if (!file) continue
if ([FileTypes.TEXT, FileTypes.DOCUMENT].includes(file.type)) {
try {
const fileContent = await window.api.file.read(file.id + file.ext)
parts.push({
type: 'text',
text: `${file.origin_name}\n${fileContent.trim()}`
})
} catch (error) {
console.warn('Failed to read file:', error)
}
}
}
return {
role: message.role === 'system' ? 'user' : message.role,
content: parts.length === 1 && parts[0].type === 'text' ? parts[0].text : parts
}
}
/**
* 转换 Cherry Studio 消息数组为 AI SDK 消息数组
*/
export async function convertMessagesToSdkMessages(
messages: Message[],
model: Model
): Promise<StreamTextParams['messages']> {
const sdkMessages: StreamTextParams['messages'] = []
const isVision = model.id.includes('vision') || model.id.includes('gpt-4') // 简单的视觉模型检测
for (const message of messages) {
const sdkMessage = await convertMessageToSdkParam(message, isVision)
sdkMessages.push(sdkMessage)
}
return sdkMessages
}
/**
* 构建 AI SDK 流式参数
* 这是主要的参数构建函数,整合所有转换逻辑
*/
export async function buildStreamTextParams(
sdkMessages: StreamTextParams['messages'],
assistant: Assistant,
options: {
mcpTools?: MCPTool[]
enableTools?: boolean
requestOptions?: {
signal?: AbortSignal
timeout?: number
headers?: Record<string, string>
}
} = {}
): Promise<{ params: StreamTextParams; modelId: string }> {
const { mcpTools, enableTools = false } = options
const model = assistant.model || getDefaultModel()
const { maxTokens, reasoning_effort } = getAssistantSettings(assistant)
const enableReasoning =
((isSupportedThinkingTokenModel(model) || isSupportedReasoningEffortModel(model)) &&
reasoning_effort !== undefined) ||
(isReasoningModel(model) && (!isSupportedThinkingTokenModel(model) || !isSupportedReasoningEffortModel(model)))
const enableWebSearch =
(assistant.enableWebSearch && isWebSearchModel(model)) ||
isOpenRouterBuiltInWebSearchModel(model) ||
model.id.includes('sonar') ||
false
const enableGenerateImage =
isGenerateImageModel(model) &&
(isSupportedDisableGenerationModel(model) ? assistant.enableGenerateImage || false : true)
// 构建系统提示
let systemPrompt = assistant.prompt || ''
if (mcpTools && mcpTools.length > 0) {
systemPrompt = await buildSystemPromptWithTools(systemPrompt, mcpTools, assistant)
}
// 构建基础参数
const params: StreamTextParams = {
messages: sdkMessages,
maxTokens: maxTokens || 1000,
temperature: getTemperature(assistant, model),
topP: getTopP(assistant, model),
system: systemPrompt || undefined,
abortSignal: options.requestOptions?.signal,
headers: options.requestOptions?.headers,
// 随便填着,后面再改
providerOptions: {
reasoning: {
enabled: enableReasoning
},
webSearch: {
enabled: enableWebSearch
},
generateImage: {
enabled: enableGenerateImage
}
},
...getCustomParameters(assistant)
}
// 添加工具(如果启用且有工具)
if (enableTools && mcpTools && mcpTools.length > 0) {
// TODO: 暂时注释掉工具支持,等类型问题解决后再启用
// params.tools = convertMcpToolsToSdkTools(mcpTools)
}
return { params, modelId: model.id }
}
/**
* 构建非流式的 generateText 参数
*/
export async function buildGenerateTextParams(
messages: CoreMessage[],
assistant: Assistant,
options: {
mcpTools?: MCPTool[]
enableTools?: boolean
} = {}
): Promise<any> {
// 复用流式参数的构建逻辑
return await buildStreamTextParams(messages, assistant, options)
}
/**
* 获取自定义参数
* 从 assistant 设置中提取自定义参数
*/
export function getCustomParameters(assistant: Assistant): Record<string, any> {
return (
assistant?.settings?.customParameters?.reduce((acc, param) => {
if (!param.name?.trim()) {
return acc
}
if (param.type === 'json') {
const value = param.value as string
if (value === 'undefined') {
return { ...acc, [param.name]: undefined }
}
try {
return { ...acc, [param.name]: JSON.parse(value) }
} catch {
return { ...acc, [param.name]: value }
}
}
return {
...acc,
[param.name]: param.value
}
}, {}) || {}
)
}

View File

@@ -1,255 +1,252 @@
/**
* 职责提供原子化的、无状态的API调用函数
*/
import { StreamTextParams } from '@cherrystudio/ai-core'
import { AiSdkMiddlewareConfig } from '@renderer/aiCore/middleware/aisdk/AiSdkMiddlewareBuilder'
import { CompletionsParams } from '@renderer/aiCore/middleware/schemas'
import Logger from '@renderer/config/logger'
import { buildStreamTextParams } from '@renderer/aiCore/transformParameters'
import {
isEmbeddingModel,
isGenerateImageModel,
isOpenRouterBuiltInWebSearchModel,
isReasoningModel,
isSupportedDisableGenerationModel,
isSupportedReasoningEffortModel,
isSupportedThinkingTokenModel,
isWebSearchModel
isSupportedThinkingTokenModel
} from '@renderer/config/models'
import {
SEARCH_SUMMARY_PROMPT,
SEARCH_SUMMARY_PROMPT_KNOWLEDGE_ONLY,
SEARCH_SUMMARY_PROMPT_WEB_ONLY
} from '@renderer/config/prompts'
import { getStoreSetting } from '@renderer/hooks/useSettings'
import i18n from '@renderer/i18n'
import {
Assistant,
ExternalToolResult,
KnowledgeReference,
MCPTool,
Model,
Provider,
WebSearchResponse,
WebSearchSource
} from '@renderer/types'
import { Assistant, MCPTool, Model, Provider } from '@renderer/types'
import { type Chunk, ChunkType } from '@renderer/types/chunk'
import { Message } from '@renderer/types/newMessage'
import { SdkModel } from '@renderer/types/sdk'
import { removeSpecialCharactersForTopicName } from '@renderer/utils'
import { isAbortError } from '@renderer/utils/error'
import { extractInfoFromXML, ExtractResults } from '@renderer/utils/extract'
import { findFileBlocks, getMainTextContent } from '@renderer/utils/messageUtils/find'
import { findLast, isEmpty, takeRight } from 'lodash'
import { isEmpty, takeRight } from 'lodash'
import AiProvider from '../aiCore'
import AiProviderNew from '../aiCore/index_new'
import store from '../store'
import {
getAssistantProvider,
getAssistantSettings,
getDefaultModel,
getProviderByModel,
getTopNamingModel,
getTranslateModel
} from './AssistantService'
import { getDefaultAssistant } from './AssistantService'
import { processKnowledgeSearch } from './KnowledgeService'
import {
filterContextMessages,
filterEmptyMessages,
filterUsefulMessages,
filterUserRoleStartMessages
} from './MessagesService'
import WebSearchService from './WebSearchService'
// TODO考虑拆开
async function fetchExternalTool(
lastUserMessage: Message,
assistant: Assistant,
onChunkReceived: (chunk: Chunk) => void,
lastAnswer?: Message
): Promise<ExternalToolResult> {
// 可能会有重复?
const knowledgeBaseIds = assistant.knowledge_bases?.map((base) => base.id)
const hasKnowledgeBase = !isEmpty(knowledgeBaseIds)
const knowledgeRecognition = assistant.knowledgeRecognition || 'on'
const webSearchProvider = WebSearchService.getWebSearchProvider(assistant.webSearchProviderId)
// // TODO考虑拆开
// async function fetchExternalTool(
// lastUserMessage: Message,
// assistant: Assistant,
// onChunkReceived: (chunk: Chunk) => void,
// lastAnswer?: Message
// ) {
// // 可能会有重复?
// const knowledgeBaseIds = assistant.knowledge_bases?.map((base) => base.id)
// const hasKnowledgeBase = !isEmpty(knowledgeBaseIds)
// const knowledgeRecognition = assistant.knowledgeRecognition || 'on'
// const webSearchProvider = WebSearchService.getWebSearchProvider(assistant.webSearchProviderId)
// 使用外部搜索工具
const shouldWebSearch = !!assistant.webSearchProviderId && webSearchProvider !== null
const shouldKnowledgeSearch = hasKnowledgeBase
// // 使用外部搜索工具
// const shouldWebSearch = !!assistant.webSearchProviderId && webSearchProvider !== null
// const shouldKnowledgeSearch = hasKnowledgeBase
// 在工具链开始时发送进度通知
const willUseTools = shouldWebSearch || shouldKnowledgeSearch
if (willUseTools) {
onChunkReceived({ type: ChunkType.EXTERNEL_TOOL_IN_PROGRESS })
}
// // 在工具链开始时发送进度通知
// const willUseTools = shouldWebSearch || shouldKnowledgeSearch
// if (willUseTools) {
// onChunkReceived({ type: ChunkType.EXTERNEL_TOOL_IN_PROGRESS })
// }
// --- Keyword/Question Extraction Function ---
const extract = async (): Promise<ExtractResults | undefined> => {
if (!lastUserMessage) return undefined
// // --- Keyword/Question Extraction Function ---
// const extract = async (): Promise<ExtractResults | undefined> => {
// if (!lastUserMessage) return undefined
// 根据配置决定是否需要提取
const needWebExtract = shouldWebSearch
const needKnowledgeExtract = hasKnowledgeBase && knowledgeRecognition === 'on'
// // 根据配置决定是否需要提取
// const needWebExtract = shouldWebSearch
// const needKnowledgeExtract = hasKnowledgeBase && knowledgeRecognition === 'on'
if (!needWebExtract && !needKnowledgeExtract) return undefined
// if (!needWebExtract && !needKnowledgeExtract) return undefined
let prompt: string
if (needWebExtract && !needKnowledgeExtract) {
prompt = SEARCH_SUMMARY_PROMPT_WEB_ONLY
} else if (!needWebExtract && needKnowledgeExtract) {
prompt = SEARCH_SUMMARY_PROMPT_KNOWLEDGE_ONLY
} else {
prompt = SEARCH_SUMMARY_PROMPT
}
// let prompt: string
// if (needWebExtract && !needKnowledgeExtract) {
// prompt = SEARCH_SUMMARY_PROMPT_WEB_ONLY
// } else if (!needWebExtract && needKnowledgeExtract) {
// prompt = SEARCH_SUMMARY_PROMPT_KNOWLEDGE_ONLY
// } else {
// prompt = SEARCH_SUMMARY_PROMPT
// }
const summaryAssistant = getDefaultAssistant()
summaryAssistant.model = assistant.model || getDefaultModel()
summaryAssistant.prompt = prompt
// const summaryAssistant = getDefaultAssistant()
// summaryAssistant.model = assistant.model || getDefaultModel()
// summaryAssistant.prompt = prompt
try {
const result = await fetchSearchSummary({
messages: lastAnswer ? [lastAnswer, lastUserMessage] : [lastUserMessage],
assistant: summaryAssistant
})
// try {
// const result = await fetchSearchSummary({
// messages: lastAnswer ? [lastAnswer, lastUserMessage] : [lastUserMessage],
// assistant: summaryAssistant
// })
if (!result) return getFallbackResult()
// if (!result) return getFallbackResult()
const extracted = extractInfoFromXML(result.getText())
// 根据需求过滤结果
return {
websearch: needWebExtract ? extracted?.websearch : undefined,
knowledge: needKnowledgeExtract ? extracted?.knowledge : undefined
}
} catch (e: any) {
console.error('extract error', e)
if (isAbortError(e)) throw e
return getFallbackResult()
}
}
// const extracted = extractInfoFromXML(result.getText())
// // 根据需求过滤结果
// return {
// websearch: needWebExtract ? extracted?.websearch : undefined,
// knowledge: needKnowledgeExtract ? extracted?.knowledge : undefined
// }
// } catch (e: any) {
// console.error('extract error', e)
// if (isAbortError(e)) throw e
// return getFallbackResult()
// }
// }
const getFallbackResult = (): ExtractResults => {
const fallbackContent = getMainTextContent(lastUserMessage)
return {
websearch: shouldWebSearch ? { question: [fallbackContent || 'search'] } : undefined,
knowledge: shouldKnowledgeSearch
? {
question: [fallbackContent || 'search'],
rewrite: fallbackContent
}
: undefined
}
}
// const getFallbackResult = (): ExtractResults => {
// const fallbackContent = getMainTextContent(lastUserMessage)
// return {
// websearch: shouldWebSearch ? { question: [fallbackContent || 'search'] } : undefined,
// knowledge: shouldKnowledgeSearch
// ? {
// question: [fallbackContent || 'search'],
// rewrite: fallbackContent
// }
// : undefined
// }
// }
// --- Web Search Function ---
const searchTheWeb = async (extractResults: ExtractResults | undefined): Promise<WebSearchResponse | undefined> => {
if (!shouldWebSearch) return
// // --- Web Search Function ---
// const searchTheWeb = async (extractResults: ExtractResults | undefined): Promise<WebSearchResponse | undefined> => {
// if (!shouldWebSearch) return
// Add check for extractResults existence early
if (!extractResults?.websearch) {
console.warn('searchTheWeb called without valid extractResults.websearch')
return
}
// // Add check for extractResults existence early
// if (!extractResults?.websearch) {
// console.warn('searchTheWeb called without valid extractResults.websearch')
// return
// }
if (extractResults.websearch.question[0] === 'not_needed') return
// if (extractResults.websearch.question[0] === 'not_needed') return
// Add check for assistant.model before using it
if (!assistant.model) {
console.warn('searchTheWeb called without assistant.model')
return undefined
}
// // Add check for assistant.model before using it
// if (!assistant.model) {
// console.warn('searchTheWeb called without assistant.model')
// return undefined
// }
try {
// Use the consolidated processWebsearch function
WebSearchService.createAbortSignal(lastUserMessage.id)
return {
results: await WebSearchService.processWebsearch(webSearchProvider!, extractResults),
source: WebSearchSource.WEBSEARCH
}
} catch (error) {
if (isAbortError(error)) throw error
console.error('Web search failed:', error)
return
}
}
// try {
// // Use the consolidated processWebsearch function
// WebSearchService.createAbortSignal(lastUserMessage.id)
// return {
// results: await WebSearchService.processWebsearch(webSearchProvider!, extractResults),
// source: WebSearchSource.WEBSEARCH
// }
// } catch (error) {
// if (isAbortError(error)) throw error
// console.error('Web search failed:', error)
// return
// }
// }
// --- Knowledge Base Search Function ---
const searchKnowledgeBase = async (
extractResults: ExtractResults | undefined
): Promise<KnowledgeReference[] | undefined> => {
if (!hasKnowledgeBase) return
// // --- Knowledge Base Search Function ---
// const searchKnowledgeBase = async (
// extractResults: ExtractResults | undefined
// ): Promise<KnowledgeReference[] | undefined> => {
// if (!hasKnowledgeBase) return
// 知识库搜索条件
let searchCriteria: { question: string[]; rewrite: string }
if (knowledgeRecognition === 'off') {
const directContent = getMainTextContent(lastUserMessage)
searchCriteria = { question: [directContent || 'search'], rewrite: directContent }
} else {
// auto mode
if (!extractResults?.knowledge) {
console.warn('searchKnowledgeBase: No valid search criteria in auto mode')
return
}
searchCriteria = extractResults.knowledge
}
// // 知识库搜索条件
// let searchCriteria: { question: string[]; rewrite: string }
// if (knowledgeRecognition === 'off') {
// const directContent = getMainTextContent(lastUserMessage)
// searchCriteria = { question: [directContent || 'search'], rewrite: directContent }
// } else {
// // auto mode
// if (!extractResults?.knowledge) {
// console.warn('searchKnowledgeBase: No valid search criteria in auto mode')
// return
// }
// searchCriteria = extractResults.knowledge
// }
if (searchCriteria.question[0] === 'not_needed') return
// if (searchCriteria.question[0] === 'not_needed') return
try {
const tempExtractResults: ExtractResults = {
websearch: undefined,
knowledge: searchCriteria
}
// Attempt to get knowledgeBaseIds from the main text block
// NOTE: This assumes knowledgeBaseIds are ONLY on the main text block
// NOTE: processKnowledgeSearch needs to handle undefined ids gracefully
// const mainTextBlock = mainTextBlocks
// ?.map((blockId) => store.getState().messageBlocks.entities[blockId])
// .find((block) => block?.type === MessageBlockType.MAIN_TEXT) as MainTextMessageBlock | undefined
return await processKnowledgeSearch(tempExtractResults, knowledgeBaseIds)
} catch (error) {
console.error('Knowledge base search failed:', error)
return
}
}
// try {
// const tempExtractResults: ExtractResults = {
// websearch: undefined,
// knowledge: searchCriteria
// }
// // Attempt to get knowledgeBaseIds from the main text block
// // NOTE: This assumes knowledgeBaseIds are ONLY on the main text block
// // NOTE: processKnowledgeSearch needs to handle undefined ids gracefully
// // const mainTextBlock = mainTextBlocks
// // ?.map((blockId) => store.getState().messageBlocks.entities[blockId])
// // .find((block) => block?.type === MessageBlockType.MAIN_TEXT) as MainTextMessageBlock | undefined
// return await processKnowledgeSearch(tempExtractResults, knowledgeBaseIds)
// } catch (error) {
// console.error('Knowledge base search failed:', error)
// return
// }
// }
// --- Execute Extraction and Searches ---
let extractResults: ExtractResults | undefined
// // --- Execute Extraction and Searches ---
// let extractResults: ExtractResults | undefined
try {
// 根据配置决定是否需要提取
if (shouldWebSearch || hasKnowledgeBase) {
extractResults = await extract()
Logger.log('[fetchExternalTool] Extraction results:', extractResults)
}
// try {
// // 根据配置决定是否需要提取
// if (shouldWebSearch || hasKnowledgeBase) {
// extractResults = await extract()
// Logger.log('[fetchExternalTool] Extraction results:', extractResults)
// }
let webSearchResponseFromSearch: WebSearchResponse | undefined
let knowledgeReferencesFromSearch: KnowledgeReference[] | undefined
// let webSearchResponseFromSearch: WebSearchResponse | undefined
// let knowledgeReferencesFromSearch: KnowledgeReference[] | undefined
// 并行执行搜索
if (shouldWebSearch || shouldKnowledgeSearch) {
;[webSearchResponseFromSearch, knowledgeReferencesFromSearch] = await Promise.all([
searchTheWeb(extractResults),
searchKnowledgeBase(extractResults)
])
}
// // 并行执行搜索
// if (shouldWebSearch || shouldKnowledgeSearch) {
// ;[webSearchResponseFromSearch, knowledgeReferencesFromSearch] = await Promise.all([
// searchTheWeb(extractResults),
// searchKnowledgeBase(extractResults)
// ])
// }
// 存储搜索结果
if (lastUserMessage) {
if (webSearchResponseFromSearch) {
window.keyv.set(`web-search-${lastUserMessage.id}`, webSearchResponseFromSearch)
}
if (knowledgeReferencesFromSearch) {
window.keyv.set(`knowledge-search-${lastUserMessage.id}`, knowledgeReferencesFromSearch)
}
}
// // 存储搜索结果
// if (lastUserMessage) {
// if (webSearchResponseFromSearch) {
// window.keyv.set(`web-search-${lastUserMessage.id}`, webSearchResponseFromSearch)
// }
// if (knowledgeReferencesFromSearch) {
// window.keyv.set(`knowledge-search-${lastUserMessage.id}`, knowledgeReferencesFromSearch)
// }
// }
// 发送工具执行完成通知
if (willUseTools) {
onChunkReceived({
type: ChunkType.EXTERNEL_TOOL_COMPLETE,
external_tool: {
webSearch: webSearchResponseFromSearch,
knowledge: knowledgeReferencesFromSearch
}
})
}
// // 发送工具执行完成通知
// if (willUseTools) {
// onChunkReceived({
// type: ChunkType.EXTERNEL_TOOL_COMPLETE,
// external_tool: {
// webSearch: webSearchResponseFromSearch,
// knowledge: knowledgeReferencesFromSearch
// }
// })
// }
// } catch (error) {
// if (isAbortError(error)) throw error
// console.error('Tool execution failed:', error)
// // 发送错误状态
// if (willUseTools) {
// onChunkReceived({
// type: ChunkType.EXTERNEL_TOOL_COMPLETE,
// external_tool: {
// webSearch: undefined,
// knowledge: undefined
// }
// })
// }
// return { mcpTools: [] }
// }
// }
export async function fetchMcpTools(assistant: Assistant) {
// Get MCP tools (Fix duplicate declaration)
let mcpTools: MCPTool[] = [] // Initialize as empty array
const allMcpServers = store.getState().mcp.servers || []
@@ -279,101 +276,46 @@ async function fetchExternalTool(
}
}
return { mcpTools }
} catch (error) {
if (isAbortError(error)) throw error
console.error('Tool execution failed:', error)
// 发送错误状态
if (willUseTools) {
onChunkReceived({
type: ChunkType.EXTERNEL_TOOL_COMPLETE,
external_tool: {
webSearch: undefined,
knowledge: undefined
}
})
}
return { mcpTools: [] }
}
return mcpTools
}
export async function fetchChatCompletion({
messages,
assistant,
options,
onChunkReceived
}: {
messages: Message[]
messages: StreamTextParams['messages']
assistant: Assistant
onChunkReceived: (chunk: Chunk) => void
// TODO
// onChunkStatus: (status: 'searching' | 'processing' | 'success' | 'error') => void
}) {
console.log('fetchChatCompletion', messages, assistant)
const provider = getAssistantProvider(assistant)
const AI = new AiProvider(provider)
// Make sure that 'Clear Context' works for all scenarios including external tool and normal chat.
messages = filterContextMessages(messages)
const lastUserMessage = findLast(messages, (m) => m.role === 'user')
const lastAnswer = findLast(messages, (m) => m.role === 'assistant')
if (!lastUserMessage) {
console.error('fetchChatCompletion returning early: Missing lastUserMessage or lastAnswer')
return
options: {
signal?: AbortSignal
timeout?: number
headers?: Record<string, string>
}
// try {
// NOTE: The search results are NOT added to the messages sent to the AI here.
// They will be retrieved and used by the messageThunk later to create CitationBlocks.
const { mcpTools } = await fetchExternalTool(lastUserMessage, assistant, onChunkReceived, lastAnswer)
const model = assistant.model || getDefaultModel()
onChunkReceived: (chunk: Chunk) => void
}) {
const provider = getAssistantProvider(assistant)
const AI = new AiProviderNew(provider)
const { maxTokens, contextCount } = getAssistantSettings(assistant)
const mcpTools = await fetchMcpTools(assistant)
const filteredMessages = filterUsefulMessages(messages)
// 使用 transformParameters 模块构建参数
const { params: aiSdkParams, modelId } = await buildStreamTextParams(messages, assistant, {
mcpTools: mcpTools,
requestOptions: options
})
const _messages = filterUserRoleStartMessages(
filterEmptyMessages(filterContextMessages(takeRight(filteredMessages, contextCount + 2))) // 取原来几个provider的最大值
)
const enableReasoning =
((isSupportedThinkingTokenModel(model) || isSupportedReasoningEffortModel(model)) &&
assistant.settings?.reasoning_effort !== undefined) ||
(isReasoningModel(model) && (!isSupportedThinkingTokenModel(model) || !isSupportedReasoningEffortModel(model)))
const enableWebSearch =
(assistant.enableWebSearch && isWebSearchModel(model)) ||
isOpenRouterBuiltInWebSearchModel(model) ||
model.id.includes('sonar') ||
false
const enableGenerateImage =
isGenerateImageModel(model) && (isSupportedDisableGenerationModel(model) ? assistant.enableGenerateImage : true)
const middlewareConfig: AiSdkMiddlewareConfig = {
streamOutput: assistant.settings?.streamOutput ?? true,
onChunk: onChunkReceived,
model: assistant.model,
provider: provider,
enableReasoning: assistant.settings?.reasoning_effort !== undefined
}
// --- Call AI Completions ---
onChunkReceived({ type: ChunkType.LLM_RESPONSE_CREATED })
if (enableWebSearch) {
onChunkReceived({ type: ChunkType.LLM_WEB_SEARCH_IN_PROGRESS })
}
await AI.completions(
{
callType: 'chat',
messages: _messages,
assistant,
onChunk: onChunkReceived,
mcpTools: mcpTools,
maxTokens,
streamOutput: assistant.settings?.streamOutput || false,
enableReasoning,
enableWebSearch,
enableGenerateImage
},
{
streamOutput: assistant.settings?.streamOutput || false
}
)
await AI.completions(modelId, aiSdkParams, middlewareConfig)
}
interface FetchTranslateProps {

View File

@@ -0,0 +1,34 @@
import { StreamTextParams } from '@cherrystudio/ai-core'
import { convertMessagesToSdkMessages } from '@renderer/aiCore/transformParameters'
import { Assistant, Message } from '@renderer/types'
import { isEmpty, takeRight } from 'lodash'
import { getAssistantSettings, getDefaultModel } from './AssistantService'
import {
filterContextMessages,
filterEmptyMessages,
filterUsefulMessages,
filterUserRoleStartMessages
} from './MessagesService'
export class ConversationService {
static async prepareMessagesForLlm(messages: Message[], assistant: Assistant): Promise<StreamTextParams['messages']> {
const { contextCount } = getAssistantSettings(assistant)
// This logic is extracted from the original ApiService.fetchChatCompletion
const contextMessages = filterContextMessages(messages)
const filteredMessages = filterUsefulMessages(contextMessages)
// Take the last `contextCount` messages, plus 2 to allow for a final user/assistant exchange.
const finalMessages = filterUserRoleStartMessages(
filterEmptyMessages(takeRight(filteredMessages, contextCount + 2))
)
return await convertMessagesToSdkMessages(finalMessages, assistant.model || getDefaultModel())
}
static needsWebSearch(assistant: Assistant): boolean {
return !!assistant.webSearchProviderId
}
static needsKnowledgeSearch(assistant: Assistant): boolean {
return !isEmpty(assistant.knowledge_bases)
}
}

View File

@@ -0,0 +1,54 @@
import { Assistant, Message } from '@renderer/types'
import { Chunk, ChunkType } from '@renderer/types/chunk'
import { fetchChatCompletion } from './ApiService'
import { ConversationService } from './ConversationService'
/**
* The request object for handling a user message.
*/
export interface OrchestrationRequest {
messages: Message[]
assistant: Assistant
options: {
signal?: AbortSignal
timeout?: number
headers?: Record<string, string>
}
}
/**
* The OrchestrationService is responsible for orchestrating the different services
* to handle a user's message. It contains the core logic of the application.
*/
export class OrchestrationService {
constructor() {
// In the future, this could be a singleton, but for now, a new instance is fine.
// this.conversationService = new ConversationService()
}
/**
* This is the core method to handle user messages.
* It takes the message context and an events object for callbacks,
* and orchestrates the call to the LLM.
* The logic is moved from `messageThunk.ts`.
* @param request The orchestration request containing messages and assistant info.
* @param events A set of callbacks to report progress and results to the UI layer.
*/
async handleUserMessage(request: OrchestrationRequest, onChunkReceived: (chunk: Chunk) => void) {
const { messages, assistant } = request
try {
const llmMessages = await ConversationService.prepareMessagesForLlm(messages, assistant)
await fetchChatCompletion({
messages: llmMessages,
assistant: assistant,
options: request.options,
onChunkReceived
})
} catch (error: any) {
onChunkReceived({ type: ChunkType.ERROR, error })
}
}
}

View File

@@ -1,9 +1,9 @@
import db from '@renderer/databases'
import { autoRenameTopic } from '@renderer/hooks/useTopic'
import { fetchChatCompletion } from '@renderer/services/ApiService'
import { EVENT_NAMES, EventEmitter } from '@renderer/services/EventService'
import FileManager from '@renderer/services/FileManager'
import { NotificationService } from '@renderer/services/NotificationService'
import { OrchestrationService } from '@renderer/services/OrchestrateService'
import { createStreamProcessor, type StreamProcessorCallbacks } from '@renderer/services/StreamProcessingService'
import { estimateMessagesUsage } from '@renderer/services/TokenService'
import store from '@renderer/store'
@@ -147,7 +147,7 @@ const getBlockThrottler = (id: string) => {
}
const rafId = requestAnimationFrame(() => {
store.dispatch(updateOneBlock({ id, changes: blockUpdate }))
// store.dispatch(updateOneBlock({ id, changes: blockUpdate }))
blockUpdateRafs.delete(id)
})
@@ -166,6 +166,7 @@ const getBlockThrottler = (id: string) => {
*/
const throttledBlockUpdate = (id: string, blockUpdate: any) => {
const throttler = getBlockThrottler(id)
store.dispatch(updateOneBlock({ id, changes: blockUpdate }))
throttler(blockUpdate)
}
@@ -829,15 +830,26 @@ const fetchAndProcessAssistantResponseImpl = async (
const streamProcessorCallbacks = createStreamProcessor(callbacks)
const startTime = Date.now()
await fetchChatCompletion({
const orchestrationService = new OrchestrationService()
await orchestrationService.handleUserMessage(
{
messages: messagesForContext,
assistant: assistant,
onChunkReceived: streamProcessorCallbacks
})
assistant,
options: {
timeout: 30000
}
},
streamProcessorCallbacks
)
} catch (error: any) {
console.error('Error fetching chat completion:', error)
if (assistantMessage) {
callbacks.onError?.(error)
console.error('Error in fetchAndProcessAssistantResponseImpl:', error)
// The main error handling is now delegated to OrchestrationService,
// which calls the `onError` callback. This catch block is for
// any errors that might occur outside of that orchestration flow.
if (assistantMessage && callbacks.onError) {
callbacks.onError(error)
} else {
// Fallback if callbacks are not even defined yet
throw error
}
}

View File

@@ -4,7 +4,8 @@
"src/renderer/src/**/*",
"src/preload/*.d.ts",
"local/src/renderer/**/*",
"packages/shared/**/*"
"packages/shared/**/*",
"packages/aiCore/src/**/*"
],
"compilerOptions": {
"composite": true,
@@ -14,7 +15,8 @@
"paths": {
"@renderer/*": ["src/renderer/src/*"],
"@shared/*": ["packages/shared/*"],
"@types": ["src/renderer/src/types/index.ts"]
"@types": ["src/renderer/src/types/index.ts"],
"@cherrystudio/ai-core": ["packages/aiCore/src/"]
}
}
}

1232
yarn.lock

File diff suppressed because it is too large Load Diff