- Introduced a new `fadeInWithBlur` keyframe animation in Tailwind CSS for enhanced visual effects.
- Removed inline fade animation styles from the `Markdown` component to streamline rendering.
- Updated the `SmoothFade` function to utilize the new animation, improving the user experience during content transitions.
- Removed `@radix-ui/react-slot` dependency from package.json and corresponding entries in yarn.lock to streamline dependencies.
- Adjusted the `PlaceholderBlock` component's margin styling for improved layout.
- Refactored utility functions by exporting `cn` from `@heroui/react`, enhancing class name management.
- Added `@radix-ui/react-slot` dependency to package.json for improved component composition.
- Introduced a new `Loader` component with various loading styles to enhance user experience during asynchronous operations.
- Updated `PlaceholderBlock` to utilize the new `Loader` component, improving loading state representation.
- Enhanced `Markdown` component to support smooth fade animations based on streaming status, improving visual feedback during content updates.
- Refactored utility functions to include a new `cn` function for class name merging, streamlining component styling.
fix(websearch): handle blocked domains conditionally in web search configurations
- Updated the handling of blocked domains in both Google Vertex and Anthropic web search configurations to only include them if they are present, improving robustness and preventing unnecessary parameters from being passed.
- Commented out all references to the 'cherryin' provider in configuration files.
- Updated the version in the persisted reducer from 157 to 158.
- Added migration logic to remove 'cherryin' from the state during version 158 migration.
* Fix slash menu Shift+Enter newline
* fix: enable Shift+Enter newline in rich editor with slash commands
Fixed an issue where users couldn't create new lines using Shift+Enter when
slash command menu (/foo) was active. The problem was caused by globa
keyboard event handlers intercepting all Enter key variants.
Changes:
- Allow Shift+Enter to pass through QuickPanel event handling
- Add Shift+Enter detection in CommandListPopover to return false
- Implement fallback Shift+Enter handling in command suggestion render
- Remove unused import in AppUpdater.ts
- Convert Chinese comments to English in QuickPanel
- Add test coverage for command suggestion functionality
---------
Co-authored-by: Zhaokun Zhang <zhaokunzhang@Zhaokuns-Air.lan>
- Bump version to 1.6.1 in package.json.
- Add patch for @ai-sdk/google@2.0.14 to address specific issues.
- Update yarn.lock to reflect the new dependency resolution for @ai-sdk/google.
- Modify getModelPath function to accept baseURL parameter for improved flexibility.
- Updated CodeToolsPage to include checks for supported endpoint types for various CLI tools.
- Added 'cherryin' to GEMINI_SUPPORTED_PROVIDERS and updated CLAUDE_SUPPORTED_PROVIDERS to include it.
- Improved logic for determining model compatibility with selected CLI tools, enhancing overall functionality.
- Introduced a helper function to escape strings for AppleScript to ensure proper command execution.
- Updated terminal command definitions to utilize the new escape function, improving compatibility with special characters.
- Adjusted command parameters to use double quotes for directory paths, enhancing consistency and reliability.
* refactor(reasoning): simplify reasoning time tracking by removing unused variables and logic
- Removed hasStartedThinking and reasoningBlockId variables as they are no longer needed.
- Updated onThinkingComplete callback to eliminate final_thinking_millsec parameter, streamlining the function.
* refactor(thinking): streamline thinking millisecond tracking and update event handling
- Removed unused thinking_millsec parameter from onThinkingComplete and adjusted related logic.
- Updated AiSdkToChunkAdapter to simplify reasoning-end event handling by removing unnecessary properties.
- Modified integration tests to reflect changes in thinking event structure.
ci(workflow): only trigger PR CI on non-draft PRs and specific events
Add trigger conditions for PR CI workflow to run on non-draft PRs and specific event types
* fix: 添加 seedThink 标签以支持新的模型识别
* Enable reasoning for SEED-OSS models
- Add SEED-OSS model ID check to reasoning exclusion logic
- Include SEED-OSS models in reasoning model detection
* fix: 更新 reasoning-end 事件处理以使用最终推理内容
- Added isNewApiProvider function to streamline checks for 'new-api' and 'cherryin' providers.
- Updated ApiClientFactory, providerConfig, and various components to utilize isNewApiProvider for improved readability and maintainability.
- Refactored conditional checks across multiple files to replace direct string comparisons with the new utility function.
- Adjusted padding in TabsBar and Navbar components to enhance spacing.
- Updated ItemRenderer and Sortable components to accept itemStyle prop for custom styling.
- Changed NotesSidebar scroll behavior from 'smooth' to 'instant'.
- Modified MCP server card width to 100% for better responsiveness.
- Set wrapperStyle and itemStyle to 100% width in McpServersList for consistent item display.
* feat(minapps): support temporary minapps
* feat(settings): use openSmartMinApp with app logo to open docs sites
* refactor(icons): replace styled img with tailwind
* feat(tab): tighten types
* feat(tab): use minapps cache and log missing entries
* test(icons): update MinAppIcon snapshot to reflect class and attrs
* fix(assistant): enforce id requirement when updating assistant
Ensure assistant id is always provided when updating assistant properties by making it a required field in the update payload. This prevents potential bugs where updates might be applied to wrong assistants.
* refactor(useAssistant): simplify updateAssistant callback by removing redundant id
Update InputbarTools to use simplified callback signature
- Adjusted the width of the CardContainer to dynamically calculate based on viewport width.
- Changed the layout of the McpServersList from grid to list, with a vertical orientation and updated styling for list items.
- Introduced new HTML files for the privacy policy in English and Chinese.
- Implemented a PrivacyPopup component to display the privacy policy within the application.
- The popup dynamically loads the appropriate language based on user settings and includes options to accept or decline the policy.
- Introduced a new IPC channel for quitting the application.
- Updated ipc.ts to handle the App_Quit channel, allowing the app to quit when invoked.
- Added corresponding quit method in the preload API for client-side access.
- Fixed a minor URL check in WindowService to ensure proper navigation handling.
* fix(assistant): update translate assistant content handling for QwenMT model
- Adjusted content assignment in getDefaultTranslateAssistant to use store settings only when the model is not a QwenMT model, ensuring correct translation behavior.
* lint err
* refactor(assistant): encapsulate content handling logic for translation
- Introduced a new function, getTranslateContent, to streamline content assignment in getDefaultTranslateAssistant.
- This change improves readability and maintains correct translation behavior for QwenMT models.
* format code
- Introduced a new method in ConfigManager to generate and retrieve a unique client ID.
- Updated AppUpdater to include the client ID in the request headers alongside the user agent.
* fix: support leadingspace to avoid normal text
* Close QuickPanel when no search results found
Add automatic closing of QuickPanel when search yields no results for
single-select input triggers, preventing users from getting stuck with
empty result lists.
* fix: reopen quick panel while editing trigger text
* fix: hide quick trigger hints when disabled
* Update zh-tw.json
Change unsupported provider error to return undefined
Replace thrown error with empty object return and update function
signature to allow undefined return type for unsupported providers
- Change condition from text.trim() === '' to text.length === 0
- Users can now delete whitespace characters (spaces, tabs, newlines) without accidentally deleting attached files
- File deletion only occurs when text is completely empty
- Maintains existing functionality for file deletion when text is truly empty
Fixes: Blank character input causes backspace to incorrectly delete attached images
Signed-off-by: zhaokun <zhaokun_zhang@icloud.com>
* fix: update default content in getDefaultTranslateAssistant function
Changed the default content from 'follow system instruction' to 'go' in the getDefaultTranslateAssistant function to improve clarity and intent.
* use user instead of system prompt
* lint error
* add qwen-plus new model
* add qwen-plus new model
* fix(models): unify qwen-plus configuration of THINKING_TOKEN_MAP
* fix(models): unify qwen-plus configuration of THINKING_TOKEN_MAP
* feat(CodeTools): add support for terminal selection on macOS
- Introduced terminal selection functionality in CodeTools, allowing users to choose from available terminal applications.
- Implemented caching for terminal availability checks to enhance performance.
- Updated CodeToolsService to preload available terminals and check their availability.
- Enhanced UI in CodeToolsPage to display terminal options and handle user selection.
- Added new IPC channel for retrieving available terminals from the main process.
* lint errs
* format
* support wezterm
* support terminal
* support ghostty
* support warp kitty
* fix github scanner issues
* fix all github issues
* support windows
* support windows
* suppport hyper
* Refactor terminal command execution for macOS applications to use shell scripts instead of AppleScript, improving compatibility and performance.
* Remove Hyper terminal configuration from shared constants
* update lint
* fix(i18n): Auto update translations for PR #10192
* fix platform checking
* format
* feat: add Tabby terminal configuration for macOS
* fix wrap terminal
* delete warp
---------
Co-authored-by: GitHub Action <action@github.com>
* Add .codebuddy and .zed to .gitignore and fix formatApiHost
Prevent formatApiHost from processing undefined/empty host values and
ignore editor-specific directories
* Refactor reasoning tag selection logic for providers
Move gpt-oss model handling from aws-bedrock case to openai case and
consolidate tag selection logic into a single if-else chain.
* Extract reasoning tag name into helper function
* fix test
* Replace array indexing with named object properties for reasoning tags
Improves code readability by using descriptive property names instead of
magic array indices when selecting reasoning tag names by model type.
* Move host validation to start of formatApiHost
* ci(claude-translator): extend workflow to handle pull request review events
- Add support for pull_request_review and pull_request_review_comment events
- Update condition logic to include new event types
- Expand claude_args to include pull request review related API commands
- Enhance prompt to handle new event types and more translation scenarios
* ci(workflows): update concurrency group in claude-translator workflow
Add github.event.review.id as additional fallback for concurrency group naming
* fix(workflow): correct API method for pull_request_review event
Use PATCH instead of PUT and update body parameter to match API requirements
* ci: clarify comment ID label in workflow output
Update the label for comment ID in workflow output to explicitly indicate when it refers to review comments
* ci: fix syntax error in GitHub workflow file
* fix(workflow): correct HTTP method for pull_request_review event
Use PUT instead of PATCH for updating pull request reviews as per GitHub API requirements
* Add AWS Bedrock reasoning extraction middleware
- Add 'reasoning' tag to tagNameArray for broader reasoning support
- Add AWS Bedrock case with gpt-oss model-specific reasoning extraction
- Add openai-chat and openrouter cases to provider options switch
- Remove unused zod import
* Add OpenRouter provider support
Updates ai-core to version alpha.18 with OpenRouter integration and
improves provider ID resolution for OpenAI API hosts.
* Fix Anthropic API URL and add endpoint path handling
- Remove trailing slash from Anthropic API base URL
- Add isAnthropicProvider utility function
- Update provider settings to show full endpoint URL for Anthropic
- Add migration to clean up existing Anthropic provider URLs
* Update src/renderer/src/pages/settings/ProviderSettings/ProviderSetting.tsx
Co-authored-by: Phantom <59059173+EurFelux@users.noreply.github.com>
---------
Co-authored-by: Phantom <59059173+EurFelux@users.noreply.github.com>
* Remove local provider option files and use external packages
Replace local implementation of XAI and OpenRouter provider options with
external packages (@ai-sdk/xai and @openrouter/ai-sdk-provider). Update
web search plugin to support additional providers including OpenAI Chat
and OpenRouter, with improved configuration mapping.
* Bump @cherrystudio/ai-core to v1.0.0-alpha.17
fix i18n
* fix(i18n): Auto update translations for PR #10213
---------
Co-authored-by: GitHub Action <action@github.com>
- Added isLeftNavbar to the useNavbarPosition hook for improved layout management.
- Adjusted background style logic to use isLeftNavbar instead of isTopNavbar for better compatibility with left-aligned navigation.
- Simplified condition for transparent window styling on macOS.
* style(markdown): improve code block styling and layout
- Add text-wrap to pre elements for better readability
- Force background color for code blocks with !important
- Change display to grid in translate page for consistent layout
- Add overflow hidden to output container
* style(markdown): remove redundant !important from code block styling
Move !important declaration to output container's markdown pre selector where it's actually needed
* build: add eslint-plugin-oxlint dependency
Add new eslint plugin to enhance linting capabilities with oxlint rules
* build(eslint): add oxlint plugin to eslint config
Add oxlint plugin as recommended in the documentation to enhance linting capabilities
* build: add oxlint v1.15.0 as a dependency
* build: add oxlint to linting commands
Add oxlint alongside eslint in test:lint and lint scripts for enhanced static analysis
* build: add oxlint configuration file
Configure oxlint with a comprehensive set of rules for JavaScript/TypeScript code quality checks
* chore: update oxlint configuration and related settings
- Add oxc to editor code actions on save
- Update oxlint configs to use eslint, typescript, and unicorn presets
- Extend ignore patterns in oxlint configuration
- Simplify oxlint command in package.json scripts
- Add oxlint-tsgolint dependency
* fix: lint warning
* chore: update oxlintrc from eslint.recommended
* refactor(lint): update eslint and oxlint configurations
- Add src/preload to eslint ignore patterns
- Update oxlint env to es2022 and add environment overrides
- Adjust several lint rule severities and configurations
* fix: lint error
* fix(file): replace eslint-disable with oxlint-disable in sanitizeFilename
The linter was changed from ESLint to oxlint, so the directive needs to be updated accordingly.
* fix: enforce stricter linting by failing on warnings in test:lint script
* feat: add recommended ts-eslint rules into exlint
* docs: remove outdated comment in oxlint config file
* style: disable typescript/no-require-imports rule in oxlint config
* docs(utils): fix comment typo from NODE to NOTE
* fix(MessageErrorBoundary): correct error description display condition
The error description was incorrectly showing in production and hiding in development. Fix the logic to show detailed errors only in development mode
* chore: add oxc-vscode extension to recommended list
* ci(workflows): reorder format check step in pr-ci.yml
* chore: update yarn.lock
* build: add @biomejs/biome as a dependency
* chore: add biome extension to vscode recommendations
* chore: migrate from prettier to biome for code formatting
Update VSCode settings to use Biome as the default formatter for multiple languages
Add Biome to code actions on save and reorder search exclude patterns
* build: add biome.json configuration file for code formatting
* build: migrate from prettier to biome for formatting
Update package.json scripts and biome.json configuration to use biome instead of prettier for code formatting. Adjust biome formatter includes/excludes patterns for better file matching.
* refactor(eslint): remove unused prettier config and imports
* chore: update biome.json configuration
- Enable linter and set custom rules
- Change jsxQuoteStyle to single quotes
- Add json parser configuration
- Set formatWithErrors to true
* chore: migrate biome config from json to jsonc format
The new jsonc format allows for comments in the configuration file, making it more maintainable and easier to document configuration choices.
* style(biome): update ignore patterns and jsx quote style
Update file ignore patterns from `/*` to `/**` for consistency
Change jsxQuoteStyle from single to double quotes for alignment with project standards
* refactor: simplify error type annotations from Error | any to any
The change standardizes error handling by using 'any' type instead of union types with Error | any, making the code more consistent and reducing unnecessary type complexity.
* chore: exclude tailwind.css from biome formatting
* style: standardize quote usage and fix JSX formatting
- Replace single quotes with double quotes in CSS imports and selectors
- Fix JSX element closing bracket alignment and formatting
- Standardize JSON formatting in package.json files
* Revert "style: standardize quote usage and fix JSX formatting"
This reverts commit 0947f8505d.
* fix: remove json import assertion for biome compatibility
The import assertion syntax is not supported by biome, so it was replaced with a standard import statement.
* style: change quote styles in biome.jsonc to use single quotes for JSX and double quotes for JS
* style: change quote style from double to single in biome config
* style: change JSX quote style from single to double
* chore: update biome.jsonc to use single quotes for CSS formatting
* chore: update biome config and format commands
- Exclude tailwind.css from linter includes
- Add biome lint to format commands
* style: format JSX closing brackets for better readability
* style: set bracketSameLine to true in biome config
The change aligns with common JSX formatting preferences where brackets on the same line improve readability for many developers
* Revert "style: format JSX closing brackets for better readability"
This reverts commit d442c934ee.
* style: format code and clean up whitespace
- Remove unnecessary whitespace in CSS and TS files
- Format package.json files to consistent style
- Reorder tsconfig.json properties alphabetically
- Improve code formatting in React components
* style(biome): update biome.jsonc config with clearer comment
Add explanation for keeping bracketSameLine as true to minimize changes in current PR while noting false would be better for future
* chore: remove prettier dependency and format package.json files
- Remove prettier from dependencies as it's no longer needed
- Reformat package.json files for better readability
* chore: replace prettier with biome for code formatting
Remove all prettier-related configuration, dependencies, and references
Update formatting scripts and documentation to use biome instead
Adjust electron-builder config to exclude biome.jsonc
* build: replace prettier with biome for formatting
Use biome as the default formatter instead of prettier for better performance and modern tooling support
* ci(i18n): replace prettier with biome for i18n formatting
Update the auto-i18n workflow to use Biome instead of Prettier for formatting translated files. This change simplifies the dependencies by removing multiple Prettier plugins and using a single tool for formatting.
* fix(i18n): Auto update translations for PR #10170
* style: format package.json files by consolidating array formatting
Consolidate multi-line array formatting into single-line format for better readability and consistency across package.json files
* Revert "fix(i18n): Auto update translations for PR #10170"
This reverts commit a7edd32efd.
* ci(workflows): specify biome config path in auto-i18n workflow
* chore: update biome.jsonc to use lexicographic sort order for json keys
* ci(workflows): update biome format command to use --config-path flag
* chore: exclude package.json from biome formatting
* ci: update biome.jsonc linter configuration
Update linter includes to target specific files and modify useSortedClasses rule
* chore: reorder search exclude patterns in vscode settings
* style(OGCard): reorder tailwind classes for consistent styling
* fix(biome): update tailwind classes sorting to safe and warn level
* docs(dev): update ide setup instructions in dev docs
Replace Prettier with Biome as the recommended formatter and clarify editor options
* build(extension-table-plus): replace prettier with biome for formatting
- Add biome.json configuration file
- Update package.json to use biome instead of prettier
- Remove prettier from dependencies
- Update lint script to use biome format
* chore: replace biome.json with biome.jsonc for extended configuration
Update biome configuration file to use JSONC format for comments and more detailed settings
* chore: remove unused biome.jsonc configuration file
---------
Co-authored-by: GitHub Action <action@github.com>
* feat(CodeTools): enhance OpenAI Codex integration with configurable parameters
- Added support for custom OpenAI model provider and model configuration in CodeToolsService.
- Updated CodeToolsPage to filter providers based on the selected CLI tool, including OpenAI Codex.
- Introduced OPENAI_CODEX_SUPPORTED_PROVIDERS constant for better provider management.
- Refactored environment variable generation to include OpenAI-specific settings.
* fix(CodeTools): correct environment variable generation for OpenAI Codex integration
- Added a break statement in the environment generation logic for OpenAI Codex to ensure proper handling of API key and base URL.
- Moved the import of codeTools to maintain consistency in the CodeToolsPage component.
* fix(error): improve error response body parsing and message handling
Handle JSON parsing of error response bodies and extract internal messages when available. Combine messages when both top-level and internal messages exist.
* refactor(error): simplify response body assignment in serializeError
Remove redundant conditional logic and directly assign error.responseBody to serializedError.responseBody
* fix(serializeError): handle responseBody assignment consistently
Ensure responseBody is always assigned from error.responseBody when available, otherwise stringify the body. This prevents potential undefined behavior when error.responseBody exists but body is not available.
- QuickPanel (view.tsx): do not intercept Enter/NumpadEnter when the panel is visible but collapsed (no non-pinned matches), so the event falls through to the input bar and sending works.
- Inputbar (Inputbar.tsx): prioritize the configured send shortcut on Enter; remove pre-blocking based on quickPanel visibility; keep Shift+Enter as native newline; insert newline for other Enter variants.
- Update inline comments to clearly document the behavior.
* fix(ThemeProvider): set document language based on user settings
Add language from settings to ThemeProvider context and update document language attribute accordingly
* fix(ThemeProvider): add language to dependency array to prevent stale closures
* fix: correct disk quota display by converting bytes to GB
The free disk space was being logged in bytes instead of GB, making the log message misleading. Convert the value to GB for accurate reporting.
* fix: format disk quota log to 2 decimal places
* feature: add option to change font
1. set app global font
2. set code block font
Signed-off-by: Albert Abdilim <albert.abdilim@foxmail.com>
* formatted code with Prettier
* fix ci errors
1.add migration in `migrate.ts`
2.add to-be-translated strings by running `yarn sync:i18n`
* chore: update yarn.lock to include font-list package version 2.0.0
* fix migration issue
---------
Signed-off-by: Albert Abdilim <albert.abdilim@foxmail.com>
Co-authored-by: suyao <sy20010504@gmail.com>
* feat: add Perplexity SDK integration
* feat: enhance AiSdkToChunkAdapter with web search capabilities
- Added support for web search in AiSdkToChunkAdapter, allowing for dynamic link conversion based on provider type.
- Updated constructor to accept provider type and web search enablement flag.
- Improved link handling logic to buffer and process incomplete links.
- Enhanced message block handling in the store to accommodate new message structure.
- Updated middleware configuration to include web search option.
* fix
* fix
* chore: remove unuseful code
* fix: ci
* chore: log
refactor(provider): wrap system provider checks in isSystemProvider
Centralize system provider checks to improve maintainability and reduce code duplication
style(MinApp): adjust container styles for better layout
- Add min-height to MinApp container
- Remove absolute positioning from search bar
- Improve flex and overflow handling in containers
- Adjust margins and widths for better spacing
* refactor(OGCard): replace static image with dynamic generated graph
- Replace CherryLogo import with GeneratedGraph component for dynamic preview
- Extract image height to constant for consistency
- Use useCallback for GeneratedGraph to optimize performance
* chore: remove unused banner.png asset
* style(OGCard): change image height from pixels to rem units
Use rem units for better responsiveness and consistency with the design system
* feat: add disk space checking functionality
- Introduced a new IPC channel for retrieving disk information.
- Integrated the 'check-disk-space' package to fetch available and total disk space.
- Updated the preload API to expose the new disk info retrieval method to the renderer.
* feat: implement disk space warning and data limit checks
- Added functionality to check available disk space and display warnings when storage is low.
- Updated IPC methods to pass directory paths for disk info retrieval.
- Introduced periodic checks for app data disk quota and internal storage quota.
- Enhanced user notifications with localized messages for low storage warnings.
* fix: enhance disk space warning logic and improve logging
- Added additional conditions for displaying disk space warnings based on free percentage thresholds.
- Improved logging format for app data disk quota, providing clearer output in GB.
- Refactored the checkDataLimit function to be asynchronous for better performance.
* format code
* update log format
* fix: improve error handling and logging in disk quota checks
- Added try-catch block in checkAppDataDiskQuota to handle potential errors when retrieving disk information.
- Ensured that errors are logged for better debugging and visibility.
- Updated checkDataLimit to await the checkAppDataDiskQuota function for proper asynchronous handling.
* fix comments
* fix: remove redundant appStorageQuota message from localization files
* lint
* fix: enhance disk space warning logic for USB disks
- Added a condition to warn users when free space on USB disks falls below 5% of total capacity.
- Improved the existing logic for displaying disk space warnings based on total disk size thresholds.
* update i18n
* Refactor data limit notification logic and update i18n messages for disk space warnings. Adjusted check intervals and improved toast notifications for low disk space alerts.
* Fix disk quota check logic in useDataLimit hook to correctly compare free space against 1GB threshold.
* refactor: update styles and improve navbar handling
- Removed unnecessary margin-bottom style from bubble markdown.
- Adjusted margin in Prompt component for better layout.
- Enhanced useAppInit hook to include navbar position logic for background styling.
- Added alignment to ErrorBlock alert for improved visual consistency.
* refactor: relocate checkDataLimit function to utils and update import in useAppInit hook
- Moved checkDataLimit function from useDataLimit hook to utils for better organization.
- Updated import path in useAppInit to reflect the new location of checkDataLimit.
- Removed the now obsolete useDataLimit hook file.
* refactor: update getDiskInfo API to specify return type
- Enhanced getDiskInfo function to explicitly define the return type as a Promise containing disk information or null.
* lint err
* fix: handle null response from getDiskInfo in checkAppDataDiskQuota
- Added a check for null response from getDiskInfo to prevent errors.
- Updated the logic to extract the free disk space only if diskInfo is valid.
---------
Co-authored-by: kangfenmao <kangfenmao@qq.com>
* refactor MCPService for improved error handling and header management
* refactor MCPService: reorder header preparation for improved clarity
* refactor: enhance MCP server type determination and clean up error handling
* refactor: update Scrollbar component and integrate horizontal scrolling in TabContainer and KnowledgeBaseInput
- Renamed Props interface to ScrollbarProps for clarity.
- Implemented useHorizontalScroll hook in TabContainer to manage horizontal scrolling.
- Removed deprecated scroll handling logic and replaced it with the new hook.
- Enhanced KnowledgeBaseInput to utilize horizontal scrolling for better UI management.
- Cleaned up unused imports and components for improved code maintainability.
* refactor: update dependencies type in useHorizontalScroll hook to readonly unknown[] for better type safety
* feat: add scrollDistance parameter to useHorizontalScroll hook for customizable scrolling behavior
* refactor: replace useHorizontalScroll with HorizontalScrollContainer in TabContainer, KnowledgeBaseInput, and MentionModelsInput components
- Updated TabContainer to utilize HorizontalScrollContainer for improved scrolling functionality.
- Refactored KnowledgeBaseInput and MentionModelsInput to replace the custom horizontal scroll implementation with HorizontalScrollContainer, simplifying the code and enhancing maintainability.
* refactor(HorizontalScrollContainer): remove paddingRight prop and update scroll handling
- Removed the unused paddingRight prop from HorizontalScrollContainerProps and its implementation.
- Updated handleScrollRight to accept the event parameter and stop propagation.
- Simplified the Container styled component by eliminating the padding-right style.
* fix: sync issue
* fix: isLeftNavbar inputbar display issue
* feat(HorizontalScrollContainer): add scroll end detection and disable button hover effect
---------
Co-authored-by: 自由的世界人 <3196812536@qq.com>
- Removed unnecessary margin-bottom style from bubble markdown.
- Adjusted margin in Prompt component for better layout.
- Enhanced useAppInit hook to include navbar position logic for background styling.
- Added alignment to ErrorBlock alert for improved visual consistency.
* feat: add api server
This reverts commit c76aa03566.
* update yarn.lock
* fix: correct import paths in ToolSettings component
Update import paths for PreprocessSettings and WebSearchSettings to reference correct locations in DocProcessSettings and WebSearchSettings directories.
* feat(settings): add API server settings link and route
* fix(auth): improve authorization handling and error responses
* feat(chat): enhance model validation and logging for chat completions
feat(models): improve logging for model retrieval and filtering
feat(utils): add model ID validation and support for OpenAI providers
* feat(api-server): refactor config loading and remove unused ToolSettings component
* refactor(ApiServerService): simplify config retrieval and improve error handling in ApiServerSettings
* fix(mcp): remove unnecessary await in listTools return statement
* refactor(ApiServerSettings): replace window.message with window.toast for notifications
---------
Co-authored-by: kangfenmao <kangfenmao@qq.com>
Update pull-requests permission from read to write and add allowed_non_write_users config
Add security warning comment about fine-grained token control
* feat(toast): add toast utility functions to global interface
Expose error, success, warning, and info toast functions globally for consistent notification handling
* refactor(toast): use ToastPropsColored type to enforce color consistency
Create ToastPropsColored type to explicitly omit color property from ToastProps
* refactor(toast): simplify toast functions using factory pattern
Create a factory function to generate toast functions instead of repeating similar code. This improves maintainability and reduces code duplication.
* fix: replace window.message with window.toast for copy notifications
* refactor(toast): update type definition to use Parameters utility
Use Parameters utility type to derive ToastPropsColored from addToast parameters for better type safety
* feat(types): add RequireSome utility type for making specific properties required
* feat(toast): add loading toast functionality
Add loading toast type to support promises in toast notifications. This enables showing loading states for async operations.
* chore: add claude script to package.json
* build(eslint): add packages dist folder to ignore patterns
* refactor: migrate message to toast
* refactor: update toast import path from @heroui/react to @heroui/toast
* docs(toast): add JSDoc comments for toast functions
* fix(toast): set default timeout for loading toasts
Make loading toasts disappear immediately by default when timeout is not specified
* fix(translate): replace window.message with window.toast for consistency
Use window.toast consistently across the translation page for displaying notifications to maintain a uniform user experience and simplify the codebase.
* refactor: remove deprecated message interface from window
The MessageInstance interface from antd was marked as deprecated and is no longer needed in the window object.
* refactor(toast): consolidate toast utilities into single export
Move all toast-related functions into a single utility export to reduce code duplication and improve maintainability. Update all imports to use the new utility function.
* docs(useOcr): remove redundant comment in ocr function
* docs: update comments from Chinese to English
Update error log messages in CodeToolsPage to use English instead of Chinese for better consistency and maintainability
* feat(toast): add no-drag style and adjust toast placement
add custom CSS class to disable drag on toast elements
move toast placement to top-center and adjust timeout settings
* refactor(RuntimeExecutor, PluginEngine): streamline parameter handling and improve type definitions for model operations
- Updated parameter handling in RuntimeExecutor methods to use specific types for generate and stream functions.
- Refactored PluginEngine methods to enhance type safety and reduce redundancy in model resolution.
- Introduced new type definitions for generate and stream parameters in types.ts for better clarity and maintainability.
- Adjusted provider options mapping in buildProviderOptions to accommodate new provider types.
* feat(googleToolsPlugin): enhance Google tools integration and update dependencies
- Updated the `ai` package version to `5.0.38` and `@ai-sdk/gateway` to `1.0.20` in `package.json` and `yarn.lock`.
- Introduced `googleToolsPlugin` with improved parameter handling and configuration options for Google tools.
- Added support for `urlContext` in middleware configuration and plugin builder.
- Refactored web search tool to streamline response handling and citation formatting.
- Updated various service methods to include `enableUrlContext` capability.
* fix: update tool response handling and clean up unused code
- Modified the `processKnowledgeReferences` function to accept the full response object instead of just `knowledgeReferences`.
- Cleaned up the `searchOrchestrationPlugin` by removing unnecessary blank lines.
- Removed commented-out code in `telemetryPlugin` to improve readability.
- Updated `KnowledgeSearchTool` to streamline the execution flow and return results more efficiently.
- Adjusted `MessageKnowledgeSearch` components to reflect changes in the data structure returned from the knowledge search tool.
- Enhanced `MemorySearchTool` by simplifying error handling and removing redundant code.
* refactor: clean up KnowledgeSearchTool and WebSearchTool by removing commented-out code
- Removed unnecessary commented-out code in `KnowledgeSearchTool` and `WebSearchTool` to improve code readability and maintainability.
- Simplified the `processKnowledgeReferences` function by eliminating the console log statement for cleaner output.
* chore: bump version to 1.0.0-alpha.14 in aiCore package.json
* chore: update @ai-sdk/google-vertex to version 3.0.25 and add @ai-sdk/anthropic@2.0.15 to dependencies
- Bumped the version of `@ai-sdk/google-vertex` in `package.json` and `yarn.lock` to 3.0.25.
- Added `@ai-sdk/anthropic` version 2.0.15 to `yarn.lock` with updated dependencies.
- Refactored `parameterBuilder.ts` to integrate new tools from `@ai-sdk/google-vertex` for enhanced functionality.
* refactor(Navbar): improve WindowControls visibility and clean up event listener management
- Updated Navbar component to conditionally render WindowControls based on minappShow state.
- Refactored IPC event listener management in preload script for better clarity and performance.
* feat(WindowControls): replace custom restore icon with a new SVG component
- Introduced a new `WindowRestoreIcon` component with enhanced SVG structure and styling.
- Updated `WindowControls` to use the new `WindowRestoreIcon` for better visual consistency and scalability.
* feat(WindowControls): update WindowRestoreIcon SVG for improved design
- Enhanced the SVG structure of the `WindowRestoreIcon` component with updated dimensions and styling for better visual appeal.
- Adjusted the path and rectangle properties to refine the icon's appearance and maintain consistency across the application.
* lint error
* ci(claude-translator): add github_token to workflow for authentication
* ci(workflows): restrict code review to main repo PRs
Fix OIDC issues by only triggering reviews for PRs from the main repository
* ci(workflows): re-enable issues trigger for claude translator
The upstream bug has been fixed, so we can now re-enable the issues trigger.
Also update the claude-code-action to use main branch instead of v1 tag.
* feat: add text file preview (#7023)
* feat: open message text file attachment in preview
* refractor: use `window.api.fs.readText`
* fix: use `FileTypes.TEXT`
* fix: trim prefix "file://" with `replace`
* refactor(FileAction): centralize file click handling for text preview
- Use FileAction.handleClick in AttachmentPreview and MessageAttachments
- Show i18n error modal on failure (zh-cn: files.click.error)
* fix: i18n
* fix: update i18n on field `files.click.error` with codex
* fix: use hook
* fix: rename `handleClick` to `preview`
* feat: support lang highlight
* fix: remove prefix '.' of extension
* fix: code editor style
* fix: editor cursor text style
* fix: add `FileTypes` check
* fix: move parseFileType into utils
* fix: move `parseFileTypes` into utils/file
* feat(minapps): add Tabs-mode webview pool and integrate page shell
* fix(minapp): position tabs pool below toolbar and preserve layout
* style(minapp): fix format issues
* style(minapps): optimize var name
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* feat(minapps): stabilize tab webview lifecycle and mount logic
* refactor(minapps): improve webview detection and state handling
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* fix(translate): prevent default paste behavior only when handling files
Only call event.preventDefault() when handling file pasting to allow text pasting by default. This fixes the issue where text pasting was being blocked unnecessarily.
* fix(translate): append new text to existing content instead of replacing
Ensure OCR and file reading operations append new content to existing text rather than replacing it entirely. This maintains user's previous input when processing additional files.
* feat: add font size and table of contents settings to RichEditor
- Introduced font size customization in the RichEditor component, allowing users to adjust the font size for better readability.
- Added a toggle for displaying a table of contents in the editor settings.
- Updated localization files to include new settings descriptions.
- Enhanced the NotesSettings component with a slider for font size adjustment and a switch for the table of contents feature.
- Migrated state management to include new settings in the Redux store.
* feat: enhance CodeEditor with customizable font size and responsive layout
* feat: enhance markdown conversion to preserve square brackets
- Improved the htmlToMarkdown function to correctly handle and preserve wiki-style double brackets [[foo]] and single brackets [foo] while maintaining proper Markdown link syntax.
- Added unit tests to verify the preservation of these bracket formats during conversion.
* feat: enhance YamlFrontMatterNodeView with editor content check
* fix
* chore
* chore: bump store persistence version to 153
---------
Co-authored-by: icarus <eurfelux@gmail.com>
* feat(translate): add settings with autoCopy option to translate state
Add settings object to translate state to store user preferences like autoCopy functionality. Implement updateSettings reducer to handle settings updates.
* docs(translate): add todo comment for settings field
* refactor(translate): simplify settings update and expose in hook
Remove dependency on objectEntriesStrict and use Object.entries directly
Expose translate settings and update function in useTranslate hook
* fix(useTranslate): use dispatch to update
* feat(translate): add auto-copy setting for translated content
Add auto-copy functionality that automatically copies translated text to clipboard when enabled. Includes settings toggle in TranslateSettings component and integration with translate logic.
* chore: add tailwindcss file association to vscode settings
* feat(translate): add auto copy setting and improve switch styling
Add new translation strings for auto copy feature and apply consistent primary color to all switches in translation settings
* fix(theme): update hero UI primary color variable
Add --primary CSS variable to match --color-primary for hero UI components
* refactor(hooks): rename _updateSettings to handleUpdateSettings for clarity
Improve variable naming consistency and better reflect the function's purpose
* refactor(translate): simplify settings update using Object.assign
* fix(translate): handle clipboard write errors in copy functionality
Add error handling for clipboard operations to prevent silent failures and show user feedback when copy fails
* feat(i18n): add translation placeholders for new UI strings
Add new translation keys for front matter operations and auto-copy setting
Include additional Anthropic OAuth related messages for better user feedback
* fix(i18n): Auto update translations for PR #10032
* fix(i18n): correct translation errors in multiple language files
Fix incorrect translations and fill missing values in Japanese, Russian, Portuguese, French and Spanish localization files. Changes include correcting property name in Japanese, adding missing empty value in Russian, fixing editValue in Portuguese, correcting date and empty values in French, and fixing multiple terms in Spanish.
* fix: update error message in migration from 151 to 152
* fix(translate): await copy operation and show success message
Ensure the copy operation completes before proceeding and notify user of successful copy
* feat(translate): add delay timer for auto-copy functionality
Use setTimeoutTimer to introduce a 100ms delay before auto-copy to ensure UI stability
* fix(translate): increase modal width from 420 to 520 for better content display
* fix(ThemeProvider): ensure proper theme class is applied to body
Add logic to toggle 'light' and 'dark' classes on body element when theme changes
* fix(translate): only copy when success
* fix(translate): remove redundant error message display on translation failure
* fix(translate): handle abort and empty translation cases properly
Improve error handling for translation abort scenarios and empty responses. Show appropriate user messages when translation is aborted and properly handle NoOutputGeneratedError cases.
* fix(translate): handle translation errors by showing user-friendly message
Display a localized error message to users when translation fails instead of just logging it
---------
Co-authored-by: GitHub Action <action@github.com>
* feat(Navbar): add WindowControls for Windows and Linux, clean up NavbarCenter component
* feat(Navbar): add NavbarRight component for improved layout in MinAppsPage
* feat(Navbar): enhance layout and styling for WindowControls and Navbar components
* lint err
* fix new ui
* refactor(logging): change logger level and remove unused log statements
- Updated logger level from info to silly in AiSdkToChunkAdapter for more granular logging.
- Removed unused logger statements in AiSdkMiddlewareBuilder and PluginBuilder to clean up the code.
- Enhanced condition check in ApiService to include prompt tool usage.
* chore
docs: update CLAUDE.md with UI design migration details
Add section about migrating from antd & styled-components to HeroUI, including link to HeroUI docs.
- Fix Peplexity -> Perplexity in both English and Chinese README
- Fix Itapano -> Italiano in Chinese README language links
- Improve documentation accuracy and professionalism
Signed-off-by: LeaderOnePro <leaderonepro@outlook.com>
* fix: improve note sorting behavior for drag and drop operations
- Skip automatic sorting when performing same-level drag reordering
- Preserve treePath during same-level moves to maintain manual ordering
- Return special indicator for manual reorder operations to prevent conflicts
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: type safety issue
---------
Co-authored-by: Claude <noreply@anthropic.com>
* feat: add YAML front matter support in markdown processing
- Introduced a new plugin to parse and render YAML front matter in markdown documents.
- Updated the markdown converter to handle YAML front matter, preserving its structure during conversion.
- Added corresponding tests to ensure YAML front matter is retained correctly in markdown to HTML and vice versa.
- Enhanced i18n files with new translations for front matter properties in English, Chinese (Simplified and Traditional).
- Included the 'yaml' package as a dependency in package.json.
* feat(i18n): add new translations for editing properties in Traditional Chinese
* chore: fix
Add SVG logos for ByteDance and Ideogram AI model providers to improve visual identification in the model selection UI.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-authored-by: Claude <noreply@anthropic.com>
* feat: add Anthropic OAuth settings UI and logic
Introduces AnthropicSettings component for managing Anthropic OAuth authentication in provider settings. Adds Anthropic OAuth logic in a new anthropicOAuth.ts file, including PKCE flow, token exchange, and credential management stubs. Integrates AnthropicSettings into ProviderSetting to enable UI for login, logout, and code entry.
* feat: add Anthropic OAuth authentication support
Introduces OAuth authentication for Anthropic provider, including UI changes for selecting authentication method and handling authorization code input. Updates i18n files with new Anthropic OAuth-related strings in multiple languages and adds the 'authType' property to the Provider type.
* fix: oauth
* refactor: Anthropic OAuth to main process service
Moved Anthropic OAuth logic from renderer to main process as a singleton service. Updated IPC channels and preload API to support Anthropic OAuth actions. Refactored AnthropicSettings component to use new IPC-based API for authentication flow.
* fix: add 'authenticating' translation and update AnthropicSettings
Added the 'authenticating' key to Anthropic provider translations across multiple languages. Updated AnthropicSettings.tsx to remove the unused 'authenticating_detail' description and set the modal to be centered.
* fix: add reference
* Update AnthropicAPIClient.ts
* fix: update credentials path and improve OAuth handling in AnthropicAPIClient
* feat: add support for Anthropic OAuth provider handling in ProviderSetting
* feat: enhance OAuth authentication messages in multiple languages
* feat: add support for Anthropic provider with OAuth authentication and system message handling for new aisdk provider
* fix: update credential path and use net.fetch for OAuth token requests
* fix: setting page ui
---------
Co-authored-by: Vaayne <liu.vaayne@gmail.com>
* fix(mcp): enhance progress event structure to include callId for specific tool tracking
* refactor(mcp): add MCP progress event with callId and progress percentage
* workflows: restrict Claude triggers to collaborators/members/owners and fix fork PR reviews
- claude.yml: gate by author_association in [COLLABORATOR, MEMBER, OWNER]
- claude-code-review.yml: use pull_request_target, add pull-requests: write and id-token: write to enable OIDC + commenting on forks
* fix(workflows): remove 'reopened' and 'assigned' types from triggers
* feat: add window control functionality for Windows and Linux
- Introduced new IPC channels for window management: minimize, maximize, unmaximize, close, and check maximized state.
- Implemented window control buttons in the UI, allowing users to minimize, maximize, and close the application.
- Enhanced Navbar and TabContainer components to include window controls, improving user experience on non-Mac platforms.
- Styled window control buttons for better visual integration.
This update enhances the application's usability by providing essential window management features.
* add tooltip
* fix macos
* lint error
* update i18n
* lint
* fix: add WindowControls to MinApp popup and improve hover styles
- Add WindowControls component to MinappPopupContainer title bar for Windows/Linux
- Fix ButtonsGroup overlap with WindowControls by adding proper margin
- Improve WindowControls hover background visibility by using rgba(128,128,128,0.3)
- Ensure WindowControls is positioned at the right edge of title bar
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* lint
* add types
---------
Co-authored-by: Claude <noreply@anthropic.com>
* feat: support PaddleOCR as an OCR provider
* style: fix format
* fix: update persistReducer version
* update wrt comments
* fix(ocr): 修复迁移147中OCR提供商的设置错误
将直接赋值改为使用addOcrProvider方法添加内置PaddleOCR提供商,确保正确初始化OCR服务
* Replace bare fetch with net.fetch
* Use '\n' as delimiter
* Optimize code wrt comments
* Add tip
---------
Co-authored-by: icarus <eurfelux@gmail.com>
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* refactor: update ApiClientFactory and index_new for improved type handling and provider mapping
- Changed the type of options in ClientConfig to 'any' for flexibility.
- Overloaded createImageClient method to support different provider settings.
- Added vertexai mapping to the provider type mapping in index_new.ts for enhanced compatibility.
* 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.
* feat: add openai-compatible provider and enhance provider configuration
- Introduced the @ai-sdk/openai-compatible package to support compatibility with OpenAI.
- Added a new ProviderConfigFactory and ProviderConfigBuilder for streamlined provider configuration.
- Updated the provider registry to include the new Google Vertex AI import path.
- Enhanced the index.ts to export new provider configuration utilities for better type safety and usability.
- Refactored ApiService and middleware to integrate the new provider configurations effectively.
* feat: enhance Vertex AI provider integration and configuration
- Added support for Google Vertex AI credentials in the provider configuration.
- Refactored the VertexAPIClient to handle both standard and VertexProvider types.
- Implemented utility functions to check Vertex AI configuration completeness and create VertexProvider instances.
- Updated provider mapping in index_new.ts to ensure proper handling of Vertex AI settings.
* feat: enhance provider options and examples for AI SDK
- Introduced new utility functions for creating and merging provider options, improving type safety and usability.
- Added comprehensive examples for OpenAI, Anthropic, Google, and generic provider options to demonstrate usage.
- Refactored existing code to streamline provider configuration and enhance clarity in the options management.
- Updated the PluginEnabledAiClient to simplify the handling of model parameters and improve overall functionality.
* feat: add patch for Google Vertex AI and enhance private key handling
- Introduced a patch for the @ai-sdk/google-vertex package to improve URL handling based on region.
- Added a new utility function to format private keys, ensuring correct PEM structure and validation.
- Updated the ProviderConfigBuilder to utilize the new private key formatting function for Google credentials.
- Created a pnpm workspace configuration to manage patched dependencies effectively.
* feat: add OpenAI Compatible provider and enhance provider configuration
- Introduced a new OpenAI Compatible provider to the AiProviderRegistry, allowing for integration with the @ai-sdk/openai-compatible package.
- Updated provider configuration logic to support the new provider, including adjustments to API host formatting and options management.
- Refactored middleware to streamline handling of OpenAI-specific configurations.
* fix: enhance anthropic provider configuration and middleware handling
- Updated providerToAiSdkConfig to support both OpenAI and Anthropic providers, improving flexibility in API host formatting.
- Refactored thinkingTimeMiddleware to ensure all chunks are correctly enqueued, enhancing middleware functionality.
- Corrected parameter naming in getAnthropicReasoningParams for consistency and clarity in configuration.
* feat: enhance AI SDK chunk handling and tool call processing
- Introduced ToolCallChunkHandler for managing tool call events and results, improving the handling of tool interactions.
- Updated AiSdkToChunkAdapter to utilize the new handler, streamlining the processing of tool call chunks.
- Refactored transformParameters to support dynamic tool integration and improved parameter handling.
- Adjusted provider mapping in factory.ts to include new provider types, enhancing compatibility with various AI services.
- Removed obsolete cherryStudioTransformPlugin to clean up the codebase and focus on more relevant functionality.
* feat: enhance provider ID resolution in AI SDK
- Updated getAiSdkProviderId function to include mapping for provider types, improving compatibility with third-party SDKs.
- Refined return logic to ensure correct provider ID resolution, enhancing overall functionality and support for various providers.
* refactor: restructure AI Core architecture and enhance client functionality
- Updated the AI Core documentation to reflect the new architecture and design principles, emphasizing modularity and type safety.
- Refactored the client structure by removing obsolete files and consolidating client creation logic into a more streamlined format.
- Introduced a new core module for managing execution and middleware, improving the overall organization of the codebase.
- Enhanced the orchestration layer to provide a clearer API for users, integrating the creation and execution processes more effectively.
- Added comprehensive type definitions and utility functions for better type safety and usability across the SDK.
* refactor: simplify AI Core architecture and enhance runtime execution
- Restructured the AI Core documentation to reflect a simplified two-layer architecture, focusing on clear responsibilities between models and runtime layers.
- Removed the orchestration layer and consolidated its functionality into the runtime layer, streamlining the API for users.
- Introduced a new runtime executor for managing plugin-enhanced AI calls, improving the handling of execution and middleware.
- Updated the core modules to enhance type safety and usability, including comprehensive type definitions for model creation and execution configurations.
- Removed obsolete files and refactored existing code to improve organization and maintainability across the SDK.
* feat: enhance AI Core runtime with advanced model handling and middleware support
- Introduced new high-level APIs for model creation and configuration, improving usability for advanced users.
- Enhanced the RuntimeExecutor to support both direct model usage and model ID resolution, allowing for more flexible execution options.
- Updated existing methods to accept middleware configurations, streamlining the integration of custom processing logic.
- Refactored the plugin system to better accommodate middleware, enhancing the overall extensibility of the AI Core.
- Improved documentation to reflect the new capabilities and usage patterns for the runtime APIs.
* feat: enhance plugin system with new reasoning and text plugins
- Introduced `reasonPlugin` and `textPlugin` to improve chunk processing and handling of reasoning content.
- Updated `transformStream` method signatures for better type safety and usability.
- Enhanced `ThinkingTimeMiddleware` to accurately track thinking time using `performance.now()`.
- Refactored `ThinkingBlock` component to utilize block thinking time directly, improving performance and clarity.
- Added logging for middleware builder to assist in debugging and monitoring middleware configurations.
* refactor: update RuntimeExecutor and introduce MCP Prompt Plugin
- Changed `pluginClient` to `pluginEngine` in `RuntimeExecutor` for clarity and consistency.
- Updated method calls in `RuntimeExecutor` to use the new `pluginEngine`.
- Enhanced `AiSdkMiddlewareBuilder` to include `mcpTools` in the middleware configuration.
- Added `MCPPromptPlugin` to support tool calls within prompts, enabling recursive processing and improved handling of tool interactions.
- Updated `ApiService` to pass `mcpTools` during chat completion requests, enhancing integration with the new plugin system.
* feat: enhance MCP Prompt plugin and recursive call capabilities
- Updated `tsconfig.web.json` to support wildcard imports for `@cherrystudio/ai-core`.
- Enhanced `package.json` to include type definitions and imports for built-in plugins.
- Introduced recursive call functionality in `PluginManager` and `PluginEngine`, allowing for improved handling of tool interactions.
- Added `MCPPromptPlugin` to facilitate tool calls within prompts, enabling recursive processing of tool results.
- Refactored `transformStream` methods across plugins to accommodate new parameters and improve type safety.
* <type>: <subject>
<body>
<footer>
用來簡要描述影響本次變動,概述即可
* feat: enhance MCP Prompt plugin with recursive call support and context handling
- Updated `AiRequestContext` to enforce `recursiveCall` and added `isRecursiveCall` for better state management.
- Modified `createContext` to initialize `recursiveCall` with a placeholder function.
- Enhanced `MCPPromptPlugin` to utilize a custom `createSystemMessage` function for improved message handling during recursive calls.
- Refactored `PluginEngine` to manage recursive call states, ensuring proper execution flow and context integrity.
* feat: update package dependencies and introduce new patches for AI SDK tools
- Added patches for `@ai-sdk/google-vertex` and `@ai-sdk/openai-compatible` to enhance functionality and fix issues.
- Updated `package.json` to reflect new dependency versions and patch paths.
- Refactored `transformParameters` and `ApiService` to support new tool configurations and improve parameter handling.
- Introduced utility functions for setting up tools and managing options, enhancing the overall integration of tools within the AI SDK.
* refactor: disable console logging in MCP Prompt plugin for cleaner output
- Commented out console log statements in the `createMCPPromptPlugin` to reduce noise during execution.
- Maintained the structure and functionality of the plugin while improving readability and performance.
* feat: enhance ModernAiProvider with new reasoning plugins and dynamic middleware construction
- Introduced `reasoningTimePlugin` and `smoothReasoningPlugin` to improve reasoning content handling and processing.
- Refactored `ModernAiProvider` to dynamically build plugin arrays based on middleware configuration, enhancing flexibility.
- Removed the obsolete `ThinkingTimeMiddleware` to streamline middleware management.
- Updated `buildAiSdkMiddlewares` to reflect changes in middleware handling and improve clarity in the configuration process.
- Enhanced logging for better visibility into plugin and middleware configurations during execution.
* feat: introduce MCP Prompt Plugin and refactor built-in plugin structure
- Added `mcpPromptPlugin.ts` to encapsulate MCP Prompt functionality, providing a structured approach for tool calls within prompts.
- Updated `index.ts` to reference the new `mcpPromptPlugin`, enhancing modularity and clarity in the built-in plugins.
- Removed the outdated `example-plugins.ts` file to streamline the plugin directory and focus on essential components.
* refactor: rename and restructure message handling in Conversation and Orchestrate services
- Renamed `prepareMessagesForLlm` to `prepareMessagesForModel` in `ConversationService` for clarity.
- Updated `OrchestrationService` to use the new method name and introduced a new function `transformMessagesAndFetch` for improved message processing.
- Adjusted imports in `messageThunk` to reflect the changes in the orchestration service, enhancing code readability and maintainability.
* refactor: streamline error handling and logging in ModernAiProvider
- Commented out the try-catch block in the `ModernAiProvider` class to simplify the code structure.
- Enhanced readability by removing unnecessary error logging while maintaining the core functionality of the AI processing flow.
- Updated `messageThunk` to incorporate an abort controller for improved request management during message processing.
* fix: update reasoningTimePlugin and smoothReasoningPlugin for improved performance tracking
- Changed the invocation of `reasoningTimePlugin` to a direct reference in `ModernAiProvider`.
- Initialized `thinkingStartTime` with `performance.now()` in `reasoningTimePlugin` for accurate timing.
- Removed `thinking_millsec` from the enqueued chunks in `smoothReasoningPlugin` to streamline data handling.
- Added console logging for performance tracking in `reasoningTimePlugin` to aid in debugging.
* feat: extend buildStreamTextParams to include capabilities for enhanced AI functionality
- Updated the return type of `buildStreamTextParams` to include `capabilities` for reasoning, web search, and image generation.
- Modified `fetchChatCompletion` to utilize the new capabilities structure, improving middleware configuration based on model capabilities.
* refactor: simplify provider validation and enhance plugin configuration
- Commented out the provider support check in `RuntimeExecutor` to streamline initialization.
- Updated `providerToAiSdkConfig` to utilize `AiCore.isSupported` for improved provider validation.
- Enhanced middleware configuration in `ModernAiProvider` to ensure tools are only added when enabled and available.
- Added comments in `transformParameters` for clarity on parameter handling and plugin activation.
* refactor: remove OpenRouter provider support and streamline reasoning logic
- Commented out the OpenRouter provider in `registry.ts` and related configurations due to excessive bugs.
- Simplified reasoning logic in `transformParameters.ts` and `options.ts` by removing unnecessary checks for `enableReasoning`.
- Enhanced logging in `transformParameters.ts` to provide better insights into reasoning capabilities.
- Updated `getReasoningEffort` to handle cases where reasoning effort is not defined, improving model compatibility.
* chore: update OpenRouter provider to version 0.7.2 and add support functions
- Updated the OpenRouter provider dependency in `package.json` and `yarn.lock` to version 0.7.2.
- Added a new function `createOpenRouterOptions` in `factory.ts` for creating OpenRouter provider options.
- Updated type definitions in `types.ts` and `registry.ts` to include OpenRouter provider settings, enhancing provider management.
* refactor: streamline reasoning plugins and remove unused components
- Removed the `reasoningTimePlugin` and `mcpPromptPlugin` to simplify the plugin architecture.
- Updated the `smoothReasoningPlugin` to enhance its functionality and reduce delay in processing.
- Adjusted the `textPlugin` to align with the new delay settings for smoother output.
- Modified the `ModernAiProvider` to utilize the updated `smoothReasoningPlugin` without the removed plugins.
* refactor: update reasoning plugins and enhance performance
- Replaced `smoothReasoningPlugin` with `reasoningTimePlugin` to improve reasoning time tracking.
- Commented out the unused `textPlugin` in the plugin list for better clarity.
- Adjusted delay settings in both `smoothReasoningPlugin` and `textPlugin` for optimized processing.
- Enhanced logging in reasoning plugins for better debugging and performance insights.
* feat: implement useSmoothStream hook for dynamic text rendering
- Added a new custom hook `useSmoothStream` to manage smooth text streaming with adjustable delays.
- Integrated the `useSmoothStream` hook into the `Markdown` component to enhance content display during streaming.
- Improved state management for displayed content and stream completion status in the `Markdown` component.
* feat: enhance OpenAI provider handling and add providerParams utility module
- Updated the `createBaseModel` function to handle OpenAI provider responses in strict mode.
- Modified `providerToAiSdkConfig` to include specific options for OpenAI when in strict mode.
- Introduced a new utility module `providerParams.ts` for managing provider-specific parameters, including OpenAI, Anthropic, and Gemini configurations.
- Added functions to retrieve service tiers, specific parameters, and reasoning efforts for various providers, improving overall provider management.
* feat: enhance OpenAI model handling with utility function
- Introduced `isOpenAIChatCompletionOnlyModel` utility function to determine if a model ID corresponds to OpenAI's chat completion-only models.
- Updated `createBaseModel` function to utilize the new utility for improved handling of OpenAI provider responses in strict mode.
- Refactored reasoning parameters in `getOpenAIReasoningParams` for consistency and clarity.
* refactor: remove providerParams utility module
* feat: add web search plugin for enhanced AI provider capabilities
- Introduced a new `webSearchPlugin` to provide unified web search functionality across multiple AI providers.
- Added helper functions for adapting web search parameters for OpenAI, Gemini, and Anthropic providers.
- Updated the built-in plugin index to export the new web search plugin and its configuration type.
- Created a new `helper.ts` file to encapsulate web search adaptation logic and support checks for provider compatibility.
* chore: migrate to v5
* refactor: migrate to v5 patch-1
* fix: unexpected chunk
* refactor: streamline model configuration and factory functions
- Updated the `createModel` function to accept a simplified `ModelConfig` interface, enhancing clarity and usability.
- Refactored `createBaseModel` to destructure parameters for better readability and maintainability.
- Removed the `ModelCreator.ts` file as its functionality has been integrated into the factory functions.
- Adjusted type definitions in `types.ts` to reflect changes in model configuration structure, ensuring consistency across the codebase.
* refactor: migrate to v5 patch-2
* fix(provider): config error
* fix(provider): config error patch-1
* feat: support image
* refactor: enhance model configuration and plugin execution
- Simplified the `createModel` function to directly accept the `ModelConfig` object, improving clarity.
- Updated `createBaseModel` to include `extraModelConfig` for extended configuration options.
- Introduced `executeConfigureContext` method in `PluginManager` to handle context configuration for plugins.
- Adjusted type definitions in `types.ts` to ensure consistency with the new configuration structure.
- Refactored plugin execution methods in `PluginEngine` to utilize the resolved model directly, enhancing the flow of data through the plugin system.
* fix: openai-gemini support
* refactor: update type exports and enhance web search functionality
- Added `ReasoningPart`, `FilePart`, and `ImagePart` to type exports in `index.ts`.
- Refactored `transformParameters.ts` to include `enableWebSearch` option and integrate web search tools.
- Introduced new utility `getWebSearchTools` in `websearch.ts` to manage web search tool configurations based on model type.
- Commented out deprecated code in `smoothReasoningPlugin.ts` and `textPlugin.ts` for potential removal.
* fix: format apihost
* feat: add XAI provider options and enhance web search plugin
- Introduced `createXaiOptions` function for XAI provider configuration.
- Added `XaiProviderOptions` type and validation schema in `xai.ts`.
- Updated `ProviderOptionsMap` to include XAI options.
- Enhanced `webSearchPlugin` to support XAI-specific search parameters.
- Refactored helper functions to integrate new XAI options into provider configurations.
* feat: conditionally enable web search plugin based on configuration
- Updated the logic to add the `webSearchPlugin` only if `middlewareConfig.enableWebSearch` is true.
- Added comments to clarify the use of default search parameters and configuration options.
* feat: aihubmix support
* refactor: improve web search plugin and middleware integration
- Cleaned up the web search plugin code by commenting out unused sections for clarity.
- Enhanced middleware handling for the OpenAI provider by wrapping the logic in a block for better readability.
- Removed redundant imports from various files to streamline the codebase.
- Added `enableWebSearch` parameter to the fetchChatCompletion function for improved functionality.
* fix: azure-openai provider
* feat: enhance web search plugin configuration
- Added `sources` array to the default web search configuration, allowing for multiple source types including 'web', 'x', and 'news'.
- This update improves the flexibility and functionality of the web search plugin.
* chore: update ai package version to 5.0.0-beta.9 in package.json and yarn.lock
* feat: enhance model handling and provider integration
- Updated `createBaseModel` to differentiate between OpenAI chat and response models.
- Introduced new utility functions for model identification: `isOpenAIReasoningModel`, `isOpenAILLMModel`, and `getModelToProviderId`.
- Improved `transformParameters` to conditionally set the system prompt based on the assistant's prompt.
- Refactored `getAiSdkProviderIdForAihubmix` to simplify provider identification logic.
- Enhanced `getAiSdkProviderId` to support provider type checks.
* feat: enhance web search plugin and tool handling
- Refactored `helper.ts` to export new types `AnthropicSearchInput` and `AnthropicSearchOutput` for better integration with the web search plugin.
- Updated `index.ts` to include the new types in the exports for improved type safety.
- Modified `AiSdkToChunkAdapter.ts` to handle tool calls more flexibly by introducing a `GenericProviderTool` type, allowing for better differentiation between MCP tools and provider-executed tools.
- Adjusted `handleTooCallChunk.ts` to accommodate the new tool type structure, enhancing the handling of tool call responses.
- Updated type definitions in `index.ts` to reflect changes in tool handling logic.
* feat: enhance provider settings and model configuration
- Updated `ModelConfig` to include a `mode` property for better differentiation between 'chat' and 'responses'.
- Modified `createBaseModel` to conditionally set the provider based on the new `mode` property in `providerSettings`.
- Refactored `RuntimeExecutor` to utilize the updated `ModelConfig` for improved type safety and clarity in provider settings.
- Adjusted imports in `executor.ts` and `types.ts` to align with the new model configuration structure.
* feat: enhance AiSdkToChunkAdapter for web search results handling
- Updated `AiSdkToChunkAdapter` to include `webSearchResults` in the final output structure for improved web search integration.
- Modified `convertAndEmitChunk` method to handle `finish-step` events, differentiating between Google and other web search results.
- Adjusted the handling of `source` events to accumulate web search results for better processing.
- Enhanced citation formatting in `messageBlock.ts` to support new web search result structures.
* feat: integrate web search tool and enhance tool handling
- Added `webSearchTool` to facilitate web search functionality within the SDK.
- Updated `AiSdkToChunkAdapter` to utilize `BaseTool` for improved type handling.
- Refactored `transformParameters` to support `webSearchProviderId` for enhanced web search integration.
- Introduced new `BaseTool` type structure to unify tool definitions across the codebase.
- Adjusted imports and type definitions to align with the new tool handling logic.
* feat: enhance web search functionality and tool integration
- Introduced `extractSearchKeywords` function to facilitate keyword extraction from user messages for web searches.
- Updated `webSearchTool` to streamline the execution of web searches without requiring a request ID.
- Enhanced `WebSearchService` methods to be static for improved accessibility and clarity.
- Modified `ApiService` to pass `webSearchProviderId` for better integration with the web search functionality.
- Improved `ToolCallChunkHandler` to handle built-in tools more effectively.
* feat: add type property to server tools in MCPService
- Enhanced the server tool structure by adding a `type` property set to 'mcp' for better identification and handling of tools within the MCPService.
* chore: update dependencies and versions in package.json and yarn.lock
- Upgraded various SDK packages to their latest beta versions for improved functionality and compatibility.
- Updated `@ai-sdk/provider-utils` to version 3.0.0-beta.3.
- Adjusted dependencies in `package.json` to reflect the latest versions, including `@ai-sdk/amazon-bedrock`, `@ai-sdk/anthropic`, `@ai-sdk/azure`, and others.
- Removed outdated versions from `yarn.lock` and ensured consistency across the project.
* fix: update provider identification logic in aiCore
- Refactored the provider identification in `index_new.ts` to use `actualProvider.type` instead of `actualProvider.id` for better clarity and accuracy in determining OpenAI response modes.
- Removed redundant type checks in `factory.ts` to streamline the provider ID retrieval process.
* chore: update package dependencies and improve AI SDK chunk handling
- Bumped versions of several dependencies in package.json, including `@swc/plugin-styled-components` to 8.0.4 and `@vitejs/plugin-react-swc` to 3.10.2.
- Enhanced `AiSdkToChunkAdapter` to streamline chunk processing, including better handling of text and reasoning events.
- Added console logging for debugging in `BlockManager` and `messageThunk` to track state changes and callback executions.
- Updated integration tests to reflect changes in message structure and types.
* refactor: reorganize AiSdkToChunkAdapter and enhance tool call handling
- Moved AiSdkToChunkAdapter to a new directory structure for better organization.
- Implemented detailed handling for tool call events in ToolCallChunkHandler, including creation, updates, and completions.
- Added a new method to handle tool call creation and improved state management for active tool calls.
- Updated StreamProcessingService to support new chunk types and callbacks for block creation.
- Enhanced type definitions and added comments for clarity in the new chunk handling logic.
* refactor: enhance provider settings and update web search plugin configuration
- Updated providerSettings to allow optional 'mode' parameter for various providers, enhancing flexibility in model configuration.
- Refactored web search plugin to integrate Google search capabilities and streamline provider options handling.
- Removed deprecated code and improved type definitions for better clarity and maintainability.
- Added console logging for debugging purposes in the provider configuration process.
* chore: add repository metadata and homepage to package.json
- Included repository URL, bugs URL, and homepage in package.json for better project visibility and issue tracking.
- This update enhances the package's metadata, making it easier for users to find relevant resources and report issues.
* chore: remove deprecated patches for @ai-sdk/google-vertex and @ai-sdk/openai-compatible
- Deleted outdated patch files for @ai-sdk/google-vertex and @ai-sdk/openai-compatible from the project.
- Updated package.json to reflect the removal of these patches, streamlining dependency management.
* chore: update package.json and add tsdown configuration for build process
- Changed the main and types entries in package.json to point to the dist directory for better output management.
- Added a new tsdown.config.ts file to define the build configuration, specifying entry points, output directory, and formats for the project.
* chore(aiCore/version): update version to 1.0.0-alpha.0
* feat: enhance AI core functionality and introduce new tool components
- Updated README to reflect the addition of a powerful plugin system and built-in web search capabilities.
- Refactored tool call handling in `ToolCallChunkHandler` to improve state management and response formatting.
- Introduced new components `MessageMcpTool`, `MessageTool`, and `MessageTools` for better handling of tool responses and user interactions.
- Updated type definitions to support new tool response structures and improved overall code organization.
- Enhanced spinner component to accept React nodes for more flexible content rendering.
* feat: add React Native support to aiCore package
Add React Native compatibility configuration to package.json, including the
react-native field and updated exports mapping. Include documentation for
React Native usage with metro.config.js setup instructions.
* chore: bump @cherrystudio/ai-core version to 1.0.0-alpha.1
* chore: bump @cherrystudio/ai-core version to 1.0.0-alpha.2 and update exports
- Updated version in package.json to 1.0.0-alpha.2.
- Added new path mapping for @cherrystudio/ai-core in tsconfig.web.json.
- Refactored export paths in tsdown.config.ts and index.ts for consistency.
- Cleaned up type exports in index.ts and types.ts for better organization.
* refactor: reorganize provider and model exports for improved structure
- Updated exports in index.ts and related files to streamline provider and model management.
- Introduced a new ModelCreator module for better encapsulation of model creation logic.
- Refactored type imports to enhance clarity and maintainability across the codebase.
- Removed deprecated provider configurations and cleaned up unused code for better performance.
* chore: update @cherrystudio/ai-core version to 1.0.0-alpha.4 and clean up dependencies
- Bumped version in package.json to 1.0.0-alpha.4.
- Removed deprecated dependencies from package.json and yarn.lock for improved clarity.
- Updated README to reflect changes in supported providers and installation instructions.
- Refactored provider registration and usage examples for better clarity and usability.
* refactor: streamline AI provider registration by replacing dynamic imports with direct creator functions
- Updated the AiProviderRegistry to use direct references to creator functions for each AI provider, improving clarity and performance.
- Removed dynamic import statements for providers, simplifying the registration process and enhancing maintainability.
* chore: bump @cherrystudio/ai-core version to 1.0.0-alpha.5
- Updated version in package.json to 1.0.0-alpha.5.
- Enhanced provider configuration validation in createProvider function for improved error handling.
* docs: update AI SDK architecture and README for enhanced clarity and new features
- Revised AI SDK architecture diagram to reflect changes in component relationships, replacing PluginEngine with RuntimeExecutor.
- Updated README to highlight core features, including a refined plugin system, improved architecture design, and new built-in plugins.
- Added detailed examples for using built-in plugins and creating custom plugins, enhancing documentation for better usability.
- Included future version roadmap and related resources for user reference.
* feat: enhance web search tool functionality and type definitions
- Introduced new `WebSearchToolOutputSchema` type to standardize output from web search tools.
- Updated `webSearchTool` and `webSearchToolWithExtraction` to utilize Zod for input and output schema validation.
- Refactored tool execution logic to improve error handling and response formatting.
- Cleaned up unused type imports and comments for better code clarity.
* fix: conditionally enable reasoning middleware for OpenAI and Azure providers
- Added a check to enable the 'thinking-tag-extraction' middleware only if reasoning is enabled in the configuration for OpenAI and Azure providers.
- Commented out the provider type check in `getAiSdkProviderId` to prevent issues with retrieving provider options.
* feat: update OpenAI provider integration and enhance type definitions
- Bumped version of `@ai-sdk/openai-compatible` to 1.0.0-beta.8 in package.json.
- Introduced a new provider configuration for 'OpenAI Responses' in AiProviderRegistry, allowing for more flexible response handling.
- Updated type definitions to include 'openai-responses' in ProviderSettingsMap for improved type safety.
- Refactored getModelToProviderId function to return a more specific ProviderId type.
* feat: enhance ToolCallChunkHandler with detailed chunk handling and remove unused plugins
- Updated `handleToolCallCreated` method to support additional chunk types with optional provider metadata.
- Removed deprecated `smoothReasoningPlugin` and `textPlugin` files to clean up the codebase.
- Cleaned up unused type imports in `tool.ts` for improved clarity and maintainability.
* <type>: <subject>
<body>
<footer>
用來簡要描述影響本次變動,概述即可
* refactor: update message handling in searchOrchestrationPlugin for improved type safety
- Replaced `Message` type with `ModelMessage` in various functions to enhance type consistency.
- Refactored `getMessageContent` function to utilize the new `ModelMessage` type for better content extraction.
- Updated `storeConversationMemory` and `analyzeSearchIntent` functions to align with the new type definitions, ensuring clearer memory storage and intent analysis processes.
* chore: bump @cherrystudio/ai-core version to 1.0.0-alpha.6 and refactor web search tool
- Updated version in package.json to 1.0.0-alpha.6.
- Simplified response structure in ToolCallChunkHandler by removing unnecessary nesting.
- Refactored input schema for web search tool to enhance type safety and clarity.
- Cleaned up commented-out code in MessageTool for improved readability.
* refactor: consolidate queue utility imports in messageThunk.ts
- Combined separate imports of `getTopicQueue` and `waitForTopicQueue` from the queue utility into a single import statement for improved code clarity and organization.
* feat: implement knowledge search tool and enhance search orchestration logic
- Added a new `knowledgeSearchTool` to facilitate knowledge base searches based on user queries and intent analysis.
- Refactored `analyzeSearchIntent` to simplify message context construction and improve prompt formatting.
- Introduced a flag to prevent concurrent analysis processes in `searchOrchestrationPlugin`.
- Updated tool configuration logic to conditionally add the knowledge search tool based on the presence of knowledge bases and user settings.
- Cleaned up commented-out code for better readability and maintainability.
* refactor: enhance search orchestration and web search tool integration
- Updated `searchOrchestrationPlugin` to improve handling of assistant configurations and prevent concurrent analysis.
- Refactored `webSearchTool` to utilize pre-extracted keywords for more efficient web searches.
- Introduced a new `MessageKnowledgeSearch` component for displaying knowledge search results.
- Cleaned up commented-out code and improved type safety across various components.
- Enhanced the integration of web search results in the UI for better user experience.
* refactor: streamline async function syntax and enhance plugin event handling
- Simplified async function syntax in `RuntimeExecutor` and `PluginEngine` for improved readability.
- Updated `AiSdkToChunkAdapter` to refine condition checks for Google metadata.
- Enhanced `searchOrchestrationPlugin` to log conversation messages and improve memory storage logic.
- Improved memory processing by ensuring fallback for existing memories.
- Added new citation block handling in `toolCallbacks` for better integration with web search results.
* feat: integrate image generation capabilities and enhance testing framework
- Added support for image generation in the `RuntimeExecutor` with a new `generateImage` method.
- Updated `aiCore` package to include `vitest` for testing, with new test scripts added.
- Enhanced type definitions to accommodate image model handling in plugins.
- Introduced new methods for resolving and executing image generation with plugins.
- Updated package dependencies in `package.json` to include `vitest` and ensure compatibility with new features.
* refactor: enhance image generation handling and tool integration
- Updated image generation logic to support new model types and improved size handling.
- Refactored middleware configuration to better manage tool usage and reasoning capabilities.
- Introduced new utility functions for checking model compatibility with image generation.
- Enhanced the integration of plugins for improved functionality during image generation processes.
- Removed deprecated knowledge search tool to streamline the codebase.
* refactor: migrate to v5 patch-1
* fix: migrate to v5-patch2
* refactor: restructure aiCore for improved modularity and legacy support
- Introduced a new `index_new.ts` file to facilitate the modern AI provider while maintaining backward compatibility with the legacy `index.ts`.
- Created a `legacy` directory to house existing clients and middleware, ensuring a clear separation from new implementations.
- Updated import paths across various modules to reflect the new structure, enhancing code organization and maintainability.
- Added comprehensive middleware and utility functions to support the new architecture, improving overall functionality and extensibility.
- Enhanced plugin management with a dedicated `PluginBuilder` for better integration and configuration of AI plugins.
* chore(yarn.lock): remove deprecated provider entries and clean up dependencies
* chore(package.json): bump version to 1.0.0-alpha.7
* feat(tests): add unit tests for utility functions in utils.test.ts
- Implemented tests for `createErrorChunk`, `capitalize`, and `isAsyncIterable` functions.
- Ensured comprehensive coverage for various input scenarios, including error handling and edge cases.
* feat(aiCore): enhance AI SDK with tracing and telemetry support
- Integrated tracing capabilities into the ModernAiProvider, allowing for better tracking of AI completions and image generation processes.
- Added a new TelemetryPlugin to inject telemetry data into AI SDK requests, ensuring compatibility with existing tracing systems.
- Updated middleware and plugin configurations to support topic-based tracing, improving the overall observability of AI interactions.
- Introduced comprehensive logging throughout the AI SDK processes to facilitate debugging and performance monitoring.
- Added unit tests for new functionalities to ensure reliability and maintainability.
* fix: update MessageKnowledgeSearch to use knowledgeReferences
- Modified MessageKnowledgeSearch component to display additional context from toolInput.
- Updated the fetch complete message to reflect the count of knowledgeReferences instead of toolOutput.
- Adjusted the mapping of results to iterate over knowledgeReferences for rendering.
* refactor(aiCore): update ModernAiProvider constructor and clean up unused code
- Modified the constructor of ModernAiProvider to accept an optional provider parameter, enhancing flexibility in provider selection.
- Removed deprecated and unused functions related to search keyword extraction and search summary fetching, streamlining the codebase.
- Updated import statements and adjusted related logic to reflect the removal of obsolete functions, improving maintainability.
* feat(Dropdown): replace RightOutlined with ChevronRight icon and update useIcons to use ChevronDown
- Introduced a patch to replace the RightOutlined icon with ChevronRight in the Dropdown component for improved visual consistency.
- Updated the useIcons hook to utilize ChevronDown instead of DownOutlined, enhancing the icon set with Lucide icons.
- Adjusted icon properties for better customization and styling options.
* feat(aiCore): add enableUrlContext capability and new support function
- Enhanced the buildStreamTextParams function to include enableUrlContext in the capabilities object, improving the parameter set for AI interactions.
- Introduced a new isSupportedFlexServiceTier function to streamline model support checks, enhancing code clarity and maintainability.
* chore: update dependencies and remove unused patches
- Updated various package versions in yarn.lock for improved compatibility and performance.
- Removed obsolete patches for antd and openai, streamlining the dependency management.
- Adjusted icon imports in Dropdown and useIcons to utilize Lucide icons for better visual consistency.
* refactor(types): update ProviderId type definition for better compatibility
- Changed ProviderId type from a union of keyof ExtensibleProviderSettingsMap and string to an intersection, enhancing type safety.
- Renamed appendTrace method to appendMessageTrace in SpanManagerService for clarity and consistency.
- Updated references to appendTrace in useMessageOperations and ApiService to use the new method name.
- Added a new appendTrace method in SpanManagerService to bind existing traces, improving trace management.
- Adjusted topicId handling in fetchMessagesSummary to default to an empty string for better consistency.
* refactor(types): modify ProviderId type definition for improved flexibility
- Updated ProviderId type from an intersection of keyof ExtensibleProviderSettingsMap and string to a union, allowing for greater compatibility with dynamic provider settings.
* fix: file name
* fix: missing dependencies
* fix: remove default renderer from MessageTool
* feat(provider): enhance provider registration and validation system
- Introduced a new Zod-based schema for provider validation, improving type safety and consistency.
- Added support for dynamic provider IDs and enhanced the provider registration process.
- Updated the AiProviderRegistry to utilize the new validation functions, ensuring robust provider management.
- Added tests for the provider registry to validate dynamic imports and functionality.
- Updated yarn.lock to reflect the latest dependency versions.
* feat(toolUsePlugin): enhance tool parsing and extraction functionality
- Updated the `defaultParseToolUse` function to return both parsed results and remaining content, improving usability.
- Introduced a new `TagExtractor` class for flexible tag extraction, supporting various tag formats.
- Modified type definitions to reflect changes in parsing function signatures.
- Enhanced handling of tool call events in the `ToolCallChunkHandler` for better integration with the new parsing logic.
- Added `isBuiltIn` property to the `MCPTool` interface for clearer tool categorization.
* feat(aiCore): update vitest version and enhance provider validation
- Upgraded `vitest` dependency to version 3.2.4 in package.json and yarn.lock for improved testing capabilities.
- Removed console error logging in provider validation functions to streamline error handling.
- Added comprehensive tests for the AiProviderRegistry functionality, ensuring robust provider management and dynamic registration.
- Introduced new test cases for provider schemas to validate configurations and IDs.
- Deleted outdated registry test file to maintain a clean test suite.
* feat(toolUsePlugin): refactor tool execution and event management
- Extracted `StreamEventManager` and `ToolExecutor` classes from `promptToolUsePlugin.ts` to improve code organization and reduce complexity.
- Enhanced tool execution logic with better error handling and event management.
- Updated the `createPromptToolUsePlugin` function to utilize the new classes for cleaner implementation.
- Improved recursive call handling and result formatting for tool executions.
- Streamlined the overall flow of tool calls and event emissions within the plugin.
* feat(dependencies): update ai-sdk packages and improve logging
- Upgraded `@ai-sdk/gateway` to version 1.0.8 and `@ai-sdk/provider-utils` to version 3.0.4 in yarn.lock for enhanced functionality.
- Updated `ai` dependency in package.json to version ^5.0.16 for better compatibility.
- Added logging functionality in `AiSdkToChunkAdapter` to track chunk types and improve debugging.
- Refactored plugin imports to streamline code and enhance readability.
- Removed unnecessary console logs in `searchOrchestrationPlugin` to clean up the codebase.
* feat(dependencies): update ai-sdk packages and improve type safety
- Upgraded multiple `@ai-sdk` packages in `yarn.lock` and `package.json` to their latest versions for enhanced functionality and compatibility.
- Improved type safety in `searchOrchestrationPlugin` by adding optional chaining to handle potential undefined values in knowledge bases.
- Cleaned up dependency declarations to use caret (^) for versioning, ensuring compatibility with future updates.
* feat(aiCore): enhance tool response handling and type definitions
- Updated the ToolCallChunkHandler to support both MCPTool and NormalToolResponse types, improving flexibility in tool response management.
- Refactored type definitions for MCPToolResponse and introduced NormalToolResponse to better differentiate between tool response types.
- Enhanced logging in MCP utility functions for improved error tracking and debugging.
- Cleaned up type imports and ensured consistent handling of tool responses across various chunks.
* feat(tools): refactor MemorySearchTool and WebSearchTool for improved response handling
- Updated MemorySearchTool to utilize aiSdk for better integration and removed unused imports.
- Refactored WebSearchTool to streamline search results handling, changing from an array to a structured object for clarity.
- Adjusted MessageTool and MessageWebSearchTool components to reflect changes in tool response structure.
- Enhanced error handling and logging in tool callbacks for improved debugging and user feedback.
* feat(aiCore): update ai-sdk-provider and enhance message conversion logic
- Upgraded `@openrouter/ai-sdk-provider` to version ^1.1.2 in package.json and yarn.lock for improved functionality.
- Enhanced `convertMessageToSdkParam` and related functions to support additional model parameters, improving message conversion for various AI models.
- Integrated logging for error handling in file processing functions to aid in debugging and user feedback.
- Added support for native PDF input handling based on model capabilities, enhancing file processing features.
* feat(dependencies): update @ai-sdk/openai and @ai-sdk/provider-utils versions
- Upgraded `@ai-sdk/openai` to version 2.0.19 in `yarn.lock` and `package.json` for improved functionality and compatibility.
- Updated `@ai-sdk/provider-utils` to version 3.0.5, enhancing dependency management.
- Added `TypedToolError` type export in `index.ts` for better error handling.
- Removed unnecessary console logs in `webSearchPlugin` for cleaner code.
- Refactored type handling in `createProvider` to ensure proper type assertions.
- Enforced `topicId` as a required field in the `ModernAiProvider` configuration for stricter validation.
* [WIP]refactor(aiCore): restructure models and introduce ModelResolver
- Removed outdated ConfigManager and factory files to streamline model management.
- Added ModelResolver for improved model ID resolution, supporting both traditional and namespaced formats.
- Introduced DynamicProviderRegistry for dynamic provider management, enhancing flexibility in model handling.
- Updated index exports to reflect the new structure and maintain compatibility with existing functionality.
* feat(aiCore): introduce Hub Provider and enhance provider management
- Added a new example file demonstrating the usage of the Hub Provider for routing to multiple underlying providers.
- Implemented the Hub Provider to support model ID parsing and routing based on a specified format.
- Refactored provider management by introducing a Registry Management class for better organization and retrieval of provider instances.
- Updated the Provider Initializer to streamline the initialization and registration of providers, enhancing overall flexibility and usability.
- Removed outdated files related to provider creation and dynamic registration to simplify the codebase.
* feat(aiCore): enhance dynamic provider registration and refactor HubProvider
- Introduced dynamic provider registration functionality, allowing for flexible management of providers through a new registry system.
- Refactored HubProvider to streamline model resolution and improve error handling for unsupported models.
- Added utility functions for managing dynamic providers, including registration, cleanup, and alias resolution.
- Updated index exports to include new dynamic provider APIs, enhancing overall usability and integration.
- Removed outdated provider files and simplified the provider management structure for better maintainability.
* chore(aiCore): bump version to 1.0.0-alpha.9 in package.json
* feat(aiCore): add MemorySearchTool and WebSearchTool components
- Introduced MessageMemorySearch and MessageWebSearch components for handling memory and web search tool responses.
- Updated MemorySearchTool and WebSearchTool to improve response handling and integrate with the new components.
- Removed unused console logs and streamlined code for better readability and maintainability.
- Added new dependencies in package.json for enhanced functionality.
* refactor(aiCore): improve type handling and response structures
- Updated AiSdkToChunkAdapter to refine web search result handling.
- Modified McpToolChunkMiddleware to ensure consistent type usage for tool responses.
- Enhanced type definitions in chunk.ts and index.ts for better clarity and type safety.
- Adjusted MessageWebSearch styles for improved UI consistency.
- Refactored parseToolUse function to align with updated MCPTool response structures.
* feat(aiCore): enhance provider management and registration system
- Added support for a new provider configuration structure in package.json, enabling better integration of provider types.
- Updated tsdown.config.ts to include new entry points for provider modules, improving build organization.
- Refactored index.ts to streamline exports and enhance type handling for provider-related functionalities.
- Simplified provider initialization and registration processes, allowing for more flexible provider management.
- Improved type definitions and removed deprecated methods to enhance code clarity and maintainability.
* chore(aiCore): bump version to 1.0.0-alpha.10 in package.json
* fix(aiCore): update tool call status and enhance execution flow
- Changed tool call status from 'invoking' to 'pending' for better clarity in execution state.
- Updated the tool execution logic to include user confirmation for non-auto-approved tools, improving user interaction.
- Refactored the handling of experimental context in the tool execution parameters to support chunk streaming.
- Commented out unused tool input event cases in AiSdkToChunkAdapter for cleaner code.
* feat(types): add VertexProvider type for Google Cloud integration
Introduced a new VertexProvider type that includes properties for Google credentials and project details, enhancing type safety and support for Google Cloud functionalities.
* refactor(logging): 将console替换为logger以统一日志管理
* fix(i18n): 更新多语言文件中 websearch.fetch_complete 的翻译格式
统一将“已完成 X 次搜索”改为“X 个搜索结果”格式,并添加 avatar.builtin 字段翻译
* refactor(aiCore): streamline type exports and enhance provider registration
Removed unused type exports from the aiCore module and consolidated type definitions for better clarity. Updated provider registration tests to reflect new configurations and improved error handling for non-existent providers. Enhanced the overall structure of the provider management system, ensuring better type safety and consistency across the codebase.
* chore(dependencies): update ai and related packages to version 5.0.26 and 1.0.15
Updated the 'ai' package to version 5.0.26 and '@ai-sdk/gateway' to version 1.0.15. Also, updated '@ai-sdk/provider-utils' to version 3.0.7 and 'eventsource-parser' to version 3.0.5. Adjusted type definitions in aiCore for better type safety in plugin parameters and results.
* chore(config): add new aliases for ai-core in Vite and TypeScript configuration
Updated the Vite and TypeScript configuration files to include new path aliases for the ai-core package, enhancing module resolution for core providers and built-in plugins. This change improves the organization and accessibility of the ai-core components within the project.
* feat(release): update version to 1.6.0-beta.1 and enhance release notes with new features, improvements, and bug fixes
- Integrated a new AI SDK architecture for better performance
- Added OCR functionality for image text recognition
- Introduced a code tools page with environment variable settings
- Enhanced the MCP server list with search capabilities
- Improved SVG preview and HTML content rendering
- Fixed multiple issues including document preprocessing failures and path handling on Windows
- Optimized performance and memory usage across various components
* refactor(modelResolver): replace ':' with '|' as the default separator for model IDs
Updated the ModelResolver and related components to use '|' as the default separator instead of ':'. This change improves compatibility and resolves potential conflicts with model ID suffixes. Adjusted model resolution logic accordingly to ensure consistent behavior across the application.
* feat(aihubmix): add 'type' property to provider configuration for Gemini integration
* refactor(errorHandling): improve error serialization and update error handling in callbacks
- Updated the error handling in the `onError` callback to use `AISDKError` type for better type safety.
- Introduced a new `serializeError` function to standardize error serialization.
- Modified the `ErrorBlock` component to directly access the error message.
- Removed deprecated error formatting functions to streamline the error utility module.
* feat(i18n): add error detail translations and enhance error handling UI
- Added new translation keys for error details in multiple languages, including 'detail', 'details', 'message', 'requestBody', 'requestUrl', 'stack', and 'status'.
- Updated the ErrorBlock component to display a modal with detailed error information, allowing users to view and copy error details easily.
- Improved the user experience by providing a clear and accessible way to understand error messages and their context.
* feat(inputbar): enhance MCP tools visibility with prompt tool support
- Updated the Inputbar component to include the `isPromptToolUse` function, allowing for better visibility of MCP tools based on the assistant's capabilities.
- This change improves user experience by expanding the conditions under which MCP tools are displayed.
* refactor(aiCore): enhance completions methods with developer mode support
- Introduced a check for developer mode in the completions methods to enable tracing capabilities when a topic ID is provided.
- Updated the method signatures and internal calls to streamline the handling of completions with and without tracing.
- Improved code organization by making the completionsForTrace method private and renaming it for clarity.
* feat(ErrorBlock): add centered modal display for error details
- Updated the ErrorBlock component to include a centered modal for displaying error details, enhancing the user interface and accessibility of error information.
* chore(aiCore): update version to 1.0.0-alpha.11 and refactor model resolution logic
- Bumped the version of the ai-core package to 1.0.0-alpha.11.
- Removed the `isOpenAIChatCompletionOnlyModel` utility function to simplify model resolution.
- Adjusted the `providerToAiSdkConfig` function to accept a model parameter for improved configuration handling.
- Updated the `ModernAiProvider` class to utilize the new model parameter in its configuration.
- Cleaned up deprecated code related to search keyword extraction and reasoning parameters.
* fix(inputbar): conditionally display knowledge icon based on MCP tools visibility
- Updated the Inputbar component to conditionally show the knowledge icon only when both `showKnowledgeIcon` and `showMcpTools` are true. This change enhances the visibility logic for the knowledge icon, improving the user interface based on the current context.
* feat(aiCore): introduce provider configuration enhancements and initialization
- Added a new provider configuration module to handle special provider logic and formatting.
- Implemented asynchronous preparation of special provider configurations in the ModernAiProvider class.
- Refactored provider initialization logic to support dynamic registration of new AI providers.
- Updated utility functions to streamline provider option building and improve compatibility with new provider configurations.
* refactor(aiCore): streamline provider options and enhance OpenAI handling
- Simplified the OpenAI mode handling in the provider configuration.
- Added service tier settings to provider-specific options for better configuration management.
- Refactored the `buildOpenAIProviderOptions` function to remove redundant parameters and improve clarity.
* refactor(aiCore): enhance temperature and TopP parameter handling
- Updated `getTemperature` and `getTopP` functions to incorporate reasoning effort checks for Claude models.
- Refactored logic to ensure temperature and TopP settings are only returned when applicable.
- Improved clarity and maintainability of parameter retrieval functions.
* feat(releaseNotes): update release notes with new features and improvements
- Added a modal for detailed error information with multi-language support.
- Enhanced AI Core with version upgrade and improved parameter handling.
- Refactored error handling for better type safety and performance.
- Removed deprecated code and improved provider initialization logic.
* refactor(aiCore): clean up KnowledgeSearchTool and searchOrchestrationPlugin
- Commented out unused parameters and code in the KnowledgeSearchTool to improve clarity and maintainability.
- Removed the tool choice assignment in searchOrchestrationPlugin to streamline the logic.
- Updated instructions handling in KnowledgeSearchTool to eliminate unnecessary fields.
* chore(package): bump version to 1.6.0-beta.2
* refactor(transformParameters): 移除DEFAULT_MAX_TOKENS并替换console.log为logger.debug
移除未使用的DEFAULT_MAX_TOKENS常量,直接使用传入的maxTokens参数
将调试日志输出从console.log改为更规范的logger.debug
* docs(OrchestrateService): 添加注释说明暂时未使用的类和函数用途
* feat(OrchestrateService): 添加提示变量替换功能
在调用API前替换assistant.prompt中的变量,以支持动态提示内容
* refactor(providers): 重构基础 providers 定义和类型导出
将基础 provider IDs 和 schema 定义移到文件顶部
移除从 baseProviders 动态生成 IDs 的逻辑
使用 satisfies 约束 baseProviders 类型
* refactor(aiCore): 重构provider选项构建逻辑以支持更多provider类型
重构buildProviderOptions函数,使用schema验证providerId并分为基础provider和自定义provider处理
新增对deepseek、openai-compatible等provider的支持
* feat(reasoning): 增强模型推理控制逻辑,支持更多提供商和模型类型
添加对Hunyuan、DeepSeek混合推理等模型的支持
优化OpenRouter、Qwen等提供商的推理控制逻辑
统一不同提供商的思考控制方式
添加日志记录和错误处理
* refactor(aiCore): improve provider registration and model resolution logic
- Enhanced the model resolution logic to support dynamic provider IDs for chat modes.
- Updated provider registration to handle both OpenAI and Azure with a unified approach for chat variants.
- Refactored the `buildOpenAIProviderOptions` function to streamline parameter handling and removed unnecessary parameters.
- Added configuration options for Azure to manage API versions and deployment URLs effectively.
* feat(aiCore): 添加对智谱AI模型的支持
在getReasoningEffort函数中新增对智谱AI模型的支持逻辑,包括判断模型类型及设置对应的推理参数
* feat(翻译): 添加对Qwen MT模型翻译选项的特殊处理
添加对Qwen MT模型的支持,当助手类型为翻译时设置翻译选项。若目标语言不支持则抛出错误
* refactor(aiCore): 将console.log替换为logger.debug以改进日志记录
* refactor(aiCore): 提取 ModernAiProviderConfig 类型以复用
将多处重复的配置类型定义提取为 ModernAiProviderConfig 类型,提高代码可维护性
* refactor(services): 提取 FetchChatCompletionOptions 类型以提升代码可维护性
* refactor(ApiService): 重构 fetchChatCompletion 参数类型定义
将参数类型提取为独立的类型定义,支持 messages 或 prompt 两种参数形式
* fix(ApiService): 使FetchChatCompletionOptions参数变为可选
为了增加接口的灵活性,将options参数改为可选
* fix(ApiService): 修复prompt参数类型并添加消息转换逻辑
根据vercel/ai#8363问题,将prompt参数类型从StreamTextParams['prompt']改为string
当传入prompt参数时自动转换为messages格式
* refactor(translate): 重构语言检测功能,使用通用聊天接口替代专用接口
- 移除专用的语言检测接口 fetchLanguageDetection
- 使用现有的 fetchChatCompletion 接口实现语言检测功能
- 处理 QwenMT 模型的特殊逻辑
- 优化语言检测的提示词和参数处理
* refactor(TranslateService): 重构翻译服务使用新的API接口
移除旧的翻译逻辑,改用新的fetchChatCompletion接口实现翻译功能
简化代码结构并移除不再需要的依赖
* feat(abortController): 添加readyToAbort函数用于创建并注册AbortController
提供便捷方法创建AbortController并自动注册到全局映射中,简化取消操作的流程
* feat(aiCore): 添加对文本增量累积的可配置支持
根据模型是否支持文本增量来决定是否累积文本内容,新增accumulate参数控制行为
* fix(translate): 修复翻译过程中中止控制器的错误处理
修正abortController.ts中中止控制器的回调函数调用方式
统一翻译错误消息的格式化处理
改进翻译服务的中止逻辑和错误传播
* docs(i18n): 添加请求路径的国际化翻译
* fix(api): 修复API检查时的错误处理和取消逻辑
添加对API检查过程中错误的处理,并支持通过abortController取消请求
避免空系统提示词导致的报错,优化检查流程的健壮性
* feat(mini窗口): 添加ErrorBoundary组件包裹内容
为mini窗口内容添加错误边界组件,防止未捕获错误导致整个应用崩溃
* feat(release): 更新版本至1.6.0-beta.3并添加新功能和优化
- 新增多个功能,包括ErrorBoundary组件、智谱AI模型支持、系统OCR功能、文件页面批量删除等
- 重构翻译服务和语言检测功能,提升扩展性和类型安全
- 修复多个问题,改善API检查和翻译过程中的错误处理
- 优化构建配置和性能,提升初始化效率
* test: 更新ApiService测试中ApiClientFactory的模拟路径
* refactor(vertexai): 将VertexAI配置检查从ApiClientFactory移至VertexAPIClient
重构VertexAI客户端的配置检查逻辑,将其从工厂类移动到具体的客户端实现类中
* test(aiCore): 更新客户端兼容性测试的mock数据
添加isOpenAIModel等mock函数用于测试
修复AnthropicVertexClient的mock路径
添加注释说明服务层不应调用React Hook
* fix: 添加注释说明redux设置状态不应被服务层使用
* test(ActionUtils): 添加对ConversationService和models模块的mock测试
* test(Spinner): 更新快照
* test(ThinkingBlock): 移除不再需要的实时计时测试用例
* refactor(ThinkingBlock): 优化条件渲染逻辑以提高可读性
* test(streamCallback): 添加serializeError的mock实现
* fix(registry): enhance provider config validation and update error handling in tests
- Added a check for null or undefined config in registerProviderConfig function.
- Updated tests to ensure proper error messages are thrown when no providers are registered.
- Adjusted mock implementations in generateImage tests to reflect changes in provider model identifiers.
* refactor(aiCore): consolidate StreamTextParams type imports and enhance type definitions
- Moved StreamTextParams type definition to a new file for better organization.
- Updated imports across multiple files to reference the new location.
- Adjusted related type definitions in ApiService and ConversationService for consistency.
* feat(providerConfig): add AWS Bedrock support in provider configuration
- Implemented AWS Bedrock integration by adding access key, region, and secret access key retrieval.
- Enhanced providerToAiSdkConfig function to handle Bedrock-specific options.
* fix(providerConfig): update Google Vertex AI import and creator function name
- Changed the import path for Google Vertex AI to '@ai-sdk/google-vertex/edge'.
- Updated the creator function name from 'createGoogleVertex' to 'createVertex' for consistency.
* feat(providerConfig): implement API key rotation logic for providers
- Added a new function to handle rotating API keys for providers, reusing legacy multi-key logic.
- Updated the providerToAiSdkConfig function to utilize the new key rotation mechanism.
- Enhanced TranslateService imports for better organization.
* fix(aiCore): update file data and mediaType extraction in convertFileBlockToFilePart function
- Modified the conversion logic to correctly extract base64 data and MIME type from the API response.
- Ensured that the filename remains unchanged during the conversion process.
* feat(aiCore): enhance file processing logic in convertFileBlockToFilePart function
- Added support for handling image files and document types beyond PDF.
- Implemented file size limit checks and fallback mechanisms for text extraction.
- Improved logging for file processing outcomes, including success and failure cases.
- Introduced functions to check model support for image input and large file uploads.
* chore(release): update version to 1.6.0-beta.4 and enhance release notes
- Updated version in package.json to 1.6.0-beta.4.
- Revised release notes in electron-builder.yml to reflect new features, improvements, and bug fixes, including API key rotation, AWS Bedrock support, and enhanced file processing capabilities.
* refactor(aiCore): restructure parameter handling and file processing modules
- Removed the transformParameters module and replaced it with a more organized structure under prepareParams.
- Introduced new modules for file processing, model capabilities, and parameter handling to improve code maintainability and clarity.
- Updated relevant imports across services to reflect the new module structure.
- Enhanced logging and error handling in file processing functions.
* refactor(providerConfig): improve provider handling and configuration logic
- Introduced formatPrivateKey utility for better private key management.
- Updated handleSpecialProviders function to streamline provider type checks and error handling.
- Enhanced providerToAiSdkConfig function to include Google Vertex AI configuration with private key formatting.
- Removed commented-out code for clarity and maintainability.
* chore(dependencies): update ai package version and enhance aiCore functionality
- Updated the 'ai' package version from 5.0.26 to 5.0.29 in package.json and yarn.lock.
- Refactored aiCore's provider schemas to introduce new provider types and improve type safety.
- Enhanced the RuntimeExecutor class to streamline model handling and plugin execution for various AI tasks.
- Updated tests to reflect changes in parameter handling and ensure compatibility with new provider configurations.
* refactor(AiSdkToChunkAdapter): streamline web search result handling
- Replaced the switch statement with a source mapping object for improved readability and maintainability.
- Enhanced handling of various web search providers by mapping them to their respective sources.
- Simplified the logic for processing web search results in the onChunk method.
* chore: update release notes and version to 1.6.0-beta.5
- Enhanced web search functionality and optimized knowledge base settings for better performance.
- Added automatic image generation for Gemini 2.5 Flash Image model and improved OCR service compatibility on Linux.
- Refactored AI core architecture and improved message retry mechanisms.
- Fixed various UI component issues and improved overall stability.
* feat: enhance provider configuration and stream text parameters
- Added maxRetries option to buildStreamTextParams for improved error handling.
- Implemented custom fetch logic for 'cherryin' provider to include signature generation in requests.
* chore: update release notes and version to 1.6.0-beta.6
- Refined performance optimizations for AI services and improved compatibility with various providers.
- Enhanced error handling and stability in the ModernAiProvider class.
- Updated version in package.json to 1.6.0-beta.6.
* refactor(ErrorBlock): simplify CodeViewer component usage
- Removed unnecessary props from CodeViewer in ErrorBlock for cleaner code and improved readability.
* refactor(CodeViewer): change children prop type to React.ReactNode
- Updated the children prop type in CodeViewer from string to React.ReactNode for improved flexibility in rendering various content types.
* chore: update migration version and add migration logic for version 147
- Incremented migration version from 146 to 147.
- Implemented migration logic to trim trailing slashes from the apiHost of the anthropic provider.
* feat(错误处理): 增强AI SDK错误处理并添加国际化支持
添加AiSdkErrorUnion类型用于统一处理AI SDK错误
实现safeToString函数安全转换任意值为字符串
添加formatAiSdkError和formatError函数格式化错误信息
在ErrorBlock中重构错误详情展示逻辑,支持多种错误类型
补充国际化字段用于错误信息展示
* feat(i18n): 添加错误相关的多语言翻译字段
* feat(错误处理): 统一使用SerializedError类型处理错误并增强类型安全
重构错误处理逻辑,使用@reduxjs/toolkit的SerializedError类型统一处理错误
新增错误类型定义文件并扩展SerializedError接口
更新相关组件和工具函数以适配新的错误类型
* refactor(CodeViewer): make children prop optional for improved flexibility
* feat(ErrorBlock): add success message on clipboard copy action
* refactor(types): 重构错误类型定义并添加序列化功能
- 将 SerializedError 从 @reduxjs/toolkit 移至本地定义
- 添加 Serializable 类型和序列化工具函数
- 更新相关文件中的错误类型引用
- 实现安全序列化功能用于错误处理
* fix(错误处理): 修复错误块中显示错误信息的问题
修正错误块组件中错误信息的显示问题:
1. 修复BuiltinError组件中错误名称显示为消息的问题
2. 修复AiSdkError组件中原因显示为消息的问题
3. 修复AiApiCallError组件中各种字段显示为消息的问题
4. 使用CodeViewer组件正确显示JSON格式数据
5. 移除CodeViewer组件中不必要的children属性
6. 设置serialize默认pretty为true
* feat(错误处理): 添加序列化错误类型检查函数并更新错误格式化逻辑
添加 isSerializedError 类型检查函数用于判断序列化错误
更新 formatError 和 formatAiSdkError 函数以处理序列化错误类型
修改 ErrorBlock 组件使用新的类型检查函数替代 instanceof 检查
* fix: 使用 SerializedError 类型替换 errorData 的 Record 类型
* fix: 为错误对象添加name和stack字段
在工具执行失败和数据库升级时,为错误对象补充name和stack字段以提供更完整的错误信息
* fix(错误处理): 使用JSON.stringify格式化响应头信息以提高可读性
* fix(ErrorBlock): 修复错误状态码检查逻辑以支持statusCode字段
* fix(ErrorBlock): 修复错误状态码检查逻辑以支持statusCode字段
* feat(AI Provider): Update image generation handling to use legacy implementation for enhanced features
- Refactor image generation logic to utilize legacy completions for better support of image editing.
- Introduce uiMessages as a required parameter for image generation endpoints.
- Update related types and middleware configurations to accommodate new message structures.
- Adjust ConversationService and OrchestrateService to handle model and UI messages separately.
* docs(types): 添加prompt类型的注释
* feat: Update message handling to include optional uiMessages parameter
- Modify BaseParams type to make uiMessages optional.
- Refactor message preparation in HomeWindow and ActionUtils to handle modelMessages and uiMessages separately.
- Ensure compatibility with updated message structures in fetchChatCompletion calls.
* refactor(types): Enhance Serializable type to include SerializableValue for improved serialization handling
- Updated Serializable type to use SerializableValue for better clarity and structure.
- Ensured compatibility with nested objects and arrays in serialization logic.
* refactor(serialize): 重命名 SerializableValue 为 SerializablePrimitive 以提高可读性
将 SerializableValue 类型重命名为 SerializablePrimitive 以更准确地反映其用途,仅包含基本类型
* Revert "refactor(serialize): 重命名 SerializableValue 为 SerializablePrimitive 以提高可读性"
This reverts commit 8408a8d359.
* docs(serialize): 添加注释
* feat(tests): Mock ConversationService to return modelMessages and uiMessages for improved test coverage
- Updated the mock implementation of ConversationService in ActionUtils.test.ts to return structured modelMessages and uiMessages.
- This change enhances the test setup by providing realistic message data for testing purposes.
---------
Co-authored-by: suyao <sy20010504@gmail.com>
Co-authored-by: one <wangan.cs@gmail.com>
Co-authored-by: icarus <eurfelux@gmail.com>
* feat: enhance RichEditor with logging and improve NotesPage editor synchronization
- Added logging for enhanced link setting failures in RichEditor.
- Improved content synchronization logic in NotesPage to prevent unnecessary updates and ensure cleaner state management during file switches.
- Updated markdown conversion to handle task list structures more robustly, including support for div formats in task items.
- Added tests to verify task list structure preservation during HTML to Markdown conversions.
* feat: enhance Markdown preview interaction in AssistantPromptSettings
- Added double-click functionality to toggle preview mode in the Markdown container, preserving scroll position for a smoother user experience.
* refactor: migrate showWorkspace setting from global settings to notes module
- Move showWorkspace state from settings store to notes store for better module cohesion
- Add useShowWorkspace hook in useNotesSettings for consistent access pattern
- Add smooth animation for workspace panel show/hide transition
- Relocate save to notes action to message toolbar for better accessibility
- Add migration v146 to handle state migration for existing users
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: cli lint error
* feat: add open outside menu
* fix: hooks error
* Update useShowWorkspace.ts
* fix: update icon import in NotesSidebarHeader component
- Replaced FilePlus icon with FilePlus2 in the NotesSidebarHeader for consistency with the latest icon set.
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: suyao <sy20010504@gmail.com>
- Removed hardcoded external dependencies and replaced them with dynamic extraction from package.json.
- Cleaned up the configuration for better maintainability and flexibility in managing dependencies.
- Introduced a new translation key 'invalid_model' in English, Japanese, Russian, Chinese (Simplified and Traditional), Greek, Spanish, French, and Portuguese.
- Updated the SelectModelButton component to display an error tag when no valid provider is found, enhancing user feedback.
- Updated getProviderByModel function to improve provider selection.
- Added fallback logic to return a default or cherryin provider if the specified model provider is not found.
- Ensured that the first provider is returned as a last resort, enhancing robustness in provider retrieval.
* feat: integrate file selection and upload functionality in KnowledgeFiles component
- Added useFiles hook to manage file selection.
- Updated handleAddFile to utilize the new file selection logic, allowing multiple file uploads.
- Improved user experience by handling file uploads asynchronously and logging the results.
* feat: enhance file upload interaction in KnowledgeFiles component
- Wrapped Dragger component in a div to allow for custom click handling.
- Prevented default click behavior to improve user experience when adding files.
- Maintained existing file upload functionality while enhancing the UI interaction.
* refactor(KnowledgeFiles): 提取文件处理逻辑到独立函数
将重复的文件上传和处理逻辑提取到独立的processFiles函数中,提高代码复用性和可维护性
---------
Co-authored-by: icarus <eurfelux@gmail.com>
* refactor(dnd): rename idKey to itemKey for clarity
* refactor: key and id type for draggable lists
* chore: update yarn lock
* fix: type error
* refactor: improve getId fallbacks
- Added support for TypeScript incremental builds by enabling the `incremental` option and specifying the `tsBuildInfoFile` in both `tsconfig.node.json` and `tsconfig.web.json`.
- Updated the `typecheck` script in `package.json` to use `concurrently` for running node and web type checks in parallel.
- Added `.tsbuildinfo` to `.gitignore` to prevent build info files from being tracked.
chore: update electron.vite.config.ts and yarn.lock for dependency management
- Added additional external dependencies in electron.vite.config.ts to improve build configuration.
- Updated multiple package versions in yarn.lock, including @napi-rs/wasm-runtime, @oxc-project/runtime, and @rolldown packages to their latest beta versions for better compatibility and performance.
- Adjusted fdir and picomatch versions to ensure alignment with the latest features and fixes.
* refactor(ocr): streamline OCR service registration and improve image preprocessing
- Simplified the registration of the system OCR service by removing the conditional check for Linux.
- Updated SystemOcrService to directly import necessary modules, enhancing clarity.
- Refactored image preprocessing to use a static import of the 'sharp' library for better performance.
* add patch for system-ocr
* add patch
* add patch again
* add patch
* delete setting
* delete i18n
* lint error
* add isLinux
* Revert "delete i18n"
This reverts commit 173e65bbd0.
* Revert "delete setting"
This reverts commit de39c76f83.
* fix: add system check for error message
---------
Co-authored-by: icarus <eurfelux@gmail.com>
* feat(chat/input): allow sending during streaming; remove loading guard
- Inputbar: drop loading check; keep Send clickable; right-click to pause
- Message/MessageMenubar: render menubar even while streaming
- Minor cleanup of unused imports and lints
* feat(chat/menubar): one-click regenerate (remove confirm); add empty-context fallback
- MessageMenubar: remove Popconfirm; click to regenerate
- ApiService: ensure last user message is included if filters empty (avoid messages=[])
- Minor cleanup
* feat(chat/ui): decouple generation from sending; enable actions during streaming
- MessageGroupMenuBar: add “Retry all” (ReloadOutlined) to retry errored/empty/no-block replies; tooltip via i18n
- Context fallback: always include last user message in both messageThunk and ApiService
- i18n: add message.group.retry_failed (zh-CN, en-US, ja-JP, ru-RU, zh-TW)
- Cleanup: remove unused imports; fix lints
* feat(chat/settings): Add confirmation settings for message actions
- Add "Confirm before deleting message" and "Confirm before regenerating message" options to the settings page, allowing users to customize action confirmations.
- Update internationalization files to support multi-language prompt messages.
- Modify the message menu bar to integrate the confirmation logic, enhancing the user experience.
* fix(chat/ui): Apply regeneration confirmation to user messages
Previously, the "Regenerate" action on user messages would trigger immediately, bypassing the `confirmRegenerateMessage` setting. This behavior was inconsistent with the regeneration logic for assistant messages, which correctly showed a confirmation dialog.
This commit wraps the user message's regenerate button in a `Popconfirm` component, conditioned on the `confirmRegenerateMessage` setting. This aligns its behavior with the existing logic for assistant messages.
Now, all regeneration actions are uniformly governed by the user's confirmation preference, creating a more consistent and predictable user experience.
* fix(ui): Only show 'Retry failed' button when errors exist
fix(ui): Conditionally render the 'Retry failed' button
The 'Retry failed messages' button in the message group menu bar was previously always visible, even when no messages had failed.
- The 'Retry failed' button is now conditionally rendered and will only appear if one or more messages in the group meet the failure criteria.
* feat(chat/ui): Add dedicated button to pause message generation
Replaced the undiscoverable right-click-to-pause functionality on the send button with a dedicated, visible "Pause" button. This new button only appears during message generation, making the action intuitive and accessible.
- Removed `onPause` and context menu logic from `SendMessageButton`.
- Added a conditional `CirclePause` button to the `Inputbar` when loading.
* feat(settings/migrate): initialize confirm message flags for legacy users
- Add migration 138 to default confirmDeleteMessage/confirmRegenerateMessage
- No behavior change for fresh installs (uses initialState)
fix(format): correct indentation in MessageMenubar
fix(settings/migrate): fix persistedReducer verison
* fix(ui): resolve React Hook dependency warnings
- Remove unnecessary `topic.prompt` dependencies from Message components
- Remove `loading` dependency from Inputbar useCallback
Resolves ESLint exhaustive-deps warnings and conflicts
---------
Co-authored-by: n2yt584v2t4nh7y <117180266+n2yt584v2t4nh7y@users.noreply.github.com>
- Updated CLAUDE_OFFICIAL_SUPPORTED_PROVIDERS to include 'modelscope'.
- Added API base URL configuration for 'modelscope' under the anthropic provider settings.
- Eliminated the showTokens state and its associated actions from the settings management.
- Updated MessageTokens component to directly display token usage without relying on showTokens.
- Adjusted migration logic to remove default showTokens setting during state initialization.
- Consolidated vision and function calling model definitions into a more structured format.
- Introduced dedicated image generation model checks in the Inputbar component.
- Removed deprecated model checks and updated related logic in ApiService.
- Added new TEXT_TO_IMAGES_MODELS configuration for better image model management.
- Enhanced overall model type handling for improved clarity and maintainability.
- Added conditional registration of the system OCR service for non-Linux platforms.
- Updated SystemOcrService to handle Linux by returning an empty text response.
- Modified image preprocessing to dynamically require the 'sharp' library, improving compatibility and performance.
- Included additional files in the electron-builder configuration for packaging.
- Added the "supported_providers" translation key to English, Japanese, Russian, Simplified Chinese, and Traditional Chinese locale files.
- Updated CodeToolsPage to display a popover with supported providers when the Claude Code model is selected, improving user experience and accessibility of provider information.
- Introduced a new styled component for provider logos to enhance visual representation.
* refactor: replace afterPack script with beforePack and remove after-pack.js file
- Updated electron-builder configuration to use beforePack instead of afterPack.
- Removed the after-pack.js script as its functionality is no longer needed.
* refactor: streamline filter logic for architecture-specific packages in before-pack script
- Consolidated platform-specific filter conditions for arm64 and x64 architectures.
- Improved readability and maintainability by using arrays to manage filters for different architectures.
- Ensured that the correct filters are applied based on the architecture during the packaging process.
* chore: remove npm build commands from CI workflows
- Eliminated unnecessary `yarn build:npm` commands from the nightly build and release workflows for Linux, macOS, and Windows.
- Streamlined the build process by focusing on platform-specific build commands.
* delete build npm
* refactor: enhance architecture-specific package management in before-pack script
- Updated the before-pack script to include additional architecture-specific packages for arm64 and x64.
- Improved the organization of package filters and streamlined the logic for handling different architectures during the packaging process.
- Ensured that the correct filters are applied based on the architecture, enhancing the build process for various platforms.
* docs: clarify comment on prebuild binaries in before-pack script
* format code
* chore: add afterPack script to electron-builder configuration
- Included afterPack script in electron-builder.yml to enhance the packaging process.
- This addition allows for post-packaging tasks to be executed, improving build automation.
* chore: update macOS entitlements to disable library validation
- Added the key `com.apple.security.cs.disable-library-validation` to the entitlements file to enhance security settings for macOS builds.
* chore: remove unused package for win32 arm64 architecture
- Deleted the `@strongtz/win32-arm64-msvc` package from `package.json` and `yarn.lock` as it is no longer needed.
- Updated the `before-pack.js` script to improve architecture-specific package management by refining filter logic and ensuring correct package downloads based on architecture.
- Enhanced the `downloadNpmPackage` function to use Node.js streams for downloading and extracting packages, improving efficiency and error handling.
* feat: add html-tags and htmlparser2 dependencies; enhance CodeViewer and RichEditor components
* fix(NotesPage): prevent unnecessary state clearing when notesTree is empty
* feat(NotesPage): enhance note saving functionality to include file path management
* style: refine button and border styles across components for improved aesthetics
- Updated ToolbarButton styles to simplify background and hover effects.
- Adjusted border styles in NotesEditor, NotesSidebar, and NotesSidebarHeader for a more consistent look.
- Enhanced overall UI by reducing border thickness in various components.
* style: add bottom spacer to richtext component for improved viewport padding
* style: ensure drag handles and plus buttons are interactive in richtext component
* feat(RichEditor): add conditional focus behavior based on text length in rich editor
---------
Co-authored-by: kangfenmao <kangfenmao@qq.com>
- Adjust image block margin from 10px to 1em for better consistency
- Fix single vs multi-image display logic with proper layout
- Update ImageBlock component to handle single/multi display modes
- Fix image model detection logic for better compatibility
- Improve overall spacing between content blocks
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-authored-by: Claude <noreply@anthropic.com>
- Implemented downloading of architecture-specific versions of the @napi-rs/system-ocr packages for macOS and Windows platforms in build-npm.js.
- Updated after-pack.js to retain these packages during the packaging process, ensuring compatibility across different architectures.
* feat: enhance note saving functionality with immediate cache invalidation
* fix: improve file name handling and localization updates
* feat: implement multi-level note sorting and enhance state management
- Introduced sorting options for notes by name, update time, and creation time, allowing users to sort notes in ascending and descending order.
- Updated NotesPage and NotesSidebar components to handle sorting functionality.
- Enhanced Redux store to manage the sorting type, improving state management for note organization.
- Refactored related services to support recursive sorting logic, ensuring a consistent user experience.
* feat(i18n): add new file upload messages for multiple languages
* fix(styles): adjust padding in richtext.scss to accommodate scrollbar
* style(NotesSidebar): add border-top-left-radius to enhance sidebar aesthetics
* feat(RichEditPopup): add isFullWidth prop to enhance popup layout
* feat(RichEditPopup): disable keyboard interaction for improved user experience
* feat(NotesPage): integrate sorting after node deletion and movement
- Added sorting functionality to be triggered after deleting or moving nodes, ensuring notes are organized immediately.
- Updated dependencies in useCallback hooks to include sortType for consistent behavior across operations.
* feat(NotesService): update initWorkSpace and sortAllLevels to accept sortType
- Modified initWorkSpace to include sortType for improved note organization during initialization.
- Enhanced sortAllLevels to optionally accept a tree parameter, allowing for more flexible sorting operations.
- Updated NotesPage to utilize the new parameters, ensuring consistent sorting behavior across various actions.
* feat(NotesSidebar): implement in-place editing for note renaming
- Introduced a new hook, useInPlaceEdit, to manage in-place editing of note names, enhancing user experience during renaming.
- Updated the NotesSidebar component to utilize this hook, streamlining the editing process and improving state management.
- Removed redundant state variables related to editing, simplifying the component's logic.
* refactor(NotesPage): remove commented code for clarity
- Removed a comment regarding folder selection behavior to streamline the code and improve readability.
- This change does not affect functionality but enhances the overall code quality.
* feat(NotesSettings): update initWorkSpace to include default sort type
- Modified initWorkSpace calls in NotesSettings to accept a default sort type of 'sort_a2z', ensuring consistent note organization during path updates and resets.
- This change enhances the initialization process by applying a predefined sorting method.
* fix: initialize notes path on app startup to resolve missing default directory
- Add notes path initialization in store persistStore callback after rehydration
- Update NotesSettings to sync tempPath when notesPath changes from initialization
- Ensure notes directory is set even when user doesn't visit NotesPage first
- Fixes issue where notes path was empty after data reset until NotesPage visit
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Update NotesSettings.tsx
---------
Co-authored-by: Claude <noreply@anthropic.com>
- Added support for downloading and retaining architecture-specific versions of the `@img/sharp` and `@img/sharp-libvips` packages for macOS, Linux, and Windows platforms.
- Removed the deprecated function for deleting macOS-only packages, streamlining the package management process.
- Updated the `after-pack.js` and `build-npm.js` scripts to ensure proper handling of image processing dependencies across different architectures.
- Update version to 1.5.8-rc.1
- Update release notes with latest features and fixes
🤖 Generated with Claude Code
https://claude.ai/code
Co-Authored-By: Claude <noreply@anthropic.com>
* feat: integrate rich text editing
- Replaced the TextEditPopup with RichEditPopup for adding and editing notes, enhancing the editing experience with rich text capabilities.
- Updated note previews to display HTML content appropriately, improving usability and visual representation.
- Added a styled component for note previews to enhance user interaction.
* feat(RichEditor): enhance rich text editing capabilities
- Added new command system for rich text editing, allowing users to execute commands like headings, lists, and formatting.
- Integrated drag handle functionality for better content manipulation within the editor.
- Updated toolbar to include additional formatting options such as strikethrough and code blocks.
- Improved markdown and HTML content handling, enabling seamless conversion and previewing.
- Introduced new utility functions for markdown conversion and sanitization.
- Added tests for command list popover and rich editor functionalities to ensure reliability.
* refactor(RichEditor): remove debug log from command suggestion
* feat(RichEditor): add link and unlink functionality
- Introduced link and unlink commands in the RichEditor toolbar, enhancing text formatting capabilities.
- Updated placeholder text for the RichEditor to provide clearer user guidance.
- Refactored styles and removed unused code to streamline the RichEditor component.
- Added internationalization support for new toolbar items and placeholder text in both English and Chinese.
* wip: custom codeblock
* feat: add new dependencies for markdown processing
- Introduced `he` for HTML entity decoding and `striptags` for stripping HTML tags in markdown conversion.
- Updated `package.json` and `yarn.lock` to include new type definitions and library versions.
* feat(RichEditor): enhance image and math input capabilities
- Added ImageUploader component for embedding images with URL support and drag-and-drop functionality.
- Introduced MathInputDialog for entering LaTeX formulas, allowing real-time updates and integration with the editor.
- Enhanced RichEditor toolbar with new commands for image and math insertion.
- Updated styles for better user experience and accessibility.
- Added internationalization support for new features in multiple languages.
* refactor(CodeBlockView): change export to local variable
- Changed the export of CodeHeader to a local variable within CodeBlockView.
- Removed unused export from code-block-shiki index file.
* feat(RichEditor): enhance command management and toolbar functionality
- Added support for disabling specific commands in the RichEditPopup.
- Implemented dynamic command registration and management in the RichEditor, allowing for initial commands to be registered on mount.
- Updated toolbar to dynamically generate items based on command groups, improving organization and accessibility.
- Introduced new command definitions for text formatting, including bold, italic, underline, and strikethrough, with toolbar visibility options.
- Enhanced command handling capabilities, including the ability to unregister commands and set their availability based on editor context.
* refactor(RichEditPopup): remove translation functionality and related components
- Eliminated translation handling logic, including the translate button and associated state management.
- Cleaned up imports and unused variables to streamline the RichEditPopup component.
- Simplified the content change handling by focusing solely on rich content management.
* feat(ImageUploader): enhance image upload functionality and styling
- Added custom image upload button with improved styling and theme support.
- Refactored image display logic to use a more flexible layout.
- Updated file acceptance criteria to restrict uploads to PNG and JPEG formats.
- Simplified the upload process by preventing default behavior and customizing request handling.
- Improved overall component structure and styling for better user experience.
* feat(AssistantPromptSettings): implement throttled update functionality and enhance UI
- Introduced throttling for the update function to improve performance and reduce unnecessary updates.
- Added a save button to the UI for manual saving of changes, enhancing user experience.
- Refactored the component to streamline the handling of emoji selection and markdown changes.
- Updated layout with Flex component for better alignment of buttons in the settings interface.
* feat(RichEditor): integrate internationalization for placeholder text
- Updated the placeholder property to utilize the i18next translation function, enhancing support for multiple languages.
- Improved user experience by providing localized placeholder text in the RichEditor component.
* fix(styles): update list styles for ordered and unordered lists in richtext.scss
- Removed default list style for ordered lists and added decimal style.
- Added disc style for unordered lists to enhance visual consistency.
* fix(styles): improve table cell background handling in richtext.scss
- Added !important to header background color to ensure consistency.
- Set table cell backgrounds to transparent to prevent inheritance issues during drag operations.
- Updated ProseMirror widget styles to maintain transparency for table cells.
- Enhanced overall table styling to improve user experience.
* fix(styles): update padding and overflow handling in RichEditor
- Increased padding in the tiptap class for improved spacing.
- Modified overflow-x property in EditorContent to allow horizontal scrolling, preventing the drag handle from being cut off.
- Ensured proper positioning and visibility of the drag handle with updated styles.
- Adjusted ProseMirror editor content to maintain drag handle positioning.
* refactor(CodeBlockNodeView, shikijsPlugin): improve language handling for code blocks
- Updated language options to ensure 'text' is always available.
- Introduced a set of languages to skip syntax highlighting, enhancing performance and user experience.
- Simplified logic for checking loaded languages, avoiding unnecessary fallbacks for unsupported languages.
* fix(RichEditor): improve link handling and selection behavior
- Enhanced link insertion logic to ensure the entire paragraph is selected when creating a link.
- Added error handling to toggle link state if selection fails.
- Cleaned up code by moving paragraph text retrieval to the appropriate location for better readability.
* fix(styles): update inline code background and text colors in color.scss
- Changed inline code background color to a solid value for better visibility.
- Updated inline code text color to use RGB format for consistency.
* refactor(RichEditor): simplify editable state management and improve UI interactions
- Removed the disabled prop from RichEditor, simplifying the editable state logic.
- Updated the useRichEditor hook to directly manage the editable state based on the editable prop.
- Enhanced the AssistantPromptSettings component by streamlining the RichEditor rendering logic and improving the save button functionality.
* chore(tests): move useRichEditor test suite
* refactor(RichEditor): enhance command handling and UI responsiveness
- Removed the 'unlink' command from the command list and toolbar for a cleaner interface.
- Improved command filtering logic by removing the maxResults limit.
- Updated command positioning to use fixed strategy with enhanced middleware for better responsiveness.
- Integrated a dynamic virtual list for command suggestions, improving performance and user experience.
- Added internationalization support for 'undo' and 'redo' commands in multiple languages.
* fix(styles): adjust strong tag styling in richtext.scss
- Updated the strong tag styling to apply font-weight to all child elements, ensuring consistent text formatting within rich text content.
* fix(RichEditor): prevent codeBlock nodes from being skipped during drag operations
- Updated the placeholder extension to check for drag operations, ensuring that codeBlock nodes are not skipped when dragging is in progress. This improves the user experience by maintaining expected behavior during content manipulation.
* feat(markdown): integrate turndown-plugin-gfm for enhanced markdown support
- Added turndown-plugin-gfm to enable support for tables and additional markdown features.
- Updated the markdown converter to include new rules for underlining and table elements.
- Enhanced HTML sanitization to allow table-related attributes, improving markdown conversion accuracy.
* feat(markdown): add task list support and enhance markdown conversion
- Integrated @rxliuli/markdown-it-task-lists for task list functionality in markdown.
- Updated markdown converter to handle task list syntax, converting it to appropriate HTML structure.
- Enhanced styles for task lists in richtext.scss to improve visual representation.
- Modified useRichEditor to include task list extensions, ensuring proper functionality within the editor.
* fix(styles): update table header styling in richtext.scss
- Modified table header styling to apply background color and font weight to all child elements, ensuring consistent formatting within tables.
* fix(styles): enhance strong tag styling in richtext.scss
- Added styling for the strong tag to ensure consistent font-weight application across all child elements, improving text formatting in rich text content.
* refactor(markdown): remove @rxliuli/markdown-it-task-lists and implement custom task list plugin
- Removed dependency on @rxliuli/markdown-it-task-lists and integrated a custom task list plugin for markdown-it.
- Enhanced markdown conversion to support task lists with improved HTML structure and sanitization.
- Updated tests to validate task list functionality and ensure proper conversion between markdown and HTML.
* refactor(tests): remove redundant task item label test from markdownConverter tests
- Deleted the test case that checked for the absence of label wrapping around task items, as it is no longer relevant with the updated markdown conversion logic.
- Ensured that existing tests continue to validate the preservation of labels in sanitized HTML for task lists.
* feat(extension-table-plus): add new table extension for Tiptap
- Introduced the @cherrystudio/extension-table-plus package, providing a comprehensive table extension for Tiptap.
- Implemented core functionalities including table, table cell, header, and row management.
- Enhanced the editor with a TableKit for easier table manipulation and integration.
- Updated styles for improved table presentation and interaction within the rich text editor.
- Modified useRichEditor to utilize the new TableKit, ensuring seamless integration with existing features.
* chore(package): remove @tiptap/extension-table dependency
- Deleted the @tiptap/extension-table from package.json and yarn.lock as it is no longer needed.
- Updated dependency management to streamline the project and reduce unnecessary packages.
* chore(package): update package.json for @cherrystudio/extension-table-plus
- Changed the description to reflect the forked nature of the extension.
- Downgraded the version to 3.0.10 to align with the new release strategy.
- Updated the homepage URL to point to the new project site.
- Modified the repository URL to reflect the new GitHub location and directory structure.
* chore(package): update @cherrystudio/extension-table-plus version in package.json
- Changed the version of @cherrystudio/extension-table-plus from workspace:* to ^3.0.10 to align with the new release strategy.
* chore(yarn): update @cherrystudio/extension-table-plus version in yarn.lock
- Changed the version of @cherrystudio/extension-table-plus from workspace:* to npm:^3.0.10 to align with the updated package management strategy.
* chore(useRichEditor): clean up comments and improve code clarity
* chore(package): update @cherrystudio/extension-table-plus version to workspace:^ in package.json and yarn.lock
- Changed the version of @cherrystudio/extension-table-plus from ^3.0.10 to workspace:^ to align with the updated package management strategy.
* chore(tsconfig): add path mapping for @cherrystudio/extension-table-plus in tsconfig.web.json
- Updated tsconfig.web.json to include path mapping for the @cherrystudio/extension-table-plus package, enhancing module resolution for TypeScript.
* chore(dependencies): update ESLint and Prettier configurations
- Added ESLint and Prettier as development dependencies in package.json and yarn.lock.
- Updated lint script to format code and fix issues automatically.
- Enhanced type safety by specifying Node type in TableKit extension.
* fix(deleteTableWhenAllCellsSelected): ensure function returns true after cell count check
- Updated the deleteTableWhenAllCellsSelected function to return true after counting selected table cells, improving the logic for table deletion when all cells are selected.
* chore(electron.config): add path mapping for @cherrystudio/extension-table-plus
- Updated electron.vite.config.ts to include path mapping for the @cherrystudio/extension-table-plus package, improving module resolution for Electron builds.
* refactor(table-cell): rename allowNestedTables to allowNestedNodes and update content type
- Changed the TableCell option from allowNestedTables to allowNestedNodes for clarity on nested node support.
- Updated content type in TableCell and TableHeader from 'block+' to 'paragraph+' to better reflect intended structure.
- Adjusted logic in Table to disallow inserting tables inside nested nodes based on the new option.
* fix: math block bug
* feat(richEditor): add inline and block math commands with updated toolbar support
- Introduced 'inlineMath' and 'blockMath' commands for inserting inline and block mathematical formulas.
- Updated the toolbar to include new commands and their respective tooltips.
- Enhanced the math input dialog to handle both inline and block math types.
- Adjusted markdown conversion to support new math syntax for inline and block math.
- Updated localization files to include translations for new commands.
* feat(table-cell): add cell selection styling and decorations
- Implemented a new plugin for cell selection styling in table cells.
- Added logic to create decorations for selected cells, enhancing visual feedback.
- Updated CSS to style selected cells with borders based on selection edges.
* feat(table): enhance table action handling with new row/column action triggers
- Added optional callbacks for row and column action triggers in TableOptions.
- Implemented row and column action buttons in TableView, allowing for dynamic actions on selected rows and columns.
- Introduced utility functions for calculating cell selection bounds and element border widths.
- Updated styles to accommodate new action buttons and ensure proper positioning.
- Integrated action menu in RichEditor for managing table actions, enhancing user interaction.
* feat(table): enhance table action menu and localization support
- Updated TableOptions to include optional position parameters for row and column action callbacks.
- Refactored TableView to utilize new action callbacks for row and column actions, improving interaction.
- Integrated ActionMenu in RichEditor for better management of table actions, replacing the previous event-based approach.
- Added localization strings for new table action commands in multiple languages, enhancing user accessibility.
* feat(richEditor): update table action icons for improved clarity
- Replaced icons for row insertion actions in the table action menu, using ArrowUp for inserting a row before and ArrowDown for inserting a row after.
- Enhanced visual representation of table actions to better align with user expectations.
* chore(package): bump version to 3.0.11 for @cherrystudio/extension-table-plus
* feat(richtext): enhance table cell styling and resize handle functionality
- Added styles for text overflow handling in table cells to improve readability.
- Introduced a column resize handle with specific positioning and visibility rules.
- Updated the RichEditor to support resizable tables, enhancing user interaction with table elements.
* fix: auto scroll to incomplete command list
* fix: cli
* feat: add MdiDragHandle icon and update RichEditor to use it
- Introduced a new MdiDragHandle SVG icon in the SVGIcon component.
- Replaced the MdiLightbulbOn icon with MdiDragHandle in the RichEditor component for improved functionality.
* feat(RichEditor): add onPaste callback for handling paste events
- Introduced an onPaste callback in both RichEditorProps and UseRichEditorOptions interfaces to allow custom handling of paste events.
- Implemented paste event handling in the useRichEditor hook, converting pasted text to HTML and dispatching it to the editor.
* feat(markdownConverter): extend allowed attributes for HTML sanitization
- Added 'width', 'height', and 'loading' to the list of allowed attributes in the sanitizeHtml function to enhance HTML sanitization capabilities.
* refactor(richtext): update paragraph and heading styles for improved layout
- Removed default margins from paragraphs and adjusted margins for headings to enhance spacing.
- Updated font sizes for headings to improve hierarchy and readability.
- Enhanced blockquote styling with a new border color and italic font style.
- Added specific margin rules for the first and last paragraphs to ensure consistent spacing.
* style(richtext): adjust margins for headings and paragraphs
- Updated heading margins from 'em' to 'rem' for consistency.
- Modified paragraph margins to improve spacing and readability.
- Removed redundant margin rules for first and last paragraphs.
* feat(AssistantPromptSettings): implement draft prompt handling for improved token estimation
- Introduced a draftPrompt ref to manage prompt changes before committing.
- Updated token count estimation to use the draft prompt instead of the current prompt.
- Enhanced the onUpdate function to commit the draft prompt when saving changes.
- Modified handleMarkdownChange to update the draft prompt directly.
* refactor(RichEditor): optimize command handling with useCallback
- Refactored the handleCommand function to use useCallback for improved performance.
- Cleaned up the command handling logic for better readability and maintainability.
- Ensured consistent behavior for link handling and other formatting commands.
* style(richtext): reorganize list styles and enhance task item appearance
- Moved list styles for unordered and ordered lists to a new section for better organization.
- Ensured consistent padding and margin for list items.
- Updated task item styles to improve visual clarity, including checked checkbox appearance.
- Adjusted paragraph margins within list items for improved readability.
* feat(richtext): add table of contents support in RichEditor
- Introduced a new table of contents extension to enhance document navigation.
- Updated RichEditor component to conditionally render the table of contents based on the new `showTableOfContents` prop.
- Integrated table of contents functionality within the useRichEditor hook, allowing for dynamic updates based on document structure.
- Styled the table of contents for improved visibility and usability.
- Updated package.json and yarn.lock to include the new @tiptap/extension-table-of-contents dependency.
* feat(richtext): enhance RichEditor with content search functionality
- Added `enableContentSearch` prop to RichEditor for in-editor content search.
- Integrated ContentSearch component, allowing users to search within the editor.
- Introduced `showUserToggle` and `positionMode` props for ContentSearch customization.
- Updated styling for Container and SearchBarContainer to support new positioning options.
- Adjusted RichEditor settings in AssistantPromptSettings to reflect new content search feature.
* fix: renderer
* fix: styles
* fix: code styles
* fix: table save
* styles: a link
* feat: link editor
* perf: don't show when editable equals to false
* chore: remove some log
* feat: link remove
* style: reduce space for nested list
* fix/link
* feat: add PlusButton to RichEditor and adjust padding in richtext styles
* style: increase font size in richtext styles
* feat: add task list functionality to RichEditor with toolbar integration and localization support
* feat: enhance math dialog positioning and toolbar integration in RichEditor
* feat: enhance Table of Contents functionality with dynamic item display and scroll behavior
* feat: enhance markdown rendering by properly escaping HTML entities in code blocks and inline code
* feat: update link handling in RichEditor to use enhancedLink functionality and auto-update href based on text content
* feat: improve link hover functionality in RichEditor by calculating position based on full link range
* refactor: remove unused MdiDragHandle component from SVGIcon
* fix: update markdown conversion tests to ensure proper HTML output for line breaks and code blocks
* feat: enhance RichEditor functionality by adding code block handling for paste events and keyboard shortcuts for indentation
* feat: enhance code block language options in RichEditor by dynamically loading available languages from Shiki
* feat: update math syntax handling in RichEditor and markdown converter to use $$ for block and inline math
* feat: allow mathPlaceholder node to accept block content in EnhancedMath extension
* feat: improve paste handling in RichEditor by conditionally cleaning HTML based on cursor position and paragraph state
* fix: correct HTML cleaning logic in RichEditor to remove only outer paragraph tags during content insertion
* feat: enhance markdown conversion to support LaTeX in table cells and improve escaping logic
* fix: enhance link hover positioning in RichEditor to account for document boundaries and improve accuracy near the end of the document
* feat: add note book feature (#8234)
* feat: add notes feature with sidebar integration
Introduces a new Notes page and integrates it into the sidebar and routing. Updates sidebar icon types, default icons, and migration logic to support the new 'notes' icon. Adds initial types for notes and folders, and provides a basic NotesPage component. Also updates Chinese locale for notes.
* feat: add notes feature with sidebar, editor, and storage
Introduces a full notes management feature, including a sidebar for folders and notes, a markdown editor using Vditor, and persistent storage of the notes tree. Adds new components (NotesNavbar, NotesSidebar), a NotesService utility for CRUD operations, and updates settings and migration logic to support workspace visibility. Also updates Chinese i18n for notes, and refines the notes type definition.
* feat: enhance notes functionality with auto-save and file name synchronization
* feat: add export to Notes feature
Introduced the ability to export messages and topics to the Notes workspace. Updated UI components, i18n strings, settings, migration logic, and export utilities to support the new export option.
* fix: merge main branch error
* fix: build check error
* Update src/renderer/src/utils/export.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update src/renderer/src/utils/export.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update src/renderer/src/App.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update src/renderer/src/pages/home/Tabs/TopicsTab.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update src/renderer/src/pages/notes/NotesPage.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Revert "Update src/renderer/src/pages/notes/NotesPage.tsx"
This reverts commit a1b9c5a5b0.
* Merge branch 'feat/richeditor' into feat-note
* wip: read markdown
* wip: markdown content save
* fix: content save
* feat: add context menu to notes sidebar and loading state
Implemented a right-click context menu for notes in the sidebar, including options to rename, star, export to knowledge base, and delete notes. Added a loading spinner to NotesPage when loading note content. Updated i18n labels and Chinese translations for new features.
* Enable exporting notes to knowledge base
Added support for exporting individual notes to the knowledge base via a popup. Updated SaveToKnowledgePopup to handle notes, adjusted UI logic for note export, and added relevant i18n strings for export actions and feedback in all supported languages. NotesSidebar now provides an export option in the note context menu.
* Add favorite notes feature to notes sidebar
Introduces the ability to mark notes as favorites and view only starred notes in the sidebar. Updates i18n translations for related labels in all supported languages. Implements UI controls for toggling favorite status and switching between all notes and starred notes view.
* Refactor notes export and update UI labels
Moved NotesService to a shared services directory and updated all imports. Replaced the notes export menu option with a direct 'Save to Notes' action in message and topic menus. Updated i18n labels for 'Save to Notes' in multiple languages and removed the notes export toggle from settings. Cleaned up related migration logic and improved code organization.
* Add drag-and-drop Markdown note upload
Implemented drag-and-drop file upload in NotesSidebar, allowing users to upload Markdown (.md) files directly to notes. Added internationalized messages for upload success, failure, and file type restrictions. Updated NotesService with uploadNote method to handle file storage and tree updates.
* fix: editor init
* Implement drag-and-drop sorting for notes tree
Replaces node moving with a more flexible drag-and-drop sorting mechanism in the notes sidebar. Adds visual indicators for drop positions and updates NotesService with a sortNodes method to handle before, after, and inside placement of nodes. Improves user experience and tree manipulation capabilities.
* fix: some bugs
* fix: remove NotesService class
* Migrate notes tree storage to IndexedDB
Replaced localStorage usage with IndexedDB for storing and retrieving the notes tree structure. Updated NotesService methods and related logic to use the new notes_tree table in Dexie, including making buildNodePath asynchronous. Adjusted translations in NotesSidebar for consistency.
* fix: some bugs
* Merge branch 'feat/richeditor' into feat-note
* feat: enhance RichEditor with table of contents and content search features
Added 'showTableOfContents' and 'enableContentSearch' props to the RichEditor component in NotesPage, improving navigation and search capabilities within notes.
* Add multi-level note sorting functionality
Introduced sorting options for notes by name, update time, and creation time in ascending and descending order. Updated UI and i18n files to support new sorting features, refactored NotesSidebar and NotesPage to handle sorting, and extended NotesService with recursive sorting logic. Added NotesSortType to note types for better type safety.
* perf: reduce rerender
* Add search functionality to notes sidebar
Introduces a search view in the notes sidebar, allowing users to filter notes by keyword. Adds UI elements for toggling search mode and inputting search terms, and updates filtering logic to support both starred and search views.
* Update NotesPage.tsx
* Add header navbar to notes page
Introduced a new HeaderNavbar component for the notes page and integrated it into NotesPage. Adjusted layout styles and reduced NotesSidebar width from 280px to 250px for improved UI consistency.
* Refactor notes state management and add character count i18n
Moved activeNodeId state to Redux store for better state management in NotesPage. Added 'characters' translation key to all supported locales and updated NotesPage to use it. Cleaned exported note content in exportMessageToNotes to remove assistant header.
* Add breadcrumb navigation to notes header
Introduces breadcrumb navigation in the notes header by passing notesTree to HeaderNavbar and implementing path calculation using getNodePathArray. Also exports findNodeInTree and refactors layout for improved UI structure.
* fix: style
* fix: update sorting labels and title capitalization in localization files for multiple languages
* style: adjust margin and padding in TableOfContentsWrapper and ToCDock components
* feat: implement content update handling in RichEditor and enhance mode switching in NotesPage
* refactor: remove redundant content update handling in RichEditor
* Update NotesPage.tsx
* Update NotesPage.tsx
* feat: enhance Table of Contents functionality with dynamic item display and scroll behavior
* fix: update markdown conversion tests to ensure proper HTML output for line breaks and code blocks
* feat: add support for saving pasted images in RichEditor with compression handling and IPC integration
* feat: enhance markdown conversion to support file:// protocol images as HTML img tags
* fix: update RichEditor styles for overflow handling and adjust markdown conversion to preserve <br> tags
* fix: refine RichEditor styles to improve text wrapping and ensure proper display of paragraphs
* Update NotesPage.tsx
* fix: update content structure in TableCell and EnhancedImage to allow for multiple block types
* feat: add methods to set selection to the last row and last column in TableView for improved user experience
* fix: adjust table layout and minimum width in RichEditor styles for better responsiveness and display
* fix: update table layout and scrollbar styles in RichEditor for improved responsiveness and user experience
* fix: improve style
* fix: update content structure in TableCell to support images alongside paragraphs
* fix: enhance layout and styling in NotesPage for improved responsiveness and user experience
* fix: unsaved mention
* Update NotesPage.tsx
* Update NotesPage.tsx
* fix: refine styling in RichEditor and NotesPage for improved layout and responsiveness
* fix: remove extraneous text from Navbar component rendering
* fix: adjust layout and styling in HeaderNavbar for better alignment and responsiveness
* fix: update Scrollbar styling in RichEditor for improved layout
* feat: implement enhanced math command in RichEditor for improved math placeholder insertion
* chore: update @tiptap dependencies to version 3.2.0 and enhance drag handling in RichEditor
* refactor: remove italic font style from rich text and clean up button styles in RichEditor
* refactor: streamline drag handle behavior and adjust styling in RichEditor for improved layout
* style: add code block styling to rich text for consistent font properties
* feat: add tooltips for plus button and drag handle in RichEditor for enhanced user guidance
* fix: update @tiptap/extension-drag-handle to use a patch version for improved functionality in RichEditor
* feat: enhance RichEditor with full width and font family options, and update settings localization
* feat: add drop hint for importing markdown files in NotesSidebar and update localization for multiple languages
* refactor: remove EditorContainer and simplify JSX structure in NotesPage for cleaner layout
* feat: add copy content functionality to HeaderNavbar and update localization for multiple languages
* refactor: simplify NotesPage by integrating NotesEditor component and optimizing state management with useCallback
* wip: open external folder
* feat: enable full width option in AssistantPromptSettings for improved layout
* wip: open external folder
* wip: open external folder
* wip: open external folder
* fix: move node
* wip: fix file rename
* refactor: notebook feature
* fix: improve file and directory deletion and renaming logic
Enhanced error handling and logging for external file and directory deletion in FileStorage. Updated file renaming to consistently append '.md' extension. Improved NotesService and NotesTreeService to use externalPath for renaming and fixed path updates for renamed nodes. Breadcrumbs in HeaderNavbar now reset when no active node is present. File scanning now strips file extension from node names.
* Refactor notes directory handling and state management
Replaces 'folderPath' with 'notesPath' throughout the codebase for clarity and consistency. Adds getNotesDir utility and updates IPC, FileStorage, Redux store, hooks, and UI components to use the new notes directory logic. Improves initialization and workspace setup for notes, ensuring correct directory creation and state synchronization.
* fix
* wip: ensure unique names for notes and folders
Introduces logic to prevent name collisions when creating or uploading notes and folders by checking for existing paths and appending a counter if necessary. Updates related services and UI to handle only one file upload at a time and provide user feedback for invalid actions.
* feat: add file watcher functionality and validate notes directory
Introduces a file watcher using chokidar to monitor changes in the notes directory. Adds IPC channels for starting and stopping the watcher, and validates the selected notes directory to ensure it meets specific criteria. Updates relevant components and services to integrate the new functionality, enhancing the application's responsiveness to file changes.
* fix: add file name validation and uniqueness checks
Introduces file name legality and uniqueness checks to prevent duplicate or invalid file/folder names. Updates IPC, backend, and renderer logic to use these checks for creating, renaming, and uploading notes and folders. Removes legacy unique name logic and refactors related code for consistency.
* fix: file name guard
* fix: rename
* Update NotesSettings.tsx
* Update NotesSettings.tsx
* feat: enhance notes settings and editor functionality
Refactors the notes settings to introduce new display and editor configurations, including options for default view modes and content compression. Updates the Redux store to manage these new settings and modifies relevant components to reflect the changes. Ensures a more intuitive user experience by allowing users to customize their editing environment and display preferences.
* feat: enhance file change handling and directory scanning
Introduces a new FileChangeEvent type to manage file system events more effectively. Updates the FileStorage service to handle directory operations with immediate synchronization and implements a debounce mechanism for file changes. Enhances the scanDir function to support recursive directory scanning with a configurable depth, improving the overall file management capabilities. Additionally, updates the Redux store to track active file paths instead of node IDs, streamlining the note management process.
* feat: enhance directory scanning and note management
Updates the scanDir function to include an optional basePath parameter for improved relative path handling. Modifies the NotesPage and NotesSidebar components to manage selected folder states, allowing for more intuitive folder and note creation. Refactors the createFolder and createNote services to ensure proper tree structure updates based on the selected folder. Additionally, introduces a new utility function to find nodes by external path, enhancing the overall note management experience.
* feat: improve code block highlighting and note saving functionality
Enhances the ShikiPlugin to load themes and languages only when necessary, preventing redundant operations. Introduces error handling for loading processes. In the NotesPage component, implements a debounced save mechanism to optimize note saving, ensuring that changes are saved only after a pause in typing. Additionally, adds logic to compare file content changes before triggering updates, improving the efficiency of file watching and content management.
* Update file.ts
* fix: improve file name validation and sanitization
Refactored file name validation logic to support platform-specific rules and provide detailed error messages. Added a sanitizeFilename utility to clean file names by replacing invalid characters and handling reserved names. Updated getName and checkName functions to use the new validation and sanitization methods.
* fix: remove unused languageMap from useRichEditor hook
Eliminated the languageMap variable from the useRichEditor hook as it was not being utilized, streamlining the code and improving performance. Updated dependencies in the effect hook accordingly.
* refactor: streamline theme and language loading in ShikiPlugin
Removed unnecessary snapshot logic for loaded themes and languages in the ShikiPlugin. Simplified the loading check by introducing a flag to track if any themes or languages were loaded, enhancing performance and reducing complexity.
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: suyao <sy20010504@gmail.com>
* feat: add isTextFile method to API for file type checking
Introduced a new method `isTextFile` in the preload API to determine if a given file path corresponds to a text file. This enhancement improves file handling capabilities within the application.
* refactor: remove useRichEditor test file
* fix: add i18n
* Update fr-fr.json
* fix: merge main branch build error
* fix the missing navbar when the navigation bar is on the left
* fix: version
* feat: update NotesEditor and NotesService functionality
- Added a temporary view mode state in NotesEditor for improved UI handling.
- Enhanced sortAllLevels function in NotesService to persist the notes tree after sorting.
- Changed default edit mode in note state from 'realtime' to 'preview' for better user experience.
* fix: prevent expanded CodeEditor in NotesEditor
* feat: implement initial sorting for notes tree
- Added a new ref to track if initial sorting has been applied.
- Introduced a useEffect to apply alphabetical sorting to the notes tree on initial load, ensuring a consistent order for users.
- Included error handling for the sorting process to log any issues encountered.
* refactor: comment out file content comparison logic in NotesPage
- Temporarily disabled the file content comparison logic in the NotesPage component to streamline the file reading process.
- This change is intended for further review and potential optimization of the file handling functionality.
* style: remove overflow-y property from richtext.scss
- Eliminated the overflow-y property to improve the styling of the rich text editor, allowing for better content display and user experience.
---------
Co-authored-by: Pleasure1234 <3196812536@qq.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: one <wangan.cs@gmail.com>
* feat: add Zhipu logo and update related images
- Introduced a new Zhipu logo component in SVG format.
- Updated existing image assets for chatglm, zhipu, and zhipu_dark.
- Added a new zhipu image for search functionality.
* feat: integrate Cherryin signature generation
- Added a new integration for Cherryin, including a signature generation feature.
- Updated IPC channels to handle Cherryin requests.
- Introduced a new JavaScript file for Cherryin integration.
- Modified configuration files to include Cherryin client secrets and paths.
- Enhanced the ESLint and TypeScript configurations to accommodate the new integration.
* feat: add Zhipu search provider and logo integration
- Implemented a new ZhipuProvider for web search functionality.
- Added Zhipu logo to the WebSearchButton component.
- Updated WebSearchProviderFactory to include Zhipu as a search option.
- Enhanced error handling and logging for Zhipu search requests.
* feat: add cherryin provider
* fix: correct import path for CherryinAPIClient and update paintings state structure in migration
* chore: update version number to 1.5.8 in package.json
* feat: enhance model filtering in SelectModelPopup
- Added support for identifying free trial models in the model filtering logic.
- Updated the condition for determining free models to include both free and free trial models.
* refactor: update navigation to use query parameters for provider settings
- Modified navigation logic in FreeTrialModelTag and related utilities to use query parameters instead of state for provider identification.
- Removed unused useLocation hook in ProviderList component to streamline state management.
* fix: remove provider ID from search parameters on selection change in ProviderList
* refactor: remove free trial model references and update related logic
- Eliminated the FreeTrialTag component and its associated logic from ModelTagsWithLabel and SelectModelPopup.
- Updated model filtering to only consider free models without the free trial distinction.
- Removed translations and utility functions related to free trial models across multiple locales.
* fix: prevent mutation of read-only properties in web search provider
- Updated the addWebSearchProvider function to clone the provider object before pushing it to the state, preventing mutation of read-only properties.
- Enhanced the migration logic to update the apiKey for the zhipu web search provider if it exists.
* refactor: streamline provider selection and navigation logic
- Updated FreeTrialModelTag to directly navigate to provider settings using query parameters, removing unnecessary provider fetching.
- Simplified ProviderList by eliminating the EventEmitter for provider selection and ensuring search parameters are updated correctly.
* fix: replace hardcoded window size on first start
Signed-off-by: dev <verc20.dev@proton.me>
* fix: change MIN_WINDOW_WIDTH from 1080 to 960
---------
Signed-off-by: dev <verc20.dev@proton.me>
* feat: add batch delete functionality for files page
- Add batch selection with checkboxes for individual files
- Implement batch delete operation with confirmation dialog
- Add select all/none functionality with indeterminate state
- Include safety check to prevent deleting files used in paintings
- Support multiple languages for batch operation UI text
- Exclude image files from batch operations per design requirements
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* style: make batch delete popconfirm icon color consistent
- Add red color styling to batch delete popconfirm icon to match individual delete
- Update i18n translations for batch warning message across all locales
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor: improve batch delete UX and i18n translations
- Change "batch_operation" label to "Select All" across all languages
- Remove unused batch_warning translation for paintings
- Simplify delete confirmation messages to use single form
- Optimize batch delete to use Promise.all for better performance
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
* fix: not using system default terminal on deepin
deepin-terminal is not in the `linuxTerminals` list, that will
cause xterm picked as the terminal to run code tool, which has
compatibility with Chinese charaters.
see: https://bbs.deepin.org.cn/post/290948
Signed-off-by: Hualet Wang <mr.asianwang@gmail.com>
* feat(codetool): add support for deepin-terminal
---------
Signed-off-by: Hualet Wang <mr.asianwang@gmail.com>
Co-authored-by: GeorgeDong32 <GeorgeDong32@qq.com>
Updated the terminal command execution logic to open a new tab in the Terminal application for running commands. This change enhances user experience by keeping the original tab available while executing commands in a separate tab.
Added logic to extract and decode the actual target URL from Bing redirect links in LocalBingProvider. Also introduced debug logging in SearchService to log search URLs.
* refactor(DraggableList): remove antd List component
The DraggableList component was unnecessarily wrapped in an antd List component. This change removes the antd List and replaces it with a standard div.
A `className` has been added to the new div for testing purposes. The `listProps` prop is preserved and its type is updated to `React.HTMLAttributes<HTMLDivElement>`.
The tests have been updated to reflect the new DOM structure, using a class selector instead of a data-testid. The antd mock has been removed, and the snapshot has been updated.
* test: fix
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
The putFile method no longer sets the Content-Length header and now includes the duplex: 'half' option in the net.fetch call. This change ensures compatibility with streaming uploads and the requirements of net.fetch.
* refactor(ProxyManager): enhance bypass rule matching and logging
- Updated the `isByPass` function to improve hostname and port matching against bypass rules.
- Refactored the dispatcher logic to utilize the updated `isByPass` function for better clarity.
- Enhanced logging to include bypass rules in system proxy change notifications.
- Simplified URL handling in the dispatcher to ensure consistent behavior.
* delete file
* refactor(ProxyManager): improve bypass rule handling and error logging
- Enhanced the `isByPass` function to check for bypass rules more efficiently, including improved error handling and logging for rule parsing failures.
- Added error logging for exceptions during URL processing.
- Cleaned up the logic to ensure consistent return values and better readability.
- Removed unnecessary environment variable deletions in the proxy manager cleanup process.
* feat(ProxyManager): add no_proxy environment variable support
- Introduced the `no_proxy` environment variable to allow bypassing specific hosts in proxy settings.
- The `no_proxy` value is constructed from the existing bypass rules, enhancing flexibility in proxy management.
* refactor(TranslateService): remove content parameter from fetchTranslate function
- Updated fetchTranslate function to eliminate the content parameter, simplifying its signature.
- Adjusted related calls to ensure compatibility with the new function definition, maintaining functionality while improving code clarity.
* Update src/renderer/src/services/TranslateService.ts
---------
Co-authored-by: Phantom <59059173+EurFelux@users.noreply.github.com>
build: add sharp dependency for image processing
* Added sharp as a dependency in package.json to enhance image processing capabilities.
* Removed sharp from the devDependencies section.
* Refactored OCR image preprocessing by integrating grayscale and normalization directly into the process, improving overall efficiency.
* refactor(CopilotService): streamline token file handling and improve error management
- Consolidated token file path retrieval into a dedicated method for better clarity and maintainability.
- Updated file system operations to ensure directory existence before writing the token file.
- Enhanced error handling during token save and read operations, ensuring robust logging and user feedback.
* lint
* build: add sharp dependency for image processing
- Added sharp as a dependency in package.json to support image processing functionalities.
- Removed sharp from the devDependencies section to ensure it is available in production.
* fix(cmd): quote executable path on Windows in command string
Wrap the executable path in double quotes when running on Windows sopaths containing spaces are handled correctly. Previously the base
command used an unquoted path which could break execution for users
whose install location includes spaces. This change only alters the
Windows branch to produce a quoted executable path while keeping the
non-Windows command unchanged.
* fix(codetool): quote bun paths in shell commands to spaces
* fix(OpenAIApiClient): update toolCalls handling to support dynamic index assignment
* refactor(OpenAIApiClient): streamline toolCalls management with reusable object structure
* fix: unexpected anthropic model recognization
* refactor(RawStreamListenerMiddleware): replace model provider retrieval with API client instance check
* fix(renderer): prevent overlays from entering titlebar drag region via no-drag and platform safe gap; cap modal body height; fixes#9123
* fix: modal close button intercepted by drag region in small window mode
- Set modal content as no-drag to ensure button clickability
- Use z-index layering for titlebar drag region management
- Remove redundant platform detection and CSS variables
* refine: only disable drag on modal close button instead of entire modal content
This allows users to still drag the window by clicking on modal header or other areas,
improving UX in small window scenarios while still protecting the close button interaction.
* refactor: simplify NotificationService initialization and use windowService for notifications
- Removed the dependency on BrowserWindow in NotificationService constructor.
- Updated the notification handling to utilize windowService for showing notifications and sending events, improving code modularity.
* refactor: remove constructor from NotificationService for cleaner initialization
* refactor(CodeToolsPage): streamline CLI tool management and enhance provider filtering logic
- Removed hardcoded CLI tool options and supported providers, replacing them with imported constants for better maintainability.
- Optimized provider filtering to include additional providers for Claude and Gemini tools.
- Updated environment variable handling for CLI tools to utilize a centralized API base URL function.
* refactor(CodeToolsPage): enhance CLI tool management and environment variable handling
- Updated provider filtering logic to utilize a centralized mapping for CLI tools, improving maintainability and extensibility.
- Refactored environment variable generation and parsing to streamline the launch process for different CLI tools.
- Simplified state management for tool selection and directory handling, enhancing code clarity.
* Add 'builtin avatar' option to avatar dropdown
-Introduces a new 'builtin avatar' option to the avatar selection dropdown in AddProviderPopup.
-Updates i18n translation files for all supported languages to include the 'builtin' avatar label.
Signed-off-by: Yuhang <190720896+YuhangHere@users.noreply.github.com>
* Add provider logo picker for builtin avatar selection
-Introduces a ProviderLogoPicker component for selecting a builtin provider logo as an avatar in AddProviderPopup.
-Updates provider logo handling in ProviderSettings.(If deleting the logoFile caused any issues, I sincerely apologize.)
Signed-off-by: Yuhang <190720896+YuhangHere@users.noreply.github.com>
* Adjust ProviderLogoPicker layout dimensions and grid
Signed-off-by: Yuhang <190720896+YuhangHere@users.noreply.github.com>
* Fix ProviderLogoPicker popover trigger behavior
Signed-off-by: Yuhang <190720896+YuhangHere@users.noreply.github.com>
* Merge branch 'main' into feat/add-builtin-provider-avatars
* Update index.tsx
---------
Signed-off-by: Yuhang <190720896+YuhangHere@users.noreply.github.com>
* fix: add provider check in isMandatoryWebSearchModel
* Fix: Add provider check in isMandatoryWebSearchModel
The isMandatoryWebSearchModel function was throwing an error when the provider was undefined. This change adds a check to ensure the provider exists before accessing its properties, similar to how it's handled in isWebSearchModel.
The position of the check has also been moved to be between the provider and modelId initializations for better code flow.
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
* fix: incorrect default avatar casing in custom provider
* add background color to default avatar in custom provider
distinction among providers.
* set ProviderInitialsLogo text color to white
添加完背景色后发现,模型列表中默认头像字体始终为白色,而编辑提供商时默认头像字体颜色会随主题色而变,黑色字体某些背景色下不清晰(比如a),所以改成始终白色
* fix: default avatar fallback when no text is entered
-设置背景色后发现,未输入文本时的背景色是根据上一个背景色继续保持的,该情况下回退到默认背景颜色
-回退后白色字体又看不清,该情况下字体颜色回退到黑色
-最终效果就是未输入文本时显示的默认头像回退到与之前一致
* fix: do not reset citation block id
* refactor: disable external websearch for mandatory websearch models
* refactor: predicate
* refactor: include openrouter perplexity
- Enhanced DraggableList component to accept listProps, allowing for customization of the Ant Design List component.
- Updated MCPSettings to utilize the new listProps feature, providing a custom empty state message when no servers are available.
* support openai codex
* lint
* refactor: remove unused codeTools enum from constant.ts
* fix build
* fix lin
* fix: add support for qwenCode CLI tool and improve error handling in CodeToolsService
* refactor: use code font family in HtmlArtifactsCard
* fix: pass onSave to HtmlArtifactsPopup
* feat: add a save button
* fix: avoid extra blank lines
* feat: make split view resizable
* refactor: improve streaming check, simplify Markdown component
* refactor: improve button style and icons
* test: update snapshots, add tests
* refactor: move font family to TerminalPreview
* test: update
* refactor: add explicit type for Node
* refactor: remove min-height
* fix: type
* refactor: improve scrollbar and splitter style
* fix: prevent incorrect @ symbol deletion in QuickPanel
- Track trigger source (input vs button) and @ position
- Only delete @ when triggered by input with model selection
- Button-triggered panels never delete text content
- Validate @ still exists at recorded position before deletion
* feat: delete search text along with @ symbol
- Pass searchText from QuickPanel to onClose callback
- Delete both @ and search text (e.g., @cla) when model selected
- Validate text matches before deletion for safety
- Fallback to deleting only @ if text doesn't match
* refactor: clarify ESC vs Backspace behavior in QuickPanel
- ESC: Cancel operation, delete @ + searchText when models selected
- Backspace: Natural editing, @ already deleted by browser, no extra action
- Clear separation of intent improves predictability and UX
* fix(export): robustly export reasoning and handle errors
* fix(export): normalize <br> to newline before notion parsing
* feat(i18n): add notion truncation and unify export warn keys
* refactor(export): add typing, state guards, and error logging
* fix(export): preserve existing <br> in reasoning when convert to html
* feat(export): add DOMPurify sanitization for reasoning content
* chore(deps): remove unused @types/dompurify dev dep
* chore(deps): remove dompurify dependency
Remove dompurify from package.json and yarn. The changes
delete dompurify entries and simplify the lockfile resolution so the
project no longer declares dompurify as a direct dependency.
This cleans up unused dependency declarations and prevents installing
dompurify when it is not required.
* refactor(ManageModelsPopup): remove margin of Empty
* chore: use destroyOnHidden rather than deprecated destroyTooltipOnHide
* refactor: center Empty
* fix: Update KnowledgeBase form and service to handle preprocess provider correctly
- Enhanced useKnowledgeBaseForm hook to set preprocessProvider with the correct providerId type.
- Modified getKnowledgeBaseParams function to retrieve preprocess provider from the store instead of the base, ensuring accurate provider assignment.
* fix: Remove unused providerId from preprocessProvider in useKnowledgeBaseForm hook
- Cleaned up the useKnowledgeBaseForm hook by removing the unused providerId property from the preprocessProvider object, ensuring a more accurate representation of the data structure.
* format code
* feat: Sync preprocess provider updates across knowledge bases
- Added a new action to synchronize updates to the preprocess provider across all knowledge bases that reference it.
- Updated the usePreprocessProvider hook to dispatch the new sync action after updating the provider.
- Modified getKnowledgeBaseParams to ensure the correct preprocess provider is assigned when retrieving knowledge base parameters.
* fix: Update sync logic for preprocess provider updates
- Modified the syncPreprocessProvider action to merge updates directly into the existing provider object instead of replacing it.
- Adjusted the usePreprocessProvider hook to only dispatch the sync action when specific fields (apiHost, apiKey, model) are updated, improving efficiency.
* refactor: replace axios and node fetch with electron's net module for network requests in preprocess providers
- Updated Doc2xPreprocessProvider and MineruPreprocessProvider to use net.fetch instead of axios for making HTTP requests.
- Improved error handling for network responses across various methods.
- Removed unnecessary AxiosRequestConfig and related code to streamline the implementation.
* lint
* refactor(Doc2xPreprocessProvider): enhance file validation and upload process
- Added file size validation to prevent loading files larger than 300MB into memory.
- Implemented file size check before reading the PDF to ensure efficient memory usage.
- Updated the file upload method to use a stream, setting the 'Content-Length' header for better handling of large files.
* refactor(brave-search): update net.fetch calls to use url.toString()
- Modified all instances of net.fetch to use url.toString() for better URL handling.
- Ensured consistency in how URLs are passed to the fetch method across various functions.
* refactor(MCPService): improve URL handling in net.fetch calls
- Updated net.fetch to use url.toString() for better type handling of URLs.
- Ensured consistent URL processing across the MCPService class.
* feat(ProxyManager): integrate axios with fetch proxy support
- Added axios as a dependency to enable fetch proxy usage.
- Implemented logic to set axios's adapter to 'fetch' for proxy handling.
- Preserved original axios adapter for restoration when disabling the proxy.
- Renamed method from _getPreReleaseVersionFromGithub to _getReleaseVersionFromGithub for clarity.
- Enhanced logic to check for the latest release version using semver.
- Removed unnecessary checks related to test plans when updates are not available.
- Improved logging for better traceability of release version fetching.
* fix(QuickPanel): auto-close panel when no commands match (#7824)
Fixes the issue where QuickPanel remains visible when user types
invalid slash commands. Now the panel intelligently closes after
300ms when no matching commands are found.
- Add smart delayed closing mechanism for unmatched searches
- Optimize memory management with proper timer cleanup
- Preserve existing trigger behavior for / and @ symbols
* feat(inputbar): intelligent @ symbol handling on model selection panel close
- Add smart @ character deletion when user selects models and closes panel with ESC/Backspace
- Preserve @ character when user closes panel without selecting any models
- Implement action tracking using useRef to detect user model interactions
- Support both ESC key and Backspace key for consistent behavior
- Use React setState instead of DOM manipulation for proper state management
Resolves user experience issue where @ symbol always remained after closing model selection panel
* perf(QuickPanel): optimize timer management and fix React anti-patterns
- Move side effects from useMemo to useEffect for proper React lifecycle
- Add automatic timer cleanup on component unmount and dependency changes
- Remove unnecessary timer creation/destruction on each search input
- Improve memory management and prevent potential memory leaks
- Maintain existing smart auto-close functionality with better performance
Fixes React anti-pattern where side effects were executed in useMemo,
which should be a pure function. This improves performance especially
when users type quickly in the search input.
* refactor(QuickPanel): remove redundant timer cleanup useEffect
Remove duplicate timer cleanup logic as the existing useEffect at line 141-164
already handles component unmount cleanup properly.
* refactor(QuickPanel): optimize useEffect dependencies and timer cleanup logic
- Replace overly broad `ctx` dependency with precise `[ctx.isVisible, searchText, list.length, ctx.close]`
- Move timer cleanup before visibility check to ensure proper cleanup on panel hide
- Add early return when panel is invisible to prevent unnecessary timer creation
- Improve performance by avoiding redundant effect executions
- Fix edge case where timers might not be cleared when panel becomes invisible
Addresses review feedback about dependency array optimization while maintaining
existing auto-close functionality and improving memory management.
* feat(QuickPanel): implement smart re-opening with dependency optimization
Features:
- Implement smart re-opening during deletion with real-time matching
- Only reopen panel when actual matches exist to avoid unnecessary interactions
- Add intelligent @ symbol handling on model selection panel close
- Optimize search text length limits (≤10 chars) for performance
Fixes:
- Fix useMemo dependency from overly broad [ctx, searchText] to precise [ctx.isVisible, ctx.symbol, ctx.list, searchText]
- Resolve trailing whitespace formatting issues
- Eliminate ESLint exhaustive-deps warnings while maintaining stability
- Prevent unnecessary re-renders when unrelated ctx properties change
Performance improvements ensure optimal QuickPanel responsiveness while maintaining
existing auto-close functionality and improving user experience.
* fix(ci): add eslint-disable comment for exhaustive-deps warning
The useEffect dependency array [ctx.isVisible, searchText, list.length, ctx.close]
is intentionally precise to avoid unnecessary re-renders when unrelated ctx
properties change. Adding ctx object would cause performance degradation.
* refactor(QuickPanel): remove smart re-opening logic during deletion
- Remove 62 lines of complex deletion detection logic from Inputbar component
- Eliminates performance overhead from frequent string matching during typing
- Reduces code complexity and potential edge cases
- Maintains simple and predictable QuickPanel behavior
- Improves maintainability by removing unnecessary "smart" features
The deletion-triggered smart reopening feature added unnecessary complexity
without significant user benefit. Users can simply type / or @ again to
reopen panels when needed.
- Introduced QuickPhraseSettings component for managing quick phrases with add, edit, and delete functionality.
- Added PreprocessSettings component to configure document preprocessing options, including provider selection.
- Updated SettingsPage to include links to the new Quick Phrase and Preprocess settings.
- Removed the deprecated ToolSettings component and its associated routes.
- Enhanced WebSearchSettings with new compression settings and improved UI for managing web search providers.
- Removed the patch for windows-system-proxy@npm:1.0.0 and updated the dependency to version 1.0.1 in package.json and yarn.lock.
- Deleted the corresponding patch file to clean up the project.
- Updated AppUpdater to eliminate the mainWindow parameter from the constructor.
- Replaced direct mainWindow references with windowService calls to retrieve the main window, improving modularity and decoupling.
* feat: add code tools
* feat(CodeToolsService): add CLI executable management and installation check
- Introduced methods to determine the CLI executable name based on the tool.
- Added functionality to check if a package is installed and create the necessary bin directory if it doesn't exist.
- Enhanced the run method to handle installation and execution of CLI tools based on their installation status.
- Updated terminal command handling for different operating systems with improved comments and error messages.
* feat(ipService): implement IP address country detection and npm registry URL selection
- Added a new module for IP address country detection using the ipinfo.io API.
- Implemented functions to check if the user is in China and to return the appropriate npm registry URL based on the user's location.
- Updated AppUpdater and CodeToolsService to utilize the new ipService functions for improved user experience based on geographical location.
- Enhanced error handling and logging for better debugging and user feedback.
* feat: remember cli model
* feat(CodeToolsService): update options for auto-update functionality
- Refactored the options parameter in CodeToolsService to replace checkUpdate and forceUpdate with autoUpdateToLatest.
- Updated logic to handle automatic updates when the CLI tool is already installed.
- Modified related UI components to reflect the new auto-update option.
- Added corresponding translations for the new feature in multiple languages.
* feat(CodeToolsService): enhance CLI tool launch with debugging support
- Added detailed logging for CLI tool launch process, including environment variables and options.
- Implemented a temporary batch file for Windows to facilitate debugging and command execution.
- Improved error handling and cleanup for the temporary batch file after execution.
- Updated terminal command handling to use the new batch file for safer execution.
* refactor(CodeToolsService): simplify command execution output
- Removed display of environment variable settings during command execution in the CLI tool.
- Updated comments for clarity on the command execution process.
* feat(CodePage): add model filtering logic for provider selection
- Introduced a modelPredicate function to filter out embedding, rerank, and text-to-image models from the available providers.
- Updated the ModelSelector component to utilize the new predicate for improved model selection experience.
* refactor(CodeToolsService): improve logging and cleanup for CLI tool execution
- Updated logging to display only the keys of environment variables during CLI tool launch for better clarity.
- Introduced a variable to store the path of the temporary batch file for Windows.
- Enhanced cleanup logic to remove the temporary batch file after execution, improving resource management.
* feat(Router): replace CodePage with CodeToolsPage and add new page for code tools
- Updated Router to import and route to the new CodeToolsPage instead of the old CodePage.
- Introduced CodeToolsPage component, which provides a user interface for selecting CLI tools and models, managing directories, and launching code tools with enhanced functionality.
* refactor(CodeToolsService): improve temporary file management and cleanup
- Removed unused variable for Windows batch file path.
- Added a cleanup task to delete the temporary batch file after 10 seconds to enhance resource management.
- Updated logging to ensure clarity during the execution of CLI tools.
* refactor(CodeToolsService): streamline environment variable handling for CLI tool execution
- Introduced a utility function to remove proxy-related environment variables before launching terminal processes.
- Updated logging to display only the relevant environment variable keys, enhancing clarity during execution.
* refactor(MCPService, CodeToolsService): unify proxy environment variable handling
- Replaced custom proxy removal logic with a shared utility function `removeEnvProxy` to streamline environment variable management across services.
- Updated logging to reflect changes in environment variable handling during CLI tool execution.
- Introduced ApiOptionsSettings component to manage API options for providers.
- Added ApiOptionsSettingsPopup for displaying API options in a modal.
- Updated ProviderSetting to include a button for opening the API options popup for non-system providers.
- Refactored imports and adjusted layout in ProviderSetting for better UI consistency.
- Simplified proxy setting logic by removing unnecessary dispatches for 'system' and 'none' modes.
- Updated useAppInit to set proxy to undefined for 'system' mode and clarified direct mode handling with comments.
- Removed TranslateSettings and TranslateModelSettings components to streamline the translation settings interface.
- Introduced CustomLanguageSettings and TranslatePromptSettings components for better management of custom languages and prompt settings.
- Updated ModelSettings to utilize the new TranslateSettingsPopup for handling translation-related configurations.
- Enhanced the overall structure and readability of the translation settings page.
* refactor(FileManager): streamline file path handling in FilesPage and ImageBlock components
* refactor(file): implement getSafeFilePath utility for consistent file path handling across loaders and preprocessors
* refactor(FileStorage): replace getSafeFilePath with fileStorage.getFilePathById for consistent file path retrieval across services
* refactor(file): unify file path retrieval across loaders and preprocessors for improved consistency
* refactor(Inputbar, MessageEditor): replace getFileExtension with file.ext for improved file type handling
* refactor(FileStorage): simplify getFilePathById method by removing redundant checks for file path retrieval
* fix(FileStorage): update getFilePathById to ensure file.path is consistent with generated filePath
* refactor(FileStorage): simplify getFilePathById method by removing unnecessary file path consistency checks
* fix(FileStorage): update duplicate file check to use file.path for accurate detection
* fix(FileStorage): correct file path usage in uploadFile method for accurate duplicate detection
* fix(loader): update file path retrieval to use file.path for consistency across loaders
- Removed unused imports and components to simplify the codebase.
- Refactored the token count calculation for improved readability.
- Adjusted the layout of the operation bar and input/output containers for better spacing and alignment.
- Enhanced the copy button functionality and visibility within the output area.
- Updated styles for consistency and improved user experience.
* Update models.ts
* Update models.ts
* Update models.ts
* feat: add OpenAI verbosity setting for GPT-5 model
Introduces a new 'verbosity' option for the OpenAI GPT-5 model, allowing users to control the level of detail in model output. Updates settings state, migration logic, UI components, and i18n translations to support this feature.
* fix(models): 修正gpt-5模型判断逻辑以支持包含gpt-5的模型ID
* fix(i18n): 修正繁体中文和希腊语的翻译错误
* fix(models): 优化OpenAI推理模型判断逻辑
* fix(OpenAIResponseAPIClient): 不再为response api添加stream_options
* fix: update OpenAI model check and add verbosity setting
Changed GPT-5 model detection to use includes instead of strict equality. Added default 'verbosity' property to OpenAI settings in migration logic.
* feat(models): 添加 GPT-5 系列模型的图标和配置
添加 GPT-5、GPT-5-chat、GPT-5-mini 和 GPT-5-nano 的图标文件,并在 models.ts 中配置对应的模型 logo
* Merge branch 'main' into fix-gpt5
* Add verbosity setting to OpenAI API client
Introduces a getVerbosity method in BaseApiClient to retrieve verbosity from settings, and passes this value in the OpenAIResponseAPIClient request payload. This enables configurable response verbosity for OpenAI API interactions.
* Upgrade OpenAI package to 5.12.2 and update patch
Replaced the OpenAI dependency from version 5.12.0 to 5.12.2 and updated related patch files and references in package.json and yarn.lock. Also updated a log message in BaseApiClient.ts for clarity.
* fix: add type and property checks for tool call handling
Improves robustness by adding explicit checks for 'function' property and 'type' when parsing tool calls and estimating tokens. Also adds error handling for unknown tool call types in mcp-tools and updates related test logic.
* feat(模型配置): 添加gpt5模型支持及相关配置
- 在模型类型中新增gpt5支持
- 添加gpt5系列模型检测函数
- 更新推理选项配置和国际化文本
- 调整effort ratio数值
* fix(ThinkingButton): 为gpt-5及后续模型添加minimal到low的选项回退映射
* feat(i18n): 更新思维链长度的中文翻译并调整对应图标
为思维链长度的"minimal"选项添加中文翻译"微念",同时调整各选项对应的灯泡图标亮度
* feat(i18n): 为推理努力设置添加"minimal"选项并调整英文文案
* fix: openai patch
* wip: OpenAISettingsGroup display
* fix: 修复OpenAISettingsGroup组件中GPT5条件下的渲染逻辑
* refactor(OpenAISettingsGroup): 优化设置项的分组和分隔符逻辑
* feat(模型配置): 添加gpt-5到visionAllowedModels列表
* feat(模型配置): 添加gpt-5到函数调用支持列表
将gpt-5及其变体添加到FUNCTION_CALLING_MODELS支持列表,同时将gpt-5-chat添加到排除列表
* fix: 在OpenAI推理模型检查中添加gpt-5-chat支持
* Update OpenAISettingsGroup.tsx
* feat(模型支持): 添加对verbosity模型的支持判断
新增isSupportVerbosityModel函数用于判断是否支持verbosity模型
替换原有isGPT5SeriesModel判断逻辑,统一使用新函数
* fix: 修复支持详细程度模型的判断逻辑
使用 getLowerBaseModelName 处理模型 ID 以确保大小写不敏感的比较
* feat: 添加对gpt-5模型的网络搜索支持但不包括chat变体
* fix(models): 修复gpt5模型支持选项缺少'off'的问题
* fix: 添加gpt-5到支持Flex Service Tier的模型列表
* refactor(aiCore): 优化OpenAI verbosity类型定义和使用
移除OpenAIResponseAPIClient中冗余的OpenAIVerbosity导入
在BaseApiClient中明确getVerbosity返回类型为OpenAIVerbosity
简化OpenAIResponseAPIClient中verbosity的类型断言
* fix(openai): 仅在支持verbosity的模型中添加verbosity参数
* fix(i18n): 修正OpenAI设置中不一致的翻译
* fix: modify low effort ratio
* fix(openai): 修复GPT5系列模型在启用网页搜索时不能使用minimal reasoning_effort的问题
* fix(openai): 修复GPT5系列模型在启用web搜索时不能使用minimal推理的问题
---------
Co-authored-by: icarus <eurfelux@gmail.com>
Co-authored-by: Phantom <59059173+EurFelux@users.noreply.github.com>
* Updated electron-builder configuration to include RPM as a target for Linux builds.
* Modified GitHub workflows to install RPM dependencies during the build process for both nightly and release workflows.
Updated the logic for determining tool usage by consolidating conditions into a single variable. Improved the handling of MCP tools by filtering active servers and checking for enabled tools before sending notifications. Removed redundant code and ensured that tool execution completion notifications are sent based on the new logic.
* feat: add language filter to local web search queries
Integrates user's language setting into search queries by applying a language filter based on the provider (Google, Bing, or others). This improves search relevance for localized results.
* fix: update language filter logic in LocalSearchProvider
Refactored applyLanguageFilter to use provider.id instead of provider.name for search engine identification. Adjusted filtering for Google, Bing, and Baidu, and removed default language filter for other providers.
* Update LocalSearchProvider.ts
- **Type Check**: `yarn typecheck` - Checks TypeScript for both node and web
- **Lint**: `yarn lint` - ESLint with auto-fix
- **Format**: `yarn format` - Prettier formatting
- **Format**: `yarn format` - Biome formatting
### Build & Release
@@ -92,6 +93,12 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
- **Multi-language Support**: i18n with dynamic loading
- **Theme System**: Light/dark themes with custom CSS variables
### UI Design
The project is in the process of migrating from antd & styled-components to HeroUI. Please use HeroUI to build UI components. The use of antd and styled-components is prohibited.
// To minimize changes in this PR as much as possible, it's set to true. However, setting it to false would make it more convenient to add attributes at the end.
- "!node_modules/selection-hook/prebuilds/**/*"# we rebuild .node, don't use prebuilds
- "!node_modules/selection-hook/node_modules"# we don't need what in the node_modules dir
- "!node_modules/selection-hook/src"# we don't need source files
- "!node_modules/tesseract.js-core/{tesseract-core.js,tesseract-core.wasm,tesseract-core.wasm.js}"# we don't need source files
- "!node_modules/tesseract.js-core/{tesseract-core-lstm.js,tesseract-core-lstm.wasm,tesseract-core-lstm.wasm.js}"# we don't need source files
- "!node_modules/tesseract.js-core/{tesseract-core-simd-lstm.js,tesseract-core-simd-lstm.wasm,tesseract-core-simd-lstm.wasm.js}"# we don't need source files
constDEFAULT_SYSTEM_PROMPT=`In this environment you have access to a set of tools you can use to answer the user's question. \\
You can use one tool per message, and will receive the result of that tool use in the user's response. You use tools step-by-step to accomplish a given task, with each tool use informed by the result of the previous tool use.
## Tool Use Formatting
Tool use is formatted using XML-style tags. The tool name is enclosed in opening and closing tags, and each parameter is similarly enclosed within its own set of tags. Here's the structure:
<tool_use>
<name>{tool_name}</name>
<arguments>{json_arguments}</arguments>
</tool_use>
The tool name should be the exact name of the tool you are using, and the arguments should be a JSON object containing the parameters required by that tool. For example:
Tiptap is a headless wrapper around [ProseMirror](https://ProseMirror.net) – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as _New York Times_, _The Guardian_ or _Atlassian_.
## Official Documentation
Documentation can be found on the [Tiptap website](https://tiptap.dev).
## License
Tiptap is open sourced software licensed under the [MIT license](https://github.com/ueberdosis/tiptap/blob/main/LICENSE.md).
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.