refactor(useSmoothStream): remove unnecessary comments and improve state initialization in Markdown component
- Cleaned up comments in useSmoothStream for clarity.
- Updated displayedContent state initialization in Markdown to handle post-processing conditionally.
* refactor(AiProvider): enhance client compatibility checks and middleware handling
- Updated AiProvider to use a compatibility type check for API clients, improving type safety and middleware management.
- Implemented getClientCompatibilityType in AihubmixAPIClient, NewAPIClient, and OpenAIResponseAPIClient to return actual client types.
- Added support for Hunyuan models in various model checks and updated the ThinkingButton component to reflect these changes.
- Improved logging for middleware construction in AiProvider.
* test(ApiService): add client compatibility type checks for mock API clients
* fix: minimax-m1 reasoning export btw
---------
Co-authored-by: Pleasurecruise <3196812536@qq.com>
* feat: ui switch
* chore: update migration version to 122 and adjust settings topic position
* refactor: replace PinnedApps component with SidebarPinnedApps and SidebarOpenedMinappTabs for improved structure
* feat(i18n): add launchpad apps and minapps translations for multiple languages
* style: update MinAppIcon and IconContainer dimensions for improved UI consistency
* refactor: remove unused SidebarContainer component from AppsPage
* refactor: adjust Navbar padding and enhance search functionality in AgentsPage
* feat(minapps): implement MinApps page and enhance mini app management features
- Added MinAppsPage for managing mini applications.
- Introduced NewAppButton for adding custom mini apps.
- Created MiniAppSettings for configuring mini app settings.
- Enhanced mini app icon management with MiniAppIconsManager.
- Updated Router to include MinAppsPage and replaced AppsPage with MinAppsPage.
- Added translations for new mini app features in multiple languages.
* wip
* refactor: rename App component to MinApp and streamline LaunchpadPage logic
- Renamed App component to MinApp for clarity.
- Removed unnecessary state management in LaunchpadPage.
- Simplified minapp sorting logic by directly using openedKeepAliveMinapps.
* feat(i18n): update translations for multiple languages and restructure title entries
- Added missing title entries for various sections in English, Japanese, Russian, Chinese (Simplified and Traditional).
- Restructured the launchpad and minapp translations for better organization.
- Enhanced navbar display settings translations across all supported languages.
* feat: add header prop to DraggableVirtualList and implement Add Topic button in TopicsTab
- Introduced a new `header` prop in the DraggableVirtualList component to allow custom header content.
- Added an Add Topic button in the TopicsTab with a corresponding styled component and translation support for multiple languages.
- Updated styles in AssistantsTab and adjusted overflow behavior in Tabs index for better UI experience.
* style: adjust margins and max-width for improved layout in various components
- Updated margin-top in HtmlArtifactsCard for consistent spacing.
- Set max-width in MessageGroup to enhance responsiveness based on navbar position.
- Modified Add Topic button in TopicsTab to emit an event for better functionality.
* fix: correct state property name in migration for navbar position
- Updated the migration logic to set the correct state property from `topicPosition` to `navbarPosition` for proper configuration handling.
* fix: adjust traffic light position and navbar height for improved UI consistency
- Updated traffic light position in WindowService to enhance layout.
- Adjusted navbar height in color.scss for better alignment across components.
- Modified TabContainer to track last settings path and improve navigation handling.
* style: update AddTopicButton styling for improved hover effect in TopicsTab
- Changed AddTopicButton from a button to a div for better styling flexibility.
- Removed dashed border and added background color on hover for enhanced user experience.
- Retained border-radius for consistent design across components.
* feat: add TextBadge component and integrate into Display and Memory settings
- Introduced a new TextBadge component for displaying styled badges.
- Integrated TextBadge into DisplaySettings to highlight the navbar title as "New".
- Replaced inline badge implementation in MemorySettings with the new TextBadge component for consistency and improved maintainability.
* fix: adjust tab and navbar styling for improved UI consistency
- Increased height of title bar overlays for better visual balance.
- Updated tab creation logic to prevent duplicate tabs for specific paths.
- Modified tab icon and close button sizes for a more compact design.
- Enhanced tab spacing and padding for improved layout across components.
* style: update PinnedMinapps component for improved UI consistency
- Increased icon size and adjusted border radius for better visual appeal.
- Modified TopNavContainer padding and margin for enhanced layout.
- Reduced dimensions of TopNavIcon for a more compact design.
* refactor: enhance TabsContainer logic and styling for improved tab management
- Introduced a new `removeSpecialTabs` function to manage special tab removal more effectively.
- Updated tab filtering logic to utilize a dedicated `specialTabs` array for better maintainability.
- Adjusted styling in PinnedMinapps for consistent icon sizing and background color improvements.
* style: adjust layout and padding for improved UI consistency in Chat and Inputbar components
- Updated main height calculation in Chat component to account for additional spacing.
- Modified padding in Inputbar component for better alignment when navbar is positioned at the top.
- Ensured consistent minimum height in Tabs component to match updated navbar height calculations.
* refactor: update app menu item text keys for improved localization
- Changed text keys in the app menu items from specific titles to a more generalized 'title' namespace for better consistency and maintainability.
- Ensured that the visual representation of the menu items remains unchanged while enhancing the localization structure.
* refactor: simplify sidebar toggle logic in ChatNavbar and Navbar components
- Removed unnecessary cooldown logic when toggling the visibility of assistants and topics.
- Updated HomePage to conditionally render the Navbar based on the sidebar state for improved UI responsiveness.
* refactor: streamline Chat component and introduce useChatMaxWidth hook
- Consolidated max width calculation logic into a new `useChatMaxWidth` hook for better reusability.
- Removed unused variables and simplified state management in the Chat component.
- Updated MessageGroup to utilize the new `useChatMaxWidth` hook for consistent layout handling.
* refactor: remove FloatingSidebar component and integrate AssistantsDrawer for improved UI management
- Deleted the FloatingSidebar component to streamline the codebase.
- Introduced AssistantsDrawer for managing assistant interactions, enhancing user experience.
- Updated Navbar and ChatNavbar components to utilize AssistantsDrawer instead of FloatingSidebar for better responsiveness and maintainability.
* refactor: implement TabsService for improved tab management functionality
- Introduced TabsService to centralize tab operations, including closing and setting active tabs.
- Updated TabsContainer and LaunchpadPage components to utilize TabsService for closing tabs, enhancing code maintainability.
- Made minor UI adjustments in PinnedMinapps for consistent icon sizing and layout improvements.
* fix: prevent default event behavior when not in fullscreen mode
- Updated WindowService to conditionally call event.preventDefault() only when the main window is not in fullscreen, improving event handling logic.
* refactor: match provider and model using a consistent method
* refactor: use keywords matching across model selectors
* refactor: update match, reuse getFancyProviderName
* refactor: use modelSelectFilter in knowledgebase settings
* refactor: use filter in ModelList
* refactor: add filterModelsByKeywords
* refactor: add getModelSelectOptions
* style: better function names
* fix: update effect dependencies in popup and panel components
Adjusted dependency arrays in HtmlArtifactsPopup and QuickPanelView to ensure correct effect execution. This change improves state synchronization and prevents unnecessary updates.
* refactor: use match in memory settings
* refactor: add avatar to model selector
* refactor: simplify utils, move select options to components
* docs: add comments
* refactor: move filter to SelectOptions
* test: add tests for SelectOptions
* test: remove type mock
* refactor: use match in EditModelsPopup
* refactor: use SelectOptions in SelectProviderModelPopup, add more tests
* fix: api check model select
* refactor: improve websearch rag model select style
* refactor: add a ModelSelector
* test: update tests for ModelSelector
* docs: comments
---------
Co-authored-by: 自由的世界人 <3196812536@qq.com>
* fix: ensure add button is always visible for empty model providers
- Move add button outside of isEmpty(models) condition to fix regression
- Keep manage and health check buttons conditional (only show when models exist)
- Fixes issue where users cannot add first model to custom providers
- Maintains clean UI by hiding management features when no content exists
Resolves the UX blocker introduced in commit 2b0c46bf where all buttons
were hidden for empty providers, preventing users from adding initial models.
* fix: remove isEmpty check to always show model management buttons
Remove isEmpty(models) conditions for manage, search, and health check buttons
to ensure all functionality is available even with empty model lists.
* feat: implement useSmoothStream hook for dynamic text rendering
- Added a new custom hook `useSmoothStream` to manage smooth text streaming with adjustable delays.
- Integrated `useSmoothStream` into the Markdown component to enhance content display during streaming.
- Implemented logic to handle content updates and reset conditions based on block status.
* feat: enhance chunk processing in useSmoothStream hook
- Updated the `addChunk` function to split text into characters for Chinese and words for English using a regular expression.
- Improved text rendering logic to support mixed language content more effectively.
* refactor: improve regular expression for chunk processing in useSmoothStream hook
- Updated the regular expression to enhance text splitting capabilities, allowing for better handling of mixed language content, including Chinese characters and alphanumeric sequences.
* refactor: simplify character processing in useSmoothStream hook
- Replaced the regular expression for character extraction with a direct conversion of the chunk to an array of characters.
- This change streamlines the chunk processing logic, enhancing performance and readability.
* feat: add post-processing capability to Markdown component
- Enhanced the Markdown component to accept an optional post-processing function for text manipulation during streaming.
- Updated MainTextBlock to utilize the new postProcess prop, allowing for dynamic content adjustments based on citation references.
* fix: update mock Markdown component to support post-processing
- Modified the mock implementation of the Markdown component to accept and apply an optional postProcess function, ensuring that the test environment accurately reflects the updated functionality introduced in the previous commit.
* refactor(ProviderSetting): add a backtop to provider setting
* refactor: decouple ModelList from ProviderSetting
* refactor: move modellist to a single dir
* refactor: allow more props for CollapsibleSearchBar
* refactor: split ModelList into ModelList, ModelListGroup and ModelListItem
* refactor: simplify health check types, improve file structure
* refactor: split HealthStatusIndicator from list items
* refactor: better indicator tooltip
* refactor: improve model search, simplify some expressions
* refactor: further simplify ModelList by extracting onHealthCheck
* refactor: remove double scroller from EditModelsPopup
* revert: remove backtop
* fix: i18n order
* refactor: sort buttons
* refactor: move initAppDataDir function to a new utils module
- Updated the import path for initAppDataDir in bootstrap.ts to reflect its new location in the utils/init module.
- Removed the initAppDataDir function and related code from file.ts to streamline the file and improve organization.
* refactor: update import structure in ipc.ts
- Removed the import of updateAppDataConfig from file.ts and added it to the new init module for better organization and clarity in the code structure.
* refactor: rename getConfigPath to getConfigDir and update related references
- Renamed the function getConfigPath to getConfigDir for clarity.
- Updated references to the renamed function in getAppDataPathFromConfig and updateAppDataConfig to reflect the new naming convention.
* refactor: update pdfjs import and improve file filtering in electron-builder configuration
- Changed pdfjs import to a direct import from 'pdfjs-dist' for consistency across modules.
- Updated file filtering in electron-builder.yml to exclude all legacy files from pdfjs-dist instead of just specific ones.
* format code
* fix: fix persistent "Searching..." indicators for o3 model web search
- Add missing LLM_WEB_SEARCH_IN_PROGRESS event in OpenAIAPIClient
- Prevent duplicate CitationBlock creation
- Ensure search status updates correctly after completion
Fixes#8307
* fix: prevent duplicate citation blocks in web search callbacks
- Add checks in onExternalToolInProgress and onLLMWebSearchInProgress
- Return early if citationBlockId already exists
- Fixes persistent "Searching..." indicator for o3 model web search
* chore: update electron to version 37.1.0 and add node-abi dependency
* chore: specify Node.js engine version requirement in package.json
* hotfix: error on deleting assistant (#8190)
fix: error on deleting assistant
* Fix/mcp bug (#8189)
* feat(models): enhance function calling model detection and update migration logic
- Added support for 'gemini-1' in FUNCTION_CALLING_EXCLUDED_MODELS.
- Updated isFunctionCallingModel to handle optional model input.
- Modified migration logic to change tool use mode for assistants using function calling models.
* feat(models): add new models to vision and function calling lists
- Added 'kimi-thinking-preview' to visionAllowedModels.
- Added 'kimi-k2' to FUNCTION_CALLING_MODELS.
- Updated migration logic to ensure compatibility with new model settings.
* refactor(TextChunkMiddleware): streamline text accumulation logic and improve response handling
- Simplified the logic for accumulating text content and updating the internal state.
- Ensured that the final text is consistently used in response callbacks.
- Removed redundant code for handling text completion in the ToolUseExtractionMiddleware.
- Added mock state for MCP tools in tests to enhance coverage for tool use extraction.
* refactor(BaseApiClient): remove unused content extraction utility
- Replaced the usage of getContentWithTools with getMainTextContent in the getMessageContent method.
- Cleaned up imports by removing the unused getContentWithTools function.
* refactor: custom mini app loading logic (#8181)
* refactor: custom mini app loading logic
Replaces try-catch with an explicit file existence check before reading 'custom-minapps.json'. Ensures the file is created with an empty array if it does not exist, improving clarity and error handling.
* refactor: custom mini app loading logic
Simplifies the loading of custom mini apps by removing the explicit file existence check and handling the read failure case directly. If reading the file fails, an empty array is written and returned.
* fix: improve error handling in file reading for custom mini apps
* Revert "feat: optimize minapp cache with LRU (#8160)" (#8205)
This reverts commit f0043b4be5.
* feat: add support for 302AI provider in MCP settings (#7755)
* feat: add support for 302AI provider in MCP settings
- Introduced new provider for 302AI, including token management and server synchronization functionality.
- Updated SyncServersPopup to integrate 302AI provider.
- Added new file for 302AI provider utilities, including token storage and server fetching logic.
* fix: re-merge main
* chore: update check-i18n scripts and remove duplicate keys (#8203)
* chore(version): 1.5.0
* fix: handle mentions when resending message (#7819)
* fix(messageThunk): 修复重置消息时模型未正确继承的问题
* fix(消息重发): 修复重发消息时模型选择逻辑
确保当原始消息模型被提及时才使用该模型,否则使用助手默认模型
* style(PasteService): 统一文件换行符为LF格式
* Revert "style(PasteService): 统一文件换行符为LF格式"
This reverts commit 37a1443b73.
* refactor(messageThunk): 优化消息重发逻辑,分离新旧消息处理
将消息重发逻辑拆分为处理已有消息和新增提及模型消息两部分
简化条件判断,移除冗余代码
* style(messageThunk): 移除多余的空行
* fix(消息重传): 单条无提及消息重传时使用助手模型
当重传单条无提及消息时,使用助手模型进行重传,其他情况保持原有逻辑
* Revert "fix(消息重传): 单条无提及消息重传时使用助手模型"
This reverts commit 2e369174e7.
* fix(消息重发): 修改重发消息时模型设置逻辑
* feat: enhance proxy management and configuration (#8164)
* feat: enhance proxy management and configuration
- Added support for new proxy modes and improved proxy configuration handling.
- Replaced AxiosProxy with direct axios usage for HTTP requests.
- Introduced fetch-socks and undici for better proxy handling.
- Updated IPC and ConfigManager to accommodate new proxy settings.
- Removed deprecated AxiosProxy service to streamline codebase.
* format code
* feat: improve proxy configuration and monitoring
- Introduced a new mechanism to monitor system proxy changes and update configurations accordingly.
- Enhanced the configureProxy method to prevent concurrent executions and added error logging with electron-log.
- Refactored proxy handling logic to streamline the setting of global and session proxies.
- Removed deprecated methods related to proxy management for cleaner code.
* update yarn.lock
* fix: update proxy configuration logic to handle direct mode
- Modified the app's ready event to check for 'direct' mode before configuring the proxy.
- Ensured that the proxy configuration is only applied when necessary, improving efficiency.
* feat: enhance proxy configuration to support authentication
- Added userId and password fields to the proxy configuration for SOCKS connections.
- Improved handling of proxy credentials to allow for authenticated proxy usage.
* refactor: remove deprecated proxy methods and streamline configuration logic
- Eliminated the setProxy and getProxy methods from ConfigManager to simplify the proxy configuration process.
- Updated ProxyManager to initialize with a default proxy configuration and removed unnecessary checks for 'direct' mode during initialization.
- Enhanced logging for proxy configuration changes to improve traceability.
* format code
* feat: enhance WebDav and ProxyManager for self-signed certificate support
- Added handling for self-signed certificates in ProxyManager to allow secure connections with custom agents.
- Updated WebDav configuration to include an https.Agent with rejectUnauthorized set to false, facilitating connections to servers with self-signed certificates.
* delete global setting for rejectUnauthorized
* chore: update dependencies in package.json and yarn.lock
- Upgraded electron from 37.1.0 to 37.2.3.
- Updated electron-vite from 3.1.0 to 4.0.0.
- Various dependency updates in yarn.lock to align with the new versions, including Babel packages and esbuild to 0.25.6.
---------
Co-authored-by: one <wangan.cs@gmail.com>
Co-authored-by: SuYao <sy20010504@gmail.com>
Co-authored-by: 自由的世界人 <3196812536@qq.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Co-authored-by: ⌞L⌝ <151412975+mthezi@users.noreply.github.com>
Co-authored-by: kangfenmao <kangfenmao@qq.com>
Co-authored-by: Phantom <59059173+EurFelux@users.noreply.github.com>
refactor(Logger): enhance logging with environment variable support
- Updated LoggerService to utilize environment variables for filtering logs by level and module in development mode.
- Modified the logging level handling to use constants from the logger configuration.
- Enhanced documentation to include details on using environment variables for log filtering in both English and Chinese documentation files.
- Cleaned up unused type definitions related to logging.
* docs: enhance LoggerService documentation and usage guidelines
- Added details about `initWindowSource` method, emphasizing its return of the LoggerService instance for method chaining.
- Introduced a section on using LoggerService within `worker` threads, highlighting the need to call `initWindowSource` first.
- Updated both English and Chinese documentation files to reflect these changes, ensuring clarity in usage instructions for developers.
* docs: update LoggerService documentation and improve environment checks
- Enhanced documentation for using LoggerService in worker threads, clarifying logging support limitations in main and renderer processes.
- Added environment checks for development and production modes directly in the LoggerService.
- Removed the unused env utility file to streamline the codebase.
* refactor(ShikiStreamService): update highlighter management and improve test assertions
- Modified the highlighter management in ShikiStreamService to clear the reference instead of disposing it directly, as it is now managed by AsyncInitializer.
- Enhanced unit tests to verify the initialization of worker and main highlighters, ensuring that either one is active but not both, and updated assertions related to highlighter disposal.
* fix/selection-not-copy
* fix: abort not copy
* test: add actionUtil test
Update onStream callback to accept content parameter and set copyable content
during streaming instead of only at completion. Removes redundant content
tracking in ActionUtils and properly passes content to callbacks as it's
received. Adds test directory structure for components.
* refactor: improve streaming content handling and fix error states
Refine content handling in ActionUtils by tracking content internally rather than
passing it through onStream callbacks. Properly set error status in message
updates and ensure content is finalized on errors. Fix typo in test filename.
* fix: show error
* chore: remove unuse
* chore: remove console
* refactor: replace console logging with logger service across multiple components
- Updated various files to utilize the logger service instead of console.log for improved logging consistency and error tracking.
- Enhanced logging levels to better categorize messages, including debug and error levels.
- Refactored logging in components such as ApiClientFactory, KnowledgeService, and MemoryProcessor to align with the new logging standards.
* refactor: update logging level in App component from error to info
- Changed the logging level in the App component to provide a more appropriate context for initialization messages, enhancing clarity in the logging output.
* refactor(logging): replace console.log with logger service in middleware and update ESLint comments
- Updated the logging implementation in the createSimpleLoggingMiddleware function to use logger.debug and logger.error instead of console.log and console.error for improved logging consistency.
- Added eslint-disable comments for restricted syntax in preload and useAppInit hooks to suppress warnings.
* chore: update ESLint configuration and LoggerService formatting
- Refactored ESLint configuration to include custom rules for LoggerService, applying them specifically to the src directory while ignoring test and mock files.
- Commented out date formatting options in LoggerService for improved clarity in development logging.
* fix: add eslint-disable comments for restricted syntax in LoggerService
- Added eslint-disable comments to suppress warnings for restricted syntax in LoggerService for both main and renderer services.
- Improved error handling by logging messages when the window source is not initialized in the renderer LoggerService.