mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-24 10:40:07 +08:00
* feat: implement early access feature toggle and update related configurations
- Replace FeedUrl with EnableEarlyAccess in IpcChannel and ConfigManager
- Update AppUpdater to handle early access updates from GitHub
- Modify settings and localization files to reflect early access functionality
- Ensure proper integration in the renderer and preload layers
* fix: enhance error handling in AppUpdater for GitHub release fetching
- Wrap the fetch call in a try-catch block to handle potential errors when retrieving the latest non-draft version from GitHub.
- Log an error message if the fetch fails and return a default feed URL.
* refactor: remove early access feature handling from AppUpdater
- Eliminate the early access feature toggle logic from the AppUpdater class.
- Adjust the feed URL setting to ensure it retrieves the latest non-draft version from GitHub when applicable.
- Clean up unnecessary user-agent header in the fetch request.
* feat(AppUpdater): enhance update feed URL logic and disable differential downloads
- Introduced a new private method to streamline feed URL setting based on early access and IP country.
- Disabled differential downloads for compatibility with GitHub and GitCode.
- Cleaned up the checkForUpdates method for better readability and maintainability.
* refactor(AppUpdater): simplify early access feed URL logic
- Consolidated the feed URL setting logic in setEnableEarlyAccess to a single line for improved readability.
- Removed redundant conditional checks while maintaining functionality for early access updates.
* refactor(AppUpdater): update feed URL structure and remove early access setting
- Modified the return structure of the latest release URL to include the channel type.
- Removed the early access setting from the IPC handler, streamlining the update process.
- Ensured the autoUpdater channel is set based on the latest release information.
* feat(UpgradeChannel): add upgrade channel management and IPC integration
- Introduced a new UpgradeChannel enum to manage different upgrade paths (latest, rc, beta).
- Updated IpcChannel to include App_SetUpgradeChannel for setting the upgrade channel.
- Enhanced ConfigManager to store and retrieve the selected upgrade channel.
- Modified AppUpdater to fetch pre-release versions based on the selected upgrade channel.
- Updated settings UI to allow users to select their preferred upgrade channel with tooltips for guidance.
- Localized new strings for upgrade channel options in multiple languages.
* refactor(AboutSettings): update version type detection and localize upgrade channel tooltips
- Changed version type detection to use the UpgradeChannel enum for better clarity.
- Localized success messages for switching upgrade channels to enhance user experience.
* chore: update version to 1.4.4-beta.1 and refactor upgrade channel handling in AboutSettings
- Updated package version to 1.4.4-beta.1.
- Renamed version type detection function to getVersionChannel for clarity.
- Refactored available version options to getAvailableTestChannels for better organization.
- Added logic to clear update info when switching upgrade channels and when toggling early access settings.
* chore: update version to 1.4.4 in package.json
* fix lint error
* feat(AppUpdater): enhance upgrade channel management and localization
- Added cancellation functionality for ongoing downloads in AppUpdater.
- Introduced a new upgrade channel option for the latest stable version.
- Updated IPC handlers to cancel downloads when changing early access settings or upgrade channels.
- Localized new strings for the latest version option in multiple languages.
- Refactored AboutSettings to include the latest version in the upgrade channel selection.
* refactor(AboutSettings): remove version channel detection logic
- Eliminated the getVersionChannel function to simplify version handling.
- Updated AboutSettings to streamline upgrade channel management.
* feat(AboutSettings): set default upgrade channel to latest
- Updated the AboutSettings component to set the default value of the upgrade channel to the latest option, enhancing user experience in channel selection.
* refactor(AboutSettings): simplify upgrade channel change handling
- Removed individual success messages for different upgrade channels in the handleUpgradeChannelChange function, streamlining the code and improving maintainability.
* refactor: file actions into FileAction service (#7413)
* refactor: file actions into FileAction service
Moved file sorting, deletion, and renaming logic from FilesPage to a new FileAction service for better modularity and reuse. Updated FileList and FilesPage to use the new service functions, and improved the delete button UI in FileList.
* fix: add tag collapse state management for assistants (#7436)
Add tag collapse state management for assistants
Introduces a collapsedTags state to manage the collapsed/expanded state of tag groups in the assistants list. Updates useTags and AssistantsTab to use this state, and adds actions to toggle and initialize tag collapse in the Redux store.
* fix(model): doubao thinking param (#7499)
* feat: Implement occupied directories handling during data copy (#7485)
* feat: Implement occupied directories handling during data copy
- Added `occupiedDirs` constant to manage directories that should not be copied.
- Enhanced the `copyOccupiedDirsInMainProcess` function to copy occupied directories to a new app data path in the main process.
- Updated IPC and preload APIs to support passing occupied directories during the copy operation.
- Modified the DataSettings component to utilize the new copy functionality with occupied directories.
* fix: Improve occupied directories handling during data copy
- Updated the filter logic in the `registerIpc` function to resolve directory paths correctly.
- Modified the `DataSettings` component to pass the correct occupied directories format during the copy operation.
* feat: add appcode (#7507)
Co-authored-by: zhaochenxue <zhaochenxue@bixin.cn>
* fix: non streamoutput sometimes (#7512)
* feat(migrate): add default settings for assistants during migration
- Introduced a new migration step to assign default settings for assistants that lack configuration.
- Default settings include temperature, context count, and other parameters to ensure consistent behavior across the application.
* chore(store): increment version number to 115 for persisted reducer
* Revert "feat: Update API Key Management Interface (#3444)"
This reverts commit 31b3ce1049.
* feat: 一些UI上的优化和重构 (#7479)
- 调整AntdProvider中主题配置,包括颜色、尺寸
- 重构聊天气泡模式的样式
- 重构多选模式的样式
- 添加Selector组件取代ant Select组件
- 重构消息搜索弹窗界面
- 重构知识库搜索弹窗界面
- 优化其他弹框UI
* fix: bailian reranker (#7518)
* feat: implement Python MCP server using existing Pyodide infrastructure (#7506)
* refactor: rename isWindows to isWin for consistency across main/renderer (#7530)
refactor: rename isWindows to isWin for consistency across components
* refactor: data migration modal logic in DataSettings (#7503)
* refactor: data migration modal logic in DataSettings
Moved showProgressModal and startMigration functions inside the useEffect hook and added t as a dependency. This improves encapsulation and ensures translation updates are handled correctly.
* remove trailing whitespace in DataSettings.tsx
Cleaned up a line by removing unnecessary trailing whitespace in the DataSettings component.
* fix: clear search cache on resending (#7510)
* fix: Resolve vllm bad request caused by always sending dimensions in embedding requests (#7525)
fix(知识库): 将dimensions字段改为可选并修复相关逻辑
* feat: Support custom registry address when configuring mcp for npm & fix lint error (#7531)
* feat: Support custom registry address when configuring mcp for npm
* fix: lint
* refactor(GeminiAPIClient): separate model and user message handling to adapt vertex (#7511)
- Introduced a new modelParts array to manage model-related messages separately from user messages.
- Updated the logic to push model messages to currentReqMessages only if they exist, improving clarity and structure.
- Adjusted the return order of messages in buildSdkMessages to ensure history is appended correctly.
- Enhanced McpToolChunkMiddleware to reset tool processing state output when output is present.
* feat: enhance WindowFooter with show/hide functionality for UI elements
- Added state management to control visibility of UI elements in the WindowFooter.
- Implemented a timer to automatically hide elements after a period of inactivity.
- Updated hotkey handlers to reset the visibility timer on user interaction.
- Modified styled component to reflect the new visibility logic.
* fix(SelectionAssistant): opacity slider too slow when sliding in settings page (#7537)
feat: enhance opacity control in Selection Assistant Settings
- Added state management for opacity value in SelectionAssistantSettings component.
- Updated Slider component to use the new opacity state instead of the previous actionWindowOpacity variable.
- Ensured onChangeComplete updates the actionWindowOpacity accordingly.
* feat(AihubmixAPIClient): add getBaseURL method to handle client base URL retrieval
* fix(migrate): restore upgradeChannel setting in migration logic
- Reintroduced the upgradeChannel setting to the state during the migration process, ensuring it defaults to LATEST when applicable.
- Adjusted the migration logic to maintain consistency in settings management.
---------
Co-authored-by: 自由的世界人 <3196812536@qq.com>
Co-authored-by: one <wangan.cs@gmail.com>
Co-authored-by: chenxue <DDU1222@users.noreply.github.com>
Co-authored-by: zhaochenxue <zhaochenxue@bixin.cn>
Co-authored-by: SuYao <sy20010504@gmail.com>
Co-authored-by: kangfenmao <kangfenmao@qq.com>
Co-authored-by: Teo <cheesen.xu@gmail.com>
Co-authored-by: Chen Tao <70054568+eeee0717@users.noreply.github.com>
Co-authored-by: LiuVaayne <10231735+vaayne@users.noreply.github.com>
Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
Co-authored-by: Wang Jiyuan <59059173+EurFelux@users.noreply.github.com>
Co-authored-by: 陈天寒 <silenceboychen@gmail.com>
Co-authored-by: fullex <0xfullex@gmail.com>
421 lines
8.6 KiB
TypeScript
421 lines
8.6 KiB
TypeScript
export const imageExts = ['.jpg', '.jpeg', '.png', '.gif', '.bmp', '.webp']
|
||
export const videoExts = ['.mp4', '.avi', '.mov', '.wmv', '.flv', '.mkv']
|
||
export const audioExts = ['.mp3', '.wav', '.ogg', '.flac', '.aac']
|
||
export const documentExts = ['.pdf', '.doc', '.docx', '.pptx', '.xlsx', '.odt', '.odp', '.ods']
|
||
export const thirdPartyApplicationExts = ['.draftsExport']
|
||
export const bookExts = ['.epub']
|
||
const textExtsByCategory = new Map([
|
||
[
|
||
'language',
|
||
[
|
||
'.js',
|
||
'.mjs',
|
||
'.cjs',
|
||
'.ts',
|
||
'.jsx',
|
||
'.tsx', // JavaScript/TypeScript
|
||
'.py', // Python
|
||
'.java', // Java
|
||
'.cs', // C#
|
||
'.cpp',
|
||
'.c',
|
||
'.h',
|
||
'.hpp',
|
||
'.cc',
|
||
'.cxx',
|
||
'.cppm',
|
||
'.ipp',
|
||
'.ixx', // C/C++
|
||
'.php', // PHP
|
||
'.rb', // Ruby
|
||
'.pl', // Perl
|
||
'.go', // Go
|
||
'.rs', // Rust
|
||
'.swift', // Swift
|
||
'.kt',
|
||
'.kts', // Kotlin
|
||
'.scala', // Scala
|
||
'.lua', // Lua
|
||
'.groovy', // Groovy
|
||
'.dart', // Dart
|
||
'.hs', // Haskell
|
||
'.clj',
|
||
'.cljs', // Clojure
|
||
'.elm', // Elm
|
||
'.erl', // Erlang
|
||
'.ex',
|
||
'.exs', // Elixir
|
||
'.ml',
|
||
'.mli', // OCaml
|
||
'.fs', // F#
|
||
'.r',
|
||
'.R', // R
|
||
'.sol', // Solidity
|
||
'.awk', // AWK
|
||
'.cob', // COBOL
|
||
'.asm',
|
||
'.s', // Assembly
|
||
'.lisp',
|
||
'.lsp', // Lisp
|
||
'.coffee', // CoffeeScript
|
||
'.ino', // Arduino
|
||
'.jl', // Julia
|
||
'.nim', // Nim
|
||
'.zig', // Zig
|
||
'.d', // D语言
|
||
'.pas', // Pascal
|
||
'.vb', // Visual Basic
|
||
'.rkt', // Racket
|
||
'.scm', // Scheme
|
||
'.hx', // Haxe
|
||
'.as', // ActionScript
|
||
'.pde', // Processing
|
||
'.f90',
|
||
'.f',
|
||
'.f03',
|
||
'.for',
|
||
'.f95', // Fortran
|
||
'.adb',
|
||
'.ads', // Ada
|
||
'.pro', // Prolog
|
||
'.m',
|
||
'.mm', // Objective-C/MATLAB
|
||
'.rpy', // Ren'Py
|
||
'.ets', // OpenHarmony,
|
||
'.uniswap', // DeFi
|
||
'.vy', // Vyper
|
||
'.shader',
|
||
'.glsl',
|
||
'.frag',
|
||
'.vert',
|
||
'.gd' // Godot
|
||
]
|
||
],
|
||
[
|
||
'script',
|
||
[
|
||
'.sh', // Shell
|
||
'.bat',
|
||
'.cmd', // Windows批处理
|
||
'.ps1', // PowerShell
|
||
'.tcl',
|
||
'.do', // Tcl
|
||
'.ahk', // AutoHotkey
|
||
'.zsh', // Zsh
|
||
'.fish', // Fish shell
|
||
'.csh', // C shell
|
||
'.vbs', // VBScript
|
||
'.applescript', // AppleScript
|
||
'.au3', // AutoIt
|
||
'.bash',
|
||
'.nu'
|
||
]
|
||
],
|
||
[
|
||
'style',
|
||
[
|
||
'.css', // CSS
|
||
'.less', // Less
|
||
'.scss',
|
||
'.sass', // Sass
|
||
'.styl', // Stylus
|
||
'.pcss', // PostCSS
|
||
'.postcss' // PostCSS
|
||
]
|
||
],
|
||
[
|
||
'template',
|
||
[
|
||
'.vue', // Vue.js
|
||
'.pug',
|
||
'.jade', // Pug/Jade
|
||
'.haml', // Haml
|
||
'.slim', // Slim
|
||
'.tpl', // 通用模板
|
||
'.ejs', // EJS
|
||
'.hbs', // Handlebars
|
||
'.mustache', // Mustache
|
||
'.twig', // Twig
|
||
'.blade', // Blade (Laravel)
|
||
'.liquid', // Liquid
|
||
'.jinja',
|
||
'.jinja2',
|
||
'.j2', // Jinja
|
||
'.erb', // ERB
|
||
'.vm', // Velocity
|
||
'.ftl', // FreeMarker
|
||
'.svelte', // Svelte
|
||
'.astro' // Astro
|
||
]
|
||
],
|
||
[
|
||
'config',
|
||
[
|
||
'.ini', // INI配置
|
||
'.conf',
|
||
'.config', // 通用配置
|
||
'.env', // 环境变量
|
||
'.toml', // TOML
|
||
'.cfg', // 通用配置
|
||
'.properties', // Java属性
|
||
'.desktop', // Linux桌面文件
|
||
'.service', // systemd服务
|
||
'.rc',
|
||
'.bashrc',
|
||
'.zshrc', // Shell配置
|
||
'.fishrc', // Fish shell配置
|
||
'.vimrc', // Vim配置
|
||
'.htaccess', // Apache配置
|
||
'.robots', // robots.txt
|
||
'.editorconfig', // EditorConfig
|
||
'.eslintrc', // ESLint
|
||
'.prettierrc', // Prettier
|
||
'.babelrc', // Babel
|
||
'.npmrc', // npm
|
||
'.dockerignore', // Docker ignore
|
||
'.npmignore',
|
||
'.yarnrc',
|
||
'.prettierignore',
|
||
'.eslintignore',
|
||
'.browserslistrc',
|
||
'.json5',
|
||
'.tfvars'
|
||
]
|
||
],
|
||
[
|
||
'document',
|
||
[
|
||
'.txt',
|
||
'.text', // 纯文本
|
||
'.md',
|
||
'.mdx', // Markdown
|
||
'.html',
|
||
'.htm',
|
||
'.xhtml', // HTML
|
||
'.xml', // XML
|
||
'.org', // Org-mode
|
||
'.wiki', // Wiki
|
||
'.tex',
|
||
'.bib', // LaTeX
|
||
'.rst', // reStructuredText
|
||
'.rtf', // 富文本
|
||
'.nfo', // 信息文件
|
||
'.adoc',
|
||
'.asciidoc', // AsciiDoc
|
||
'.pod', // Perl文档
|
||
'.1',
|
||
'.2',
|
||
'.3',
|
||
'.4',
|
||
'.5',
|
||
'.6',
|
||
'.7',
|
||
'.8',
|
||
'.9', // man页面
|
||
'.man', // man页面
|
||
'.texi',
|
||
'.texinfo', // Texinfo
|
||
'.readme',
|
||
'.me', // README
|
||
'.changelog', // 变更日志
|
||
'.license', // 许可证
|
||
'.authors', // 作者文件
|
||
'.po',
|
||
'.pot'
|
||
]
|
||
],
|
||
[
|
||
'data',
|
||
[
|
||
'.json', // JSON
|
||
'.jsonc', // JSON with comments
|
||
'.yaml',
|
||
'.yml', // YAML
|
||
'.csv',
|
||
'.tsv', // 分隔值文件
|
||
'.edn', // Clojure数据
|
||
'.jsonl',
|
||
'.ndjson', // 换行分隔JSON
|
||
'.geojson', // GeoJSON
|
||
'.gpx', // GPS Exchange
|
||
'.kml', // Keyhole Markup
|
||
'.rss',
|
||
'.atom', // Feed格式
|
||
'.vcf', // vCard
|
||
'.ics', // iCalendar
|
||
'.ldif', // LDAP数据交换
|
||
'.pbtxt',
|
||
'.map'
|
||
]
|
||
],
|
||
[
|
||
'build',
|
||
[
|
||
'.gradle', // Gradle
|
||
'.make',
|
||
'.mk', // Make
|
||
'.cmake', // CMake
|
||
'.sbt', // SBT
|
||
'.rake', // Rake
|
||
'.spec', // RPM spec
|
||
'.pom',
|
||
'.build', // Meson
|
||
'.bazel' // Bazel
|
||
]
|
||
],
|
||
[
|
||
'database',
|
||
[
|
||
'.sql', // SQL
|
||
'.ddl',
|
||
'.dml', // DDL/DML
|
||
'.plsql', // PL/SQL
|
||
'.psql', // PostgreSQL
|
||
'.cypher', // Cypher
|
||
'.sparql' // SPARQL
|
||
]
|
||
],
|
||
[
|
||
'web',
|
||
[
|
||
'.graphql',
|
||
'.gql', // GraphQL
|
||
'.proto', // Protocol Buffers
|
||
'.thrift', // Thrift
|
||
'.wsdl', // WSDL
|
||
'.raml', // RAML
|
||
'.swagger',
|
||
'.openapi' // API文档
|
||
]
|
||
],
|
||
[
|
||
'version',
|
||
[
|
||
'.gitignore', // Git ignore
|
||
'.gitattributes', // Git attributes
|
||
'.gitconfig', // Git config
|
||
'.hgignore', // Mercurial ignore
|
||
'.bzrignore', // Bazaar ignore
|
||
'.svnignore', // SVN ignore
|
||
'.githistory' // Git history
|
||
]
|
||
],
|
||
[
|
||
'subtitle',
|
||
[
|
||
'.srt',
|
||
'.sub',
|
||
'.ass' // 字幕格式
|
||
]
|
||
],
|
||
[
|
||
'log',
|
||
[
|
||
'.log',
|
||
'.rpt' // 日志和报告 (移除了.out,因为通常是二进制可执行文件)
|
||
]
|
||
],
|
||
[
|
||
'eda',
|
||
[
|
||
'.v',
|
||
'.sv',
|
||
'.svh', // Verilog/SystemVerilog
|
||
'.vhd',
|
||
'.vhdl', // VHDL
|
||
'.lef',
|
||
'.def', // LEF/DEF
|
||
'.edif', // EDIF
|
||
'.sdf', // SDF
|
||
'.sdc',
|
||
'.xdc', // 约束文件
|
||
'.sp',
|
||
'.spi',
|
||
'.cir',
|
||
'.net', // SPICE
|
||
'.scs', // Spectre
|
||
'.asc', // LTspice
|
||
'.tf', // Technology File
|
||
'.il',
|
||
'.ils' // SKILL
|
||
]
|
||
],
|
||
[
|
||
'game',
|
||
[
|
||
'.mtl', // Material Template Library
|
||
'.x3d', // X3D文件
|
||
'.gltf', // glTF JSON
|
||
'.prefab', // Unity预制体 (YAML格式)
|
||
'.meta' // Unity元数据文件 (YAML格式)
|
||
]
|
||
],
|
||
[
|
||
'other',
|
||
[
|
||
'.mcfunction', // Minecraft函数
|
||
'.jsp', // JSP
|
||
'.aspx', // ASP.NET
|
||
'.ipynb', // Jupyter Notebook
|
||
'.cake',
|
||
'.ctp', // CakePHP
|
||
'.cfm',
|
||
'.cfc' // ColdFusion
|
||
]
|
||
]
|
||
])
|
||
|
||
export const textExts = Array.from(textExtsByCategory.values()).flat()
|
||
|
||
export const ZOOM_LEVELS = [0.25, 0.33, 0.5, 0.67, 0.75, 0.8, 0.9, 1, 1.1, 1.25, 1.5, 1.75, 2, 2.5, 3, 4, 5]
|
||
|
||
// 从 ZOOM_LEVELS 生成 Ant Design Select 所需的 options 结构
|
||
export const ZOOM_OPTIONS = ZOOM_LEVELS.map((level) => ({
|
||
value: level,
|
||
label: `${Math.round(level * 100)}%`
|
||
}))
|
||
|
||
export const ZOOM_SHORTCUTS = [
|
||
{
|
||
key: 'zoom_in',
|
||
shortcut: ['CommandOrControl', '='],
|
||
editable: false,
|
||
enabled: true,
|
||
system: true
|
||
},
|
||
{
|
||
key: 'zoom_out',
|
||
shortcut: ['CommandOrControl', '-'],
|
||
editable: false,
|
||
enabled: true,
|
||
system: true
|
||
},
|
||
{
|
||
key: 'zoom_reset',
|
||
shortcut: ['CommandOrControl', '0'],
|
||
editable: false,
|
||
enabled: true,
|
||
system: true
|
||
}
|
||
]
|
||
|
||
export const KB = 1024
|
||
export const MB = 1024 * KB
|
||
export const GB = 1024 * MB
|
||
export const defaultLanguage = 'en-US'
|
||
|
||
export enum FeedUrl {
|
||
PRODUCTION = 'https://releases.cherry-ai.com',
|
||
GITHUB_LATEST = 'https://github.com/CherryHQ/cherry-studio/releases/latest/download'
|
||
}
|
||
|
||
export enum UpgradeChannel {
|
||
LATEST = 'latest', // 最新稳定版本
|
||
RC = 'rc', // 公测版本
|
||
BETA = 'beta' // 预览版本
|
||
}
|
||
|
||
export const defaultTimeout = 5 * 1000 * 60
|
||
|
||
export const occupiedDirs = ['logs', 'Network', 'Partitions/webview/Network']
|