mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-19 14:41:24 +08:00
copilot/fix-half-input-box-issue
104 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
a6182eaf85
|
Refactor/inputbar (#10332)
* Refactor inputbar system with configurable scope-based architecture - **Implement scope-based configuration** for chat, agent sessions, and mini-window with feature toggles - **Add tool registry system** with dependency injection for modular inputbar tools - **Create shared state management** via InputbarToolsProvider for consistent state handling - **Migrate existing tools** to registry-based definitions with proper scope filtering The changes introduce a flexible inputbar architecture that supports different use cases through scope-based configuration while maintaining feature parity and improving code organization. * Remove unused import and refactor tool rendering - Delete obsolete '@renderer/pages/home/Inputbar/tools' import from Inputbar.tsx - Extract ToolButton component to render tools outside useMemo dependency cycle - Store tool definitions in config for deferred rendering with current context - Fix potential stale closure issues in tool rendering by rebuilding context on each render * Wrap ToolButton in React.memo and optimize quick panel menu updates - Memoize ToolButton component to prevent unnecessary re-renders when tool key remains unchanged - Replace direct menu state updates with version-based triggering to batch registry changes - Add useEffect to consolidate menu updates and reduce redundant flat operations * chore style * refactor(InputbarToolsProvider): simplify quick panel menu update logic * Improve QuickPanel behavior and input handling - Default select first item when panel symbol changes to enhance user experience - Add Tab key support for selecting template variables in input field - Refactor QuickPanel trigger logic with better symbol tracking and boundary checks - Fix typo in translation key for model selection menu item * Refactor import statements to use type-only imports - Convert inline type imports to explicit type imports in Inputbar.tsx and types.ts - Replace combined type/value imports with separate type imports in InputbarToolsProvider and tools - Remove unnecessary menu version state and effect in InputbarToolsProvider * Refactor InputbarTools context to separate state and dispatch concerns - Split single context into separate state and dispatch contexts to optimize re-renders - Introduce derived state for `couldMentionNotVisionModel` based on file types - Encapsulate Quick Panel API in stable object with memoized functions - Add internal dispatch context for Inputbar-specific state setters * Refactor Inputbar to use split context hooks and optimize QuickPanel - Replace monolithic `useInputbarTools` with separate state, dispatch, and internal dispatch hooks - Move text state from context to local component state in InputbarInner - Optimize QuickPanel trigger registration to use ref pattern, avoiding frequent re-registrations * Refactor QuickPanel API to separate concerns between tools and inputbar - Split QuickPanel API into `toolsRegistry` for tool registration and `triggers` for inputbar triggering - Remove unused QuickPanel state variables and clean up dependencies - Update tool context to use new API structure with proper type safety * Optimize the state management of QuickPanel and Inputbar, add text update functionality, and improve the tool registration logic. * chore * Add reusable React hooks and InputbarCore component for chat input - Create `useInputText`, `useKeyboardHandler`, and `useTextareaResize` hooks for text management, keyboard shortcuts, and auto-resizing - Implement `InputbarCore` component with modular toolbar sections, drag-drop support, and textarea customization - Add `useFileDragDrop` and `usePasteHandler` hooks for file uploads and paste handling with type filtering * Refactor Inputbar to use custom hooks for text and textarea management - Replace manual text state with useInputText hook for text management and empty state - Replace textarea resize logic with useTextareaResize hook for automatic height adjustment - Add comprehensive refactoring documentation with usage examples and guidelines * Refactor inputbar drag-drop and paste handling into custom hooks - Extract paste handling logic into usePasteHandler hook - Extract drag-drop file handling into useFileDragDrop hook - Remove inline drag-drop state and handlers, use hook interfaces - Clean up dependencies and callback optimizations * Refactor Inputbar component to use InputbarCore composition - Extract complex UI logic into InputbarCore component for better separation of concerns - Remove intermediate wrapper component and action ref forwarding pattern - Consolidate focus/blur handlers and simplify component structure * Refactor Inputbar to expose actions via ref for external control - Extract action handlers into ProviderActionHandlers interface and expose via ref - Split component into Inputbar wrapper and InputbarInner implementation - Update useEffect to sync inner component actions with ref for external access * feat: inputbar core * refactor: Update QuickPanel integration across various tools * refactor: migrate to antd * chore: format * fix: clean code * clean code * fix i18n * fix: i18n * relative path * model type * 🤖 Weekly Automated Update: Nov 09, 2025 (#11209) feat(bot): Weekly automated script run Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com> Co-authored-by: SuYao <sy20010504@gmail.com> * format * fix * fix: format * use ripgrep * update with input * add common filters * fix build issue * format * fix error * smooth change * adjust * support listing dir * keep list files when focus and blur * support draft save * Optimize the rendering logic of session messages and input bars, and simplify conditional judgments. * Upgrade to agentId * format * 🐛 fix: force quick triggers for agent sessions * revert * fix migrate * fix: filter * fix: trigger * chore packages * feat: 添加过滤和排序功能,支持自定义函数 * fix cursor bug * fix format --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: beyondkmp <beyondkmp@gmail.com> Co-authored-by: kangfenmao <kangfenmao@qq.com> |
||
|
|
2a06c606e1
|
feat: restore data to mobile App (#10108)
* feat: restore data to App
* fix: i18n check
* fix: lint
* Change WebSocket service port to 11451
- Update default port from 3000 to 11451 for WebSocket connections
- Maintain existing service structure and client connection handling
* Add local IP address to WebSocket server configuration
- Set server path using local IP address for improved network accessibility
- Maintain existing CORS policy with wildcard origin
- Keep backward compatibility with current connection handling
* Remove local IP path and enforce WebSocket transport
- Replace dynamic local IP path with static WebSocket transport configuration
- Maintain CORS policy with wildcard origin for cross-origin connections
- Ensure reliable WebSocket-only communication by disabling fallback transports
* Add detailed logging to WebSocket connection flow
- Enhance WebSocketService with verbose connection logging including transport type and client count
- Add comprehensive logging in ExportToPhoneLanPopup for WebSocket initialization and status tracking
- Improve error handling with null checks for main window before sending events
* Add engine-level WebSocket connection monitoring
- Add initial_headers event listener to log connection attempts with URL and headers
- Add engine connection event to log established connections with remote addresses
- Add startup logs for server binding and allowed transports
* chore: change to use 7017 port
* Improve local IP address selection with interface priority system
- Implement network interface priority ranking to prefer Ethernet/Wi-Fi over virtual/VPN interfaces
- Add detailed logging for interface discovery and selection process
- Remove websocket-only transport restriction for broader client compatibility
- Clean up unused parameter in initial_headers event handler
* Add VPN interface patterns for Tailscale and WireGuard
- Include Tailscale VPN interfaces in network interface filtering
- Add WireGuard VPN interfaces to low-priority network candidates
- Maintain existing VPN tunnel interface patterns for compatibility
* Add network interface prioritization for QR code generation
- Implement `getAllCandidates()` method to scan and prioritize network interfaces by type (Ethernet/Wi-Fi over VPN/virtual interfaces)
- Update QR code payload to include all candidate IPs with priority rankings instead of single host
- Add comprehensive interface pattern matching for macOS, Windows, and Linux systems
* Add WebSocket getAllCandidates IPC channel
- Add new WebSocket_GetAllCandidates enum value to IpcChannel
- Register getAllCandidates handler in main process IPC
- Expose getAllCandidates method in preload script API
* Add WebSocket connection logging and temporary test button
- Add URL and method logging to WebSocket engine connection events
- Implement Socket.IO connect and connect_error event handlers with logging
- Add temporary test button to force connection status for debugging
* Clean up WebSocket logging and remove debug code
- Remove verbose debug logs from WebSocket service and connection handling
- Consolidate connection logging into single informative messages
- Remove temporary test button and force connection functionality from UI
- Add missing "sending" translation key for export button loading state
* Enhance file transfer with progress tracking and improved UI
- Add transfer speed monitoring and formatted file size display in WebSocket service
- Implement detailed connection and transfer state management in UI component
- Improve visual feedback with status indicators, progress bars, and error handling
* Enhance WebSocket service and LAN export UI with improved logging and user experience
- Add detailed WebSocket server configuration with transports, CORS, and timeout settings
- Implement comprehensive connection logging at both Socket.IO and Engine.IO levels
- Refactor export popup with modular components, status indicators, and i18n support
* 移除 WebSocket 连接时的冗余日志记录
* Remove dot indicator from connection status component
- Simplify status style map by removing unused dot color properties
- Delete dot indicator element from connection status display
- Maintain existing border and background color styling for status states
* Refactor ExportToPhoneLanPopup with dedicated UI components and improved UX
- Extract QR code display states into separate components (LoadingQRCode, ScanQRCode, ConnectingAnimation, ConnectedDisplay, ErrorQRCode)
- Add confirmation dialog when attempting to close during active file transfer
- Improve WebSocket cleanup and modal dismissal behavior with proper connection handling
* Remove close button hiding during QR code generation
- Eliminate `hideCloseButton={isSending}` prop to keep close button visible
- Maintain consistent modal behavior throughout export process
- Prevent user confusion by ensuring close option remains available
* auto close
* Extract auto-close countdown into separate component
- Move auto-close countdown logic from TransferProgress to dedicated AutoCloseCountdown component
- Update styling to use paddingTop instead of marginTop for better spacing
- Clean up TransferProgress dependencies by removing autoCloseCountdown
* 添加局域网传输相关的翻译文本,包括自动关闭提示和确认关闭消息
---------
Co-authored-by: suyao <sy20010504@gmail.com>
|
||
|
|
aa810a7ead
|
fix: notify renderer when api server ready (#11049)
* fix: notify renderer when api server ready * chore: minor comment update Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: minor ui change to reflect server loading state --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> |
||
|
|
5790c12011
|
✨ Feat: Enhanced Tool Permission System with Real-time Approvals #10738 (#10743)
* ⬆️ chore: upgrade claude agent sdk to 0.1.15 * ✨ feat: add initial tool permission approval system - Add promptForToolApproval function for real-time tool approval UI - Integrate canUseTool callback into ClaudeCodeService - Create tool-permissions.ts module for permission handling - Set foundation for enhanced tool permission system #10738 This provides the basic infrastructure for displaying tool approval prompts and getting user consent before agents execute potentially dangerous operations. * restore to main for restore to main for * ✨ feat: implement agent tool permission request system Add comprehensive tool permission management for Claude Code agents with: - IPC channels for bidirectional permission requests/responses between main and renderer - Permission request queue with timeout (30s), abort signal handling, and auto-cleanup - Auto-approval system via CHERRY_AUTO_ALLOW_TOOLS env var and default allow-list (Read, Glob, Grep) - New ToolPermissionRequestCard UI component for user approval with input preview - Redux store (toolPermissions) for tracking pending/resolved permission requests - User input stream architecture allowing dynamic user messages during agent execution Key changes: - packages/shared/IpcChannel.ts: Add AgentToolPermission_* channels - src/main/services/agents/services/claudecode/: Refactor canUseTool with permission prompts - src/renderer/src/store/toolPermissions.ts: New Redux slice for permission state - src/renderer/src/pages/home/Messages/Tools/ToolPermissionRequestCard.tsx: Interactive approval UI * refactor: simplify ToolPermissionRequestCard by removing unused imports and suggestion handling logic * feat: add i18n * fix(i18n): Auto update translations for PR #10743 --------- Co-authored-by: dev <verc20.dev@proton.me> Co-authored-by: GitHub Action <action@github.com> |
||
|
|
352ecbc506
|
✨ feat: add plugin management system for Claude Agent (agents, commands, skills) (#10854)
* ✨ feat: add claude-code-templates via git submodule with build-time copy - Add git submodule for davila7/claude-code-templates - Create scripts/copy-templates.js to copy components at build time - Update package.json build script to include template copying - Add resources/data/components/ to .gitignore (generated files) Templates are now automatically synced from external repo to resources/data/components/ during build process, avoiding manual file copying. To update templates: git submodule update --remote --merge * fix: update target directory for copying Claude Code templates * ✨ feat: merge Anthropics skills into template sync * 📝 docs: add agent plugins management implementation spec Add comprehensive implementation plan for plugin management feature: - Security validation and transactional operations - Plugin browsing, installation, and management UI - IPC handlers and PluginService architecture - Metadata caching and database integration * ✨ feat: add plugin management backend infrastructure Backend implementation for Claude Code plugin management: - Add PluginService with security validation and caching - Create IPC handlers for plugin operations (list, install, uninstall) - Add markdown parser with safe YAML frontmatter parsing - Extend AgentConfiguration schema with installed_plugins field - Update preload bridge to expose plugin API to renderer - Add plugin types (PluginMetadata, PluginError, PluginResult) Features: - Transactional install/uninstall with rollback - Path traversal prevention and file validation - 5-minute plugin list caching for performance - SHA-256 content hashing for integrity checks - Duplicate plugin handling (auto-replace) Dependencies added: - gray-matter: Markdown frontmatter parsing - js-yaml: Safe YAML parsing with FAILSAFE_SCHEMA * ✨ feat: add plugin management UI and integration Complete frontend implementation for Claude Code plugin management: **React Hooks:** - useAvailablePlugins: Fetch and cache available plugins - useInstalledPlugins: List installed plugins with refresh - usePluginActions: Install/uninstall with loading states **UI Components (HeroUI):** - PluginCard: Display plugin with install/uninstall actions - CategoryFilter: Multi-select chip-based category filter - InstalledPluginsList: Table view with uninstall confirmation - PluginBrowser: Search, filter, pagination, responsive grid - PluginSettings: Main container with Available/Installed tabs **Integration:** - Added "Plugins" tab to AgentSettingsPopup - Full i18n support (English, Simplified Chinese, Traditional Chinese) - Toast notifications for success/error states - Loading skeletons and empty states **Features:** - Search plugins by name/description - Filter by category and type (agents/commands) - Pagination (12 items per page) - Install/uninstall with confirmation dialogs - Real-time plugin list updates - Responsive grid layout (1-3 columns) All code formatted with Biome and follows existing patterns. * 🐛 fix: add missing plugin i18n keys at root level Add plugin translation keys at root 'plugins.*' level to match component usage: - Search and filter UI strings - Pluralization support for result counts - Empty state messages - Action button labels - Confirmation dialog text Translations added for all three locales (en-US, zh-CN, zh-TW). * 🐛 fix: use getResourcePath() utility for plugin directory resolution Replace manual path calculation with getResourcePath() utility which correctly handles both development and production environments. This fixes the issue where plugins were not loading because __dirname was resolving to the wrong location. Fixes: - Plugins now load correctly in development mode - Path resolution consistent with other resource loading in the app - Removed unused 'app' import from electron * 🎨 fix: improve plugin UI scrolling and category filter layout Fixes two UI issues: 1. Enable scrolling for plugin list: - Changed overflow-hidden to overflow-y-auto on tab containers - Plugin grid now scrollable when content exceeds viewport 2. Make category filter more compact: - Added max-h-24 (96px) height limit to category chip container - Enabled vertical scrolling for category chips - Prevents category filter from taking too much vertical space UI improvements enhance usability when browsing large plugin collections. * 🎨 fix: ensure both agent and command badges have visible backgrounds Changed Chip variant from 'flat' to 'solid' for plugin type badges. This ensures both agent (primary) and command (secondary) badges display with consistent, visible background colors instead of command badges appearing as text-only. * ✨ feat: add plugin detail modal for viewing full plugin information Add modal to display complete plugin details when clicking on a card: Features: - Click any plugin card to view full details in a modal - Shows complete description (not truncated) - Displays all metadata: version, author, tools, allowed_tools, tags - Shows file info: filename, size, source path, install date - Install/uninstall actions available in modal - Hover effect on cards to indicate clickability - Button clicks don't trigger card click (event.stopPropagation) Components: - New PluginDetailModal component with scrollable content - Updated PluginCard to be clickable (isPressable) - Updated PluginBrowser to manage modal state UI improvements provide better plugin exploration and decision-making. * 🐛 fix: render plugin detail modal above agent settings modal Use React portal to render PluginDetailModal directly to document.body, ensuring it appears above the agent settings modal instead of being blocked by it. Changes: - Import createPortal from react-dom - Wrap modal content in createPortal(modalContent, document.body) - Add z-[9999] to modal wrapper for proper layering Fixes modal visibility issue where plugin details were hidden behind the parent agent settings modal. * ✨ feat: add plugin content viewing and editing in detail modal - Added IPC channels for reading and writing plugin content - Implemented readContent() and writeContent() methods in PluginService - Added IPC handlers for content operations with proper error handling - Exposed plugin content API through preload bridge - Updated PluginDetailModal to fetch and display markdown content - Added edit mode with textarea for modifying plugin content - Implemented save/cancel functionality with optimistic UI updates - Added agentId prop to component chain for write operations - Updated AgentConfigurationSchema to include all plugin metadata fields - Moved plugin types to shared @types for cross-process access - Added validation and security checks for content read/write - Updated content hash in DB after successful edits * 🐛 fix: change event handler from onPress to onClick for uninstall and install buttons * 📝 docs: update AI Assistant Guide to clarify proposal and commit guidelines * 📝 docs: add skills support extension spec for agent plugins management * ✨ feat: add secure file operation utilities for skills plugin system - Implement copyDirectoryRecursive() with security protections - Implement deleteDirectoryRecursive() with path validation - Implement getDirectorySize() for folder size calculation - Add path traversal protection using isPathInside() - Handle symlinks securely to prevent attacks - Add recursion depth limits to prevent stack overflow - Preserve file permissions during copy - Handle race conditions and missing files gracefully - Skip special files (pipes, sockets, devices) Security features: - Path validation against allowedBasePath boundary - Symlink detection and skip to prevent circular loops - Input validation for null/empty/relative paths - Comprehensive error handling and logging Updated spec status to "In Progress" and added implementation progress checklist. * ✨ feat: add skill type support and skill metadata parsing Type System Updates (plugin.ts): - Add PluginType export for 'agent' | 'command' | 'skill' - Update PluginMetadataSchema to include 'skill' in type enum - Update InstalledPluginSchema to support skill type - Update all option interfaces to support skill type - Add skills array to ListAvailablePluginsResult - Document filename semantics differences between types Markdown Parser Updates (markdownParser.ts): - Implement parseSkillMetadata() function for SKILL.md parsing - Add comprehensive input validation (absolute path check) - Add robust error handling with specific PluginErrors - Add try-catch around file operations and YAML parsing - Add type validation for frontmatter data fields - Add proper logging using loggerService - Handle getDirectorySize() failures gracefully - Document hash scope decision (SKILL.md only vs entire folder) - Use FAILSAFE_SCHEMA for safe YAML parsing Security improvements: - Path validation to ensure absolute paths - Differentiate ENOENT from permission errors - Type validation for all frontmatter fields - Safe YAML parsing to prevent deserialization attacks Updated spec progress tracking. * ✨ feat: implement complete skill support in PluginService Core Infrastructure: - Add imports for parseSkillMetadata and file operation utilities - Add PluginType to imports for type-safe handling Skill-Specific Methods: - sanitizeFolderName() - validates folder names (no dots allowed) - scanSkillDirectory() - scans skills/ for skill folders - installSkill() - copies folders with transaction/rollback - uninstallSkill() - removes folders with transaction/rollback Updated Methods for Skills Support: - listAvailable() - now scans and returns skills array - install() - branches on type to handle skills vs files - uninstall() - branches on type for skill/file handling - ensureClaudeDirectory() - handles 'skills' subdirectory - listInstalled() - validates skill folders on filesystem - writeContent() - updated signature to accept PluginType Key Implementation Details: - Skills use folder names WITHOUT extensions - Agents/commands use filenames WITH .md extension - Different sanitization rules for folders vs files - Transaction pattern with rollback for all operations - Comprehensive logging and error handling - Maintains backward compatibility with existing code Updated spec progress tracking. * ✨ feat: add skill support to frontend hooks and UI components Frontend Hooks (usePlugins.ts): - Add skills state to useAvailablePlugins hook - Return skills array in hook result - Update install() to accept 'skill' type - Update uninstall() to accept 'skill' type UI Components: - PluginCard: Add 'skill' type badge with success color - PluginBrowser: Add skills prop and include in plugin list - PluginBrowser: Update type definitions to include 'skill' - PluginBrowser: Include skills in tab filtering Complete frontend integration for skills plugin type. Updated spec progress tracking. * ♻️ refactor: remove unused variable in installSkill method * 📝 docs: mark implementation as complete with summary Implementation Status: COMPLETE (11/12 tasks) Completed: - ✅ File operation utilities with security protections - ✅ Skill metadata parsing with validation - ✅ Plugin type system updated to include 'skill' - ✅ PluginService skill methods (scan, install, uninstall) - ✅ PluginService updated for skill support - ✅ IPC handlers (no changes needed - already generic) - ✅ Frontend hooks updated for skills - ✅ UI components updated (PluginCard, PluginBrowser) - ✅ Build check passed with lint fixes Deferred (non-blocking): - ⏸️ Session integration - requires further investigation into session handler location and implementation The core skills plugin system is fully implemented and functional. Skills can be browsed, installed, and uninstalled through the UI. All security requirements met with path validation and transaction rollback. Code passes lint checks and follows project patterns. * 🐛 fix: pass skills prop to PluginBrowser component Fixed "skills is not iterable" error by: - Destructuring skills from useAvailablePlugins hook - Updating type annotations to include 'skill' type - Passing skills prop to PluginBrowser component This completes the missing UI wiring for skills support. * ✨ feat: add Skills tab to plugin browser Added missing Skills tab to PluginBrowser component: - Added Skills tab to type tabs - Added translations for skills in all locales (en-us, zh-cn, zh-tw) - English: "Skills" - Simplified Chinese: "技能" - Traditional Chinese: "技能" This completes the UI integration for the skills plugin type. * ✨ feat: add 'skill' type to AgentConfiguration and GetAgentSessionResponse schemas * ⬆️ chore: upgrade @anthropic-ai/claude-agent-sdk to v0.1.25 with patch - Updated from v0.1.1 to v0.1.25 - Applied fork/IPC patch to new version - Removed old patch file - All tests passing * 🐛 fix: resolve linting and TypeScript type errors in build check - Add external/** and resources/data/claude-code-plugins/** to lint ignore patterns to exclude git submodules and plugin templates from linting - Fix TypeScript error handling in IPC handlers by properly typing caught errors - Fix AgentConfiguration type mismatches by providing default values for permission_mode and max_turns when spreading configuration - Replace control character regex with String.fromCharCode() to avoid ESLint no-control-regex rule in sanitization functions - Fix markdownParser yaml.load return type by adding type assertion - Add getPluginErrorMessage helper to properly extract error messages from PluginError discriminated union types Main process TypeScript errors: Fixed (0 errors) Linting errors: Fixed (0 errors from 4397) Remaining: 4 renderer TypeScript errors in settings components * ♻️ refactor: improve plugin error handling and reorganize i18n structure * ⬆️ chore: update @anthropic-ai/claude-agent-sdk to include patch and additional dependencies * 🗑️ chore: remove unused Claude code plugins and related configurations - Deleted `.gitmodules` and associated submodules for `claude-code-templates` and `anthropics-skills`. - Updated `.gitignore`, `.oxlintrc.json`, and `eslint.config.mjs` to exclude `claude-code-plugins`. - Modified `package.json` to remove the build script dependency on copying templates. - Adjusted `PluginService.ts` to handle plugin paths without relying on removed resources. * format code * delete * delete * fix(i18n): Auto update translations for PR #10854 * ✨ feat: enhance PluginService and markdownParser with recursive skill directory search - Added `findAllSkillDirectories` function to recursively locate directories containing `SKILL.md`. - Updated `scanSkillDirectory` method in `PluginService` to utilize the new recursive search. - Modified `PluginDetailModal` to append `/SKILL.md` to the source path for skill plugins. * fix(i18n): Auto update translations for PR #10854 * remove specs * update claude code plugins files --------- Co-authored-by: suyao <sy20010504@gmail.com> Co-authored-by: beyondkmp <beyondkmp@gmail.com> Co-authored-by: GitHub Action <action@github.com> |
||
|
|
d187adb0d3
|
feat: redirect macOS About menu to settings About page (#10902)
* ci: add GitHub issue tracker workflow with Feishu notifications (#10895) * feat: add GitHub issue tracker workflow with Feishu notifications * fix: add missing environment variable for Claude translator in GitHub issue tracker workflow * fix: update environment variable for Claude translator in GitHub issue tracker workflow * Add quiet hours handling and scheduled processing for GitHub issue notifications - Implement quiet hours detection (00:00-08:30 Beijing Time) with delayed notifications - Add scheduled workflow to process pending issues daily at 08:30 Beijing Time - Create new script to batch process and summarize multiple pending issues with Claude * Replace custom Node.js script with Claude Code Action for issue processing - Migrate from custom JavaScript implementation to Claude Code Action for AI-powered issue summarization and processing - Simplify workflow by leveraging Claude's built-in GitHub API integration and tool usage capabilities - Maintain same functionality: fetch pending issues, generate Chinese summaries, send Feishu notifications, and clean up labels - Update Claude action reference from version pin to main branch for latest features * Remove GitHub issue comment functionality - Delete automated AI summary comments on issues after processing - Remove documentation for manual issue commenting workflow - Keep Feishu notification system intact while streamlining issue interactions * feat: redirect macOS About menu to settings About page Add functionality to navigate to the About page in settings when clicking the About menu item in macOS menu bar. Changes: - Add Windows_NavigateToAbout IPC channel for communication between main and renderer processes - Create AppMenuService to setup macOS application menu with custom About handler - Add IPC handler in main process to show main window and trigger navigation - Add IPC listener in renderer NavigationHandler to navigate to /settings/about - Initialize AppMenuService on app startup for macOS platform 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * * feat: add GitHub issue tracker workflow with Feishu notifications * feat: add GitHub issue tracker workflow with Feishu notifications * fix: add missing environment variable for Claude translator in GitHub issue tracker workflow * fix: update environment variable for Claude translator in GitHub issue tracker workflow * Add quiet hours handling and scheduled processing for GitHub issue notifications - Implement quiet hours detection (00:00-08:30 Beijing Time) with delayed notifications - Add scheduled workflow to process pending issues daily at 08:30 Beijing Time - Create new script to batch process and summarize multiple pending issues with Claude * Replace custom Node.js script with Claude Code Action for issue processing - Migrate from custom JavaScript implementation to Claude Code Action for AI-powered issue summarization and processing - Simplify workflow by leveraging Claude's built-in GitHub API integration and tool usage capabilities - Maintain same functionality: fetch pending issues, generate Chinese summaries, send Feishu notifications, and clean up labels - Update Claude action reference from version pin to main branch for latest features * Remove GitHub issue comment functionality - Delete automated AI summary comments on issues after processing - Remove documentation for manual issue commenting workflow - Keep Feishu notification system intact while streamlining issue interactions * Add OIDC token permissions and GitHub token to Claude workflow - Add `id-token: write` permission for OIDC authentication in both jobs - Pass `github_token` to Claude action for proper GitHub API access - Maintain existing issue write and contents read permissions * fix: add GitHub issue tracker workflow with Feishu notifications * feat: add GitHub issue tracker workflow with Feishu notifications * fix: add missing environment variable for Claude translator in GitHub issue tracker workflow * fix: update environment variable for Claude translator in GitHub issue tracker workflow * Add quiet hours handling and scheduled processing for GitHub issue notifications - Implement quiet hours detection (00:00-08:30 Beijing Time) with delayed notifications - Add scheduled workflow to process pending issues daily at 08:30 Beijing Time - Create new script to batch process and summarize multiple pending issues with Claude * Replace custom Node.js script with Claude Code Action for issue processing - Migrate from custom JavaScript implementation to Claude Code Action for AI-powered issue summarization and processing - Simplify workflow by leveraging Claude's built-in GitHub API integration and tool usage capabilities - Maintain same functionality: fetch pending issues, generate Chinese summaries, send Feishu notifications, and clean up labels - Update Claude action reference from version pin to main branch for latest features * Remove GitHub issue comment functionality - Delete automated AI summary comments on issues after processing - Remove documentation for manual issue commenting workflow - Keep Feishu notification system intact while streamlining issue interactions * Add OIDC token permissions and GitHub token to Claude workflow - Add `id-token: write` permission for OIDC authentication in both jobs - Pass `github_token` to Claude action for proper GitHub API access - Maintain existing issue write and contents read permissions * Enhance GitHub issue automation workflow with Claude integration - Refactor Claude action to handle issue analysis, Feishu notification, and comment creation in single step - Add tool permissions for Bash commands and custom notification script execution - Update prompt with detailed task instructions including summary generation and automated actions - Remove separate notification step by integrating all operations into Claude action workflow * fix * 删除AI总结评论的添加步骤和注意事项 * fix comments * refactor(AppMenuService): streamline WindowService usage Updated the AppMenuService to directly import and use the windowService for retrieving the main window and showing it, enhancing code clarity and maintainability. * add i18n * fix(AppMenuService): handle macOS application menu setup conditionally Updated the AppMenuService to only instantiate when running on macOS, preventing potential null reference errors. Additionally, added optional chaining in the main index file for safer menu setup. * fix(i18n): Auto update translations for PR #10902 --------- Co-authored-by: SuYao <sy20010504@gmail.com> Co-authored-by: Payne Fu <payne@Paynes-MacBook-Pro.local> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: GitHub Action <action@github.com> |
||
|
|
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> |
||
|
|
d9d8bae2d6 | Merge remote-tracking branch 'origin/main' into feat/agents-new | ||
|
|
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> |
||
|
|
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 | ||
|
|
a32fad06a0 | Merge remote-tracking branch 'origin/main' into feat/agents-new | ||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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. |
||
|
|
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 |
||
|
|
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. |
||
|
|
d0cf3179a2
|
feat(translate): brand new translate feature (#8513)
* refactor(translate): 将翻译设置组件抽离为独立文件 * refactor(translate): 统一变量名translateHistory为translateHistories * perf(translate): 翻译页面的输入处理性能优化 添加防抖函数来优化文本输入和键盘事件的处理,减少不必要的状态更新和翻译请求 * refactor(translate): 将输入区域组件抽离为独立文件 重构翻译页面,将输入区域相关逻辑和UI抽离到单独的InputArea组件中 优化代码结构,提高可维护性 buggy: waiting for merge * revert: 恢复main的translate page * refactor(translate): 缓存源语言状态 * refactor(translate): 提取翻译设置组件 将翻译设置功能提取为独立组件,减少主页面代码复杂度 * build: 添加 react-transition-group 及其类型定义依赖 * refactor(translate): 将翻译历史组件拆分为独立文件并优化布局结构 * refactor(translate): 调整翻译页面布局和样式 统一操作栏的padding样式,将输入和输出区域的容器样式分离以提高可维护性 * feat(翻译): 添加语言交换功能 添加源语言与目标语言交换功能按钮 为AWS Bedrock添加i18n * fix(自动翻译): 在翻译提示中添加去除前缀的说明 在翻译提示中添加说明,要求翻译时去除文本中的"[to be translated]"前缀 * feat(translate): 实现翻译历史列表的虚拟滚动以提高性能 添加虚拟列表组件并应用于翻译历史页面,优化长列表渲染性能 * refactor(translate): 移除未使用的InputArea组件 * feat(translate): 添加模型选择器到翻译页面并移除设置中的模型选择 将模型选择器从翻译设置移动到翻译页面主界面,优化模型选择流程 * style(translate): 为输出占位文本添加不可选中样式 * feat(翻译): 添加自定义语言支持 - 新增 CustomTranslateLanguage 类型定义 - 在数据库中增加 translate_languages 表和相关 CRUD 操作 - 实现自定义语言的添加、删除、更新和查询功能 * feat(翻译设置): 新增自定义语言管理和翻译模型配置功能 添加翻译设置页面,包含自定义语言表格、添加/编辑模态框、翻译模型选择和提示词配置 * feat(翻译设置): 实现自定义语言管理功能 添加自定义语言表格组件及模态框,支持增删改查操作 修复数据库字段命名不一致问题,将langcode改为langCode 新增内置语言代码列表用于校验 添加多语言支持及错误提示 * docs(TranslateService): 为自定义语言功能添加JSDoc注释 * feat(翻译): 添加获取所有翻译语言选项的功能 新增getTranslateOptions函数,用于合并内置翻译语言和自定义语言选项。当获取自定义语言失败时,自动回退到只返回内置语言选项。 * refactor(translate): 重构翻译功能代码,优化语言选项管理和类型定义 - 将翻译语言选项管理集中到useTranslate钩子中 - 修改LanguageCode类型为string以支持自定义语言 - 废弃旧的getLanguageByLangcode方法,提供新的实现 - 统一各组件对翻译语言选项的获取方式 - 优化类型定义,移除冗余类型TranslateLanguageVarious * refactor(translate): 重构翻译相关组件,提取LanguageSelect为独立组件并优化代码结构 * fix(AssistantService): 添加对未知目标语言的错误处理 当目标语言未知时抛出错误并记录日志,防止后续处理异常 * refactor(TranslateSettings): 重命名并重构自定义语言设置组件 将 CustomLanguageTable 重命名为 CustomLanguageSettings 并重构其实现 增加对自定义语言的增删改查功能 调整加载状态的高度以适应新组件 * style(settings): 调整设置页面布局样式以改善显示效果 移除重复的高度和padding设置,统一在内容容器中设置高度 * refactor(translate): 重命名变量 将 builtinTranslateLanguageOptions 重命名为 builtinLanguages 以提高代码可读性 更新相关引用以保持一致性 * refactor(TranslateSettings): 使用useCallback优化删除函数以避免不必要的重渲染 * feat(翻译设置): 为自定义语言设置添加标签本地化 为自定义语言设置中的"Value"和"langCode"字段添加中文标签 * style(TranslateSettings): 为SettingGroup添加flex样式以改善布局 * style(TranslateSettings): 表格样式调整 * docs(技术文档): 添加translate_languages表的技术文档 添加translate_languages表的技术说明文档,包含表结构、字段定义及业务约束说明 * feat(翻译): 添加对不支持语言的错误处理并规范化语言代码 - 在翻译服务中添加对不支持语言的错误提示 - 将自定义语言的langCode统一转为小写 - 完善QwenMT模型的语言映射表 * docs(messageUtils): 标记废弃的函数 * feat(消息工具): 添加通过ID查找翻译块的功能并优化翻译错误处理 添加findTranslationBlocksById函数通过消息ID从状态中查询翻译块 在翻译失败时清理无效的翻译块并显示错误提示 * fix(ApiService): 修复翻译请求错误处理逻辑 捕获翻译请求中的错误并通过onError回调传递,避免静默失败 * fix(translate): 调整双向翻译语言显示的最小宽度 * fix(translate): 修复语言交换条件判断逻辑 添加对双向翻译的限制检查,防止在双向翻译模式下错误交换语言 * feat(i18n): 添加翻译功能的自定义语言支持 * refactor(store): 将 targetLanguage 类型从 string 改为 LanguageCode * refactor(types): 将语言代码类型从字符串改为LanguageCode * refactor: 统一使用@logger导入loggerService 将项目中从@renderer/services/LoggerService导入loggerService的引用改为从@logger导入,以统一日志服务的引用方式 * refactor(translate): 移除旧的VirtualList组件并替换为DynamicVirtualList * refactor(translate): 移除未使用的useCallback导入 * refactor(useTranslate): 调整导入语句顺序以保持一致性 * fix(translate): 修复 useEffect 依赖项缺失问题 * refactor: 调整导入顺序 * refactor(i18n): 移除未使用的翻译字段并更新部分翻译内容 * fix(ApiService): 将completions方法替换为completionsForTrace以修复追踪问题 * refactor(TranslateSettings): 替换Spin组件为自定义加载图标 使用SvgSpinners180Ring替换antd的Spin组件以保持UI一致性 * refactor(TranslateSettings): 替换 HStack 为 Space 组件以优化布局 * style(TranslateSettings): 为删除按钮添加危险样式以提升视觉警示 * style(TranslateSettings): 移除表格容器中多余的justify-content属性 * fix(TranslateSettings): 添加默认emoji旗帜 * refactor(translate): 将语言映射函数移动到translate配置文件 将mapLanguageToQwenMTModel函数及相关映射表从utils模块移动到config/translate模块 * fix(translate): 修复couldTranslate语义错误 * docs(i18n): 更新日语翻译中的错误翻译 * refactor(translate): 将历史记录列表改为抽屉组件并优化样式 * fix(TranslateService): 修复添加自定义语言时缺少await的问题 * fix(TranslateService): 修复变量名错误,使用正确的langCode参数 在添加自定义语言时,错误地使用了value变量而非langCode参数,导致重复检查失效。修正为使用正确的参数名并更新相关错误信息。 * refactor(TranslateSettings): 使用函数式更新优化状态管理 * style(TranslatePromptSettings): 替换按钮为自定义样式组件 使用styled-components创建自定义ResetButton组件替换antd的Button 统一按钮样式与整体设计风格 * style(settings): 调整设置页面内边距从20px减少到10px * refactor(translate): 类型重命名 将Language更名为TranslateLanguage 将LanguageCode更名为TranslateLanguageCode * refactor(LanguageSelect): 提取默认语言渲染逻辑到独立函数 将重复的语言渲染逻辑提取为 defaultLanguageRenderer 函数,减少代码重复并提高可维护性 * refactor(TranslateSettings): 使用antd Form重构自定义语言模态框表单逻辑 重构自定义语言模态框,将原有的手动状态管理改为使用antd Form组件管理表单状态 表单验证逻辑整合到handleSubmit中,提高代码可维护性 修复emoji显示不同步的问题 * feat(翻译设置): 添加自定义语言表单的帮助文本和布局优化 为自定义语言表单的语言代码和语言名称字段添加帮助文本提示 重构表单布局,使用更合理的表单项排列方式 * refactor(TranslateSettings): 调整 CustomLanguageModal 中 EmojiPicker 的布局结构 * style(TranslateSettings): 调整自定义语言模态框按钮容器的内边距 * feat(翻译设置): 添加语言代码为空时的错误提示并优化表单验证 将表单验证逻辑从手动校验改为使用antd Form的rules属性 添加语言代码为空的错误提示信息 移除未使用的导入和日志代码 * feat(翻译设置): 改进自定义语言表单验证和错误处理 - 添加语言已存在的错误提示信息 - 使用国际化文本替换硬编码错误信息 - 重构表单布局,移除不必要的样式组件 - 增加语言代码存在性验证 - 改进表单标签和帮助信息的显示方式 * fix(i18n): 修正语言代码占位符的大小写格式 * style(translate): 移除设置页面中多余的翻译图标 * refactor(translate): 移动 OperationBar 样式并调整 LanguageSelect 宽度 将 OperationBar 样式从独立文件移至 TranslatePage 组件内 为 LanguageSelect 添加最小宽度并移除硬编码宽度 * refactor(设置页): 替换LanguageSelect为Selector组件以统一样式 * feat(翻译): 重构翻译功能并添加历史记录管理 将翻译相关逻辑从useTranslate钩子移动到TranslatePage组件 添加翻译历史记录的保存、删除和清空功能 在输入框底部显示预估token数量 * refactor(translate): 重构翻译页面代码结构并添加注释 将相关hooks和状态分组整理,添加清晰的注释说明各功能块作用 优化代码可读性和维护性 * refactor(TranslateService): 移除store依赖并优化错误处理 - 移除对store的依赖,直接使用getDefaultTranslateAssistant获取翻译助手 - 将翻译失败的错误消息从'failed'改为更明确的'empty' * feat(翻译): 优化翻译服务错误处理和错误信息展示 重构翻译服务逻辑,将错误处理和模型检查移至统一入口。添加翻译结果为空时的错误提示,并改进错误信息展示,包含具体错误原因。同时简化翻译页面调用逻辑,使用统一的翻译服务接口。 * style(translate): 为token计数添加右侧内边距以改善视觉间距 * refactor(translate): 移除useTranslate中未使用的状态并优化组件结构 将translatedContent和translating状态从useTranslate钩子中移除,改为在TranslatePage组件中直接使用redux状态 简化useTranslate的文档注释,仅保留核心功能描述 * refactor(LanguageSelect): 提取剩余props避免重复传递 避免将extraOptionsAfter等已解构的props再次传递给Select组件 * docs(i18n): 更新多语言翻译文件,添加缺失的翻译字段 * refactor(translate): 将历史记录操作移至TranslateService * style(LanguageSelect): 移除多余的 Space.Compact 包装 * fix(TranslateSettings): 修复编辑自定义语言时重复校验语言代码的问题 * refactor(translate): 调整翻译页面布局结构,优化操作栏样式 将输入输出区域整合为统一容器,调整操作栏宽度和间距 移动设置和历史按钮到输出操作栏,简化布局结构 * style(translate): 调整操作栏样式间距 * refactor(窗口): 将窗口最小尺寸常量提取到共享配置中 将硬编码的窗口最小宽度和高度值替换为从共享配置导入的常量,提高代码可维护性 * refactor(translate): 重构翻译页面操作栏布局 将操作栏从三个独立部分改为网格布局,使用InnerOperationBar组件统一样式 移除冗余的operationBarWidth变量,简化样式代码 * refactor(translate): 替换自定义复制按钮为原生按钮组件 移除自定义的CopyButton组件,直接使用Ant Design的原生Button组件来实现复制功能,保持UI一致性并减少冗余代码 * refactor(translate): 重构翻译页面操作栏布局 将操作按钮从左侧移动到右侧,并移除不必要的HStack组件 调整翻译按钮位置并保留其工具提示功能 * fix(translate): 修复语言选择器宽度不一致问题 为源语言和目标语言选择器添加统一的宽度样式,保持UI一致性 * feat(窗口): 添加获取窗口尺寸和监听窗口大小变化的功能 添加 Windows_GetSize IPC 通道用于获取窗口当前尺寸 添加 Windows_Resize IPC 通道用于监听窗口大小变化 新增 useWindowSize hook 方便在渲染进程中使用窗口尺寸 * feat(窗口大小): 优化窗口大小变化处理并添加响应式布局 使用debounce优化窗口大小变化的处理,避免频繁触发更新 为翻译页面添加响应式布局,根据窗口宽度和导航栏位置动态调整模型选择器宽度 * feat(WindowService): 添加窗口最大化/还原时的尺寸变化事件 在窗口最大化或还原时发送尺寸变化事件,以便界面可以响应这些状态变化 * refactor(hooks): 将窗口大小变化的日志级别从debug改为silly * feat(翻译配置): 添加对粤语的语言代码支持 为翻译配置添加对'zh-yue'语言代码的处理,返回对应的'Cantonese'值 * fix(TranslateSettings): 修复自定义语言模态框中语言代码重复校验问题 当编辑已存在的自定义语言时,如果输入的语言代码已存在且与原代码不同,则抛出错误提示 * fix: 修复拼写错误,将"Unkonwn"改为"Unknown" * fix(useTranslate): 添加加载状态检查防止未加载时返回错误数据 当翻译语言尚未加载完成时,返回UNKNOWN而非尝试查找语言 * feat(组件): 添加模型选择按钮组件用于选择模型 * refactor(translate): 重构翻译页面模型选择器和按钮布局 简化模型选择逻辑,移除未使用的代码和复杂样式计算 将ModelSelector替换为ModelSelectButton组件 将TranslateButton提取为独立组件 * refactor(hooks): 重命名并完善窗口尺寸钩子函数 将 useWindow.ts 重命名为 useWindowSize.ts 并添加详细注释 * docs(i18n): 修正语言代码标签的大小写 * style(TranslateSettings): 调整自定义语言模态框中表单标签的宽度 * fix(CustomLanguageModal): disable mask closing for the custom language modal * style: 调整组件间距和图标大小 优化 TranslatePage 内容容器的内边距和间距,并增大 ModelSelectButton 的图标尺寸 * style(translate): 调整翻译历史列表项高度和样式结构 重构翻译历史列表项的样式结构,将高度从120px增加到140px,并拆分样式组件以提高可维护性 * fix(translate): 点击翻译历史item后关闭drawer --------- Co-authored-by: suyao <sy20010504@gmail.com> |
||
|
|
488a01d7d7
|
fix: flush redux persist data when app quit and update (#8741)
* feat(database): enable strict transaction durability for CherryStudio database - Updated the Dexie database initialization to include `chromeTransactionDurability: 'strict'`, enhancing data integrity during transactions. * feat(app): enhance application shutdown process and data flushing - Added functionality to flush storage data and cookies before quitting the application, ensuring data integrity. - Introduced a new `handleBeforeQuit` function to centralize cleanup logic for both manual and update-triggered quits. - Updated logging to provide better insights during the shutdown process. - Modified ProxyManager to use debug level for unchanged proxy configurations. - Added `persistor` to the global window object and implemented `handleSaveData` to flush Redux state before quitting. * format code * feat(ipc): add App_SaveData channel and implement data saving on window close - Introduced a new IPC channel `App_SaveData` for saving application data. - Updated `WindowService` to send a save data message when the main window is closed. - Enhanced `useAppInit` hook to handle the `App_SaveData` event and trigger data saving logic. * refactor(env): remove persistor from global window object - Removed the `persistor` property from the global `window` object in both `env.d.ts` and `index.ts` files, streamlining the application state management. |
||
|
|
c76aa03566 | refactor: remove api server | ||
|
|
d0b2f18d9a
|
feat: Support Cherry Studio as a Service (CSaaS) (#8098) | ||
|
|
18521c93b4
|
fix(LocalBackup): streamline local backup relative directory handling (#8595)
* fix(LocalBackup): streamline local backup directory handling - Added a new state to manage the resolved local backup directory in LocalBackupSettings. - Updated the LocalBackupManager component to use the resolved directory instead of the raw input. - Enhanced the backupToLocal and restoreFromLocal functions to resolve the local backup directory path before use, improving reliability. * refactor(Backup): remove setLocalBackupDir functionality - Removed the setLocalBackupDir method and its associated IPC channel handling from the BackupManager and IpcChannel. - Updated LocalBackupSettings to eliminate direct calls to setLocalBackupDir, instead resolving the local backup directory path directly. - Cleaned up related code in the BackupService to streamline local backup operations. * format code |
||
|
|
c4182a950f
|
fix: add isPathInside functionality to check path relationships (#8590)
* feat(ipc): add isPathInside functionality to check path relationships - Introduced a new IPC channel for checking if a path is inside another path, enhancing path validation capabilities. - Implemented the isPathInside function in the file utility, which accurately determines parent-child path relationships, handling edge cases. - Updated relevant components to utilize the new isPathInside function for validating app data and backup paths, ensuring better user experience and error handling. - Added comprehensive tests for isPathInside to cover various scenarios, including edge cases and error handling. * format code |
||
|
|
26bd9203e1
|
feat: long run mcp (#8499)
* feat(MCPService, MCPSettings, MessageTools): enhance long-running server support and UI integration - Added support for long-running server configurations in MCPService, allowing for timeout adjustments based on server settings. - Introduced a new `longRunning` property in MCPSettings to manage server behavior and UI elements accordingly. - Integrated a ProgressBar component in MessageTools to visually represent progress for long-running operations, improving user experience. * refactor(IpcChannel, MCPService, MessageTools): remove progress IPC channel and integrate progress handling - Removed the `Mcp_SetProgress` channel from `IpcChannel` and its associated handlers in `ipc.ts` and `preload/index.ts`. - Integrated progress handling directly in `McpService` to send progress updates to the main window. - Updated `MessageTools` to display progress using Ant Design's `Progress` component, enhancing the user interface for long-running operations. - Deleted the `ProgressBar` component as its functionality has been replaced by the new progress handling approach. * feat(MCPService): add maxTotalTimeout configuration for long-running operations - Introduced a new `maxTotalTimeout` property in MCPService to define a maximum timeout duration for long-running server operations, enhancing control over server behavior based on the `longRunning` setting. * refactor(MCPService): remove unused notification handler for cancelled operations * Removed the CancelledNotificationHandler from MCPService to streamline notification handling and improve code clarity. * Updated MessageTools component to simplify rendering logic for status indicators, enhancing readability and maintainability. |
||
|
|
03b996d626
|
feat: support Relative Path Input for Backup Directory (#8471)
* chore(env): add .env.example file and update .gitignore - Introduced a new .env.example file with NODE_OPTIONS configuration. - Updated .gitignore to exclude .env.example from being ignored. - Added instructions in dev.md for copying .env.example to .env. * fix(MessageTools): improve error handling and logging in message preview rendering (#8453) - Enhanced the rendering logic for message previews by adding a try-catch block to handle JSON parsing errors more gracefully. - Updated the error handling to provide clearer error messages in the preview when exceptions occur. - Added debug logging to track the rendering process of message content. * refactor(Theme): update theme management to use setTheme function - Replaced toggleTheme with setTheme for more explicit theme handling. - Removed unused SunMoon icon from TabContainer and Sidebar components. - Updated theme icon rendering logic to directly reflect the current theme state. - Adjusted ThemeProvider to include setTheme in context for better theme management. * refactor(ModelList): streamline button layout and improve accessibility - Removed tooltip wrappers from manage and add model buttons for a cleaner UI. - Introduced a new Flex container for primary and default buttons, enhancing layout consistency. - Updated button rendering to improve accessibility and user experience. * feat(ModelList): add bulk add/remove functionality for models with confirmation dialog - Implemented onAddAll and onRemoveAll functions to handle bulk actions for models. - Added confirmation dialog for adding all models to the list, enhancing user experience. - Updated translations for confirmation messages in multiple languages. * chore(languages): update languages with a script (#8445) * chore(languages): update languages with a script * refactor: update languages and merge it into constants * refactor: add usf and ush * refactor(ipc): enhance write permission check and add untildify utility - Updated the hasWritePermission function to resolve paths using the new untildify utility, improving path handling. - Modified IPC handler to await the permission check for better asynchronous handling. - Introduced a new untildify function to convert paths starting with '~' to the user's home directory. * fix(ModelEdit): enhance model type management and introduce new selection logic (#8420) * fix(ModelEdit): enhance model type management and introduce new selection logic - Added support for 'rerank' model type in the ModelEditContent component. - Refactored type selection logic to utilize new utility functions for finding differences and unions in model types. - Updated model type handling to include user selection status, improving user experience in type management. - Adjusted migration logic to initialize newType for existing models, ensuring backward compatibility. - Introduced isUserSelectedModelType utility to streamline model type checks across the application. * refactor(isFunctionCallingModel): simplify model type check logic - Replaced the inline check for 'function_calling' model type with a call to the new utility function isUserSelectedModelType, enhancing code clarity and maintainability. * feat(collection): add utility functions for array operations - Introduced `findIntersection`, `findDifference`, and `findUnion` functions to handle array operations with support for custom key selectors and comparison functions. - Removed previous implementations from `index.ts` to streamline utility exports. - Added comprehensive tests for new functions covering basic types and object types with various edge cases. * refactor(collection): rename utility functions for clarity - Renamed `findIntersection`, `findDifference`, and `findUnion` to `getIntersection`, `getDifference`, and `getUnion` respectively for improved clarity and consistency in naming. - Updated corresponding tests to reflect the new function names, ensuring all tests pass with the updated utility functions. * refactor(ModelEditContent): update model type management and improve selection logic - Replaced utility function calls to `findDifference` and `findUnion` with `getDifference` and `getUnion` for consistency. - Introduced temporary state management for model types to enhance user selection handling. - Added a reset functionality for model type selections, improving user experience. - Updated the rendering logic to conditionally disable certain model types based on user selections. * fix(ModelEditContent): enhance model type selection logic with conditional disabling - Introduced logic to conditionally disable 'rerank' and 'embedding' model types based on user selections. - Updated the state management for model types to ensure correct user selection handling. - Improved the confirmation modal to reflect the updated selection logic for better user experience. * fix(ModelEditContent): refine model type selection and update confirmation logic - Enhanced the logic for model type selection to ensure accurate user selections for 'rerank' and 'embedding'. - Updated the confirmation modal to reflect changes in selection handling, improving user experience. - Adjusted state management to correctly handle updates based on selected model types. * fix(models): update model support logic to include 'qwen3-235b-a22b-instruct' * refactor(models): rename 'newType' to 'capabilities' and update related logic in ModelEditContent and migration scripts * feat(ipc): add App_ResolvePath channel and update path handling - Introduced a new IPC channel `App_ResolvePath` to resolve file paths, enhancing path management. - Updated the `hasWritePermission` function to log the original directory instead of the resolved one. - Modified the `LocalBackupSettings` component to utilize the new `resolvePath` method for improved directory validation. * add ut * fix comments * fix clear manually * delete duplicate var --------- Co-authored-by: kangfenmao <kangfenmao@qq.com> Co-authored-by: SuYao <sy20010504@gmail.com> Co-authored-by: one <wangan.cs@gmail.com> |
||
|
|
4c0167cc03
|
Feat/vertex-claude-support (#7564)
* feat(migrate): add default settings for assistants during migration - Introduced a new migration step to assign default settings for assistants that lack configuration. - Default settings include temperature, context count, and other parameters to ensure consistent behavior across the application. * chore(store): increment version number to 115 for persisted reducer * feat(vertex-sdk): integrate Anthropic Vertex SDK and add access token retrieval - Added support for the new `@anthropic-ai/vertex-sdk` in the project. - Introduced a new IPC channel `VertexAI_GetAccessToken` to retrieve access tokens. - Implemented `getAccessToken` method in `VertexAIService` to handle service account authentication. - Updated the `IpcChannel` enum and related IPC handlers to support the new functionality. - Enhanced the `VertexAPIClient` to utilize the `AnthropicVertexClient` for model handling. - Refactored existing code to accommodate the integration of the Vertex SDK and improve modularity. * feat(vertex-ai): enhance VertexAI settings and API host management - Added a new method to format the API host URL in both AnthropicVertexClient and VertexAPIClient. - Updated getBaseURL methods to utilize the new formatting logic. - Enhanced VertexAISettings component to include an input for API host configuration, with help text for user guidance. - Updated localization files to include new help text for the API host field in multiple languages. * fix(vertex-sdk): update baseURL handling and patch dependencies - Refactored baseURL assignment in AnthropicVertexClient to ensure it defaults to undefined when the URL is empty. - Updated yarn.lock to reflect changes in dependency resolution and checksum for @anthropic-ai/vertex-sdk patch. * refactor(VertexAISetting): use provider.id rather than provider * refactor: improve API host formatting in AnthropicVertexClient - Updated the `formatApiHost` method to streamline host URL handling. - Introduced a helper function to determine if the original host should be used based on its format. - Ensured consistent appending of the `/v1/` path for valid API requests. * fix: handle empty host in AnthropicVertexClient - Added a check in the `getBaseURL` method to return the host if it is empty, preventing potential errors. - Included a console log for the base URL to aid in debugging and verification of the URL formatting. * feat(AnthropicVertexClient): add logging for authentication errors and mock client in tests - Introduced logging functionality in AnthropicVertexClient to replace console.error with logger service for better error tracking. - Added mock implementation for AnthropicVertexClient in tests to enhance testing capabilities. - Updated package.json to include the @aws-sdk/client-s3 dependency. * feat(tests): add comprehensive tests for client compatibility types - Introduced a new test file to validate compatibility types for various API clients including OpenAI, Anthropic, Gemini, Aihubmix, NewAPI, and Vertex. - Implemented mock services to facilitate testing and ensure isolation of client behavior. - Added tests for both direct API clients and decorator pattern clients, ensuring correct compatibility type returns. - Enhanced middleware compatibility logic tests to verify correct identification of compatible clients. --------- Co-authored-by: one <wangan.cs@gmail.com> |
||
|
|
3b123863b5
|
feat: Support LLM Tracing by Alibaba Cloud EDAS product (#7895)
* feat: add tracing modules * Initial commit * fix: problem * fix: update trace web * fix: trace view * fix: trace view * fix: fix some problem * fix: knowledge and mcp trace * feat: save trace to user home dir * feat: open trace with electron browser window * fix: root trace outputs * feat: trace internationalization and add trace icon * feat: add trace title * feat: update * package.json添加windows运行script * feat: update window title * fix: mcp trace param * fix: error show * fix: listTool result * fix: merge error * feat: add stream usage and response * feat: change trace stream * fix: change stream adapter * fix: span detail show problem * fix: process show by time * fix: stream outputs * fix: merge problem * fix: stream outputs * fix: output text * fix: EDAS support text * fix: change trace footer style * fix: topicId is loaded multiple times * fix: span reload problem & attribute with cache * fix: refresh optimization * Change Powered by text. * resolve upstream conflicts * fix: build-time type exception * fix: exceptions not used when building * fix: recend no trace * fix: resend trace list * fix: delete temporary files * feat: trace for resend * fix: trace for resend message with edit * fix: directory structure and construction method of mcp-trace * fix: change CRLF to LF * fix: add function call outputs * Revert "fix: change CRLF to LF" * fix: reorganize multi-model display * fix: append model trace binding topic * fix: some problems * fix: code optimization * fix: delete async * fix: UI optimization * fix: sort import --------- Co-authored-by: 崔顺发 <csf01409784@alibaba-inc.com> Co-authored-by: 管鑫荣 <gxr01409783@alibaba-inc.com> |
||
|
|
40f9601379
|
refactor: Unified Logger / 统一日志管理 (#8207)
* Revert "feat: optimize minapp cache with LRU (#8160)"
This reverts commit
|
||
|
|
72ae105166
|
[1.5.0-rc] Feat/memory (#7689)
* Merge memory into main * Improvement/memory UI (#7655) * feat: add auto-dimension detection to memory settings - Add automatic embedding dimension detection for memory configuration - Add toggle switch to enable/disable auto-detection (enabled by default) - Detect dimensions by making test API call to embedding provider - Show dimension input field only when auto-detection is disabled - Add loading state and error handling during dimension detection - Maintain consistency with knowledge base dimension handling 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * ✨ feat: implement unified embedding dimensions for memory service - Add jaison dependency for robust JSON parsing - Normalize all embeddings to 1536 dimensions for consistency - Improve embedding dimension logging - Update memory processor to use jaison for better error handling - Handle various JSON response formats in fact extraction 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * feat: refactor MemoriesPage layout with new styled components and improved user management features --------- Co-authored-by: Claude <noreply@anthropic.com> * Improvement/memory UI (#7656) Co-authored-by: Claude <noreply@anthropic.com> * ✨ feat: add memory icon to sidebar for existing users - Add migration version 118 to enable memory feature visibility - Adds 'memory' icon to sidebar visible icons if not already present - Updates store version to trigger migration for existing users 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * fix(memory): include last user message ID in processor config * ✨ feat(memory): enhance memory settings UI and add new translations * Enhance memory management UI: Added settings, statistics, search, actions, and user management sections to the memory page. Updated translations for multiple languages to include new UI elements. Refactored component structure for improved layout and readability. * feat: add i18n * ui: Enhance memory modals and UI * refactor(memory): replace direct message calls with window.message for error and success notifications * fix: eslint error * feat(memory): enhance memory restoration logic and queries - Updated MemoryService to restore deleted memories instead of inserting new ones if a memory with the same hash exists. - Added new SQL queries to check for deleted memories and restore them. - Improved logging for memory restoration and embedding generation. - Refactored related API service methods to handle updated memory processing logic. * refactor: update memory configuration to use ApiClient structure - Refactored memory-related services and components to utilize the new ApiClient structure for embedding and reranking models. - Updated constructors and method signatures across multiple files to accept embedApiClient and rerankApiClient parameters. - Enhanced memory settings UI to reflect changes in memory configuration management. - Improved type definitions for KnowledgeBaseParams and MemoryConfig to align with the new structure. * ui: improve user interface for adding new users in memory page - Enhanced the button for adding new users by incorporating an icon and adjusting padding for better alignment. - Updated the user selection options to ensure consistent alignment of avatars and user names. - Refactored layout to improve overall user experience and visual consistency. * refactor(memory): streamline MemoryProcessor usage in ApiService - Removed the singleton instance of MemoryProcessor and instantiated it directly within the ApiService methods. - Updated relevant methods to utilize the new instance for searching and processing memories, improving clarity and encapsulation of memory handling logic. * chore: move knowledge dir * fix: correct import paths in KnowledgeService.ts * fix(Memory): memory deduplicate * fix(Memory): memory llm provider * fix: ci error * fix(Memory): update fact extraction prompt to focus on personal information * feat: Refactor memory fom sidebar to settings page - Removed MemoryStick icon from Sidebar component. - Updated navigation to point to the new memory settings page. - Introduced MemoriesSettingsModal for managing memory configurations. - Created MemorySettings component for comprehensive memory management. - Added user management features including adding, editing, and deleting users. - Implemented pagination and search functionality for memory items. - Updated sidebar settings to remove memory icon and ensure proper migration. - Adjusted Redux store settings to reflect changes in sidebar icons. * feat: redesign memory settings page with improved UI and layout * fix i18n * fix: update citation titles to include memory hash and increment version number * fix: remove unnecessary prop from KnowledgeCitation component * feat: enhance fact extraction prompt with clearer guidelines and examples * 🔧 feat: disable global memory by default and improve UI - Set globalMemoryEnabled default to false for better user experience - Remove manual localStorage handling to rely on redux-persist - Add Beta badge to memory settings section - Improve layout and styling of memory settings UI components 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Simplify external tool completion handling * Fix whitespace in migrate config --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: suyao <sy20010504@gmail.com> Co-authored-by: eeee0717 <chentao020717Work@outlook.com> Co-authored-by: kangfenmao <kangfenmao@qq.com> Co-authored-by: 自由的世界人 <3196812536@qq.com> |
||
|
|
ee4553130b
|
[1.5.0-rc] feat(MCP): Add DXT format support for MCP server installation (#7618)
* feat(MCP): Add DXT format support for MCP server installation
- Add comprehensive DXT package upload and extraction functionality
- Support for DXT manifest validation and MCP server configuration
- Hierarchical UI structure: Quick Add | JSON Import | DXT Import
- Variable substitution for DXT args (${__dirname} replacement)
- Automatic cleanup of DXT server directories on removal
- Enhanced error handling and connectivity checks
- Full internationalization support (EN/CN)
- Uses existing node-stream-zip for efficient extraction
- Proper working directory setup for DXT-based servers
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* 🐛 fix(MCP): Fix DXT server installation and deletion issues
- Replace fs.renameSync with cross-filesystem compatible moveDirectory method to handle temp->mcp directory moves across different mount points
- Add recursive copy fallback when rename fails (ENOENT error fix)
- Sanitize server names with slashes to prevent subdirectory creation during installation
- Improve cleanupDxtServer to handle sanitized names and provide fallback lookup
- Add proper error logging and directory existence warnings
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* feat(MCP): Implement comprehensive DXT MCP configuration support
- Add platform_overrides support to DXT manifest interface
- Implement complete variable substitution system (${__dirname}, ${HOME}, ${DESKTOP}, ${DOCUMENTS}, ${pathSeparator}, ${user_config.KEY})
- Add platform detection utilities (getPlatformIdentifier)
- Create resolved MCP configuration system with applyPlatformOverrides
- Export ResolvedMcpConfig interface and utility functions
- Integrate DXT configuration resolution into MCPService runtime
- Support platform-specific command, args, and environment overrides
- Add comprehensive logging for configuration resolution
Addresses DXT MANIFEST.md mcp_configuration requirements:
- Platform-specific configuration variations
- Cross-platform variable substitution
- Flexible command and environment management
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* feat: add downloads directory variable substitution and simplify platform detection
---------
Co-authored-by: Claude <noreply@anthropic.com>
|
||
|
|
16ca373c55
|
✨ feat: add MCP server version display with badges (#8097) | ||
|
|
bcc1046cdf
|
feat: add upload file (#8035) | ||
|
|
fba6c1642d
|
feat: implement tool call progress handling and status updates (#7303)
* feat: implement tool call progress handling and status updates - Update MCP tool response handling to include 'pending' and 'cancelled' statuses. - Introduce new IPC channel for progress updates. - Enhance UI components to reflect tool call statuses, including pending and cancelled states. - Add localization for new status messages in multiple languages. - Refactor message handling logic to accommodate new tool response types. * fix: adjust alignment of action tool container in MessageTools component - Change justify-content from flex-end to flex-start to improve layout consistency. * feat: enhance tool confirmation handling and update related components - Introduced a new tool confirmation mechanism in userConfirmation.ts, allowing for individual tool confirmations. - Updated GeminiAPIClient and OpenAIResponseAPIClient to include tool configuration options. - Refactored MessageTools component to utilize new confirmation functions and improved styling. - Enhanced mcp-tools.ts to manage tool invocation and confirmation processes more effectively, ensuring real-time status updates. * refactor(McpToolChunkMiddleware): enhance tool execution handling and confirmation tracking - Updated createToolHandlingTransform to manage confirmed tool calls and results more effectively. - Refactored executeToolCalls and executeToolUseResponses to return both tool results and confirmed tool calls. - Adjusted buildParamsWithToolResults to utilize confirmed tool calls for building new request messages. - Improved error handling in messageThunk for tool call status updates, ensuring accurate block ID mapping. * feat(McpToolChunkMiddleware, ToolUseExtractionMiddleware, mcp-tools, userConfirmation): enhance tool execution and confirmation handling - Updated McpToolChunkMiddleware to execute tool calls and responses asynchronously, improving performance and response handling. - Enhanced ToolUseExtractionMiddleware to generate unique tool IDs for better tracking. - Modified parseToolUse function to accept a starting index for tool extraction. - Improved user confirmation handling with abort signal support to manage tool action confirmations more effectively. - Updated SYSTEM_PROMPT to clarify the use of multiple tools per message. * fix(tagExtraction): update test expectations for tag extraction results - Adjusted expected length of results from 7 to 9 to reflect changes in tag extraction logic. - Modified content assertions for specific tag contents to ensure accurate validation of extracted tags. * refactor(GeminiAPIClient, OpenAIResponseAPIClient): remove unused function calling configurations - Removed the unused FunctionCallingConfigMode from GeminiAPIClient to streamline the code. - Eliminated the parallel_tool_calls property from OpenAIResponseAPIClient, simplifying the tool call configuration. * feat(McpToolChunkMiddleware): enhance LLM response handling and tool call confirmation - Added notification to UI for new LLM response processing before recursive calls in createToolHandlingTransform. - Improved tool call confirmation logic in executeToolCalls to match tool IDs more accurately, enhancing response validation. * refactor(McpToolChunkMiddleware, ToolUseExtractionMiddleware, messageThunk): remove unnecessary console logs - Eliminated redundant console log statements in McpToolChunkMiddleware, ToolUseExtractionMiddleware, and messageThunk to clean up the code and improve performance. - Focused on enhancing readability and maintainability by reducing clutter in the logging output. * refactor(McpToolChunkMiddleware): remove redundant logging statements - Eliminated unnecessary logging in createToolHandlingTransform to streamline the code and enhance readability. - Focused on reducing clutter in the logging output while maintaining error handling functionality. * feat: enhance action button functionality with cancel and confirm options * refactor(AbortHandlerMiddleware, McpToolChunkMiddleware, ToolUseExtractionMiddleware, messageThunk): improve error handling and code clarity - Updated AbortHandlerMiddleware to skip abort status checks if an error chunk is received, enhancing error handling logic. - Replaced console.error with Logger.error in McpToolChunkMiddleware for consistent logging practices. - Refined ToolUseExtractionMiddleware to improve tool use extraction logic and ensure proper handling of tool_use tags. - Enhanced messageThunk to include initialPlaceholderBlockId in block ID checks, improving error state management. * refactor(ToolUseExtractionMiddleware): enhance tool use parsing logic with counter - Introduced a toolCounter to track the number of tool use responses processed. - Updated parseToolUse function calls to include the toolCounter, improving the extraction logic and ensuring accurate response handling. * feat(McpService, IpcChannel, MessageTools): implement tool abort functionality - Added Mcp_AbortTool channel to handle tool abortion requests. - Implemented abortTool method in McpService to manage active tool calls and provide logging. - Updated MessageTools component to include an abort button for ongoing tool calls, enhancing user control. - Modified API calls to support optional callId for better tracking of tool executions. - Added localization strings for tool abort messages in multiple languages. --------- Co-authored-by: Vaayne <liu.vaayne@gmail.com> |