mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-20 15:10:59 +08:00
copilot/fix-scrollbar-mouse-issue
147 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
0e5ebcfd00
|
feat: new build-in OCR provider -> intel OV(NPU) OCR (#10737)
* new build-in ocr provider intel ov Signed-off-by: Ma, Kejiang <kj.ma@intel.com> Signed-off-by: Kejiang Ma <kj.ma@intel.com> * updated base on PR's commnets Signed-off-by: Kejiang Ma <kj.ma@intel.com> * feat(OcrImageSettings): use swr to fetch available providers Add loading state and error handling when fetching available OCR providers. Display an alert when provider loading fails, showing the error message. Also optimize provider filtering logic using useMemo. * refactor(ocr): rename providers to listProviders for consistency Update method name to better reflect its functionality and maintain naming consistency across the codebase --------- Signed-off-by: Ma, Kejiang <kj.ma@intel.com> Signed-off-by: Kejiang Ma <kj.ma@intel.com> Co-authored-by: icarus <eurfelux@gmail.com> |
||
|
|
1a972ac0e0
|
fix: api server status (#10734)
* refactor(apiServer): move api server types to dedicated module Restructure api server type definitions by moving them from index.ts to a dedicated apiServer.ts file. This improves code organization and maintainability by grouping related types together. * feat(api-server): add api server management hooks and integration Extract api server management logic into reusable hook and integrate with settings page * feat(api-server): improve api server status handling and error messages - add new error messages for api server status - optimize initial state and loading in useApiServer hook - centralize api server enabled check via useApiServer hook - update components to use new api server status handling * fix(agents): update error message key for agent server not running * fix(i18n): update api server status messages across locales Remove redundant 'notRunning' message in en-us locale Add consistent 'not_running' error message in all locales Add missing 'notEnabled' message in several locales * refactor: update api server type imports to use @types Move api server related type imports from renderer/src/types to @types package for better code organization and maintainability * docs(IpcChannel): add comment about unused api-server:get-config Add TODO comment about data inconsistency in useApiServer hook * refactor(assistants): pass apiServerEnabled as prop instead of using hook Move apiServerEnabled from being fetched via useApiServer hook to being passed as a prop through component hierarchy. This improves maintainability by making dependencies more explicit and reducing hook usage in child components. * style(AssistantsTab): add consistent margin-bottom to alert components * feat(useAgent): add api server status checks before fetching agent Ensure api server is enabled and running before attempting to fetch agent data |
||
|
|
7b90dfb46c
|
fix: intercept webview keyboard shortcuts for search functionality (#10641)
* feat: intercept webview keyboard shortcuts for search functionality Implemented keyboard shortcut interception in webview to enable search functionality (Ctrl/Cmd+F) and navigation (Enter/Escape) within mini app pages. Previously, these shortcuts were consumed by the webview content and not propagated to the host application. Changes: - Added Webview_SearchHotkey IPC channel for forwarding keyboard events - Implemented before-input-event handler in WebviewService to intercept Ctrl/Cmd+F, Escape, and Enter - Extended preload API with onFindShortcut callback for webview shortcut events - Updated WebviewSearch component to handle shortcuts from both window and webview - Added comprehensive test coverage for webview shortcut handling 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix lint * refactor: improve webview hotkey initialization and error handling Refactored webview keyboard shortcut handler for better code organization and reliability. Changes: - Extracted keyboard handler logic into reusable attachKeyboardHandler function - Added initWebviewHotkeys() to initialize handlers for existing webviews on startup - Integrated initialization in main app entry point - Added explanatory comment for event.preventDefault() behavior - Added warning log when webContentsId is unavailable in WebviewSearch 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * feat: add WebviewKeyEvent type and update related components - Introduced WebviewKeyEvent type to standardize keyboard event handling for webviews. - Updated preload index to utilize the new WebviewKeyEvent type in the onFindShortcut callback. - Refactored WebviewSearch component and its tests to accommodate the new type, enhancing type safety and clarity. 🤖 Generated with [Claude Code](https://claude.com/claude-code) * fix lint --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
62774b34d3
|
feat: add updating dialog in render (#10569)
* feat: replace update dialog handling with quit and install functionality * refactor: remove App_ShowUpdateDialog and implement App_QuitAndInstall in IpcChannel * update ipc.ts to handle quit and install action * modify AppUpdater to include quitAndInstall method * adjust preload index to invoke new quit and install action * enhance AboutSettings to manage update dialog state and trigger quit and install * fix(AboutSettings): handle null update info in update dialog state management * fix(UpdateDialog): improve error handling during update installation and enhance release notes processing * fix(AppUpdater): remove redundant assignment of releaseInfo after update download * fix(IpcChannel): remove UpdateDownloadedCancelled enum value * format code * fix(UpdateDialog): enhance installation process with loading state and error handling * update i18n * fix(i18n): Auto update translations for PR #10569 * feat(UpdateAppButton): integrate UpdateDialog and update button functionality for better user experience * fix(UpdateDialog): update installation handler to support async operation and ensure modal closes after installation * refactor(AppUpdater.test): remove deprecated formatReleaseNotes tests to streamline test suite * refactor(update-dialog): simplify dialog close handling Replace onOpenChange with onClose prop to directly handle dialog closing Remove redundant handleClose function and simplify button onPress handler --------- Co-authored-by: GitHub Action <action@github.com> Co-authored-by: icarus <eurfelux@gmail.com> |
||
|
|
d4c6131fa3 |
Merge remote-tracking branch 'origin/main' into feat/agents-new
# Conflicts: # package.json # src/renderer/src/aiCore/chunk/AiSdkToChunkAdapter.ts |
||
|
|
38ac42af8c
|
feat: add GitHub Copilot CLI integration to coding tools (#10403)
* feat: add GitHub Copilot CLI integration to coding tools - Add githubCopilotCli to codeTools enum - Support @github/copilot package installation - Add 'copilot' executable command mapping - Update Redux store to include GitHub Copilot CLI state - Add GitHub Copilot CLI option to UI with proper provider mapping - Implement environment variable handling for GitHub authentication - Fix model selection logic to disable model choice for GitHub Copilot CLI - Update launch validation to not require model selection for GitHub Copilot CLI - Fix prepareLaunchEnvironment and executeLaunch to handle no-model scenario This enables users to launch GitHub Copilot CLI directly from Cherry Studio's code tools interface without needing to select a model, as GitHub Copilot CLI uses GitHub's built-in models and authentication. Signed-off-by: LeaderOnePro <leaderonepro@outlook.com> * style: apply code formatting for GitHub Copilot CLI integration Auto-fix code style inconsistencies using project's Biome formatter. Resolves semicolon, comma, and quote style issues to match project standards. Signed-off-by: LeaderOnePro <leaderonepro@outlook.com> * feat: conditionally render model selector for GitHub Copilot CLI - Hide model selector component when GitHub Copilot CLI is selected - Maintain validation logic to allow GitHub Copilot CLI without model selection - Improve UX by removing empty model dropdown for GitHub Copilot CLI 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Signed-off-by: LeaderOnePro <leaderonepro@outlook.com> Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
538291c03f |
♻️ refactor: consolidate Claude Code system message handling and streaming logic
- Unify buildClaudeCodeSystemMessage implementation in shared package - Refactor MessagesService to provide comprehensive message processing API - Extract streaming logic, error handling, and header preparation into service methods - Remove duplicate anthropic config from renderer, use shared implementation - Update ClaudeCodeService to use append mode for custom instructions - Improve type safety and request validation in message processing |
||
|
|
d9d8bae2d6 | Merge remote-tracking branch 'origin/main' into feat/agents-new | ||
|
|
422ba52093 |
⬆️ chore: migrate from Claude Code SDK to Claude Agent SDK v0.1.1
- Replace @anthropic-ai/claude-code with @anthropic-ai/claude-agent-sdk@0.1.1 - Update all import statements across 4 files - Migrate patch for Electron compatibility (fork vs spawn) - Handle breaking changes: replace appendSystemPrompt with systemPrompt preset - Add settingSources configuration for filesystem settings - Update vendor path in build scripts - Update package name mapping in CodeToolsService |
||
|
|
27c31d6e0c |
feat(file): add showInFolder IPC channel to reveal files in explorer
Implement functionality to show files/folders in system explorer through IPC. Includes channel definition, preload API, main handler, and error handling for non-existent paths. |
||
|
|
961ee22327
|
feat: add new provider intel OVMS(openvino model server) (#9853)
* add new provider: OVMS(openvino model server) Signed-off-by: Ma, Kejiang <kj.ma@intel.com> * remove useless comments * add note: support windows only * fix eslint error; add migrate for ovms provider Signed-off-by: Ma, Kejiang <kj.ma@intel.com> * fix ci error after rebase Signed-off-by: Ma, Kejiang <kj.ma@intel.com> * modifications base on reviewers' comments Signed-off-by: Ma, Kejiang <kj.ma@intel.com> * show intel-ovms provider only on windows and intel cpu Signed-off-by: Ma, Kejiang <kj.ma@intel.com> * complete i18n for intel ovms Signed-off-by: Ma, Kejiang <kj.ma@intel.com> * update ovms 2025.3; apply patch for model qwen3-8b on local Signed-off-by: Ma, Kejiang <kj.ma@intel.com> * fix lint issues Signed-off-by: Ma, Kejiang <kj.ma@intel.com> * fix issues for format, type checking Signed-off-by: Ma, Kejiang <kj.ma@intel.com> * remove test code Signed-off-by: Ma, Kejiang <kj.ma@intel.com> * fix issues after rebase Signed-off-by: Ma, Kejiang <kj.ma@intel.com> --------- Signed-off-by: Ma, Kejiang <kj.ma@intel.com> |
||
|
|
cff9068359 | ♻️ refactor: standardize string quotes and improve logging in Anthropic integration | ||
|
|
cc871b7a72 | ♻️ refactor: enhance logging and provider handling for Anthropic integration | ||
|
|
4d133d59ea |
feat: enhance Anthropic API support for compatible providers
- Add support for anthropicApiHost configuration in providers - Improve model filtering for Anthropic-compatible providers - Add isAnthropicModel function to validate Anthropic models - Update ClaudeCode service to support compatible providers - Enhance logging and error handling in API routes - Fix model transformation and validation logic |
||
|
|
35b885798b |
Add Anthropic API Host support for compatible providers
- Add `anthropicApiHost` field to Provider type - Update provider config and migration to set Anthropic endpoints - Add UI for configuring Anthropic API Host in provider settings - Update SDK client logic to use Anthropic API Host when available - Add i18n strings for Anthropic API Host configuration |
||
|
|
45961d2eda | Merge remote-tracking branch 'origin/main' into feat/agents-new | ||
|
|
499cb52e28
|
feat: enhance terminal command handling for macOS (#10362)
- 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. |
||
|
|
8e163b8f17 | Merge branch 'main' of github.com:CherryHQ/cherry-studio into feat/agents-new | ||
|
|
37218eef4f | feat: enable cherryin provider | ||
|
|
183b46be9e |
feat(ipc): add App_Quit channel and update related handlers
- 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. |
||
|
|
1d5761b1fd
|
WIP | ||
|
|
335bf47dbd
|
Merge branch 'feat/agents-new' of https://github.com/CherryHQ/cherry-studio into feat/agents-new | ||
|
|
26ac9e3c2e | fix(getSdkClient): add authToken to anthropic client initialization for claude code | ||
|
|
6f6944d003
|
chunk type | ||
|
|
a32fad06a0 | Merge remote-tracking branch 'origin/main' into feat/agents-new | ||
|
|
a09c52424f | 💄 style: format code with yarn format | ||
|
|
b869869e26 |
✨ feat: implement comprehensive Claude Code OAuth integration and API enhancements
- Add shared Anthropic utilities package with OAuth and API key client creation - Implement provider-specific message routing alongside existing v1 API - Enhance authentication middleware with priority handling (API key > Bearer token) - Add comprehensive auth middleware test suite with timing attack protection - Update session handling and message transformation for Claude Code integration - Improve error handling and validation across message processing pipeline - Standardize import formatting and code structure across affected modules This establishes the foundation for Claude Code OAuth authentication while maintaining backward compatibility with existing API key authentication methods. |
||
|
|
36f86ff2b9
|
Refactor/agent align (#10276)
* Refactor agent streaming from EventEmitter to ReadableStream Replaced EventEmitter-based agent streaming with ReadableStream for better compatibility with AI SDK patterns. Modified SessionMessageService to return stream/completion pair instead of event emitter, updated HTTP handlers to use stream pumping, and added IPC contract for renderer-side message persistence. * Add accessible paths management to agent configuration Move accessible paths functionality from session modal to agent modal, add validation requiring at least one path, and update form handling to inherit agent paths in sessions. * Add provider_name field to model objects and improve display - Add provider_name field to ApiModel schema and transformation logic - Update model options to include providerName for better display - Improve provider label fallback chain in model transformation - Fix agent hook to use proper SWR key and conditional fetching - Enhance option rendering with better truncation and provider display * fix(i18n): Auto update translations for PR #10276 * Optimize chat components with memoization and shared layout - Wrap `SessionMessages` and `SessionInputBar` in `useMemo` to prevent unnecessary re-renders - Refactor `AgentSessionMessages` to use shared layout components and message grouping - Extract common styled components to `shared.tsx` for reuse across message components * Add smooth animations to SessionsTab and Sessions components - Replace static conditional rendering with Framer Motion animations for no-agent and session states - Animate session list items with staggered entrance and exit transitions - Add loading spinner animation with fade effect - Apply motion to session creation button with delayed entrance * Add loading state with spinner and i18n support to SessionsTab - Replace static "No active agent" message with a spinner and loading text - Integrate react-i18next for translation of loading message - Adjust animation timing and styling for smoother loading state transition * Support API models with provider_name field in getModelName - Add ApiModel type import and update function signature to accept ApiModel - Return formatted name using provider_name field for API models - Maintain backward compatibility for legacy models by looking up provider in store * Simplify provider display name logic and add debug logging - Replace complex fallback chain for provider display name with direct provider name access - Add console.log for model debugging in getModelName function * Extract model name from session model string - Use split and pop to isolate the model name after the colon - Fall back to the full model string if no colon is present - Maintain provider and group identifiers for model object consistency * Improve model name resolution for agent sessions - Extract actual model ID from session model string and resolve model details - Use resolved model name, provider, and group when available instead of defaults - Remove redundant API model handling in getModelName function * Set default active agent and session on load - Automatically select first agent if none active after loading - Automatically select first session per agent if none active after loading - Prevent empty selection states in UI components --------- Co-authored-by: GitHub Action <action@github.com> |
||
|
|
5dac1f5867
|
feat: support more terminal in code tools (#10192)
* 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> |
||
|
|
ee95fad7e5
|
feat: add support for iflow cli (#10198)
Signed-off-by: 本x <liyuyun.lyy@alibaba-inc.com> |
||
|
|
993d497aad
|
feature: add option to change font (#10133)
* 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> |
||
|
|
8f36c4e793
|
fix: referer (#10124)
* fix: referer * fix(i18n): Auto update translations for PR #10124 --------- Co-authored-by: GitHub Action <action@github.com> |
||
|
|
871565c687
|
feat: add data limit warning notification (#8866)
* 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> |
||
|
|
6104b7803b
|
refactor: MCPService for improved error handling and header management (#10100)
* 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 |
||
|
|
2e31a5bbcb
|
Feat/api server (#9855)
* feat: add api server
This reverts commit
|
||
|
|
c940e0bc92
|
feat: add Anthropic OAuth settings UI and logic (#8905)
* 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> |
||
|
|
86e3776fff
|
fix(mcp): enhance progress event structure to include callId for specific tool tracking (#9946)
* fix(mcp): enhance progress event structure to include callId for specific tool tracking * refactor(mcp): add MCP progress event with callId and progress percentage |
||
|
|
b1a39e9b38
|
feat: support custom minimize, maximize and close (#9847)
* 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> |
||
|
|
b6d10656f9
|
feat: refactor Knowledge Base (#8384)
Co-authored-by: icarus <eurfelux@gmail.com> Co-authored-by: eeee0717 <chentao020717@outlook.com> |
||
|
|
1ee57f1385
|
feat(window): check fullscreen state when useFullScreen mounted (#9719)
feat(全屏): 添加检查窗口是否全屏的功能 实现通过IPC通道检查主窗口全屏状态的功能,并在渲染进程首次加载时获取当前状态 |
||
|
|
dfb3322b28
|
feat: add notes module (#8871)
* feat: integrate rich text editing
- Replaced the TextEditPopup with RichEditPopup for adding and editing notes, enhancing the editing experience with rich text capabilities.
- Updated note previews to display HTML content appropriately, improving usability and visual representation.
- Added a styled component for note previews to enhance user interaction.
* feat(RichEditor): enhance rich text editing capabilities
- Added new command system for rich text editing, allowing users to execute commands like headings, lists, and formatting.
- Integrated drag handle functionality for better content manipulation within the editor.
- Updated toolbar to include additional formatting options such as strikethrough and code blocks.
- Improved markdown and HTML content handling, enabling seamless conversion and previewing.
- Introduced new utility functions for markdown conversion and sanitization.
- Added tests for command list popover and rich editor functionalities to ensure reliability.
* refactor(RichEditor): remove debug log from command suggestion
* feat(RichEditor): add link and unlink functionality
- Introduced link and unlink commands in the RichEditor toolbar, enhancing text formatting capabilities.
- Updated placeholder text for the RichEditor to provide clearer user guidance.
- Refactored styles and removed unused code to streamline the RichEditor component.
- Added internationalization support for new toolbar items and placeholder text in both English and Chinese.
* wip: custom codeblock
* feat: add new dependencies for markdown processing
- Introduced `he` for HTML entity decoding and `striptags` for stripping HTML tags in markdown conversion.
- Updated `package.json` and `yarn.lock` to include new type definitions and library versions.
* feat(RichEditor): enhance image and math input capabilities
- Added ImageUploader component for embedding images with URL support and drag-and-drop functionality.
- Introduced MathInputDialog for entering LaTeX formulas, allowing real-time updates and integration with the editor.
- Enhanced RichEditor toolbar with new commands for image and math insertion.
- Updated styles for better user experience and accessibility.
- Added internationalization support for new features in multiple languages.
* refactor(CodeBlockView): change export to local variable
- Changed the export of CodeHeader to a local variable within CodeBlockView.
- Removed unused export from code-block-shiki index file.
* feat(RichEditor): enhance command management and toolbar functionality
- Added support for disabling specific commands in the RichEditPopup.
- Implemented dynamic command registration and management in the RichEditor, allowing for initial commands to be registered on mount.
- Updated toolbar to dynamically generate items based on command groups, improving organization and accessibility.
- Introduced new command definitions for text formatting, including bold, italic, underline, and strikethrough, with toolbar visibility options.
- Enhanced command handling capabilities, including the ability to unregister commands and set their availability based on editor context.
* refactor(RichEditPopup): remove translation functionality and related components
- Eliminated translation handling logic, including the translate button and associated state management.
- Cleaned up imports and unused variables to streamline the RichEditPopup component.
- Simplified the content change handling by focusing solely on rich content management.
* feat(ImageUploader): enhance image upload functionality and styling
- Added custom image upload button with improved styling and theme support.
- Refactored image display logic to use a more flexible layout.
- Updated file acceptance criteria to restrict uploads to PNG and JPEG formats.
- Simplified the upload process by preventing default behavior and customizing request handling.
- Improved overall component structure and styling for better user experience.
* feat(AssistantPromptSettings): implement throttled update functionality and enhance UI
- Introduced throttling for the update function to improve performance and reduce unnecessary updates.
- Added a save button to the UI for manual saving of changes, enhancing user experience.
- Refactored the component to streamline the handling of emoji selection and markdown changes.
- Updated layout with Flex component for better alignment of buttons in the settings interface.
* feat(RichEditor): integrate internationalization for placeholder text
- Updated the placeholder property to utilize the i18next translation function, enhancing support for multiple languages.
- Improved user experience by providing localized placeholder text in the RichEditor component.
* fix(styles): update list styles for ordered and unordered lists in richtext.scss
- Removed default list style for ordered lists and added decimal style.
- Added disc style for unordered lists to enhance visual consistency.
* fix(styles): improve table cell background handling in richtext.scss
- Added !important to header background color to ensure consistency.
- Set table cell backgrounds to transparent to prevent inheritance issues during drag operations.
- Updated ProseMirror widget styles to maintain transparency for table cells.
- Enhanced overall table styling to improve user experience.
* fix(styles): update padding and overflow handling in RichEditor
- Increased padding in the tiptap class for improved spacing.
- Modified overflow-x property in EditorContent to allow horizontal scrolling, preventing the drag handle from being cut off.
- Ensured proper positioning and visibility of the drag handle with updated styles.
- Adjusted ProseMirror editor content to maintain drag handle positioning.
* refactor(CodeBlockNodeView, shikijsPlugin): improve language handling for code blocks
- Updated language options to ensure 'text' is always available.
- Introduced a set of languages to skip syntax highlighting, enhancing performance and user experience.
- Simplified logic for checking loaded languages, avoiding unnecessary fallbacks for unsupported languages.
* fix(RichEditor): improve link handling and selection behavior
- Enhanced link insertion logic to ensure the entire paragraph is selected when creating a link.
- Added error handling to toggle link state if selection fails.
- Cleaned up code by moving paragraph text retrieval to the appropriate location for better readability.
* fix(styles): update inline code background and text colors in color.scss
- Changed inline code background color to a solid value for better visibility.
- Updated inline code text color to use RGB format for consistency.
* refactor(RichEditor): simplify editable state management and improve UI interactions
- Removed the disabled prop from RichEditor, simplifying the editable state logic.
- Updated the useRichEditor hook to directly manage the editable state based on the editable prop.
- Enhanced the AssistantPromptSettings component by streamlining the RichEditor rendering logic and improving the save button functionality.
* chore(tests): move useRichEditor test suite
* refactor(RichEditor): enhance command handling and UI responsiveness
- Removed the 'unlink' command from the command list and toolbar for a cleaner interface.
- Improved command filtering logic by removing the maxResults limit.
- Updated command positioning to use fixed strategy with enhanced middleware for better responsiveness.
- Integrated a dynamic virtual list for command suggestions, improving performance and user experience.
- Added internationalization support for 'undo' and 'redo' commands in multiple languages.
* fix(styles): adjust strong tag styling in richtext.scss
- Updated the strong tag styling to apply font-weight to all child elements, ensuring consistent text formatting within rich text content.
* fix(RichEditor): prevent codeBlock nodes from being skipped during drag operations
- Updated the placeholder extension to check for drag operations, ensuring that codeBlock nodes are not skipped when dragging is in progress. This improves the user experience by maintaining expected behavior during content manipulation.
* feat(markdown): integrate turndown-plugin-gfm for enhanced markdown support
- Added turndown-plugin-gfm to enable support for tables and additional markdown features.
- Updated the markdown converter to include new rules for underlining and table elements.
- Enhanced HTML sanitization to allow table-related attributes, improving markdown conversion accuracy.
* feat(markdown): add task list support and enhance markdown conversion
- Integrated @rxliuli/markdown-it-task-lists for task list functionality in markdown.
- Updated markdown converter to handle task list syntax, converting it to appropriate HTML structure.
- Enhanced styles for task lists in richtext.scss to improve visual representation.
- Modified useRichEditor to include task list extensions, ensuring proper functionality within the editor.
* fix(styles): update table header styling in richtext.scss
- Modified table header styling to apply background color and font weight to all child elements, ensuring consistent formatting within tables.
* fix(styles): enhance strong tag styling in richtext.scss
- Added styling for the strong tag to ensure consistent font-weight application across all child elements, improving text formatting in rich text content.
* refactor(markdown): remove @rxliuli/markdown-it-task-lists and implement custom task list plugin
- Removed dependency on @rxliuli/markdown-it-task-lists and integrated a custom task list plugin for markdown-it.
- Enhanced markdown conversion to support task lists with improved HTML structure and sanitization.
- Updated tests to validate task list functionality and ensure proper conversion between markdown and HTML.
* refactor(tests): remove redundant task item label test from markdownConverter tests
- Deleted the test case that checked for the absence of label wrapping around task items, as it is no longer relevant with the updated markdown conversion logic.
- Ensured that existing tests continue to validate the preservation of labels in sanitized HTML for task lists.
* feat(extension-table-plus): add new table extension for Tiptap
- Introduced the @cherrystudio/extension-table-plus package, providing a comprehensive table extension for Tiptap.
- Implemented core functionalities including table, table cell, header, and row management.
- Enhanced the editor with a TableKit for easier table manipulation and integration.
- Updated styles for improved table presentation and interaction within the rich text editor.
- Modified useRichEditor to utilize the new TableKit, ensuring seamless integration with existing features.
* chore(package): remove @tiptap/extension-table dependency
- Deleted the @tiptap/extension-table from package.json and yarn.lock as it is no longer needed.
- Updated dependency management to streamline the project and reduce unnecessary packages.
* chore(package): update package.json for @cherrystudio/extension-table-plus
- Changed the description to reflect the forked nature of the extension.
- Downgraded the version to 3.0.10 to align with the new release strategy.
- Updated the homepage URL to point to the new project site.
- Modified the repository URL to reflect the new GitHub location and directory structure.
* chore(package): update @cherrystudio/extension-table-plus version in package.json
- Changed the version of @cherrystudio/extension-table-plus from workspace:* to ^3.0.10 to align with the new release strategy.
* chore(yarn): update @cherrystudio/extension-table-plus version in yarn.lock
- Changed the version of @cherrystudio/extension-table-plus from workspace:* to npm:^3.0.10 to align with the updated package management strategy.
* chore(useRichEditor): clean up comments and improve code clarity
* chore(package): update @cherrystudio/extension-table-plus version to workspace:^ in package.json and yarn.lock
- Changed the version of @cherrystudio/extension-table-plus from ^3.0.10 to workspace:^ to align with the updated package management strategy.
* chore(tsconfig): add path mapping for @cherrystudio/extension-table-plus in tsconfig.web.json
- Updated tsconfig.web.json to include path mapping for the @cherrystudio/extension-table-plus package, enhancing module resolution for TypeScript.
* chore(dependencies): update ESLint and Prettier configurations
- Added ESLint and Prettier as development dependencies in package.json and yarn.lock.
- Updated lint script to format code and fix issues automatically.
- Enhanced type safety by specifying Node type in TableKit extension.
* fix(deleteTableWhenAllCellsSelected): ensure function returns true after cell count check
- Updated the deleteTableWhenAllCellsSelected function to return true after counting selected table cells, improving the logic for table deletion when all cells are selected.
* chore(electron.config): add path mapping for @cherrystudio/extension-table-plus
- Updated electron.vite.config.ts to include path mapping for the @cherrystudio/extension-table-plus package, improving module resolution for Electron builds.
* refactor(table-cell): rename allowNestedTables to allowNestedNodes and update content type
- Changed the TableCell option from allowNestedTables to allowNestedNodes for clarity on nested node support.
- Updated content type in TableCell and TableHeader from 'block+' to 'paragraph+' to better reflect intended structure.
- Adjusted logic in Table to disallow inserting tables inside nested nodes based on the new option.
* fix: math block bug
* feat(richEditor): add inline and block math commands with updated toolbar support
- Introduced 'inlineMath' and 'blockMath' commands for inserting inline and block mathematical formulas.
- Updated the toolbar to include new commands and their respective tooltips.
- Enhanced the math input dialog to handle both inline and block math types.
- Adjusted markdown conversion to support new math syntax for inline and block math.
- Updated localization files to include translations for new commands.
* feat(table-cell): add cell selection styling and decorations
- Implemented a new plugin for cell selection styling in table cells.
- Added logic to create decorations for selected cells, enhancing visual feedback.
- Updated CSS to style selected cells with borders based on selection edges.
* feat(table): enhance table action handling with new row/column action triggers
- Added optional callbacks for row and column action triggers in TableOptions.
- Implemented row and column action buttons in TableView, allowing for dynamic actions on selected rows and columns.
- Introduced utility functions for calculating cell selection bounds and element border widths.
- Updated styles to accommodate new action buttons and ensure proper positioning.
- Integrated action menu in RichEditor for managing table actions, enhancing user interaction.
* feat(table): enhance table action menu and localization support
- Updated TableOptions to include optional position parameters for row and column action callbacks.
- Refactored TableView to utilize new action callbacks for row and column actions, improving interaction.
- Integrated ActionMenu in RichEditor for better management of table actions, replacing the previous event-based approach.
- Added localization strings for new table action commands in multiple languages, enhancing user accessibility.
* feat(richEditor): update table action icons for improved clarity
- Replaced icons for row insertion actions in the table action menu, using ArrowUp for inserting a row before and ArrowDown for inserting a row after.
- Enhanced visual representation of table actions to better align with user expectations.
* chore(package): bump version to 3.0.11 for @cherrystudio/extension-table-plus
* feat(richtext): enhance table cell styling and resize handle functionality
- Added styles for text overflow handling in table cells to improve readability.
- Introduced a column resize handle with specific positioning and visibility rules.
- Updated the RichEditor to support resizable tables, enhancing user interaction with table elements.
* fix: auto scroll to incomplete command list
* fix: cli
* feat: add MdiDragHandle icon and update RichEditor to use it
- Introduced a new MdiDragHandle SVG icon in the SVGIcon component.
- Replaced the MdiLightbulbOn icon with MdiDragHandle in the RichEditor component for improved functionality.
* feat(RichEditor): add onPaste callback for handling paste events
- Introduced an onPaste callback in both RichEditorProps and UseRichEditorOptions interfaces to allow custom handling of paste events.
- Implemented paste event handling in the useRichEditor hook, converting pasted text to HTML and dispatching it to the editor.
* feat(markdownConverter): extend allowed attributes for HTML sanitization
- Added 'width', 'height', and 'loading' to the list of allowed attributes in the sanitizeHtml function to enhance HTML sanitization capabilities.
* refactor(richtext): update paragraph and heading styles for improved layout
- Removed default margins from paragraphs and adjusted margins for headings to enhance spacing.
- Updated font sizes for headings to improve hierarchy and readability.
- Enhanced blockquote styling with a new border color and italic font style.
- Added specific margin rules for the first and last paragraphs to ensure consistent spacing.
* style(richtext): adjust margins for headings and paragraphs
- Updated heading margins from 'em' to 'rem' for consistency.
- Modified paragraph margins to improve spacing and readability.
- Removed redundant margin rules for first and last paragraphs.
* feat(AssistantPromptSettings): implement draft prompt handling for improved token estimation
- Introduced a draftPrompt ref to manage prompt changes before committing.
- Updated token count estimation to use the draft prompt instead of the current prompt.
- Enhanced the onUpdate function to commit the draft prompt when saving changes.
- Modified handleMarkdownChange to update the draft prompt directly.
* refactor(RichEditor): optimize command handling with useCallback
- Refactored the handleCommand function to use useCallback for improved performance.
- Cleaned up the command handling logic for better readability and maintainability.
- Ensured consistent behavior for link handling and other formatting commands.
* style(richtext): reorganize list styles and enhance task item appearance
- Moved list styles for unordered and ordered lists to a new section for better organization.
- Ensured consistent padding and margin for list items.
- Updated task item styles to improve visual clarity, including checked checkbox appearance.
- Adjusted paragraph margins within list items for improved readability.
* feat(richtext): add table of contents support in RichEditor
- Introduced a new table of contents extension to enhance document navigation.
- Updated RichEditor component to conditionally render the table of contents based on the new `showTableOfContents` prop.
- Integrated table of contents functionality within the useRichEditor hook, allowing for dynamic updates based on document structure.
- Styled the table of contents for improved visibility and usability.
- Updated package.json and yarn.lock to include the new @tiptap/extension-table-of-contents dependency.
* feat(richtext): enhance RichEditor with content search functionality
- Added `enableContentSearch` prop to RichEditor for in-editor content search.
- Integrated ContentSearch component, allowing users to search within the editor.
- Introduced `showUserToggle` and `positionMode` props for ContentSearch customization.
- Updated styling for Container and SearchBarContainer to support new positioning options.
- Adjusted RichEditor settings in AssistantPromptSettings to reflect new content search feature.
* fix: renderer
* fix: styles
* fix: code styles
* fix: table save
* styles: a link
* feat: link editor
* perf: don't show when editable equals to false
* chore: remove some log
* feat: link remove
* style: reduce space for nested list
* fix/link
* feat: add PlusButton to RichEditor and adjust padding in richtext styles
* style: increase font size in richtext styles
* feat: add task list functionality to RichEditor with toolbar integration and localization support
* feat: enhance math dialog positioning and toolbar integration in RichEditor
* feat: enhance Table of Contents functionality with dynamic item display and scroll behavior
* feat: enhance markdown rendering by properly escaping HTML entities in code blocks and inline code
* feat: update link handling in RichEditor to use enhancedLink functionality and auto-update href based on text content
* feat: improve link hover functionality in RichEditor by calculating position based on full link range
* refactor: remove unused MdiDragHandle component from SVGIcon
* fix: update markdown conversion tests to ensure proper HTML output for line breaks and code blocks
* feat: enhance RichEditor functionality by adding code block handling for paste events and keyboard shortcuts for indentation
* feat: enhance code block language options in RichEditor by dynamically loading available languages from Shiki
* feat: update math syntax handling in RichEditor and markdown converter to use $$ for block and inline math
* feat: allow mathPlaceholder node to accept block content in EnhancedMath extension
* feat: improve paste handling in RichEditor by conditionally cleaning HTML based on cursor position and paragraph state
* fix: correct HTML cleaning logic in RichEditor to remove only outer paragraph tags during content insertion
* feat: enhance markdown conversion to support LaTeX in table cells and improve escaping logic
* fix: enhance link hover positioning in RichEditor to account for document boundaries and improve accuracy near the end of the document
* feat: add note book feature (#8234)
* feat: add notes feature with sidebar integration
Introduces a new Notes page and integrates it into the sidebar and routing. Updates sidebar icon types, default icons, and migration logic to support the new 'notes' icon. Adds initial types for notes and folders, and provides a basic NotesPage component. Also updates Chinese locale for notes.
* feat: add notes feature with sidebar, editor, and storage
Introduces a full notes management feature, including a sidebar for folders and notes, a markdown editor using Vditor, and persistent storage of the notes tree. Adds new components (NotesNavbar, NotesSidebar), a NotesService utility for CRUD operations, and updates settings and migration logic to support workspace visibility. Also updates Chinese i18n for notes, and refines the notes type definition.
* feat: enhance notes functionality with auto-save and file name synchronization
* feat: add export to Notes feature
Introduced the ability to export messages and topics to the Notes workspace. Updated UI components, i18n strings, settings, migration logic, and export utilities to support the new export option.
* fix: merge main branch error
* fix: build check error
* Update src/renderer/src/utils/export.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update src/renderer/src/utils/export.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update src/renderer/src/App.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update src/renderer/src/pages/home/Tabs/TopicsTab.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update src/renderer/src/pages/notes/NotesPage.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Revert "Update src/renderer/src/pages/notes/NotesPage.tsx"
This reverts commit
|
||
|
|
ebe2806467
|
feat: add cherryin provider (#9681)
* feat: add Zhipu logo and update related images - Introduced a new Zhipu logo component in SVG format. - Updated existing image assets for chatglm, zhipu, and zhipu_dark. - Added a new zhipu image for search functionality. * feat: integrate Cherryin signature generation - Added a new integration for Cherryin, including a signature generation feature. - Updated IPC channels to handle Cherryin requests. - Introduced a new JavaScript file for Cherryin integration. - Modified configuration files to include Cherryin client secrets and paths. - Enhanced the ESLint and TypeScript configurations to accommodate the new integration. * feat: add Zhipu search provider and logo integration - Implemented a new ZhipuProvider for web search functionality. - Added Zhipu logo to the WebSearchButton component. - Updated WebSearchProviderFactory to include Zhipu as a search option. - Enhanced error handling and logging for Zhipu search requests. * feat: add cherryin provider * fix: correct import path for CherryinAPIClient and update paintings state structure in migration * chore: update version number to 1.5.8 in package.json * feat: enhance model filtering in SelectModelPopup - Added support for identifying free trial models in the model filtering logic. - Updated the condition for determining free models to include both free and free trial models. * refactor: update navigation to use query parameters for provider settings - Modified navigation logic in FreeTrialModelTag and related utilities to use query parameters instead of state for provider identification. - Removed unused useLocation hook in ProviderList component to streamline state management. * fix: remove provider ID from search parameters on selection change in ProviderList * refactor: remove free trial model references and update related logic - Eliminated the FreeTrialTag component and its associated logic from ModelTagsWithLabel and SelectModelPopup. - Updated model filtering to only consider free models without the free trial distinction. - Removed translations and utility functions related to free trial models across multiple locales. * fix: prevent mutation of read-only properties in web search provider - Updated the addWebSearchProvider function to clone the provider object before pushing it to the state, preventing mutation of read-only properties. - Enhanced the migration logic to update the apiKey for the zhipu web search provider if it exists. * refactor: streamline provider selection and navigation logic - Updated FreeTrialModelTag to directly navigate to provider settings using query parameters, removing unnecessary provider fetching. - Simplified ProviderList by eliminating the EventEmitter for provider selection and ensuring search parameters are updated correctly. |
||
|
|
8f5e89d69a
|
fix: replace hardcoded window size on first start (#9669)
* 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> |
||
|
|
2f5cd78f7f
|
chore(deps): bump mermaid, shiki, tanstack, etc. (#9658)
* chore(deps): bump mermaid, shiki, tanstack, etc. * refactor: update code languages, fix lint warnings |
||
|
|
7bb3826cdd
|
feat: ocr image to translate (#9423)
* build: 添加 tesseract.js 及其类型定义依赖 * feat(ocr): 添加OCR类型定义文件以支持OCR功能扩展 * feat(ocr): 添加 Tesseract OCR 提供程序配置 * feat(ocr): 添加Tesseract.js的logo * refactor(settings): 重构文档预处理设置模块结构 将PreprocessSettings重命名为DocProcessSettings并调整文件结构 更新相关路由和组件引用以保持功能一致性 * refactor(config): 重命名OCR_PROVIDER_CONFIG为BUILTIN_OCR_PROVIDERS以更准确描述用途 * refactor(ocr): 更改文件名 * refactor(ocr): 将获取OCR提供商logo的功能移动到utils目录 将getOcrProviderLogo函数从config/ocr.ts移动到utils/ocr.ts,保持功能集中 * refactor(ocr): 重构OCR配置结构以支持默认提供者 将内置OCR提供者数组重构为单独定义的常量,并添加默认OCR提供者映射。这提高了代码的可维护性并支持未来扩展。 * feat(store): 添加OCR状态管理切片 实现OCR提供商的增删改查功能,使用Redux Toolkit管理OCR相关状态 * feat(types): 添加图片文件类型守卫函数 添加 ImageFileMetadata 类型和 isImageFile 类型守卫函数,用于检查文件是否为图片类型 * feat(ocr): 添加对OCR支持文件类型的类型定义和校验函数 添加SupportedOcrFileType类型和isSupportedOcrFileType校验函数 添加SupportedOcrFile类型和isSupportedOcrFile校验函数 * feat(ocr): 添加OCR功能支持 实现基于Tesseract的OCR功能,包括文件类型检查、服务接口和IPC通信 新增OCR相关类型定义和服务实现 * refactor(OcrService): 更新日志上下文为'main:OcrService' * feat(ocr): 添加OCR服务基础功能 实现OCR服务的基础功能,通过调用window.api.ocr接口处理支持的文件类型 * feat(store): 添加ocr模块到redux store * feat(ocr): 添加OCR功能支持及文件类型校验 添加OCR功能钩子useOcr,支持图片文件识别 添加不支持文件类型的错误提示国际化文案 * refactor(ocr): 重命名updatePreprocessProvider为updateOcrProvider以保持命名一致性 * feat(ocr): 添加设置图片OCR提供商的功能 * refactor(ocr): 统一OCR类型导入路径 将所有OCR相关类型从'@renderer/types/ocr'改为从'@renderer/types'或'@types'导入 优化DEFAULT_OCR_PROVIDER类型定义 * feat(store): 更新持久化存储版本并添加OCR配置迁移 添加137版本迁移逻辑,初始化OCR提供者和默认图像提供者配置 * feat(ocr): 添加OCR服务设置界面及提供商选择功能 实现OCR服务设置界面,包含图片OCR提供商的选择功能 修复ocr.ts中imageProvider的类型定义 添加相关国际化文本 * fix(ocr): 添加图像大小检查并优化错误处理 检查图像文件大小是否超过50MB限制 使用buffer读取文件替代直接路径识别 简化错误处理逻辑,直接抛出原始错误 * feat(OCR服务): 支持base64字符串作为OCR输入 扩展tesseractOcr函数以接受base64字符串或图像文件作为输入 * feat(hooks): 添加useFiles钩子用于文件选择功能 * refactor(useFiles): 移除multipleSelections参数并重构文件选择逻辑 将multipleSelections从组件props移动到onSelectFile方法参数中,简化组件接口 重构文件选择逻辑,移除不必要的useMemo,提升代码可维护性 * refactor(useFiles): 使用useMemo优化扩展名处理逻辑 将扩展名处理逻辑移至useMemo中,避免不必要的重复计算。当props.extensions未提供时默认返回['*'] * feat(文件选择): 增强文件选择功能并添加清除文件方法 - 为文件选择API添加返回类型声明 - 完善文件选择回调函数的文档注释 - 修改文件选择逻辑以返回选中的文件数组 - 添加清除文件列表的方法 * refactor(useFiles): 将参数从布尔值改为对象以增强可扩展性 * feat(hooks): 在useFiles钩子中暴露selecting状态 * feat(translate): 添加文件OCR功能支持 在翻译页面新增浮动按钮,支持通过OCR识别文件内容并自动填充到输入框。添加相关hooks和文件类型检查逻辑,提升用户输入便捷性。 * build: 将 tesseract.js 从 devDependencies 移至 dependencies 确保生产环境能正确使用 tesseract.js 功能 * refactor(ocr): 将Tesseract服务文件移动到tesseract子目录并更新配置 * refactor(TesseractService): 添加日志记录并更新worker配置 添加loggerService用于记录worker日志,并更新createWorker配置以使用自定义logger * feat(翻译页面): 添加OCR处理中的加载状态提示 在翻译页面中添加OCR处理时的加载状态提示,提升用户体验 * fix(translate): 为OCR处理消息添加无限持续时间 防止OCR处理过程中消息自动消失,确保用户明确知道处理状态 * fix: 添加OCR未知错误的翻译并更新错误提示 在OCR处理失败时,使用翻译后的错误消息替代原始错误提示 * style(translate): 调整浮动按钮位置从右上到左下 * fix(translate): 处理未选择文件时提前返回以避免空指针异常 * feat(i18n): 添加OCR功能的多语言支持 * feat(fs): 添加自动识别编码读取文本文件功能 实现通过自动检测文件编码来读取文本文件的功能 在IPC通道、预加载API和文件服务中添加相关方法 * feat(翻译): 添加文件读取功能并改进错误处理 添加对文本文件的支持并优化文件处理流程 改进错误提示信息,包括文件过大和读取失败的场景 * fix(i18n): 更新文件大小限制错误信息并添加多语言支持 修改文件大小限制的错误信息格式,移除括号内的限制范围 为多种语言添加文件操作相关的翻译条目 在错误提示中动态显示文件大小限制范围 * refactor(AttachmentButton): 移除类型注释,使用自动类型推断 * fix(hooks): 返回变量supportedFiles * fix(ocr): 改进OCR处理中的消息管理和错误处理 在useOcr钩子中统一管理OCR处理的消息提示,并完善错误处理逻辑 移除TranslatePage中重复的消息管理代码,简化OCR处理流程 * fix(translate): 在选择文件后清除文件状态以避免残留 在文件选择完成后调用clearFiles以清除文件状态 * refactor(preload): 移动OCR类型定义到共享类型文件 将OCR相关的类型定义(OcrProvider, OcrResult, SupportedOcrFile)从渲染进程类型文件移动到共享类型文件@types,以提高代码复用性和维护性 * refactor(ocr): 修改tesseractOcr返回完整识别结果而非仅文本 返回完整识别结果以便后续处理使用更多OCR信息,同时简化imageOcr中的条件判断逻辑 * fix(ocr): 修复文件类型与OCR提供者能力不匹配时的错误抛出位置 将错误抛出语句移至else分支 * refactor(ocr): 简化 DEFAULT_OCR_PROVIDER 的类型定义 * build: 将 tesseract.js 从 devDependencies 移至 dependencies 确保生产环境能正确使用 tesseract.js 功能 * refactor(ocr): 将Tesseract服务文件移动到tesseract子目录并更新配置 * refactor(TesseractService): 添加日志记录并更新worker配置 添加loggerService用于记录worker日志,并更新createWorker配置以使用自定义logger * feat(i18n): 添加OCR功能的多语言支持 * refactor(preload): 移动OCR类型定义到共享类型文件 将OCR相关的类型定义(OcrProvider, OcrResult, SupportedOcrFile)从渲染进程类型文件移动到共享类型文件@types,以提高代码复用性和维护性 * refactor(ocr): 修改tesseractOcr返回完整识别结果而非仅文本 返回完整识别结果以便后续处理使用更多OCR信息,同时简化imageOcr中的条件判断逻辑 * fix(ocr): 修复文件类型与OCR提供者能力不匹配时的错误抛出位置 将错误抛出语句移至else分支 * refactor(ocr): 简化 DEFAULT_OCR_PROVIDER 的类型定义 * fix(ocr): 改进OCR处理中的消息管理和错误处理 在useOcr钩子中统一管理OCR处理的消息提示,并完善错误处理逻辑 移除TranslatePage中重复的消息管理代码,简化OCR处理流程 * feat(i18n): 添加OCR相关的错误和状态翻译文本 * fix(useOcr): 修复未支持文件类型错误抛出位置 将不支持的OCR文件类型错误抛出逻辑移至条件判断内 * refactor(ocr): ocrImage实现使用OcrService并更新日志上下文 将ocrImage函数从useOcr钩子移动到OcrService中,提高代码复用性 更新日志服务上下文从'main'改为'renderer'以更准确反映模块位置 * style(TabContainer): 移除多余的空行并保持代码整洁 * refactor(ocr): 简化OCR文件类型检查逻辑 使用现有的isImageFile函数替代冗余的类型检查逻辑,提高代码复用性 * fix: 将迁移错误日志从136更新为137 * feat(ocr): enhance Tesseract service with language support and worker management - Added support for multiple Tesseract languages: Chinese (Simplified and Traditional) and English. - Refactored Tesseract worker management into a class for better encapsulation and reuse. - Introduced methods to dynamically determine language path based on IP country and manage worker lifecycle. * update cn url * support cn data * change to asyn * use register design mode * add type * use bind function * refactor(ipc): 简化OCR处理程序参数 * refactor(ocr): 修改ocrProviderCapabilityRecord类型定义 允许只定义部分能力 * refactor(ocr): 将Tesseract相关配置移至服务内部 将语言列表和下载URL常量从共享配置移至Tesseract服务内部 使用常量定义图片大小阈值以提高可读性 * refactor(ocr): 统一使用 SupportedOcrFile 类型替换 FileMetadata 更新 OCR 服务及其 Tesseract 实现,使用 SupportedOcrFile 类型替代原有的 FileMetadata 类型,以提高类型安全性和一致性。同时在 OcrService 中添加重复注册的警告日志。 * refactor(ocr): 重构OCR类型定义以支持模型和API配置 将OCR提供者配置拆分为独立类型,增加模型能力记录和API配置类型检查 添加OCR处理程序类型定义,为未来扩展提供更好的类型支持 * refactor(OcrService): 移除重复的OcrHandler类型定义 已在@types中定义OcrHandler类型,移除重复定义以提高代码一致性 * refactor(ocr): 将OcrService移动到ocr目录下并更新引用路径 * feat(ocr): 添加OCR API客户端工厂及示例实现 实现OCR API客户端工厂模式,支持根据不同提供商创建对应的客户端 新增OcrBaseApiClient作为基础类,提供通用功能 添加OcrExampleApiClient作为示例实现 修改OcrService以使用新的客户端工厂 * refactor(ocr): 添加日志记录以跟踪OCR文件处理 在OCR服务中添加日志记录功能,便于跟踪文件处理过程 * fix(deps): 更新 tesseract.js 依赖并添加补丁文件 修复 tesseract.js 类型定义问题并添加语言常量支持 * refactor(ocr): 移除注释掉的tesseract语言映射代码 使用Tesseract.js的LanguageCode类型替代硬编码的语言列表,提高类型安全性 * feat(ocr): 添加 Tesseract OCR 配置类型 * refactor(OCR设置): 重命名OcrImageProviderSettings为OcrImageSettings并优化代码结构 * refactor(ocr): 将 Tesseract 相关类型移动到文件底部以改善代码组织 * feat(ocr): 添加 Tesseract OCR 提供者类型检查函数 * feat(ocr): 添加更新OCR提供者配置的功能 * feat: 添加OCR提供者钩子函数 实现useOcrProvider钩子用于获取和更新OCR提供者配置 * refactor(ocr): 修改removeOcrProvider参数为字符串id 简化removeOcrProvider方法的参数类型,直接使用字符串id进行过滤,提高代码简洁性 * refactor(ocr): 将内置OCR提供者从数组改为映射结构 重构OCR配置模块,使用映射结构存储内置OCR提供者以便于扩展和维护 * refactor(ocr): 将BUILTIN_OCR_PROVIDERS改为只读数组 使用Object.freeze确保数组不可变,提高代码安全性 * feat(ocr): 添加OCR提供者管理功能并改进错误处理 添加useOcrProviders钩子用于管理OCR提供者的添加和删除 当内置OCR提供者不存在时自动恢复默认配置 改进错误提示信息并增加国际化支持 * Revert "refactor(ocr): 将BUILTIN_OCR_PROVIDERS改为只读数组" This reverts commit |
||
|
|
0af5a85f67
|
feat: Image OCR (#9409)
* build: 添加 tesseract.js 及其类型定义依赖
* feat(ocr): 添加OCR类型定义文件以支持OCR功能扩展
* feat(ocr): 添加 Tesseract OCR 提供程序配置
* feat(ocr): 添加Tesseract.js的logo
* refactor(settings): 重构文档预处理设置模块结构
将PreprocessSettings重命名为DocProcessSettings并调整文件结构
更新相关路由和组件引用以保持功能一致性
* refactor(config): 重命名OCR_PROVIDER_CONFIG为BUILTIN_OCR_PROVIDERS以更准确描述用途
* refactor(ocr): 更改文件名
* refactor(ocr): 将获取OCR提供商logo的功能移动到utils目录
将getOcrProviderLogo函数从config/ocr.ts移动到utils/ocr.ts,保持功能集中
* refactor(ocr): 重构OCR配置结构以支持默认提供者
将内置OCR提供者数组重构为单独定义的常量,并添加默认OCR提供者映射。这提高了代码的可维护性并支持未来扩展。
* feat(store): 添加OCR状态管理切片
实现OCR提供商的增删改查功能,使用Redux Toolkit管理OCR相关状态
* feat(types): 添加图片文件类型守卫函数
添加 ImageFileMetadata 类型和 isImageFile 类型守卫函数,用于检查文件是否为图片类型
* feat(ocr): 添加对OCR支持文件类型的类型定义和校验函数
添加SupportedOcrFileType类型和isSupportedOcrFileType校验函数
添加SupportedOcrFile类型和isSupportedOcrFile校验函数
* feat(ocr): 添加OCR功能支持
实现基于Tesseract的OCR功能,包括文件类型检查、服务接口和IPC通信
新增OCR相关类型定义和服务实现
* refactor(OcrService): 更新日志上下文为'main:OcrService'
* feat(ocr): 添加OCR服务基础功能
实现OCR服务的基础功能,通过调用window.api.ocr接口处理支持的文件类型
* feat(store): 添加ocr模块到redux store
* feat(ocr): 添加OCR功能支持及文件类型校验
添加OCR功能钩子useOcr,支持图片文件识别
添加不支持文件类型的错误提示国际化文案
* refactor(ocr): 重命名updatePreprocessProvider为updateOcrProvider以保持命名一致性
* feat(ocr): 添加设置图片OCR提供商的功能
* refactor(ocr): 统一OCR类型导入路径
将所有OCR相关类型从'@renderer/types/ocr'改为从'@renderer/types'或'@types'导入
优化DEFAULT_OCR_PROVIDER类型定义
* feat(store): 更新持久化存储版本并添加OCR配置迁移
添加137版本迁移逻辑,初始化OCR提供者和默认图像提供者配置
* feat(ocr): 添加OCR服务设置界面及提供商选择功能
实现OCR服务设置界面,包含图片OCR提供商的选择功能
修复ocr.ts中imageProvider的类型定义
添加相关国际化文本
* fix(ocr): 添加图像大小检查并优化错误处理
检查图像文件大小是否超过50MB限制
使用buffer读取文件替代直接路径识别
简化错误处理逻辑,直接抛出原始错误
* feat(OCR服务): 支持base64字符串作为OCR输入
扩展tesseractOcr函数以接受base64字符串或图像文件作为输入
* build: 将 tesseract.js 从 devDependencies 移至 dependencies
确保生产环境能正确使用 tesseract.js 功能
* refactor(ocr): 将Tesseract服务文件移动到tesseract子目录并更新配置
* refactor(TesseractService): 添加日志记录并更新worker配置
添加loggerService用于记录worker日志,并更新createWorker配置以使用自定义logger
* feat(i18n): 添加OCR功能的多语言支持
* refactor(preload): 移动OCR类型定义到共享类型文件
将OCR相关的类型定义(OcrProvider, OcrResult, SupportedOcrFile)从渲染进程类型文件移动到共享类型文件@types,以提高代码复用性和维护性
* refactor(ocr): 修改tesseractOcr返回完整识别结果而非仅文本
返回完整识别结果以便后续处理使用更多OCR信息,同时简化imageOcr中的条件判断逻辑
* fix(ocr): 修复文件类型与OCR提供者能力不匹配时的错误抛出位置
将错误抛出语句移至else分支
* refactor(ocr): 简化 DEFAULT_OCR_PROVIDER 的类型定义
* fix(ocr): 改进OCR处理中的消息管理和错误处理
在useOcr钩子中统一管理OCR处理的消息提示,并完善错误处理逻辑
移除TranslatePage中重复的消息管理代码,简化OCR处理流程
* feat(i18n): 添加OCR相关的错误和状态翻译文本
* fix(useOcr): 修复未支持文件类型错误抛出位置
将不支持的OCR文件类型错误抛出逻辑移至条件判断内
* refactor(ocr): ocrImage实现使用OcrService并更新日志上下文
将ocrImage函数从useOcr钩子移动到OcrService中,提高代码复用性
更新日志服务上下文从'main'改为'renderer'以更准确反映模块位置
* style(TabContainer): 移除多余的空行并保持代码整洁
* refactor(ocr): 简化OCR文件类型检查逻辑
使用现有的isImageFile函数替代冗余的类型检查逻辑,提高代码复用性
* fix: 将迁移错误日志从136更新为137
* feat(ocr): enhance Tesseract service with language support and worker management
- Added support for multiple Tesseract languages: Chinese (Simplified and Traditional) and English.
- Refactored Tesseract worker management into a class for better encapsulation and reuse.
- Introduced methods to dynamically determine language path based on IP country and manage worker lifecycle.
* update cn url
* support cn data
* change to asyn
* use register design mode
* add type
* use bind function
* refactor(ipc): 简化OCR处理程序参数
* refactor(ocr): 修改ocrProviderCapabilityRecord类型定义
允许只定义部分能力
* refactor(ocr): 将Tesseract相关配置移至服务内部
将语言列表和下载URL常量从共享配置移至Tesseract服务内部
使用常量定义图片大小阈值以提高可读性
* refactor(ocr): 统一使用 SupportedOcrFile 类型替换 FileMetadata
更新 OCR 服务及其 Tesseract 实现,使用 SupportedOcrFile 类型替代原有的 FileMetadata 类型,以提高类型安全性和一致性。同时在 OcrService 中添加重复注册的警告日志。
* refactor(ocr): 重构OCR类型定义以支持模型和API配置
将OCR提供者配置拆分为独立类型,增加模型能力记录和API配置类型检查
添加OCR处理程序类型定义,为未来扩展提供更好的类型支持
* refactor(OcrService): 移除重复的OcrHandler类型定义
已在@types中定义OcrHandler类型,移除重复定义以提高代码一致性
* refactor(ocr): 将OcrService移动到ocr目录下并更新引用路径
* feat(ocr): 添加OCR API客户端工厂及示例实现
实现OCR API客户端工厂模式,支持根据不同提供商创建对应的客户端
新增OcrBaseApiClient作为基础类,提供通用功能
添加OcrExampleApiClient作为示例实现
修改OcrService以使用新的客户端工厂
* refactor(ocr): 添加日志记录以跟踪OCR文件处理
在OCR服务中添加日志记录功能,便于跟踪文件处理过程
* fix(deps): 更新 tesseract.js 依赖并添加补丁文件
修复 tesseract.js 类型定义问题并添加语言常量支持
* refactor(ocr): 移除注释掉的tesseract语言映射代码
使用Tesseract.js的LanguageCode类型替代硬编码的语言列表,提高类型安全性
* feat(ocr): 添加 Tesseract OCR 配置类型
* refactor(OCR设置): 重命名OcrImageProviderSettings为OcrImageSettings并优化代码结构
* refactor(ocr): 将 Tesseract 相关类型移动到文件底部以改善代码组织
* feat(ocr): 添加 Tesseract OCR 提供者类型检查函数
* feat(ocr): 添加更新OCR提供者配置的功能
* feat: 添加OCR提供者钩子函数
实现useOcrProvider钩子用于获取和更新OCR提供者配置
* refactor(ocr): 修改removeOcrProvider参数为字符串id
简化removeOcrProvider方法的参数类型,直接使用字符串id进行过滤,提高代码简洁性
* refactor(ocr): 将内置OCR提供者从数组改为映射结构
重构OCR配置模块,使用映射结构存储内置OCR提供者以便于扩展和维护
* refactor(ocr): 将BUILTIN_OCR_PROVIDERS改为只读数组
使用Object.freeze确保数组不可变,提高代码安全性
* feat(ocr): 添加OCR提供者管理功能并改进错误处理
添加useOcrProviders钩子用于管理OCR提供者的添加和删除
当内置OCR提供者不存在时自动恢复默认配置
改进错误提示信息并增加国际化支持
* Revert "refactor(ocr): 将BUILTIN_OCR_PROVIDERS改为只读数组"
This reverts commit
|
||
|
|
4dabc214f2
|
feat: enhance file extension handling in Inputbar (#9269)
* feat: add isTextFile functionality and improve file selection handling - Introduced a new IPC channel for checking if a file is a text file. - Implemented isTextFile method in FileStorage service to determine file type based on content. - Enhanced AttachmentButton to filter selected files based on text file validation. - Updated translations to include support for displaying unsupported file counts across multiple languages. - Added utility functions for text file validation and filtering in file utilities. * refactor(FileStorage): replace hardcoded buffer size with constant for improved readability * restore yarn lock * add isbinaryfile dep * refactor: 整理导入顺序 * fix(preload): 为isTextFile方法添加返回类型Promise<boolean> * refactor(FileManager): update getSafePath to use file metadata for path retrieval - Modified getSafePath method to utilize the path from file metadata instead of a hardcoded file path. - Enhanced handling for files not stored in the file storage system. * refactor(FileUtilities): rename text file functions for clarity - Updated function names from isTextFile to isSupportedFile and filterTextFiles to filterSupportedFiles to better reflect their purpose. - Adjusted related imports and usages in AttachmentButton and PasteService components to align with the new naming conventions. * fix drop files * refactor(MarkdownStyles): remove last-child margin override; adjust MessageFooter margin and clean up unused code in MessageAttachments * feat(Sidebar): add 'code_tools' icon and route; enhance CodeToolsPage layout with Navbar and improved provider filtering * feat(CodeTools): add environment variable support for CLI tools; update UI to manage environment variables and enhance localization for related strings * refactor(Sidebar): remove unused imports and code related to documentation; streamline sidebar functionality * refactor(SvgPreview): use transparent container for SVG (#9294) * refactor(SvgPreview): use transparent container for SVG * test: fix snapshot * refactor(CodeToolsService): replace npm package version fetching with direct API call; simplify command construction for installation * chore: release v1.5.7-rc.1 * refactor(CodeToolsService): adjust command construction for Windows compatibility; streamline installation command handling * refactor(Markdown): update disallowed elements to include 'script' for enhanced security * feat: quick model (#9290) * refactor(i18n): 将话题命名模型相关文案更新为摘要模型 更新所有语言文件中关于话题命名模型的文案,统一改为摘要模型,以反映功能的扩展和更通用的用途 * refactor(设置页面): 优化主题命名弹窗组件性能 使用useCallback和useMemo优化回调函数和渲染性能 将重复的JSX代码提取为独立组件 * feat(设置): 在模型设置中添加话题命名折叠面板 将话题命名设置从直接显示改为折叠面板形式,提升界面整洁度 * refactor(i18n): 重构话题命名相关翻译字段结构 * docs(i18n): 添加生成图像的高度、宽度和安全容忍度翻译占位符 * fix(settings): 修正主题命名弹窗中的翻译键名 * style(ui): 调整主题命名弹窗的间距和文本区域高度 移除多余的上下边距,并使用自适应高度的文本区域 * refactor(llm): 将 topicNamingModel 重命名为 summaryModel 更新相关函数、状态和测试用例以反映命名变更 增加迁移逻辑处理旧状态数据 更新持久化版本号至133 * fix(ApiService): 优先使用摘要模型替代默认模型 当获取摘要时,优先使用getSummaryModel()返回的模型,其次才是助手指定的模型或默认模型,以确保摘要生成的一致性 * docs(i18n): 更新摘要模型描述中的搜索关键词提炼 将"搜索结果摘要"修改为"搜索关键字提炼"以更准确描述功能 * fix(i18n): 更新多语言翻译文件中的摘要模型相关文本 * feat(i18n): 为摘要模型设置添加工具提示说明 添加摘要模型设置的工具提示,建议用户选择轻量模型而非思考模型 * refactor(i18n): 将摘要模型相关文案更新为快速模型 更新国际化文案和组件引用,将"摘要模型"统一改为"快速模型"以更准确描述功能用途 * feat(i18n): 将摘要模型重命名为快速模型并更新相关描述 * refactor(llm): 将summaryModel重命名为quickModel以提升语义清晰度 * test(api): 在ApiService测试中添加LlmState类型和awsBedrock配置 添加LlmState类型以满足类型检查要求,并补充awsBedrock的mock配置以完善测试覆盖 * Revert "feat(设置): 在模型设置中添加话题命名折叠面板" This reverts commit |
||
|
|
332ba5d678
|
feat: support openai codex (#9332)
* 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 |
||
|
|
a21fc91915
|
fix: unexpected quitting full screen mode (#9200)
* fix(Inputbar): 修正拼写错误,将expend改为expand
* fix: 修复Escape键事件冒泡问题并改进全屏处理
修复多个组件中Escape键事件未阻止冒泡的问题
添加全屏控制IPC通道
将全屏退出逻辑移至渲染进程处理
移除主进程中冗余的全屏退出处理代码
* fix(SelectModelPopup): 修复键盘事件处理并移除无效的useEffect
将键盘事件监听从window移动到Modal容器,避免事件冒泡问题
移除无效的useEffect并更新键盘事件类型定义
* fix(QuickPanel): 拦截window上的keydown事件
* fix(QuickPanel): 修复事件监听器移除时未使用相同参数的问题
* fix(TopView): 修复左侧导航栏布局崩坏问题
* fix: 修正变量名拼写错误,将expended改为expanded
* Revert "fix(SelectModelPopup): 修复键盘事件处理并移除无效的useEffect"
This reverts commit
|
||
|
|
1c7b7a1a55
|
feat: add code tools (#9043)
* feat: add code tools * feat(CodeToolsService): add CLI executable management and installation check - Introduced methods to determine the CLI executable name based on the tool. - Added functionality to check if a package is installed and create the necessary bin directory if it doesn't exist. - Enhanced the run method to handle installation and execution of CLI tools based on their installation status. - Updated terminal command handling for different operating systems with improved comments and error messages. * feat(ipService): implement IP address country detection and npm registry URL selection - Added a new module for IP address country detection using the ipinfo.io API. - Implemented functions to check if the user is in China and to return the appropriate npm registry URL based on the user's location. - Updated AppUpdater and CodeToolsService to utilize the new ipService functions for improved user experience based on geographical location. - Enhanced error handling and logging for better debugging and user feedback. * feat: remember cli model * feat(CodeToolsService): update options for auto-update functionality - Refactored the options parameter in CodeToolsService to replace checkUpdate and forceUpdate with autoUpdateToLatest. - Updated logic to handle automatic updates when the CLI tool is already installed. - Modified related UI components to reflect the new auto-update option. - Added corresponding translations for the new feature in multiple languages. * feat(CodeToolsService): enhance CLI tool launch with debugging support - Added detailed logging for CLI tool launch process, including environment variables and options. - Implemented a temporary batch file for Windows to facilitate debugging and command execution. - Improved error handling and cleanup for the temporary batch file after execution. - Updated terminal command handling to use the new batch file for safer execution. * refactor(CodeToolsService): simplify command execution output - Removed display of environment variable settings during command execution in the CLI tool. - Updated comments for clarity on the command execution process. * feat(CodePage): add model filtering logic for provider selection - Introduced a modelPredicate function to filter out embedding, rerank, and text-to-image models from the available providers. - Updated the ModelSelector component to utilize the new predicate for improved model selection experience. * refactor(CodeToolsService): improve logging and cleanup for CLI tool execution - Updated logging to display only the keys of environment variables during CLI tool launch for better clarity. - Introduced a variable to store the path of the temporary batch file for Windows. - Enhanced cleanup logic to remove the temporary batch file after execution, improving resource management. * feat(Router): replace CodePage with CodeToolsPage and add new page for code tools - Updated Router to import and route to the new CodeToolsPage instead of the old CodePage. - Introduced CodeToolsPage component, which provides a user interface for selecting CLI tools and models, managing directories, and launching code tools with enhanced functionality. * refactor(CodeToolsService): improve temporary file management and cleanup - Removed unused variable for Windows batch file path. - Added a cleanup task to delete the temporary batch file after 10 seconds to enhance resource management. - Updated logging to ensure clarity during the execution of CLI tools. * refactor(CodeToolsService): streamline environment variable handling for CLI tool execution - Introduced a utility function to remove proxy-related environment variables before launching terminal processes. - Updated logging to display only the relevant environment variable keys, enhancing clarity during execution. * refactor(MCPService, CodeToolsService): unify proxy environment variable handling - Replaced custom proxy removal logic with a shared utility function `removeEnvProxy` to streamline environment variable management across services. - Updated logging to reflect changes in environment variable handling during CLI tool execution. |