* 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
- Enhanced the logic to determine included Claude code vendors based on architecture and platform.
- Adjusted filters for excluding and including Claude code vendors to improve compatibility, particularly for Windows ARM64.
- Removed unnecessary variables and streamlined the filter application process.
- Removed outdated dependencies: js-yaml, bonjour-service, and emoji-picker-element-data from devDependencies.
- Added js-yaml, bonjour-service, and emoji-picker-element-data back to their respective locations in dependencies.
- Introduced optionalDependencies for @strongtz/win32-arm64-msvc with version ^0.4.7.
- Updated pnpm-lock.yaml to reflect the changes in package.json and added new package versions.
Updated version number to 1.7.11 in package.json and electron-builder.yml. Added release notes highlighting the introduction of the MCP Hub with Auto mode and various bug fixes, including improvements to the Chat and Editor components.
This commit fixes a bug where search results could not be retrieved from Bing, Baidu, and Google.
The root cause of this issue was a discrepancy in page content when the Electron window was hidden versus when it was visible. Additionally, the previous use of `did-finish-load` caused page jitter within the window, leading to sporadic failures in fetching search content.
To resolve this, I've enabled offscreen rendering, ensuring consistent page content regardless of window visibility. Furthermore, I've switched to using the `ready-to-show` event to ensure the complete page DOM is available before attempting to retrieve content, thereby eliminating the search bug.
* feat(fetch): add request throttling (already present in the original, keeping it)
Co-authored-by: suyao <sy20010504@gmail.com>
* refactor: separate message extraction from rendering
Extract `lastAssistantMessage` memoization separately from rendering
`MessageContent` component, improving code clarity and separation of
concerns.
* feat: Replace manual loading state with AssistantMessageStatus tracking
* refactor: Replace loading state with status enum in translation action
- Add LoadingOutlined icon for preparing state
- Remove AssistantMessageStatus dependency
- Simplify streaming detection using local status state
* feat: Add logging and status sync for translation action
* feat: Refactor action component state management to be consistent with
translate action
Replace separate `isContented` and `isLoading` states with a single
`status` state that tracks 'preparing', 'streaming', and 'finished'
phases. Sync status with assistant message status and update footer
loading prop accordingly.
* fix: Add missing pauseTrace import to ActionTranslate component
* fix: Add missing break statements in assistant message status handling
* fix: Move pauseTrace call inside abort completion condition
* 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 894b2fd487.
* 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>
* fix: resolve ActionTranslate stalling after initialization
Issue: When invoking translate from the selection assistant, the fetchResult function does not react to the completion of initialize, causing the ActionTranslate component to enter an infinite loading state.
Cause: In commit 680bda3993, the initialize effect hook was refactored into a callback function. This refactor omitted the notification that fetchResult should run after initialization, so fetchResult never executes post‑initialization.
Fix: Change the initialized flag from a ref to a state variable and have fetchResult listen to this state. This modification ensures the effect hook triggers fetchResult exactly once after initialization is complete.
* fix(ActionTranslate): fix missing dependency in useEffect hook
---------
Co-authored-by: icarus <eurfelux@gmail.com>
AI SDK v5 uses 'developer' role for reasoning models, but some providers
like Azure DeepSeek R1 only support 'system', 'user', 'assistant', 'tool'
roles, causing HTTP 422 errors.
This fix adds a custom fetch wrapper that converts 'developer' role back
to 'system' for providers that don't support it.
Fixes#12321🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
Use fixed base URL for TokenFlux image API instead of provider.apiHost.
After migration 191, apiHost was changed to include /openai/v1 suffix
for chat API compatibility, but image API needs the base URL without
this suffix, causing /openai/v1/v1/images/models (wrong path).
Fixes#12284
Signed-off-by: SherlockShemol <shemol@163.com>
- Changed all 'Assistant:' labels to 'A:' in tool use examples for consistency
- Added missing blank line before final response in both files
- Affects promptToolUsePlugin.ts and prompt.ts
- Resolves#12310
* fix: use ipinfo lite API with token for IP country detection
Switch from ipinfo.io/json to api.ipinfo.io/lite/me endpoint with
authentication token to improve reliability and avoid rate limiting.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* fix: use country_code field from ipinfo lite API response
The lite API returns country_code instead of country field.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
* 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>
* 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 acffad31f8.
* 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>
Add `isolation: isolate` to NotesSidebar container to create a new
stacking context, preventing sticky folder elements (z-index: 1000+)
from overlapping MinApp webview when switching pages.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
I have corrected several typos and refined the terminology in the ro-ro.json file for better linguistic accuracy. This update ensures translation consistency throughout the user interface.
* fix: preserve thinking time when stopping reply
Fixes#11886
Signed-off-by: Calvin <calvinvwei@gmail.com>
* fix: also preserve thinking time when stopping during thinking
This extends the previous fix to also handle the case when the user
stops the reply while thinking is still in progress (not just after
thinking is complete).
Signed-off-by: Calvin <calvinvwei@gmail.com>
* fix: auto-complete thinking when text output starts
This fixes the issue where the thinking timer continues running after
thinking is complete and text output begins. Some AI providers don't
send a reasoning-end event explicitly, so we now auto-complete thinking
when a text-start event is received with accumulated reasoning content.
Fixes#11796
Signed-off-by: Calvin <calvinvwei@gmail.com>
* refactor: extract emitThinkingCompleteIfNeeded to reduce duplication
Extract the shared logic for emitting THINKING_COMPLETE chunk into a
reusable method. This removes code duplication between text-start and
reasoning-end event handlers as suggested in code review.
Signed-off-by: Calvin <calvinvwei@gmail.com>
---------
Signed-off-by: Calvin <calvinvwei@gmail.com>
* feat(code-tools): add 302.AI as Claude Code provider
* feat(agent): add 302.AI anthropicApiHost to enable Agent support
302.AI now supports Claude Code (Agent) functionality by configuring
the anthropicApiHost endpoint. Users can use 302.AI's Claude models
(claude-sonnet-4-20250514, claude-opus-4-20250514) with Agent.
* feat(migrate): add migration 192 to set 302ai API host
- Add session-based user data persistence using Electron partitions
- Implement multi-tab support with tab management operations
- Add new tools: create_tab, list_tabs, close_tab, switch_tab
- Update existing tools (open, execute, fetch, reset) to support tabId parameter
- Refactor controller to manage sessions with multiple tabs
- Add comprehensive documentation in README.md
- Add TypeScript interfaces for SessionInfo and TabInfo
BREAKING CHANGE: Controller now manages sessions with tabs instead of single windows per session
* refactor(translate): remove default temperature setting
* refactor(translate): Remove temperature setting from language detection
prompt
* refactor: Set default translate languages from user settings
Initialize target language from user's language setting, falling back to
zh-CN if unknown. Set alter language to en-US by default. Remove
redundant logic that was duplicated in the effect.
* fix(translate): translate action won't trigger twice
* fix(translate): Fix getLanguageByLangcode to return built-in language
when not loaded
Previously, the function would always return UNKNOWN if the languages
were not loaded, even for built-in language codes. This change ensures
built-in languages are returned if found, regardless of the load state.
* fix: Expose translation languages loaded state and fix initialization
Add `isLoaded` flag to `useTranslate` hook to track when translation
languages are available. Use this flag to prevent premature
initialization in `ActionTranslate` component, ensuring language lookups
succeed before creating assistants and topics.
Add error logging for failed custom language loading and update fallback
warning messages for better debugging.
* fix: set initialized when finished
Fixes an Electron bug where zoom factor resets during route changes by listening to the 'did-navigate-in-page' event and reapplying the configured zoom factor.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
* feat(i18n): add Romanian localization (ro-RO)
Added the ro-ro.json file to provide Romanian language support for the Cherry Studio interface.
This commit introduces a high-quality, professional translation for the Romanian language. The localization has been carefully reviewed to ensure linguistic accuracy and terminology consistency, so no further adjustments from other contributors are required at this stage. Thank you!
* chore: move ro-ro.json to translate folder and register in index.ts
Moved the Romanian translation file to the translate directory and updated the i18n index to support the automated workflow as requested.
* Delete src/renderer/src/i18n/locales/ro-ro.json
* chore: add ro-ro.json to translate folder
Finalized the relocation of the Romanian translation file to the translate directory to support the automated i18n workflow.
* chore(i18n): remove trailing comma in index.ts
Biome formatter removed trailing comma for consistency.
* feat(i18n): add Romanian (ro-RO) to language selector
Add Romanian language option in settings with Română label and 🇷🇴 flag.
* fix(i18n): add Romanian language support
- Add ro-RO to LanguageVarious type
- Add Romanian to language selector in settings
- Add emoji picker fallback to English (no Romanian CLDR data)
* feat: Add Romanian to auto-translation language map
* fix: Add Romanian language support in main
* fix: Add Romanian (ro-RO) locale support for AntdProvider
* fix: Add Romanian language support to smooth stream segmenter
* fix: Add Romanian translations for assistant preset groups
---------
Co-authored-by: George·Dong <GeorgeDong32@qq.com>
Co-authored-by: icarus <eurfelux@gmail.com>
Remove the confusing V2 naming from message thunk functions to avoid conflicts with the upcoming real V2 data refactoring.
Changes:
- Inline V2 function implementations directly into messageThunk.ts
- Replace V2 function calls with direct dbService calls
- Remove messageThunk.v2.ts file
- Remove misleading "V2 DATA&UI REFACTORING" header comments
The V2 suffix was originally added for agent session support, not for a data layer refactoring. This cleanup clears the naming space for the actual V2 refactoring work.