🍒 Cherry Studio 是一款支持多个 LLM 提供商的桌面客户端
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
fix(workflows): add pnpm installing and caching (#12374) | 7 个月前 | |
refactor: switch yarn to pnpm (#12260) * refactor: switch workflows from yarn to pnpm Replace Yarn usage with pnpm in CI workflows to standardize package management and leverage pnpm's store/cache behavior. - Use pnpm/action-setup to install pnpm (v) instead of enabling corepack and preparing Yarn. - Retrieve pnpm store path and update cache actions to cache the pnpm store and use pnpm-lock.yaml for cache keys and restores. - Replace yarn commands with pnpm equivalents across workflows: install, i18n:sync/translate, format, build:* and tsx invocation. - Avoid committing lockfile changes by resetting pnpm-lock.yaml instead of yarn.lock when checking for changes. - Update install flags: use pnpm install --frozen-lockfile / --install semantics where appropriate. These changes unify dependency tooling, improve caching correctness, and ensure CI uses pnpm-specific lockfile and cache paths. * build: switch pre-commit hook to pnpm lint-staged Update .husky/pre-commit to run pnpm lint-staged instead of yarn. This aligns the pre-commit hook with the project's package manager and ensures lint-staged runs using pnpm's environment and caching. * chore(ci): remove pinned pnpm version from GH Action steps Remove the explicit with: version: 9 lines from multiple GitHub Actions workflows (auto-i18n.yml, nightly-build.yml, pr-ci.yml, update-app-upgrade-config.yml, sync-to-gitcode.yml, release.yml). The workflows still call pnpm/action-setup@v4 but no longer hardcode a pnpm version. This simplifies maintenance and allows the action to resolve an appropriate pnpm version (or use its default) without needing updates whenever the pinned version becomes outdated. It reduces churn when bumping pnpm across CI configs and prevents accidental pin drift between workflow files. * build: Update pnpm to 10.27.0 and add onlyBuiltDependencies config * Update @cherrystudio/openai to 6.15.0 and consolidate overrides * Add @langchain/core to overrides * Add override for openai-compatible 1.0.27 * build: optimize pnpm config and add missing dependencies - Comment out shamefully-hoist in .npmrc for better pnpm compatibility - Add React-related packages to optimizeDeps in electron.vite.config.ts - Add missing peer dependencies and packages that were previously hoisted 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * build: refine pnpm configuration and dependency management - Simplify .npmrc to only essential electron mirror config - Move platform-specific dependencies to devDependencies - Pin sharp version to 0.34.3 for consistency - Update sharp-libvips versions to 1.2.4 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * reduce app size * format * build: remove unnecessary disableOxcRecommendation option from react plugin configuration * docs: Replace yarn commands with pnpm in documentation and scripts * Revert "build: optimize pnpm config and add missing dependencies" This reverts commit acffad31f8c6122085d2e6cde46731378e001322. * build: import dependencies from yarn.lock * build: Add some phantom dependencies and reorganize dependencies * build: Keep consistent by removing types of semver It's not in the previous package.json * build: Add some phantom dependencies Keep same version with yarn.lock * build: Add form-data dependency version 4.0.4 * Add chalk dependency * build: downgrade some dependencies Reference: .yarn-state-copy.yml. These phantom dependencies should use top-level package of that version in node_modules * build: Add phantom dependencies * build: pin tiptap dependencies to exact versions Ensure consistent dependency resolution by removing caret ranges and pinning all @tiptap packages to exact version 3.2.0 * chore: pin embedjs dependencies to exact versions * build: pin @modelcontextprotocol/sdk to exact version 1.23.0 Remove caret from version specifier to prevent automatic upgrades and ensure consistent dependencies * chore: update @types/node dependency to 22.17.2 Update package.json and pnpm-lock.yaml to use @types/node version 22.17.2 instead of 22.19.3 to maintain consistency across dependencies * build: move some dependencies to dev deps and pin dependency versions to exact numbers Remove caret (^) from version ranges to ensure consistent dependency resolution across environments * chore: move dependencies from prod to dev and update lockfile Move @ant-design/icons, chalk, form-data, and open from dependencies to devDependencies Update pnpm-lock.yaml to reflect dependency changes * build: update package dependencies - Add new dependencies: md5, @libsql/win32-x64-msvc, @strongtz/win32-arm64-msvc, bonjour-service, emoji-picker-element-data, gray-matter, js-yaml - Remove redundant dependencies from devDependencies * build: add cors, katex and pako dependencies add new dependencies to support cross-origin requests, mathematical notation rendering and data compression * move some js deps to dev deps * test: update snapshot tests for Spinner and InputEmbeddingDimension * chore: exclude .zed directory from biome formatting * Update @ai-sdk/openai-compatible patch hash * chore: update @kangfenmao/keyv-storage to version 0.1.3 in package.json and pnpm-lock.yaml --------- Co-authored-by: icarus <eurfelux@gmail.com> Co-authored-by: beyondkmp <beyondkmp@gmail.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: kangfenmao <kangfenmao@qq.com> | 7 个月前 | |
chore: add tailwindCSS class attributes to vscode settings | 11 个月前 | |
fix(installer): auto-install VC++ Redistributable without user prompt (#11927) | 8 个月前 | |
♻️ refactor: implement config-based update system with version compatibility control (#11147) * ♻️ refactor: implement config-based update system with version compatibility control Replace GitHub API-based update discovery with JSON config file system. Support version gating (users below v1.7 must upgrade to v1.7.0 before v2.0). Auto-select GitHub/GitCode config source based on IP location. Simplify fallback logic. Changes: - Add update-config.json with version compatibility rules - Implement _fetchUpdateConfig() and _findCompatibleChannel() - Remove legacy _getReleaseVersionFromGithub() and GitHub API dependency - Refactor _setFeedUrl() with simplified fallback to default feed URLs - Add design documentation in docs/UPDATE_CONFIG_DESIGN.md 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix(i18n): Auto update translations for PR #11147 * format code * 🔧 chore: update config for v1.7.5 → v2.0.0 → v2.1.6 upgrade path Update version configuration to support multi-step upgrade path: - v1.6.x users → v1.7.5 (last v1.x release) - v1.7.x users → v2.0.0 (v2.x intermediate version) - v2.0.0+ users → v2.1.6 (current latest) Changes: - Update 1.7.0 → 1.7.5 with fixed feedUrl - Set 2.0.0 as intermediate version with fixed feedUrl - Add 2.1.6 as current latest pointing to releases/latest This ensures users upgrade through required intermediate versions before jumping to major releases. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * 🔧 chore: refactor update config with constants and adjust versions Refactor update configuration system and adjust to actual versions: - Add UpdateConfigUrl enum in constant.ts for centralized config URLs - Point to test server (birdcat.top) for development testing - Update AppUpdater.ts to use UpdateConfigUrl constants - Adjust update-config.json to actual v1.6.7 with rc/beta channels - Remove v2.1.6 entry (not yet released) - Set package version to 1.6.5 for testing upgrade path - Add update-config.example.json for reference 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * update version * ✅ test: add comprehensive unit tests for AppUpdater config system Add extensive test coverage for new config-based update system including: - Config fetching with IP-based source selection (GitHub/GitCode) - Channel compatibility matching with version constraints - Smart fallback from rc/beta to latest when appropriate - Multi-step upgrade path validation (1.6.3 → 1.6.7 → 2.0.0) - Error handling for network and HTTP failures Test Coverage: - _fetchUpdateConfig: 4 tests (GitHub/GitCode selection, error handling) - _findCompatibleChannel: 9 tests (channel matching, version comparison) - Upgrade Path: 3 tests (version gating scenarios) - Total: 30 tests, 100% passing Also optimize _findCompatibleChannel logic with better variable naming and log messages. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * ✅ test: add complete multi-step upgrade path tests (1.6.3 → 1.7.5 → 2.0.0 → 2.1.6) Add comprehensive test suite for complete upgrade journey including: - Individual step validation (1.6.3→1.7.5, 1.7.5→2.0.0, 2.0.0→2.1.6) - Full multi-step upgrade simulation with version progression - Version gating enforcement (block skipping intermediate versions) - Verification that 1.6.3 cannot directly upgrade to 2.0.0 or 2.1.6 - Verification that 1.7.5 cannot skip 2.0.0 to reach 2.1.6 Test Coverage: - 6 new tests for complete upgrade path scenarios - Total: 36 tests, 100% passing This ensures the version compatibility system correctly enforces intermediate version upgrades for major releases. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * 📝 docs: reorganize update config documentation with English translation Move update configuration design document to docs/technical/ directory and add English translation for international contributors. Changes: - Move docs/UPDATE_CONFIG_DESIGN.md → docs/technical/app-update-config-zh.md - Add docs/technical/app-update-config-en.md (English translation) - Organize technical documentation in dedicated directory Documentation covers: - Config-based update system design and rationale - JSON schema with version compatibility control - Multi-step upgrade path examples (1.6.3 → 1.7.5 → 2.0.0 → 2.1.6) - TypeScript type definitions and matching algorithms - GitHub/GitCode source selection for different regions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * format code * ✅ test: add tests for latest channel self-comparison prevention Add tests to verify the optimization that prevents comparing latest channel with itself when latest is requested, and ensures rc/beta channels are returned when they are newer than latest. New tests: - should not compare latest with itself when requesting latest channel - should return rc when rc version > latest version - should return beta when beta version > latest version These tests ensure the requestedChannel !== UpgradeChannel.LATEST check works correctly and users get the right channel based on version comparisons. Test Coverage: 39 tests, 100% passing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * update github/gitcode * format code * update rc version * ♻️ refactor: merge update configs into single multi-mirror file - Merge app-upgrade-config-github.json and app-upgrade-config-gitcode.json into single app-upgrade-config.json - Add UpdateMirror enum for type-safe mirror selection - Optimize _fetchUpdateConfig to receive mirror parameter, eliminating duplicate IP country checks - Update ChannelConfig interface to use Record<UpdateMirror, string> for feedUrls - Rename documentation files from app-update-config-* to app-upgrade-config-* - Update docs with new multi-mirror configuration structure 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * ✅ test: update AppUpdater tests for multi-mirror configuration - Add UpdateMirror enum import - Update _fetchUpdateConfig tests to accept mirror parameter - Convert all feedUrl to feedUrls structure in test mocks - Update test expectations to match new ChannelConfig interface - All 39 tests passing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * format code * delete files * 📝 docs: add UpdateMirror enum to type definitions - Add UpdateMirror enum definition in both EN and ZH docs - Update ChannelConfig to use Record<UpdateMirror, string> - Add comments showing equivalent structure for clarity 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * 🐛 fix: return actual channel from _findCompatibleChannel Fix channel mismatch issue where requesting rc/beta but getting latest: - Change _findCompatibleChannel return type to include actual channel - Return { config, channel } instead of just config - Update _setFeedUrl to use actualChannel instead of requestedChannel - Update all test expectations to match new return structure - Add channel assertions to key tests This ensures autoUpdater.channel matches the actual feed URL being used. Fixes issue where: - User requests 'rc' channel - latest >= rc, so latest config is returned - But channel was set to 'rc' with latest URL ❌ - Now channel is correctly set to 'latest' ✅ All 39 tests passing ✅ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * update version * udpate version * update config * add no cache header * update files * 🤖 chore: automate app upgrade config updates * format code * update workflow * update get method * docs: document upgrade workflow automation --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: GitHub Action <action@github.com> | 9 个月前 | |
feat(scripts): migrate feishu-notify to TypeScript CLI tool with subcommands (#12371) * build: add commander package as dependency * refactor(scripts): migrate feishu-notify to TypeScript with CLI interface - Convert JavaScript implementation to TypeScript with proper type definitions - Add CLI interface using commander for better usability - Improve error handling and input validation - Add version management and subcommand support * ci(workflows): update feishu notification command and add pnpm install step Update the feishu notification command to use CLI tool with proper arguments instead of direct node script execution Add pnpm install step to ensure dependencies are available before running the workflow * docs: add feishu notification script documentation Add Chinese and English documentation for the feishu-notify.ts CLI tool * feat(notify): add generic send command to feishu-notify Add a new 'send' subcommand to send simple notifications to Feishu with customizable title, description and header color. This provides a more flexible way to send notifications without being tied to specific business logic like the existing 'issue' command. The implementation includes: - New send command handler and options interface - Simple card creation function - Zod schema for header color validation - Documentation updates in both Chinese and English | 7 个月前 | |
feat(mcp): add MCP Hub server for multi-server tool orchestration (#12192) * feat(mcp): add hub server type definitions - Add 'hub' to BuiltinMCPServerNames enum as '@cherry/hub' - Create GeneratedTool, SearchQuery, ExecInput, ExecOutput types - Add ExecutionContext and ConsoleMethods interfaces Amp-Thread-ID: https://ampcode.com/threads/T-019b4e7d-86a3-770d-82f8-9e646e7e597e Co-authored-by: Amp <amp@ampcode.com> * feat(mcp): implement hub server core components - generator.ts: Convert MCP tools to JS functions with JSDoc - tool-registry.ts: In-memory cache with 10-min TTL - search.ts: Comma-separated keyword search with ranking - runtime.ts: Code execution with parallel/settle/console helpers Amp-Thread-ID: https://ampcode.com/threads/T-019b4e7d-86a3-770d-82f8-9e646e7e597e Co-authored-by: Amp <amp@ampcode.com> * feat(mcp): integrate hub server with MCP infrastructure - Create HubServer class with search/exec tools - Implement mcp-bridge for calling tools via MCPService - Register hub server in factory with dependency injection - Initialize hub dependencies in MCPService constructor - Add hub server description label for i18n Amp-Thread-ID: https://ampcode.com/threads/T-019b4e7d-86a3-770d-82f8-9e646e7e597e Co-authored-by: Amp <amp@ampcode.com> * test(mcp): add unit tests for hub server - generator.test.ts: Test schema conversion and JSDoc generation - search.test.ts: Test keyword matching, ranking, and limits - runtime.test.ts: Test code execution, helpers, and error handling Amp-Thread-ID: https://ampcode.com/threads/T-019b4e7d-86a3-770d-82f8-9e646e7e597e Co-authored-by: Amp <amp@ampcode.com> * docs(mcp): add hub server documentation - Document search/exec tool usage and parameters - Explain configuration and caching behavior - Include architecture diagram and file structure Amp-Thread-ID: https://ampcode.com/threads/T-019b4e7d-86a3-770d-82f8-9e646e7e597e Co-authored-by: Amp <amp@ampcode.com> * ♻️ refactor(hub): simplify dependency injection for HubServer - Remove HubServerDependencies interface and setHubServerDependencies from factory - Add initHubBridge() to mcp-bridge for direct initialization - Make HubServer constructor parameterless (uses pre-initialized bridge) - MCPService now calls initHubBridge() directly instead of factory setter - Add integration tests for full search → exec flow * 📝 docs(hub): add comments explaining why hub is not in builtin list - Add JSDoc to HubServer class explaining its purpose and design - Add comment to builtinMCPServers explaining hub exclusion - Hub is a meta-server for LLM code mode, auto-enabled internally * ✨ feat: add available tools section to HUB_MODE_SYSTEM_PROMPT - Add shared utility for generating MCP tool function names (serverName_toolName format) - Update hub server to use consistent function naming across search, exec and prompt - Add fetchAllActiveServerTools to ApiService for renderer process - Update parameterBuilder to include available tools in auto/hub mode prompt - Use CacheService for 1-minute tools caching in hub server - Remove ToolRegistry in favor of direct fetching with caching - Update search ranking to include server name matching - Fix tests to use new naming format Amp-Thread-ID: https://ampcode.com/threads/T-019b6971-d5c9-7719-9245-a89390078647 Co-authored-by: Amp <amp@ampcode.com> * ♻️ refactor: consolidate MCP tool name utilities into shared module - Merge buildFunctionCallToolName from src/main/utils/mcp.ts into packages/shared/mcp.ts - Create unified buildMcpToolName base function with options for prefix, delimiter, maxLength, existingNames - Fix toCamelCase to normalize uppercase snake case (MY_SERVER → myServer) - Fix maxLength + existingNames interaction to respect length limit when adding collision suffix - Add comprehensive JSDoc documentation - Update tests and hub.test.ts for new lowercase normalization behavior * ✨ feat: isolate hub exec worker and filter disabled tools * 🐛 fix: inline hub worker source * 🐛 fix: sync hub tool cache and map * Update import path for buildFunctionCallToolName in BaseService * ✨ feat: refine hub mode system prompt * 🐛 fix: propagate hub tool errors * 📝 docs: clarify hub exec return * ✨ feat(hub): improve prompts and tool descriptions for better LLM success rate - Rewrite HUB_MODE_SYSTEM_PROMPT_BASE with Critical Rules section - Add Common Mistakes to Avoid section with examples - Update exec tool description with IMPORTANT return requirement - Improve search tool description clarity - Simplify generator output with return reminder in header - Add per-field @param JSDoc with required/optional markers Fixes issue where LLMs forgot to return values from exec code * ♻️ refactor(hub): return empty string when no tools available * ✨ feat(hub): add dedicated AUTO_MODE_SYSTEM_PROMPT for auto mode - Create self-contained prompt teaching XML tool_use format - Only shows search/exec tools (no generic examples) - Add complete workflow example with common mistakes - Update parameterBuilder to use getAutoModeSystemPrompt() - User prompt comes first, then auto mode instructions - Skip hub prompt when no tools available * ♻️ refactor: move hub prompts to dedicated prompts-code-mode.ts - Create src/renderer/src/config/prompts-code-mode.ts - Move HUB_MODE_SYSTEM_PROMPT_BASE and AUTO_MODE_SYSTEM_PROMPT_BASE - Move getHubModeSystemPrompt() and getAutoModeSystemPrompt() - Extract shared buildToolsSection() helper - Update parameterBuilder.ts import * ♻️ refactor: add mcpMode support to promptToolUsePlugin - Add mcpMode parameter to PromptToolUseConfig and defaultBuildSystemPrompt - Pass mcpMode through middleware config to plugin builder - Consolidate getAutoModeSystemPrompt into getHubModeSystemPrompt - Update parameterBuilder to use getHubModeSystemPrompt * ♻️ refactor: move getHubModeSystemPrompt to shared package - Create @cherrystudio/shared workspace package with exports - Move getHubModeSystemPrompt and ToolInfo to packages/shared/prompts - Add @cherrystudio/shared dependency to @cherrystudio/ai-core - Update promptToolUsePlugin to import from shared package - Update renderer prompts-code-mode.ts to re-export from shared - Add toolSetToToolInfoArray converter for type compatibility * Revert "♻️ refactor: move getHubModeSystemPrompt to shared package" This reverts commit 894b2fd487363ae516a0f0d2bbd4d857a0e612ef. * Remove duplicate Tool Use Examples header from system prompt * fix: add handleModeChange call in MCPToolsButton for manual mode activation * style: update AssistantMCPSettings to use min-height instead of overflow for better layout control * feat(i18n): add MCP server modes and truncate messages in multiple languages - Introduced new "mode" options for MCP servers: auto, disabled, and manual with corresponding descriptions and labels. - Added translations for "base64DataTruncated" and "truncated" messages across various language files. - Enhanced user experience by providing clearer feedback on data truncation. * Normalize tool names for search and exec in parser * Clarify tool usage rules in code mode prompts and examples * Clarify code execution instructions and update example usage * refactor: simplify JSDoc description handling by removing unnecessary truncation * refactor: optimize listAllActiveServerTools method to use Promise.allSettled for improved error handling and performance --------- Co-authored-by: Amp <amp@ampcode.com> Co-authored-by: kangfenmao <kangfenmao@qq.com> | 7 个月前 | |
⬆️ chore(deps): upgrade @anthropic-ai/claude-agent-sdk to 0.1.76 (#12317) - Upgrade from 0.1.62 to 0.1.76 (latest stable) - Remove version-specific patch (no longer needed) | 7 个月前 | |
feat:upgrade ovms to 2025.4, add preset-model Qwen3-4B-int4-ov (#12045) | 8 个月前 | |
refactor: use pnpm install instead of manual download for prebuild packages (#12358) * refactor: use pnpm install instead of manual download for prebuild packages Replace manual tgz download with pnpm install for architecture-specific prebuild binaries, simplifying the build process. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * delete utils * update after pack * udpate before pack * use optional deps * refactor: use js-yaml to modify pnpm-workspace.yaml for cross-platform builds - Add all prebuild packages to optionalDependencies in package.json - Use js-yaml to parse and modify pnpm-workspace.yaml - Add target platform to supportedArchitectures.os and cpu - Restore original config after pnpm install Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * fix version * refactor: streamline package management and filtering logic in before… (#12370) refactor: streamline package management and filtering logic in before-pack.js - Consolidated architecture-specific package definitions into a single array for better maintainability. - Simplified the logic for determining target platform and architecture. - Enhanced the filtering process for excluding and including packages based on architecture and platform. - Improved console logging for clarity during package installation. This refactor aims to improve the readability and efficiency of the prebuild package handling process. * refactor: update package filtering logic in before-pack.js to read from electron-builder.yml - Modified the package filtering process to load configuration directly from electron-builder.yml, reducing potential errors from multiple overrides. - Enhanced maintainability by centralizing the file configuration management. This change aims to streamline the prebuild package handling and improve configuration clarity. --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: 亢奋猫 <kangfenmao@qq.com> | 7 个月前 | |
fix: add dispose method to prevent abort listener leak (#12269) * fix: add dispose method to prevent abort listener leak Add dispose() method to StreamAbortController that explicitly removes the abort event listener when stream ends normally. Previously, the listener would only be removed when abort was triggered ({ once: true }), but if the stream completed normally without abort, the listener would remain attached until garbage collection. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * chore: format code 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com> | 7 个月前 | |
feat(mcp): add MCP Hub server for multi-server tool orchestration (#12192) * feat(mcp): add hub server type definitions - Add 'hub' to BuiltinMCPServerNames enum as '@cherry/hub' - Create GeneratedTool, SearchQuery, ExecInput, ExecOutput types - Add ExecutionContext and ConsoleMethods interfaces Amp-Thread-ID: https://ampcode.com/threads/T-019b4e7d-86a3-770d-82f8-9e646e7e597e Co-authored-by: Amp <amp@ampcode.com> * feat(mcp): implement hub server core components - generator.ts: Convert MCP tools to JS functions with JSDoc - tool-registry.ts: In-memory cache with 10-min TTL - search.ts: Comma-separated keyword search with ranking - runtime.ts: Code execution with parallel/settle/console helpers Amp-Thread-ID: https://ampcode.com/threads/T-019b4e7d-86a3-770d-82f8-9e646e7e597e Co-authored-by: Amp <amp@ampcode.com> * feat(mcp): integrate hub server with MCP infrastructure - Create HubServer class with search/exec tools - Implement mcp-bridge for calling tools via MCPService - Register hub server in factory with dependency injection - Initialize hub dependencies in MCPService constructor - Add hub server description label for i18n Amp-Thread-ID: https://ampcode.com/threads/T-019b4e7d-86a3-770d-82f8-9e646e7e597e Co-authored-by: Amp <amp@ampcode.com> * test(mcp): add unit tests for hub server - generator.test.ts: Test schema conversion and JSDoc generation - search.test.ts: Test keyword matching, ranking, and limits - runtime.test.ts: Test code execution, helpers, and error handling Amp-Thread-ID: https://ampcode.com/threads/T-019b4e7d-86a3-770d-82f8-9e646e7e597e Co-authored-by: Amp <amp@ampcode.com> * docs(mcp): add hub server documentation - Document search/exec tool usage and parameters - Explain configuration and caching behavior - Include architecture diagram and file structure Amp-Thread-ID: https://ampcode.com/threads/T-019b4e7d-86a3-770d-82f8-9e646e7e597e Co-authored-by: Amp <amp@ampcode.com> * ♻️ refactor(hub): simplify dependency injection for HubServer - Remove HubServerDependencies interface and setHubServerDependencies from factory - Add initHubBridge() to mcp-bridge for direct initialization - Make HubServer constructor parameterless (uses pre-initialized bridge) - MCPService now calls initHubBridge() directly instead of factory setter - Add integration tests for full search → exec flow * 📝 docs(hub): add comments explaining why hub is not in builtin list - Add JSDoc to HubServer class explaining its purpose and design - Add comment to builtinMCPServers explaining hub exclusion - Hub is a meta-server for LLM code mode, auto-enabled internally * ✨ feat: add available tools section to HUB_MODE_SYSTEM_PROMPT - Add shared utility for generating MCP tool function names (serverName_toolName format) - Update hub server to use consistent function naming across search, exec and prompt - Add fetchAllActiveServerTools to ApiService for renderer process - Update parameterBuilder to include available tools in auto/hub mode prompt - Use CacheService for 1-minute tools caching in hub server - Remove ToolRegistry in favor of direct fetching with caching - Update search ranking to include server name matching - Fix tests to use new naming format Amp-Thread-ID: https://ampcode.com/threads/T-019b6971-d5c9-7719-9245-a89390078647 Co-authored-by: Amp <amp@ampcode.com> * ♻️ refactor: consolidate MCP tool name utilities into shared module - Merge buildFunctionCallToolName from src/main/utils/mcp.ts into packages/shared/mcp.ts - Create unified buildMcpToolName base function with options for prefix, delimiter, maxLength, existingNames - Fix toCamelCase to normalize uppercase snake case (MY_SERVER → myServer) - Fix maxLength + existingNames interaction to respect length limit when adding collision suffix - Add comprehensive JSDoc documentation - Update tests and hub.test.ts for new lowercase normalization behavior * ✨ feat: isolate hub exec worker and filter disabled tools * 🐛 fix: inline hub worker source * 🐛 fix: sync hub tool cache and map * Update import path for buildFunctionCallToolName in BaseService * ✨ feat: refine hub mode system prompt * 🐛 fix: propagate hub tool errors * 📝 docs: clarify hub exec return * ✨ feat(hub): improve prompts and tool descriptions for better LLM success rate - Rewrite HUB_MODE_SYSTEM_PROMPT_BASE with Critical Rules section - Add Common Mistakes to Avoid section with examples - Update exec tool description with IMPORTANT return requirement - Improve search tool description clarity - Simplify generator output with return reminder in header - Add per-field @param JSDoc with required/optional markers Fixes issue where LLMs forgot to return values from exec code * ♻️ refactor(hub): return empty string when no tools available * ✨ feat(hub): add dedicated AUTO_MODE_SYSTEM_PROMPT for auto mode - Create self-contained prompt teaching XML tool_use format - Only shows search/exec tools (no generic examples) - Add complete workflow example with common mistakes - Update parameterBuilder to use getAutoModeSystemPrompt() - User prompt comes first, then auto mode instructions - Skip hub prompt when no tools available * ♻️ refactor: move hub prompts to dedicated prompts-code-mode.ts - Create src/renderer/src/config/prompts-code-mode.ts - Move HUB_MODE_SYSTEM_PROMPT_BASE and AUTO_MODE_SYSTEM_PROMPT_BASE - Move getHubModeSystemPrompt() and getAutoModeSystemPrompt() - Extract shared buildToolsSection() helper - Update parameterBuilder.ts import * ♻️ refactor: add mcpMode support to promptToolUsePlugin - Add mcpMode parameter to PromptToolUseConfig and defaultBuildSystemPrompt - Pass mcpMode through middleware config to plugin builder - Consolidate getAutoModeSystemPrompt into getHubModeSystemPrompt - Update parameterBuilder to use getHubModeSystemPrompt * ♻️ refactor: move getHubModeSystemPrompt to shared package - Create @cherrystudio/shared workspace package with exports - Move getHubModeSystemPrompt and ToolInfo to packages/shared/prompts - Add @cherrystudio/shared dependency to @cherrystudio/ai-core - Update promptToolUsePlugin to import from shared package - Update renderer prompts-code-mode.ts to re-export from shared - Add toolSetToToolInfoArray converter for type compatibility * Revert "♻️ refactor: move getHubModeSystemPrompt to shared package" This reverts commit 894b2fd487363ae516a0f0d2bbd4d857a0e612ef. * Remove duplicate Tool Use Examples header from system prompt * fix: add handleModeChange call in MCPToolsButton for manual mode activation * style: update AssistantMCPSettings to use min-height instead of overflow for better layout control * feat(i18n): add MCP server modes and truncate messages in multiple languages - Introduced new "mode" options for MCP servers: auto, disabled, and manual with corresponding descriptions and labels. - Added translations for "base64DataTruncated" and "truncated" messages across various language files. - Enhanced user experience by providing clearer feedback on data truncation. * Normalize tool names for search and exec in parser * Clarify tool usage rules in code mode prompts and examples * Clarify code execution instructions and update example usage * refactor: simplify JSDoc description handling by removing unnecessary truncation * refactor: optimize listAllActiveServerTools method to use Promise.allSettled for improved error handling and performance --------- Co-authored-by: Amp <amp@ampcode.com> Co-authored-by: kangfenmao <kangfenmao@qq.com> | 7 个月前 | |
style: set eol to lf, code formatting (#7923) * chore(gitattributes): set eol to lf * chore: git renormalize * style: reformatting * chore: keep eslint prettier plugin consistent on eol | 1 年前 | |
fix: support gpt-5 (#8945) * Update models.ts * Update models.ts * Update models.ts * feat: add OpenAI verbosity setting for GPT-5 model Introduces a new 'verbosity' option for the OpenAI GPT-5 model, allowing users to control the level of detail in model output. Updates settings state, migration logic, UI components, and i18n translations to support this feature. * fix(models): 修正gpt-5模型判断逻辑以支持包含gpt-5的模型ID * fix(i18n): 修正繁体中文和希腊语的翻译错误 * fix(models): 优化OpenAI推理模型判断逻辑 * fix(OpenAIResponseAPIClient): 不再为response api添加stream_options * fix: update OpenAI model check and add verbosity setting Changed GPT-5 model detection to use includes instead of strict equality. Added default 'verbosity' property to OpenAI settings in migration logic. * feat(models): 添加 GPT-5 系列模型的图标和配置 添加 GPT-5、GPT-5-chat、GPT-5-mini 和 GPT-5-nano 的图标文件,并在 models.ts 中配置对应的模型 logo * Merge branch 'main' into fix-gpt5 * Add verbosity setting to OpenAI API client Introduces a getVerbosity method in BaseApiClient to retrieve verbosity from settings, and passes this value in the OpenAIResponseAPIClient request payload. This enables configurable response verbosity for OpenAI API interactions. * Upgrade OpenAI package to 5.12.2 and update patch Replaced the OpenAI dependency from version 5.12.0 to 5.12.2 and updated related patch files and references in package.json and yarn.lock. Also updated a log message in BaseApiClient.ts for clarity. * fix: add type and property checks for tool call handling Improves robustness by adding explicit checks for 'function' property and 'type' when parsing tool calls and estimating tokens. Also adds error handling for unknown tool call types in mcp-tools and updates related test logic. * feat(模型配置): 添加gpt5模型支持及相关配置 - 在模型类型中新增gpt5支持 - 添加gpt5系列模型检测函数 - 更新推理选项配置和国际化文本 - 调整effort ratio数值 * fix(ThinkingButton): 为gpt-5及后续模型添加minimal到low的选项回退映射 * feat(i18n): 更新思维链长度的中文翻译并调整对应图标 为思维链长度的"minimal"选项添加中文翻译"微念",同时调整各选项对应的灯泡图标亮度 * feat(i18n): 为推理努力设置添加"minimal"选项并调整英文文案 * fix: openai patch * wip: OpenAISettingsGroup display * fix: 修复OpenAISettingsGroup组件中GPT5条件下的渲染逻辑 * refactor(OpenAISettingsGroup): 优化设置项的分组和分隔符逻辑 * feat(模型配置): 添加gpt-5到visionAllowedModels列表 * feat(模型配置): 添加gpt-5到函数调用支持列表 将gpt-5及其变体添加到FUNCTION_CALLING_MODELS支持列表,同时将gpt-5-chat添加到排除列表 * fix: 在OpenAI推理模型检查中添加gpt-5-chat支持 * Update OpenAISettingsGroup.tsx * feat(模型支持): 添加对verbosity模型的支持判断 新增isSupportVerbosityModel函数用于判断是否支持verbosity模型 替换原有isGPT5SeriesModel判断逻辑,统一使用新函数 * fix: 修复支持详细程度模型的判断逻辑 使用 getLowerBaseModelName 处理模型 ID 以确保大小写不敏感的比较 * feat: 添加对gpt-5模型的网络搜索支持但不包括chat变体 * fix(models): 修复gpt5模型支持选项缺少'off'的问题 * fix: 添加gpt-5到支持Flex Service Tier的模型列表 * refactor(aiCore): 优化OpenAI verbosity类型定义和使用 移除OpenAIResponseAPIClient中冗余的OpenAIVerbosity导入 在BaseApiClient中明确getVerbosity返回类型为OpenAIVerbosity 简化OpenAIResponseAPIClient中verbosity的类型断言 * fix(openai): 仅在支持verbosity的模型中添加verbosity参数 * fix(i18n): 修正OpenAI设置中不一致的翻译 * fix: modify low effort ratio * fix(openai): 修复GPT5系列模型在启用网页搜索时不能使用minimal reasoning_effort的问题 * fix(openai): 修复GPT5系列模型在启用web搜索时不能使用minimal推理的问题 --------- Co-authored-by: icarus <eurfelux@gmail.com> Co-authored-by: Phantom <59059173+EurFelux@users.noreply.github.com> | 1 年前 | |
chore: git blame ignore (#7925) | 1 年前 | |
style: set eol to lf, code formatting (#7923) * chore(gitattributes): set eol to lf * chore: git renormalize * style: reformatting * chore: keep eslint prettier plugin consistent on eol | 1 年前 | |
Merge remote-tracking branch 'origin/main' into feat/agents-new | 11 个月前 | |
refactor: switch yarn to pnpm (#12260) * refactor: switch workflows from yarn to pnpm Replace Yarn usage with pnpm in CI workflows to standardize package management and leverage pnpm's store/cache behavior. - Use pnpm/action-setup to install pnpm (v) instead of enabling corepack and preparing Yarn. - Retrieve pnpm store path and update cache actions to cache the pnpm store and use pnpm-lock.yaml for cache keys and restores. - Replace yarn commands with pnpm equivalents across workflows: install, i18n:sync/translate, format, build:* and tsx invocation. - Avoid committing lockfile changes by resetting pnpm-lock.yaml instead of yarn.lock when checking for changes. - Update install flags: use pnpm install --frozen-lockfile / --install semantics where appropriate. These changes unify dependency tooling, improve caching correctness, and ensure CI uses pnpm-specific lockfile and cache paths. * build: switch pre-commit hook to pnpm lint-staged Update .husky/pre-commit to run pnpm lint-staged instead of yarn. This aligns the pre-commit hook with the project's package manager and ensures lint-staged runs using pnpm's environment and caching. * chore(ci): remove pinned pnpm version from GH Action steps Remove the explicit with: version: 9 lines from multiple GitHub Actions workflows (auto-i18n.yml, nightly-build.yml, pr-ci.yml, update-app-upgrade-config.yml, sync-to-gitcode.yml, release.yml). The workflows still call pnpm/action-setup@v4 but no longer hardcode a pnpm version. This simplifies maintenance and allows the action to resolve an appropriate pnpm version (or use its default) without needing updates whenever the pinned version becomes outdated. It reduces churn when bumping pnpm across CI configs and prevents accidental pin drift between workflow files. * build: Update pnpm to 10.27.0 and add onlyBuiltDependencies config * Update @cherrystudio/openai to 6.15.0 and consolidate overrides * Add @langchain/core to overrides * Add override for openai-compatible 1.0.27 * build: optimize pnpm config and add missing dependencies - Comment out shamefully-hoist in .npmrc for better pnpm compatibility - Add React-related packages to optimizeDeps in electron.vite.config.ts - Add missing peer dependencies and packages that were previously hoisted 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * build: refine pnpm configuration and dependency management - Simplify .npmrc to only essential electron mirror config - Move platform-specific dependencies to devDependencies - Pin sharp version to 0.34.3 for consistency - Update sharp-libvips versions to 1.2.4 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * reduce app size * format * build: remove unnecessary disableOxcRecommendation option from react plugin configuration * docs: Replace yarn commands with pnpm in documentation and scripts * Revert "build: optimize pnpm config and add missing dependencies" This reverts commit acffad31f8c6122085d2e6cde46731378e001322. * build: import dependencies from yarn.lock * build: Add some phantom dependencies and reorganize dependencies * build: Keep consistent by removing types of semver It's not in the previous package.json * build: Add some phantom dependencies Keep same version with yarn.lock * build: Add form-data dependency version 4.0.4 * Add chalk dependency * build: downgrade some dependencies Reference: .yarn-state-copy.yml. These phantom dependencies should use top-level package of that version in node_modules * build: Add phantom dependencies * build: pin tiptap dependencies to exact versions Ensure consistent dependency resolution by removing caret ranges and pinning all @tiptap packages to exact version 3.2.0 * chore: pin embedjs dependencies to exact versions * build: pin @modelcontextprotocol/sdk to exact version 1.23.0 Remove caret from version specifier to prevent automatic upgrades and ensure consistent dependencies * chore: update @types/node dependency to 22.17.2 Update package.json and pnpm-lock.yaml to use @types/node version 22.17.2 instead of 22.19.3 to maintain consistency across dependencies * build: move some dependencies to dev deps and pin dependency versions to exact numbers Remove caret (^) from version ranges to ensure consistent dependency resolution across environments * chore: move dependencies from prod to dev and update lockfile Move @ant-design/icons, chalk, form-data, and open from dependencies to devDependencies Update pnpm-lock.yaml to reflect dependency changes * build: update package dependencies - Add new dependencies: md5, @libsql/win32-x64-msvc, @strongtz/win32-arm64-msvc, bonjour-service, emoji-picker-element-data, gray-matter, js-yaml - Remove redundant dependencies from devDependencies * build: add cors, katex and pako dependencies add new dependencies to support cross-origin requests, mathematical notation rendering and data compression * move some js deps to dev deps * test: update snapshot tests for Spinner and InputEmbeddingDimension * chore: exclude .zed directory from biome formatting * Update @ai-sdk/openai-compatible patch hash * chore: update @kangfenmao/keyv-storage to version 0.1.3 in package.json and pnpm-lock.yaml --------- Co-authored-by: icarus <eurfelux@gmail.com> Co-authored-by: beyondkmp <beyondkmp@gmail.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: kangfenmao <kangfenmao@qq.com> | 7 个月前 | |
feat(test): e2e framework (#11494) * feat(test): e2e framework Add Playwright-based e2e testing framework for Electron app with: - Custom fixtures for electronApp and mainWindow - Page Object Model (POM) pattern implementation - 15 example test cases covering app launch, navigation, settings, and chat - Comprehensive README for humans and AI assistants 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * refactor(tests): update imports and improve code readability - Changed imports from 'import { Page, Locator }' to 'import type { Locator, Page }' for better type clarity across multiple page files. - Reformatted waitFor calls in ChatPage and HomePage for improved readability. - Updated index.ts to correct the export order of ChatPage and SidebarPage. - Minor adjustments in electron.fixture.ts and electron-app.ts for consistency in import statements. These changes enhance the maintainability and clarity of the test codebase. * chore: update linting configuration to include tests directory - Added 'tests/**' to the ignore patterns in .oxlintrc.json and eslint.config.mjs to ensure test files are not linted. - Minor adjustment in electron.fixture.ts to improve the fixture definition. These changes streamline the linting process and enhance code organization. * fix(test): select main window by title to fix flaky e2e tests on Mac On Mac, the app may create miniWindow for QuickAssistant alongside mainWindow. Using firstWindow() could randomly select the wrong window, causing test failures. Now we wait for the window with title "Cherry Studio" to ensure we get the main window. Also removed unused electron-app.ts utility file. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com> | 8 个月前 | |
✨ feat(sessions): add session message creation endpoint and update session details | 11 个月前 | |
refactor: switch yarn to pnpm (#12260) * refactor: switch workflows from yarn to pnpm Replace Yarn usage with pnpm in CI workflows to standardize package management and leverage pnpm's store/cache behavior. - Use pnpm/action-setup to install pnpm (v) instead of enabling corepack and preparing Yarn. - Retrieve pnpm store path and update cache actions to cache the pnpm store and use pnpm-lock.yaml for cache keys and restores. - Replace yarn commands with pnpm equivalents across workflows: install, i18n:sync/translate, format, build:* and tsx invocation. - Avoid committing lockfile changes by resetting pnpm-lock.yaml instead of yarn.lock when checking for changes. - Update install flags: use pnpm install --frozen-lockfile / --install semantics where appropriate. These changes unify dependency tooling, improve caching correctness, and ensure CI uses pnpm-specific lockfile and cache paths. * build: switch pre-commit hook to pnpm lint-staged Update .husky/pre-commit to run pnpm lint-staged instead of yarn. This aligns the pre-commit hook with the project's package manager and ensures lint-staged runs using pnpm's environment and caching. * chore(ci): remove pinned pnpm version from GH Action steps Remove the explicit with: version: 9 lines from multiple GitHub Actions workflows (auto-i18n.yml, nightly-build.yml, pr-ci.yml, update-app-upgrade-config.yml, sync-to-gitcode.yml, release.yml). The workflows still call pnpm/action-setup@v4 but no longer hardcode a pnpm version. This simplifies maintenance and allows the action to resolve an appropriate pnpm version (or use its default) without needing updates whenever the pinned version becomes outdated. It reduces churn when bumping pnpm across CI configs and prevents accidental pin drift between workflow files. * build: Update pnpm to 10.27.0 and add onlyBuiltDependencies config * Update @cherrystudio/openai to 6.15.0 and consolidate overrides * Add @langchain/core to overrides * Add override for openai-compatible 1.0.27 * build: optimize pnpm config and add missing dependencies - Comment out shamefully-hoist in .npmrc for better pnpm compatibility - Add React-related packages to optimizeDeps in electron.vite.config.ts - Add missing peer dependencies and packages that were previously hoisted 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * build: refine pnpm configuration and dependency management - Simplify .npmrc to only essential electron mirror config - Move platform-specific dependencies to devDependencies - Pin sharp version to 0.34.3 for consistency - Update sharp-libvips versions to 1.2.4 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * reduce app size * format * build: remove unnecessary disableOxcRecommendation option from react plugin configuration * docs: Replace yarn commands with pnpm in documentation and scripts * Revert "build: optimize pnpm config and add missing dependencies" This reverts commit acffad31f8c6122085d2e6cde46731378e001322. * build: import dependencies from yarn.lock * build: Add some phantom dependencies and reorganize dependencies * build: Keep consistent by removing types of semver It's not in the previous package.json * build: Add some phantom dependencies Keep same version with yarn.lock * build: Add form-data dependency version 4.0.4 * Add chalk dependency * build: downgrade some dependencies Reference: .yarn-state-copy.yml. These phantom dependencies should use top-level package of that version in node_modules * build: Add phantom dependencies * build: pin tiptap dependencies to exact versions Ensure consistent dependency resolution by removing caret ranges and pinning all @tiptap packages to exact version 3.2.0 * chore: pin embedjs dependencies to exact versions * build: pin @modelcontextprotocol/sdk to exact version 1.23.0 Remove caret from version specifier to prevent automatic upgrades and ensure consistent dependencies * chore: update @types/node dependency to 22.17.2 Update package.json and pnpm-lock.yaml to use @types/node version 22.17.2 instead of 22.19.3 to maintain consistency across dependencies * build: move some dependencies to dev deps and pin dependency versions to exact numbers Remove caret (^) from version ranges to ensure consistent dependency resolution across environments * chore: move dependencies from prod to dev and update lockfile Move @ant-design/icons, chalk, form-data, and open from dependencies to devDependencies Update pnpm-lock.yaml to reflect dependency changes * build: update package dependencies - Add new dependencies: md5, @libsql/win32-x64-msvc, @strongtz/win32-arm64-msvc, bonjour-service, emoji-picker-element-data, gray-matter, js-yaml - Remove redundant dependencies from devDependencies * build: add cors, katex and pako dependencies add new dependencies to support cross-origin requests, mathematical notation rendering and data compression * move some js deps to dev deps * test: update snapshot tests for Spinner and InputEmbeddingDimension * chore: exclude .zed directory from biome formatting * Update @ai-sdk/openai-compatible patch hash * chore: update @kangfenmao/keyv-storage to version 0.1.3 in package.json and pnpm-lock.yaml --------- Co-authored-by: icarus <eurfelux@gmail.com> Co-authored-by: beyondkmp <beyondkmp@gmail.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: kangfenmao <kangfenmao@qq.com> | 7 个月前 | |
docs: update documentation for a more inclusive environment and added japanese and chinese documentation | 1 年前 | |
docs: update docs directory structure - Updated links in CONTRIBUTING.md and README.md to point to the correct Chinese documentation paths. - Removed outdated files including the English and Chinese versions of the branching strategy, contributing guide, and test plan documents. - Cleaned up references to non-existent documentation in the project structure to streamline the contributor experience. | 8 个月前 | |
chore: update LICENSE file to include full text of GNU AGPL-3.0 - Replaced previous licensing information with the complete text of the GNU Affero General Public License v3.0 (AGPL-3.0). - Clarified terms regarding commercial use and compliance with AGPL-3.0. - Added detailed definitions and conditions for users and organizations regarding licensing options. This update ensures that users have clear access to the licensing terms governing the Cherry Studio Community Edition. | 10 个月前 | |
fix: update links in README and AboutSettings for correct documentation paths | 7 个月前 | |
refactor: model list and health check (#7997) * refactor(ProviderSetting): add a backtop to provider setting * refactor: decouple ModelList from ProviderSetting * refactor: move modellist to a single dir * refactor: allow more props for CollapsibleSearchBar * refactor: split ModelList into ModelList, ModelListGroup and ModelListItem * refactor: simplify health check types, improve file structure * refactor: split HealthStatusIndicator from list items * refactor: better indicator tooltip * refactor: improve model search, simplify some expressions * refactor: further simplify ModelList by extracting onHealthCheck * refactor: remove double scroller from EditModelsPopup * revert: remove backtop * fix: i18n order * refactor: sort buttons | 1 年前 | |
♻️ refactor: implement config-based update system with version compatibility control (#11147) * ♻️ refactor: implement config-based update system with version compatibility control Replace GitHub API-based update discovery with JSON config file system. Support version gating (users below v1.7 must upgrade to v1.7.0 before v2.0). Auto-select GitHub/GitCode config source based on IP location. Simplify fallback logic. Changes: - Add update-config.json with version compatibility rules - Implement _fetchUpdateConfig() and _findCompatibleChannel() - Remove legacy _getReleaseVersionFromGithub() and GitHub API dependency - Refactor _setFeedUrl() with simplified fallback to default feed URLs - Add design documentation in docs/UPDATE_CONFIG_DESIGN.md 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix(i18n): Auto update translations for PR #11147 * format code * 🔧 chore: update config for v1.7.5 → v2.0.0 → v2.1.6 upgrade path Update version configuration to support multi-step upgrade path: - v1.6.x users → v1.7.5 (last v1.x release) - v1.7.x users → v2.0.0 (v2.x intermediate version) - v2.0.0+ users → v2.1.6 (current latest) Changes: - Update 1.7.0 → 1.7.5 with fixed feedUrl - Set 2.0.0 as intermediate version with fixed feedUrl - Add 2.1.6 as current latest pointing to releases/latest This ensures users upgrade through required intermediate versions before jumping to major releases. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * 🔧 chore: refactor update config with constants and adjust versions Refactor update configuration system and adjust to actual versions: - Add UpdateConfigUrl enum in constant.ts for centralized config URLs - Point to test server (birdcat.top) for development testing - Update AppUpdater.ts to use UpdateConfigUrl constants - Adjust update-config.json to actual v1.6.7 with rc/beta channels - Remove v2.1.6 entry (not yet released) - Set package version to 1.6.5 for testing upgrade path - Add update-config.example.json for reference 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * update version * ✅ test: add comprehensive unit tests for AppUpdater config system Add extensive test coverage for new config-based update system including: - Config fetching with IP-based source selection (GitHub/GitCode) - Channel compatibility matching with version constraints - Smart fallback from rc/beta to latest when appropriate - Multi-step upgrade path validation (1.6.3 → 1.6.7 → 2.0.0) - Error handling for network and HTTP failures Test Coverage: - _fetchUpdateConfig: 4 tests (GitHub/GitCode selection, error handling) - _findCompatibleChannel: 9 tests (channel matching, version comparison) - Upgrade Path: 3 tests (version gating scenarios) - Total: 30 tests, 100% passing Also optimize _findCompatibleChannel logic with better variable naming and log messages. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * ✅ test: add complete multi-step upgrade path tests (1.6.3 → 1.7.5 → 2.0.0 → 2.1.6) Add comprehensive test suite for complete upgrade journey including: - Individual step validation (1.6.3→1.7.5, 1.7.5→2.0.0, 2.0.0→2.1.6) - Full multi-step upgrade simulation with version progression - Version gating enforcement (block skipping intermediate versions) - Verification that 1.6.3 cannot directly upgrade to 2.0.0 or 2.1.6 - Verification that 1.7.5 cannot skip 2.0.0 to reach 2.1.6 Test Coverage: - 6 new tests for complete upgrade path scenarios - Total: 36 tests, 100% passing This ensures the version compatibility system correctly enforces intermediate version upgrades for major releases. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * 📝 docs: reorganize update config documentation with English translation Move update configuration design document to docs/technical/ directory and add English translation for international contributors. Changes: - Move docs/UPDATE_CONFIG_DESIGN.md → docs/technical/app-update-config-zh.md - Add docs/technical/app-update-config-en.md (English translation) - Organize technical documentation in dedicated directory Documentation covers: - Config-based update system design and rationale - JSON schema with version compatibility control - Multi-step upgrade path examples (1.6.3 → 1.7.5 → 2.0.0 → 2.1.6) - TypeScript type definitions and matching algorithms - GitHub/GitCode source selection for different regions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * format code * ✅ test: add tests for latest channel self-comparison prevention Add tests to verify the optimization that prevents comparing latest channel with itself when latest is requested, and ensures rc/beta channels are returned when they are newer than latest. New tests: - should not compare latest with itself when requesting latest channel - should return rc when rc version > latest version - should return beta when beta version > latest version These tests ensure the requestedChannel !== UpgradeChannel.LATEST check works correctly and users get the right channel based on version comparisons. Test Coverage: 39 tests, 100% passing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * update github/gitcode * format code * update rc version * ♻️ refactor: merge update configs into single multi-mirror file - Merge app-upgrade-config-github.json and app-upgrade-config-gitcode.json into single app-upgrade-config.json - Add UpdateMirror enum for type-safe mirror selection - Optimize _fetchUpdateConfig to receive mirror parameter, eliminating duplicate IP country checks - Update ChannelConfig interface to use Record<UpdateMirror, string> for feedUrls - Rename documentation files from app-update-config-* to app-upgrade-config-* - Update docs with new multi-mirror configuration structure 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * ✅ test: update AppUpdater tests for multi-mirror configuration - Add UpdateMirror enum import - Update _fetchUpdateConfig tests to accept mirror parameter - Convert all feedUrl to feedUrls structure in test mocks - Update test expectations to match new ChannelConfig interface - All 39 tests passing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * format code * delete files * 📝 docs: add UpdateMirror enum to type definitions - Add UpdateMirror enum definition in both EN and ZH docs - Update ChannelConfig to use Record<UpdateMirror, string> - Add comments showing equivalent structure for clarity 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * 🐛 fix: return actual channel from _findCompatibleChannel Fix channel mismatch issue where requesting rc/beta but getting latest: - Change _findCompatibleChannel return type to include actual channel - Return { config, channel } instead of just config - Update _setFeedUrl to use actualChannel instead of requestedChannel - Update all test expectations to match new return structure - Add channel assertions to key tests This ensures autoUpdater.channel matches the actual feed URL being used. Fixes issue where: - User requests 'rc' channel - latest >= rc, so latest config is returned - But channel was set to 'rc' with latest URL ❌ - Now channel is correctly set to 'latest' ✅ All 39 tests passing ✅ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * update version * udpate version * update config * add no cache header * update files * 🤖 chore: automate app upgrade config updates * format code * update workflow * update get method * docs: document upgrade workflow automation --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: GitHub Action <action@github.com> | 9 个月前 | |
refactor: switch yarn to pnpm (#12260) * refactor: switch workflows from yarn to pnpm Replace Yarn usage with pnpm in CI workflows to standardize package management and leverage pnpm's store/cache behavior. - Use pnpm/action-setup to install pnpm (v) instead of enabling corepack and preparing Yarn. - Retrieve pnpm store path and update cache actions to cache the pnpm store and use pnpm-lock.yaml for cache keys and restores. - Replace yarn commands with pnpm equivalents across workflows: install, i18n:sync/translate, format, build:* and tsx invocation. - Avoid committing lockfile changes by resetting pnpm-lock.yaml instead of yarn.lock when checking for changes. - Update install flags: use pnpm install --frozen-lockfile / --install semantics where appropriate. These changes unify dependency tooling, improve caching correctness, and ensure CI uses pnpm-specific lockfile and cache paths. * build: switch pre-commit hook to pnpm lint-staged Update .husky/pre-commit to run pnpm lint-staged instead of yarn. This aligns the pre-commit hook with the project's package manager and ensures lint-staged runs using pnpm's environment and caching. * chore(ci): remove pinned pnpm version from GH Action steps Remove the explicit with: version: 9 lines from multiple GitHub Actions workflows (auto-i18n.yml, nightly-build.yml, pr-ci.yml, update-app-upgrade-config.yml, sync-to-gitcode.yml, release.yml). The workflows still call pnpm/action-setup@v4 but no longer hardcode a pnpm version. This simplifies maintenance and allows the action to resolve an appropriate pnpm version (or use its default) without needing updates whenever the pinned version becomes outdated. It reduces churn when bumping pnpm across CI configs and prevents accidental pin drift between workflow files. * build: Update pnpm to 10.27.0 and add onlyBuiltDependencies config * Update @cherrystudio/openai to 6.15.0 and consolidate overrides * Add @langchain/core to overrides * Add override for openai-compatible 1.0.27 * build: optimize pnpm config and add missing dependencies - Comment out shamefully-hoist in .npmrc for better pnpm compatibility - Add React-related packages to optimizeDeps in electron.vite.config.ts - Add missing peer dependencies and packages that were previously hoisted 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * build: refine pnpm configuration and dependency management - Simplify .npmrc to only essential electron mirror config - Move platform-specific dependencies to devDependencies - Pin sharp version to 0.34.3 for consistency - Update sharp-libvips versions to 1.2.4 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * reduce app size * format * build: remove unnecessary disableOxcRecommendation option from react plugin configuration * docs: Replace yarn commands with pnpm in documentation and scripts * Revert "build: optimize pnpm config and add missing dependencies" This reverts commit acffad31f8c6122085d2e6cde46731378e001322. * build: import dependencies from yarn.lock * build: Add some phantom dependencies and reorganize dependencies * build: Keep consistent by removing types of semver It's not in the previous package.json * build: Add some phantom dependencies Keep same version with yarn.lock * build: Add form-data dependency version 4.0.4 * Add chalk dependency * build: downgrade some dependencies Reference: .yarn-state-copy.yml. These phantom dependencies should use top-level package of that version in node_modules * build: Add phantom dependencies * build: pin tiptap dependencies to exact versions Ensure consistent dependency resolution by removing caret ranges and pinning all @tiptap packages to exact version 3.2.0 * chore: pin embedjs dependencies to exact versions * build: pin @modelcontextprotocol/sdk to exact version 1.23.0 Remove caret from version specifier to prevent automatic upgrades and ensure consistent dependencies * chore: update @types/node dependency to 22.17.2 Update package.json and pnpm-lock.yaml to use @types/node version 22.17.2 instead of 22.19.3 to maintain consistency across dependencies * build: move some dependencies to dev deps and pin dependency versions to exact numbers Remove caret (^) from version ranges to ensure consistent dependency resolution across environments * chore: move dependencies from prod to dev and update lockfile Move @ant-design/icons, chalk, form-data, and open from dependencies to devDependencies Update pnpm-lock.yaml to reflect dependency changes * build: update package dependencies - Add new dependencies: md5, @libsql/win32-x64-msvc, @strongtz/win32-arm64-msvc, bonjour-service, emoji-picker-element-data, gray-matter, js-yaml - Remove redundant dependencies from devDependencies * build: add cors, katex and pako dependencies add new dependencies to support cross-origin requests, mathematical notation rendering and data compression * move some js deps to dev deps * test: update snapshot tests for Spinner and InputEmbeddingDimension * chore: exclude .zed directory from biome formatting * Update @ai-sdk/openai-compatible patch hash * chore: update @kangfenmao/keyv-storage to version 0.1.3 in package.json and pnpm-lock.yaml --------- Co-authored-by: icarus <eurfelux@gmail.com> Co-authored-by: beyondkmp <beyondkmp@gmail.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: kangfenmao <kangfenmao@qq.com> | 7 个月前 | |
feat: add after-build script for renaming files and updating latest.yml - Introduced a new script to rename files with spaces in the 'dist' directory. - Updated 'latest.yml' to remove the first file entry and adjust paths accordingly. - Enhanced build process for Windows to include the new script execution. - Added js-yaml dependency for YAML file manipulation. | 1 年前 | |
chore: release v1.7.12 Updated version number to 1.7.12 in package.json and electron-builder.yml. Added release notes detailing the introduction of the MCP Hub with Auto mode and new cache control options for the Anthropic provider, along with various bug fixes. | 7 个月前 | |
refactor: switch yarn to pnpm (#12260) * refactor: switch workflows from yarn to pnpm Replace Yarn usage with pnpm in CI workflows to standardize package management and leverage pnpm's store/cache behavior. - Use pnpm/action-setup to install pnpm (v) instead of enabling corepack and preparing Yarn. - Retrieve pnpm store path and update cache actions to cache the pnpm store and use pnpm-lock.yaml for cache keys and restores. - Replace yarn commands with pnpm equivalents across workflows: install, i18n:sync/translate, format, build:* and tsx invocation. - Avoid committing lockfile changes by resetting pnpm-lock.yaml instead of yarn.lock when checking for changes. - Update install flags: use pnpm install --frozen-lockfile / --install semantics where appropriate. These changes unify dependency tooling, improve caching correctness, and ensure CI uses pnpm-specific lockfile and cache paths. * build: switch pre-commit hook to pnpm lint-staged Update .husky/pre-commit to run pnpm lint-staged instead of yarn. This aligns the pre-commit hook with the project's package manager and ensures lint-staged runs using pnpm's environment and caching. * chore(ci): remove pinned pnpm version from GH Action steps Remove the explicit with: version: 9 lines from multiple GitHub Actions workflows (auto-i18n.yml, nightly-build.yml, pr-ci.yml, update-app-upgrade-config.yml, sync-to-gitcode.yml, release.yml). The workflows still call pnpm/action-setup@v4 but no longer hardcode a pnpm version. This simplifies maintenance and allows the action to resolve an appropriate pnpm version (or use its default) without needing updates whenever the pinned version becomes outdated. It reduces churn when bumping pnpm across CI configs and prevents accidental pin drift between workflow files. * build: Update pnpm to 10.27.0 and add onlyBuiltDependencies config * Update @cherrystudio/openai to 6.15.0 and consolidate overrides * Add @langchain/core to overrides * Add override for openai-compatible 1.0.27 * build: optimize pnpm config and add missing dependencies - Comment out shamefully-hoist in .npmrc for better pnpm compatibility - Add React-related packages to optimizeDeps in electron.vite.config.ts - Add missing peer dependencies and packages that were previously hoisted 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * build: refine pnpm configuration and dependency management - Simplify .npmrc to only essential electron mirror config - Move platform-specific dependencies to devDependencies - Pin sharp version to 0.34.3 for consistency - Update sharp-libvips versions to 1.2.4 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * reduce app size * format * build: remove unnecessary disableOxcRecommendation option from react plugin configuration * docs: Replace yarn commands with pnpm in documentation and scripts * Revert "build: optimize pnpm config and add missing dependencies" This reverts commit acffad31f8c6122085d2e6cde46731378e001322. * build: import dependencies from yarn.lock * build: Add some phantom dependencies and reorganize dependencies * build: Keep consistent by removing types of semver It's not in the previous package.json * build: Add some phantom dependencies Keep same version with yarn.lock * build: Add form-data dependency version 4.0.4 * Add chalk dependency * build: downgrade some dependencies Reference: .yarn-state-copy.yml. These phantom dependencies should use top-level package of that version in node_modules * build: Add phantom dependencies * build: pin tiptap dependencies to exact versions Ensure consistent dependency resolution by removing caret ranges and pinning all @tiptap packages to exact version 3.2.0 * chore: pin embedjs dependencies to exact versions * build: pin @modelcontextprotocol/sdk to exact version 1.23.0 Remove caret from version specifier to prevent automatic upgrades and ensure consistent dependencies * chore: update @types/node dependency to 22.17.2 Update package.json and pnpm-lock.yaml to use @types/node version 22.17.2 instead of 22.19.3 to maintain consistency across dependencies * build: move some dependencies to dev deps and pin dependency versions to exact numbers Remove caret (^) from version ranges to ensure consistent dependency resolution across environments * chore: move dependencies from prod to dev and update lockfile Move @ant-design/icons, chalk, form-data, and open from dependencies to devDependencies Update pnpm-lock.yaml to reflect dependency changes * build: update package dependencies - Add new dependencies: md5, @libsql/win32-x64-msvc, @strongtz/win32-arm64-msvc, bonjour-service, emoji-picker-element-data, gray-matter, js-yaml - Remove redundant dependencies from devDependencies * build: add cors, katex and pako dependencies add new dependencies to support cross-origin requests, mathematical notation rendering and data compression * move some js deps to dev deps * test: update snapshot tests for Spinner and InputEmbeddingDimension * chore: exclude .zed directory from biome formatting * Update @ai-sdk/openai-compatible patch hash * chore: update @kangfenmao/keyv-storage to version 0.1.3 in package.json and pnpm-lock.yaml --------- Co-authored-by: icarus <eurfelux@gmail.com> Co-authored-by: beyondkmp <beyondkmp@gmail.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: kangfenmao <kangfenmao@qq.com> | 7 个月前 | |
Add browser CDP MCP server with session management (#11844) * ✨ feat: add CDP browser MCP server * ♻️ refactor: add navigation timeout for browser cdp * 🐛 fix: reuse window for execute and add debugger logging * ✨ feat: add show option and multiline execute for browser cdp * ✨ feat: support multiple sessions for browser cdp * ♻️ refactor: add LRU and idle cleanup for browser cdp sessions * Refactor browser-cdp for readability and set Firefox UA * 🐛 fix: type electron mock for cdp tests * ♻️ refactor: rename browser_cdp MCP server to browser Simplify the MCP server name from @cherry/browser-cdp to just browser for cleaner tool naming in the MCP protocol. * ✨ feat: add fetch tool to browser MCP server Add a new fetch tool that uses the CDP-controlled browser to fetch URLs and return content in various formats (html, txt, markdown, json). Also ignore .conductor folder in biome and eslint configs. * ♻️ refactor: split browser MCP server into modular folder structure Reorganize browser.ts (525 lines) into browser/ folder with separate files for better maintainability. Each tool now has its own file with schema, definition, and handler. * ♻️ refactor: use switch statement in browser server request handler * ♻️ refactor: extract helpers and use handler registry pattern - Add successResponse/errorResponse helpers in tools/utils.ts - Add closeWindow helper to consolidate window cleanup logic - Add ensureDebuggerAttached helper to consolidate debugger setup - Add toolHandlers map for registry-based handler lookup - Simplify server.ts to use dynamic handler dispatch * 🐛 fix: improve browser MCP server robustness - Add try-catch for JSON.parse in fetch() to handle invalid JSON gracefully - Add Zod schema validation to reset tool for consistency with other tools - Fix memory leak in open() by ensuring event listeners cleanup on timeout - Add JSDoc comments for key methods and classes * ♻️ refactor: rename browser MCP to @cherry/browser Follow naming convention of other builtin MCP servers. * 🌐 i18n: translate pending strings across 8 locales Translate all "[to be translated]" markers including: - CDP browser MCP server description (all 8 locales) - "Extra High" reasoning chain length option (6 locales) - Git Bash configuration strings (el-gr, ja-jp) | 8 个月前 | |
chore: release v1.7.12 Updated version number to 1.7.12 in package.json and electron-builder.yml. Added release notes detailing the introduction of the MCP Hub with Auto mode and new cache control options for the Anthropic provider, along with various bug fixes. | 7 个月前 | |
feat(test): e2e framework (#11494) * feat(test): e2e framework Add Playwright-based e2e testing framework for Electron app with: - Custom fixtures for electronApp and mainWindow - Page Object Model (POM) pattern implementation - 15 example test cases covering app launch, navigation, settings, and chat - Comprehensive README for humans and AI assistants 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * refactor(tests): update imports and improve code readability - Changed imports from 'import { Page, Locator }' to 'import type { Locator, Page }' for better type clarity across multiple page files. - Reformatted waitFor calls in ChatPage and HomePage for improved readability. - Updated index.ts to correct the export order of ChatPage and SidebarPage. - Minor adjustments in electron.fixture.ts and electron-app.ts for consistency in import statements. These changes enhance the maintainability and clarity of the test codebase. * chore: update linting configuration to include tests directory - Added 'tests/**' to the ignore patterns in .oxlintrc.json and eslint.config.mjs to ensure test files are not linted. - Minor adjustment in electron.fixture.ts to improve the fixture definition. These changes streamline the linting process and enhance code organization. * fix(test): select main window by title to fix flaky e2e tests on Mac On Mac, the app may create miniWindow for QuickAssistant alongside mainWindow. Using firstWindow() could randomly select the wrong window, causing test failures. Now we wait for the window with title "Cherry Studio" to ensure we get the main window. Also removed unused electron-app.ts utility file. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com> | 8 个月前 | |
refactor: use pnpm install instead of manual download for prebuild packages (#12358) * refactor: use pnpm install instead of manual download for prebuild packages Replace manual tgz download with pnpm install for architecture-specific prebuild binaries, simplifying the build process. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * delete utils * update after pack * udpate before pack * use optional deps * refactor: use js-yaml to modify pnpm-workspace.yaml for cross-platform builds - Add all prebuild packages to optionalDependencies in package.json - Use js-yaml to parse and modify pnpm-workspace.yaml - Add target platform to supportedArchitectures.os and cpu - Restore original config after pnpm install Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * fix version * refactor: streamline package management and filtering logic in before… (#12370) refactor: streamline package management and filtering logic in before-pack.js - Consolidated architecture-specific package definitions into a single array for better maintainability. - Simplified the logic for determining target platform and architecture. - Enhanced the filtering process for excluding and including packages based on architecture and platform. - Improved console logging for clarity during package installation. This refactor aims to improve the readability and efficiency of the prebuild package handling process. * refactor: update package filtering logic in before-pack.js to read from electron-builder.yml - Modified the package filtering process to load configuration directly from electron-builder.yml, reducing potential errors from multiple overrides. - Enhanced maintainability by centralizing the file configuration management. This change aims to streamline the prebuild package handling and improve configuration clarity. --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: 亢奋猫 <kangfenmao@qq.com> | 7 个月前 | |
refactor: use pnpm install instead of manual download for prebuild packages (#12358) * refactor: use pnpm install instead of manual download for prebuild packages Replace manual tgz download with pnpm install for architecture-specific prebuild binaries, simplifying the build process. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * delete utils * update after pack * udpate before pack * use optional deps * refactor: use js-yaml to modify pnpm-workspace.yaml for cross-platform builds - Add all prebuild packages to optionalDependencies in package.json - Use js-yaml to parse and modify pnpm-workspace.yaml - Add target platform to supportedArchitectures.os and cpu - Restore original config after pnpm install Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * fix version * refactor: streamline package management and filtering logic in before… (#12370) refactor: streamline package management and filtering logic in before-pack.js - Consolidated architecture-specific package definitions into a single array for better maintainability. - Simplified the logic for determining target platform and architecture. - Enhanced the filtering process for excluding and including packages based on architecture and platform. - Improved console logging for clarity during package installation. This refactor aims to improve the readability and efficiency of the prebuild package handling process. * refactor: update package filtering logic in before-pack.js to read from electron-builder.yml - Modified the package filtering process to load configuration directly from electron-builder.yml, reducing potential errors from multiple overrides. - Enhanced maintainability by centralizing the file configuration management. This change aims to streamline the prebuild package handling and improve configuration clarity. --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: 亢奋猫 <kangfenmao@qq.com> | 7 个月前 | |
feat: integrate HeroUI and Tailwind CSS for enhanced styling (#9973) | 11 个月前 | |
fix: preserve openrouter reasoning with web search (#11505) * feat(options): implement deep merging for provider options Add deep merge functionality to preserve nested properties when combining provider options. The new implementation handles object merging recursively while maintaining type safety. * refactor(tsconfig): reorganize include paths in tsconfig files Clean up and reorder include paths for better maintainability and consistency between tsconfig.node.json and tsconfig.web.json * test: add aiCore test configuration and script Add new test configuration for aiCore package and corresponding test script in package.json to enable running tests specifically for the aiCore module. * fix: format * fix(aiCore): resolve test failures and update test infrastructure - Add vitest setup file with global mocks for @cherrystudio/ai-sdk-provider - Fix context assertions: use 'model' instead of 'modelId' in plugin tests - Fix error handling tests: update expected error messages to match actual behavior - Fix streamText tests: use 'maxOutputTokens' instead of 'maxTokens' - Fix schemas test: update expected provider list to match actual implementation - Fix mock-responses: use AI SDK v5 format (inputTokens/outputTokens) - Update vi.mock to use importOriginal for preserving jsonSchema export 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix(aiCore): add alias mock for @cherrystudio/ai-sdk-provider in tests The vi.mock in setup file doesn't work for source code imports. Use vitest resolve.alias to mock the external package properly. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix(aiCore): disable unused-vars warnings in mock file 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix(aiCore): use import.meta.url for ESM compatibility in vitest config __dirname is not available in ESM modules, use fileURLToPath instead. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix(aiCore): use absolute paths in vitest config for workspace compatibility - Use path.resolve for setupFiles and all alias paths - Extend aiCore vitest.config.ts from root workspace config - Change aiCore test environment to 'node' instead of 'jsdom' 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * docs(factory): improve mergeProviderOptions documentation Add detailed explanation of merge behavior with examples * test(factory): add tests for mergeProviderOptions behavior Add test cases to verify mergeProviderOptions correctly handles primitive values, arrays, and nested objects during merging * refactor(tests): clean up mock responses test fixtures Remove unused mock streaming chunks and error responses to simplify test fixtures Update warning details structure in mock complete responses * docs(test): clarify comment in generateImage test Update comment to use consistent 'model id' terminology instead of 'modelId' * test(factory): verify array replacement in mergeProviderOptions --------- Co-authored-by: suyao <sy20010504@gmail.com> Co-authored-by: Claude <noreply@anthropic.com> | 8 个月前 | |
fix: preserve openrouter reasoning with web search (#11505) * feat(options): implement deep merging for provider options Add deep merge functionality to preserve nested properties when combining provider options. The new implementation handles object merging recursively while maintaining type safety. * refactor(tsconfig): reorganize include paths in tsconfig files Clean up and reorder include paths for better maintainability and consistency between tsconfig.node.json and tsconfig.web.json * test: add aiCore test configuration and script Add new test configuration for aiCore package and corresponding test script in package.json to enable running tests specifically for the aiCore module. * fix: format * fix(aiCore): resolve test failures and update test infrastructure - Add vitest setup file with global mocks for @cherrystudio/ai-sdk-provider - Fix context assertions: use 'model' instead of 'modelId' in plugin tests - Fix error handling tests: update expected error messages to match actual behavior - Fix streamText tests: use 'maxOutputTokens' instead of 'maxTokens' - Fix schemas test: update expected provider list to match actual implementation - Fix mock-responses: use AI SDK v5 format (inputTokens/outputTokens) - Update vi.mock to use importOriginal for preserving jsonSchema export 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix(aiCore): add alias mock for @cherrystudio/ai-sdk-provider in tests The vi.mock in setup file doesn't work for source code imports. Use vitest resolve.alias to mock the external package properly. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix(aiCore): disable unused-vars warnings in mock file 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix(aiCore): use import.meta.url for ESM compatibility in vitest config __dirname is not available in ESM modules, use fileURLToPath instead. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix(aiCore): use absolute paths in vitest config for workspace compatibility - Use path.resolve for setupFiles and all alias paths - Extend aiCore vitest.config.ts from root workspace config - Change aiCore test environment to 'node' instead of 'jsdom' 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * docs(factory): improve mergeProviderOptions documentation Add detailed explanation of merge behavior with examples * test(factory): add tests for mergeProviderOptions behavior Add test cases to verify mergeProviderOptions correctly handles primitive values, arrays, and nested objects during merging * refactor(tests): clean up mock responses test fixtures Remove unused mock streaming chunks and error responses to simplify test fixtures Update warning details structure in mock complete responses * docs(test): clarify comment in generateImage test Update comment to use consistent 'model id' terminology instead of 'modelId' * test(factory): verify array replacement in mergeProviderOptions --------- Co-authored-by: suyao <sy20010504@gmail.com> Co-authored-by: Claude <noreply@anthropic.com> | 8 个月前 | |
fix: prevent OOM when handling large base64 image data (#12244) * fix: prevent OOM when handling large base64 image data - Add memory-safe parseDataUrl utility using string operations instead of regex - Truncate large base64 data in ErrorBlock detail modal to prevent freezing - Update ImageViewer, FileStorage, messageConverter to use shared parseDataUrl - Deprecate parseDataUrlMediaType in favor of shared utility - Add GB support to formatFileSize - Add comprehensive unit tests for parseDataUrl (18 tests) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * refactor: simplify parseDataUrl API to return DataUrlParts | null - Change return type from discriminated union to simple nullable type - Update all call sites to use optional chaining (?.) - Update tests to use toBeNull() for failure cases - More idiomatic and consistent with codebase patterns (e.g., parseJSON) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com> | 7 个月前 |
English | 中文 | Official Site | Documents | Development | Feedback
🍒 Cherry Studio
Cherry Studio is a desktop client that supports multiple LLM providers, available on Windows, Mac and Linux.
👏 Join Telegram Group|Discord | QQ Group(575014769)
❤️ Like Cherry Studio? Give it a star 🌟 or Sponsor to support the development!
🌠 Screenshot
🌟 Key Features
- Diverse LLM Provider Support:
- ☁️ Major LLM Cloud Services: OpenAI, Gemini, Anthropic, and more
- 🔗 AI Web Service Integration: Claude, Perplexity, Poe, and others
- 💻 Local Model Support with Ollama, LM Studio
- AI Assistants & Conversations:
- 📚 300+ Pre-configured AI Assistants
- 🤖 Custom Assistant Creation
- 💬 Multi-model Simultaneous Conversations
- Document & Data Processing:
- 📄 Supports Text, Images, Office, PDF, and more
- ☁️ WebDAV File Management and Backup
- 📊 Mermaid Chart Visualization
- 💻 Code Syntax Highlighting
- Practical Tools Integration:
- 🔍 Global Search Functionality
- 📝 Topic Management System
- 🔤 AI-powered Translation
- 🎯 Drag-and-drop Sorting
- 🔌 Mini Program Support
- ⚙️ MCP(Model Context Protocol) Server
- Enhanced User Experience:
- 🖥️ Cross-platform Support for Windows, Mac, and Linux
- 📦 Ready to Use - No Environment Setup Required
- 🎨 Light/Dark Themes and Transparent Window
- 📝 Complete Markdown Rendering
- 🤲 Easy Content Sharing
📝 Roadmap
We're actively working on the following features and improvements:
- 🎯 Core Features
- Selection Assistant with smart content selection enhancement
- Deep Research with advanced research capabilities
- Memory System with global context awareness
- Document Preprocessing with improved document handling
- MCP Marketplace for Model Context Protocol ecosystem
- 🗂 Knowledge Management
- Notes and Collections
- Dynamic Canvas visualization
- OCR capabilities
- TTS (Text-to-Speech) support
- 📱 Platform Support
- HarmonyOS Edition (PC)
- Android App (Phase 1)
- iOS App (Phase 1)
- Multi-Window support
- Window Pinning functionality
- Intel AI PC (Core Ultra) Support
- 🔌 Advanced Features
- Plugin System
- ASR (Automatic Speech Recognition)
- Assistant and Topic Interaction Refactoring
Track our progress and contribute on our project board.
Want to influence our roadmap? Join our GitHub Discussions to share your ideas and feedback!
🌈 Theme
- Theme Gallery: https://cherrycss.com
- Aero Theme: https://github.com/hakadao/CherryStudio-Aero
- PaperMaterial Theme: https://github.com/rainoffallingstar/CherryStudio-PaperMaterial
- Claude dynamic-style: https://github.com/bjl101501/CherryStudio-Claudestyle-dynamic
- Maple Neon Theme: https://github.com/BoningtonChen/CherryStudio_themes
Welcome PR for more themes
🤝 Contributing
We welcome contributions to Cherry Studio! Here are some ways you can contribute:
- Contribute Code: Develop new features or optimize existing code.
- Fix Bugs: Submit fixes for any bugs you find.
- Maintain Issues: Help manage GitHub issues.
- Product Design: Participate in design discussions.
- Write Documentation: Improve user manuals and guides.
- Community Engagement: Join discussions and help users.
- Promote Usage: Spread the word about Cherry Studio.
Refer to the Branching Strategy for contribution guidelines
Getting Started
- Fork the Repository: Fork and clone it to your local machine.
- Create a Branch: For your changes.
- Submit Changes: Commit and push your changes.
- Open a Pull Request: Describe your changes and reasons.
For more detailed guidelines, please refer to our Contributing Guide.
Thank you for your support and contributions!
🔧 Developer Co-creation Program
We are launching the Cherry Studio Developer Co-creation Program to foster a healthy and positive-feedback loop within the open-source ecosystem. We believe that great software is built collaboratively, and every merged pull request breathes new life into the project.
We sincerely invite you to join our ranks of contributors and shape the future of Cherry Studio with us.
Contributor Rewards Program
To give back to our core contributors and create a virtuous cycle, we have established the following long-term incentive plan.
The inaugural tracking period for this program will be Q3 2025 (July, August, September). Rewards for this cycle will be distributed on October 1st.
Within any tracking period (e.g., July 1st to September 30th for the first cycle), any developer who contributes more than 30 meaningful commits to any of Cherry Studio's open-source projects on GitHub will be eligible for the following benefits:
- Cursor Subscription Sponsorship: Receive a $70 USD credit or reimbursement for your Cursor subscription, making AI your most efficient coding partner.
- Unlimited Model Access: Get unlimited API calls for the DeepSeek and Qwen models.
- Cutting-Edge Tech Access: Enjoy occasional perks, including API access to models like Claude, Gemini, and OpenAI, keeping you at the forefront of technology.
Growing Together & Future Plans
A vibrant community is the driving force behind any sustainable open-source project. As Cherry Studio grows, so will our rewards program. We are committed to continuously aligning our benefits with the best-in-class tools and resources in the industry. This ensures our core contributors receive meaningful support, creating a positive cycle where developers, the community, and the project grow together.
Moving forward, the project will also embrace an increasingly open stance to give back to the entire open-source community.
How to Get Started?
We look forward to your first Pull Request!
You can start by exploring our repositories, picking up a good first issue, or proposing your own enhancements. Every commit is a testament to the spirit of open source.
Thank you for your interest and contributions.
Let's build together.
🏢 Enterprise Edition
Building on the Community Edition, we are proud to introduce Cherry Studio Enterprise Edition—a privately-deployable AI productivity and management platform designed for modern teams and enterprises.
The Enterprise Edition addresses core challenges in team collaboration by centralizing the management of AI resources, knowledge, and data. It empowers organizations to enhance efficiency, foster innovation, and ensure compliance, all while maintaining 100% control over their data in a secure environment.
Core Advantages
- Unified Model Management: Centrally integrate and manage various cloud-based LLMs (e.g., OpenAI, Anthropic, Google Gemini) and locally deployed private models. Employees can use them out-of-the-box without individual configuration.
- Enterprise-Grade Knowledge Base: Build, manage, and share team-wide knowledge bases. Ensures knowledge retention and consistency, enabling team members to interact with AI based on unified and accurate information.
- Fine-Grained Access Control: Easily manage employee accounts and assign role-based permissions for different models, knowledge bases, and features through a unified admin backend.
- Fully Private Deployment: Deploy the entire backend service on your on-premises servers or private cloud, ensuring your data remains 100% private and under your control to meet the strictest security and compliance standards.
- Reliable Backend Services: Provides stable API services and enterprise-grade data backup and recovery mechanisms to ensure business continuity.
✨ Online Demo
Version Comparison
| Feature | Community Edition | Enterprise Edition |
|---|---|---|
| Open Source | ✅ Yes | ⭕️ Partially released to customers |
| Cost | AGPL-3.0 License | Buyout / Subscription Fee |
| Admin Backend | — | ● Centralized Model Access ● Employee Management ● Shared Knowledge Base ● Access Control ● Data Backup |
| Server | — | ✅ Dedicated Private Deployment |
Get the Enterprise Edition
We believe the Enterprise Edition will become your team's AI productivity engine. If you are interested in Cherry Studio Enterprise Edition and would like to learn more, request a quote, or schedule a demo, please feel free to contact us.
- For Business Inquiries & Purchasing: 📧 bd@cherry-ai.com
🔗 Related Projects
-
new-api: The next-generation LLM gateway and AI asset management system supports multiple languages.
-
one-api: LLM API management and distribution system supporting mainstream models like OpenAI, Azure, and Anthropic. Features a unified API interface, suitable for key management and secondary distribution.
-
Poe: Poe gives you access to the best AI, all in one place. Explore GPT-5, Claude Opus 4.1, DeepSeek-R1, Veo 3, ElevenLabs, and millions of others.
-
ublacklist: Blocks specific sites from appearing in Google search results
🚀 Contributors
📊 GitHub Stats
⭐️ Star History
📜 License
The Cherry Studio Community Edition is governed by the standard GNU Affero General Public License v3.0 (AGPL-3.0), available at https://www.gnu.org/licenses/agpl-3.0.html.
Use of the Cherry Studio Community Edition for commercial purposes is permitted, subject to full compliance with the terms and conditions of the AGPL-3.0 license.
Should you require a commercial license that provides an exemption from the AGPL-3.0 requirements, please contact us at bd@cherry-ai.com.