mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-19 14:41:24 +08:00
a32fad06a0
32 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
5dac1f5867
|
feat: support more terminal in code tools (#10192)
* feat(CodeTools): add support for terminal selection on macOS - Introduced terminal selection functionality in CodeTools, allowing users to choose from available terminal applications. - Implemented caching for terminal availability checks to enhance performance. - Updated CodeToolsService to preload available terminals and check their availability. - Enhanced UI in CodeToolsPage to display terminal options and handle user selection. - Added new IPC channel for retrieving available terminals from the main process. * lint errs * format * support wezterm * support terminal * support ghostty * support warp kitty * fix github scanner issues * fix all github issues * support windows * support windows * suppport hyper * Refactor terminal command execution for macOS applications to use shell scripts instead of AppleScript, improving compatibility and performance. * Remove Hyper terminal configuration from shared constants * update lint * fix(i18n): Auto update translations for PR #10192 * fix platform checking * format * feat: add Tabby terminal configuration for macOS * fix wrap terminal * delete warp --------- Co-authored-by: GitHub Action <action@github.com> |
||
|
|
ee95fad7e5
|
feat: add support for iflow cli (#10198)
Signed-off-by: 本x <liyuyun.lyy@alibaba-inc.com> |
||
|
|
8f5e89d69a
|
fix: replace hardcoded window size on first start (#9669)
* fix: replace hardcoded window size on first start Signed-off-by: dev <verc20.dev@proton.me> * fix: change MIN_WINDOW_WIDTH from 1080 to 960 --------- Signed-off-by: dev <verc20.dev@proton.me> |
||
|
|
332ba5d678
|
feat: support openai codex (#9332)
* support openai codex * lint * refactor: remove unused codeTools enum from constant.ts * fix build * fix lin * fix: add support for qwenCode CLI tool and improve error handling in CodeToolsService |
||
|
|
d0cf3179a2
|
feat(translate): brand new translate feature (#8513)
* refactor(translate): 将翻译设置组件抽离为独立文件 * refactor(translate): 统一变量名translateHistory为translateHistories * perf(translate): 翻译页面的输入处理性能优化 添加防抖函数来优化文本输入和键盘事件的处理,减少不必要的状态更新和翻译请求 * refactor(translate): 将输入区域组件抽离为独立文件 重构翻译页面,将输入区域相关逻辑和UI抽离到单独的InputArea组件中 优化代码结构,提高可维护性 buggy: waiting for merge * revert: 恢复main的translate page * refactor(translate): 缓存源语言状态 * refactor(translate): 提取翻译设置组件 将翻译设置功能提取为独立组件,减少主页面代码复杂度 * build: 添加 react-transition-group 及其类型定义依赖 * refactor(translate): 将翻译历史组件拆分为独立文件并优化布局结构 * refactor(translate): 调整翻译页面布局和样式 统一操作栏的padding样式,将输入和输出区域的容器样式分离以提高可维护性 * feat(翻译): 添加语言交换功能 添加源语言与目标语言交换功能按钮 为AWS Bedrock添加i18n * fix(自动翻译): 在翻译提示中添加去除前缀的说明 在翻译提示中添加说明,要求翻译时去除文本中的"[to be translated]"前缀 * feat(translate): 实现翻译历史列表的虚拟滚动以提高性能 添加虚拟列表组件并应用于翻译历史页面,优化长列表渲染性能 * refactor(translate): 移除未使用的InputArea组件 * feat(translate): 添加模型选择器到翻译页面并移除设置中的模型选择 将模型选择器从翻译设置移动到翻译页面主界面,优化模型选择流程 * style(translate): 为输出占位文本添加不可选中样式 * feat(翻译): 添加自定义语言支持 - 新增 CustomTranslateLanguage 类型定义 - 在数据库中增加 translate_languages 表和相关 CRUD 操作 - 实现自定义语言的添加、删除、更新和查询功能 * feat(翻译设置): 新增自定义语言管理和翻译模型配置功能 添加翻译设置页面,包含自定义语言表格、添加/编辑模态框、翻译模型选择和提示词配置 * feat(翻译设置): 实现自定义语言管理功能 添加自定义语言表格组件及模态框,支持增删改查操作 修复数据库字段命名不一致问题,将langcode改为langCode 新增内置语言代码列表用于校验 添加多语言支持及错误提示 * docs(TranslateService): 为自定义语言功能添加JSDoc注释 * feat(翻译): 添加获取所有翻译语言选项的功能 新增getTranslateOptions函数,用于合并内置翻译语言和自定义语言选项。当获取自定义语言失败时,自动回退到只返回内置语言选项。 * refactor(translate): 重构翻译功能代码,优化语言选项管理和类型定义 - 将翻译语言选项管理集中到useTranslate钩子中 - 修改LanguageCode类型为string以支持自定义语言 - 废弃旧的getLanguageByLangcode方法,提供新的实现 - 统一各组件对翻译语言选项的获取方式 - 优化类型定义,移除冗余类型TranslateLanguageVarious * refactor(translate): 重构翻译相关组件,提取LanguageSelect为独立组件并优化代码结构 * fix(AssistantService): 添加对未知目标语言的错误处理 当目标语言未知时抛出错误并记录日志,防止后续处理异常 * refactor(TranslateSettings): 重命名并重构自定义语言设置组件 将 CustomLanguageTable 重命名为 CustomLanguageSettings 并重构其实现 增加对自定义语言的增删改查功能 调整加载状态的高度以适应新组件 * style(settings): 调整设置页面布局样式以改善显示效果 移除重复的高度和padding设置,统一在内容容器中设置高度 * refactor(translate): 重命名变量 将 builtinTranslateLanguageOptions 重命名为 builtinLanguages 以提高代码可读性 更新相关引用以保持一致性 * refactor(TranslateSettings): 使用useCallback优化删除函数以避免不必要的重渲染 * feat(翻译设置): 为自定义语言设置添加标签本地化 为自定义语言设置中的"Value"和"langCode"字段添加中文标签 * style(TranslateSettings): 为SettingGroup添加flex样式以改善布局 * style(TranslateSettings): 表格样式调整 * docs(技术文档): 添加translate_languages表的技术文档 添加translate_languages表的技术说明文档,包含表结构、字段定义及业务约束说明 * feat(翻译): 添加对不支持语言的错误处理并规范化语言代码 - 在翻译服务中添加对不支持语言的错误提示 - 将自定义语言的langCode统一转为小写 - 完善QwenMT模型的语言映射表 * docs(messageUtils): 标记废弃的函数 * feat(消息工具): 添加通过ID查找翻译块的功能并优化翻译错误处理 添加findTranslationBlocksById函数通过消息ID从状态中查询翻译块 在翻译失败时清理无效的翻译块并显示错误提示 * fix(ApiService): 修复翻译请求错误处理逻辑 捕获翻译请求中的错误并通过onError回调传递,避免静默失败 * fix(translate): 调整双向翻译语言显示的最小宽度 * fix(translate): 修复语言交换条件判断逻辑 添加对双向翻译的限制检查,防止在双向翻译模式下错误交换语言 * feat(i18n): 添加翻译功能的自定义语言支持 * refactor(store): 将 targetLanguage 类型从 string 改为 LanguageCode * refactor(types): 将语言代码类型从字符串改为LanguageCode * refactor: 统一使用@logger导入loggerService 将项目中从@renderer/services/LoggerService导入loggerService的引用改为从@logger导入,以统一日志服务的引用方式 * refactor(translate): 移除旧的VirtualList组件并替换为DynamicVirtualList * refactor(translate): 移除未使用的useCallback导入 * refactor(useTranslate): 调整导入语句顺序以保持一致性 * fix(translate): 修复 useEffect 依赖项缺失问题 * refactor: 调整导入顺序 * refactor(i18n): 移除未使用的翻译字段并更新部分翻译内容 * fix(ApiService): 将completions方法替换为completionsForTrace以修复追踪问题 * refactor(TranslateSettings): 替换Spin组件为自定义加载图标 使用SvgSpinners180Ring替换antd的Spin组件以保持UI一致性 * refactor(TranslateSettings): 替换 HStack 为 Space 组件以优化布局 * style(TranslateSettings): 为删除按钮添加危险样式以提升视觉警示 * style(TranslateSettings): 移除表格容器中多余的justify-content属性 * fix(TranslateSettings): 添加默认emoji旗帜 * refactor(translate): 将语言映射函数移动到translate配置文件 将mapLanguageToQwenMTModel函数及相关映射表从utils模块移动到config/translate模块 * fix(translate): 修复couldTranslate语义错误 * docs(i18n): 更新日语翻译中的错误翻译 * refactor(translate): 将历史记录列表改为抽屉组件并优化样式 * fix(TranslateService): 修复添加自定义语言时缺少await的问题 * fix(TranslateService): 修复变量名错误,使用正确的langCode参数 在添加自定义语言时,错误地使用了value变量而非langCode参数,导致重复检查失效。修正为使用正确的参数名并更新相关错误信息。 * refactor(TranslateSettings): 使用函数式更新优化状态管理 * style(TranslatePromptSettings): 替换按钮为自定义样式组件 使用styled-components创建自定义ResetButton组件替换antd的Button 统一按钮样式与整体设计风格 * style(settings): 调整设置页面内边距从20px减少到10px * refactor(translate): 类型重命名 将Language更名为TranslateLanguage 将LanguageCode更名为TranslateLanguageCode * refactor(LanguageSelect): 提取默认语言渲染逻辑到独立函数 将重复的语言渲染逻辑提取为 defaultLanguageRenderer 函数,减少代码重复并提高可维护性 * refactor(TranslateSettings): 使用antd Form重构自定义语言模态框表单逻辑 重构自定义语言模态框,将原有的手动状态管理改为使用antd Form组件管理表单状态 表单验证逻辑整合到handleSubmit中,提高代码可维护性 修复emoji显示不同步的问题 * feat(翻译设置): 添加自定义语言表单的帮助文本和布局优化 为自定义语言表单的语言代码和语言名称字段添加帮助文本提示 重构表单布局,使用更合理的表单项排列方式 * refactor(TranslateSettings): 调整 CustomLanguageModal 中 EmojiPicker 的布局结构 * style(TranslateSettings): 调整自定义语言模态框按钮容器的内边距 * feat(翻译设置): 添加语言代码为空时的错误提示并优化表单验证 将表单验证逻辑从手动校验改为使用antd Form的rules属性 添加语言代码为空的错误提示信息 移除未使用的导入和日志代码 * feat(翻译设置): 改进自定义语言表单验证和错误处理 - 添加语言已存在的错误提示信息 - 使用国际化文本替换硬编码错误信息 - 重构表单布局,移除不必要的样式组件 - 增加语言代码存在性验证 - 改进表单标签和帮助信息的显示方式 * fix(i18n): 修正语言代码占位符的大小写格式 * style(translate): 移除设置页面中多余的翻译图标 * refactor(translate): 移动 OperationBar 样式并调整 LanguageSelect 宽度 将 OperationBar 样式从独立文件移至 TranslatePage 组件内 为 LanguageSelect 添加最小宽度并移除硬编码宽度 * refactor(设置页): 替换LanguageSelect为Selector组件以统一样式 * feat(翻译): 重构翻译功能并添加历史记录管理 将翻译相关逻辑从useTranslate钩子移动到TranslatePage组件 添加翻译历史记录的保存、删除和清空功能 在输入框底部显示预估token数量 * refactor(translate): 重构翻译页面代码结构并添加注释 将相关hooks和状态分组整理,添加清晰的注释说明各功能块作用 优化代码可读性和维护性 * refactor(TranslateService): 移除store依赖并优化错误处理 - 移除对store的依赖,直接使用getDefaultTranslateAssistant获取翻译助手 - 将翻译失败的错误消息从'failed'改为更明确的'empty' * feat(翻译): 优化翻译服务错误处理和错误信息展示 重构翻译服务逻辑,将错误处理和模型检查移至统一入口。添加翻译结果为空时的错误提示,并改进错误信息展示,包含具体错误原因。同时简化翻译页面调用逻辑,使用统一的翻译服务接口。 * style(translate): 为token计数添加右侧内边距以改善视觉间距 * refactor(translate): 移除useTranslate中未使用的状态并优化组件结构 将translatedContent和translating状态从useTranslate钩子中移除,改为在TranslatePage组件中直接使用redux状态 简化useTranslate的文档注释,仅保留核心功能描述 * refactor(LanguageSelect): 提取剩余props避免重复传递 避免将extraOptionsAfter等已解构的props再次传递给Select组件 * docs(i18n): 更新多语言翻译文件,添加缺失的翻译字段 * refactor(translate): 将历史记录操作移至TranslateService * style(LanguageSelect): 移除多余的 Space.Compact 包装 * fix(TranslateSettings): 修复编辑自定义语言时重复校验语言代码的问题 * refactor(translate): 调整翻译页面布局结构,优化操作栏样式 将输入输出区域整合为统一容器,调整操作栏宽度和间距 移动设置和历史按钮到输出操作栏,简化布局结构 * style(translate): 调整操作栏样式间距 * refactor(窗口): 将窗口最小尺寸常量提取到共享配置中 将硬编码的窗口最小宽度和高度值替换为从共享配置导入的常量,提高代码可维护性 * refactor(translate): 重构翻译页面操作栏布局 将操作栏从三个独立部分改为网格布局,使用InnerOperationBar组件统一样式 移除冗余的operationBarWidth变量,简化样式代码 * refactor(translate): 替换自定义复制按钮为原生按钮组件 移除自定义的CopyButton组件,直接使用Ant Design的原生Button组件来实现复制功能,保持UI一致性并减少冗余代码 * refactor(translate): 重构翻译页面操作栏布局 将操作按钮从左侧移动到右侧,并移除不必要的HStack组件 调整翻译按钮位置并保留其工具提示功能 * fix(translate): 修复语言选择器宽度不一致问题 为源语言和目标语言选择器添加统一的宽度样式,保持UI一致性 * feat(窗口): 添加获取窗口尺寸和监听窗口大小变化的功能 添加 Windows_GetSize IPC 通道用于获取窗口当前尺寸 添加 Windows_Resize IPC 通道用于监听窗口大小变化 新增 useWindowSize hook 方便在渲染进程中使用窗口尺寸 * feat(窗口大小): 优化窗口大小变化处理并添加响应式布局 使用debounce优化窗口大小变化的处理,避免频繁触发更新 为翻译页面添加响应式布局,根据窗口宽度和导航栏位置动态调整模型选择器宽度 * feat(WindowService): 添加窗口最大化/还原时的尺寸变化事件 在窗口最大化或还原时发送尺寸变化事件,以便界面可以响应这些状态变化 * refactor(hooks): 将窗口大小变化的日志级别从debug改为silly * feat(翻译配置): 添加对粤语的语言代码支持 为翻译配置添加对'zh-yue'语言代码的处理,返回对应的'Cantonese'值 * fix(TranslateSettings): 修复自定义语言模态框中语言代码重复校验问题 当编辑已存在的自定义语言时,如果输入的语言代码已存在且与原代码不同,则抛出错误提示 * fix: 修复拼写错误,将"Unkonwn"改为"Unknown" * fix(useTranslate): 添加加载状态检查防止未加载时返回错误数据 当翻译语言尚未加载完成时,返回UNKNOWN而非尝试查找语言 * feat(组件): 添加模型选择按钮组件用于选择模型 * refactor(translate): 重构翻译页面模型选择器和按钮布局 简化模型选择逻辑,移除未使用的代码和复杂样式计算 将ModelSelector替换为ModelSelectButton组件 将TranslateButton提取为独立组件 * refactor(hooks): 重命名并完善窗口尺寸钩子函数 将 useWindow.ts 重命名为 useWindowSize.ts 并添加详细注释 * docs(i18n): 修正语言代码标签的大小写 * style(TranslateSettings): 调整自定义语言模态框中表单标签的宽度 * fix(CustomLanguageModal): disable mask closing for the custom language modal * style: 调整组件间距和图标大小 优化 TranslatePage 内容容器的内边距和间距,并增大 ModelSelectButton 的图标尺寸 * style(translate): 调整翻译历史列表项高度和样式结构 重构翻译历史列表项的样式结构,将高度从120px增加到140px,并拆分样式组件以提高可维护性 * fix(translate): 点击翻译历史item后关闭drawer --------- Co-authored-by: suyao <sy20010504@gmail.com> |
||
|
|
efda20c143
|
feat: support bypass proxy (#8791)
* feat(ProxyManager): implement SelectiveDispatcher for localhost handling - Added SelectiveDispatcher to manage proxy and direct connections based on the hostname. - Introduced isLocalhost function to check for localhost addresses. - Updated ProxyManager to bypass proxy for localhost in dispatch methods and set proxy bypass rules. - Enhanced global dispatcher setup to utilize SelectiveDispatcher for both EnvHttpProxyAgent and SOCKS dispatcher. * refactor(ProxyManager): update axios configuration to use fetch adapter - Changed axios to use the 'fetch' adapter for proxy requests. - Removed previous proxy settings for axios, streamlining the configuration. - Updated HTTP methods to bind with the new proxy agent. * feat(Proxy): add support for proxy bypass rules - Updated IPC handler to accept optional bypass rules for proxy configuration. - Enhanced ProxyManager to store and utilize bypass rules for localhost and other specified addresses. - Modified settings and UI components to allow users to input and manage bypass rules. - Added translations for bypass rules in multiple languages. * feat(ProxyManager): add HTTP_PROXY environment variable support - Added support for the HTTP_PROXY environment variable in ProxyManager to enhance proxy configuration capabilities. * lint * refactor(ProxyManager): optimize bypass rules handling - Updated bypass rules initialization to split the rules string into an array for improved performance. - Simplified the isByPass function to directly check against the array of bypass rules. - Enhanced configuration handling to ensure bypass rules are correctly parsed from the provided settings. * refactor(ProxyManager): streamline bypass rules initialization - Consolidated the initialization of bypass rules by directly splitting the default rules string into an array. - Updated configuration handling to ensure bypass rules are correctly assigned without redundant splitting. * style(GeneralSettings): adjust proxy bypass rules input width to improve UI layout * refactor(ProxyManager): enhance proxy configuration logging and handling - Added proxy bypass rules to the configuration method for improved flexibility. - Updated logging to include bypass rules for better debugging. - Refactored the setGlobalProxy method to accept configuration parameters directly, streamlining proxy setup. - Adjusted the useAppInit hook to handle proxy settings more cleanly. * refactor(ProxyManager): implement close and destroy methods for proxy dispatcher - Added close and destroy methods to the SelectiveDispatcher class for better resource management. - Updated ProxyManager to handle the lifecycle of the proxyDispatcher, ensuring proper closure and destruction. - Enhanced error handling during dispatcher closure and destruction to prevent resource leaks. * refactor(ProxyManager): manage proxy agent lifecycle - Introduced proxyAgent property to ProxyManager for better management of the proxy agent. - Implemented error handling during the destruction of the proxy agent to prevent potential issues. - Updated the proxy setup process to ensure the proxy agent is correctly initialized and cleaned up. * refactor(ProxyManager): centralize default bypass rules management - Moved default bypass rules to a shared constant for consistency across components. - Updated ProxyManager and GeneralSettings to utilize the centralized bypass rules. - Adjusted migration logic to set default bypass rules from the shared constant, ensuring uniformity in configuration. |
||
|
|
eef20e399c
|
chore: Update channel improve (#8501)
* chore(env): add .env.example file and update .gitignore - Introduced a new .env.example file with NODE_OPTIONS configuration. - Updated .gitignore to exclude .env.example from being ignored. - Added instructions in dev.md for copying .env.example to .env. * fix(MessageTools): improve error handling and logging in message preview rendering (#8453) - Enhanced the rendering logic for message previews by adding a try-catch block to handle JSON parsing errors more gracefully. - Updated the error handling to provide clearer error messages in the preview when exceptions occur. - Added debug logging to track the rendering process of message content. * refactor(Theme): update theme management to use setTheme function - Replaced toggleTheme with setTheme for more explicit theme handling. - Removed unused SunMoon icon from TabContainer and Sidebar components. - Updated theme icon rendering logic to directly reflect the current theme state. - Adjusted ThemeProvider to include setTheme in context for better theme management. * refactor(ModelList): streamline button layout and improve accessibility - Removed tooltip wrappers from manage and add model buttons for a cleaner UI. - Introduced a new Flex container for primary and default buttons, enhancing layout consistency. - Updated button rendering to improve accessibility and user experience. * feat(ModelList): add bulk add/remove functionality for models with confirmation dialog - Implemented onAddAll and onRemoveAll functions to handle bulk actions for models. - Added confirmation dialog for adding all models to the list, enhancing user experience. - Updated translations for confirmation messages in multiple languages. * chore(languages): update languages with a script (#8445) * chore(languages): update languages with a script * refactor: update languages and merge it into constants * refactor: add usf and ush * fix(ModelEdit): enhance model type management and introduce new selection logic (#8420) * fix(ModelEdit): enhance model type management and introduce new selection logic - Added support for 'rerank' model type in the ModelEditContent component. - Refactored type selection logic to utilize new utility functions for finding differences and unions in model types. - Updated model type handling to include user selection status, improving user experience in type management. - Adjusted migration logic to initialize newType for existing models, ensuring backward compatibility. - Introduced isUserSelectedModelType utility to streamline model type checks across the application. * refactor(isFunctionCallingModel): simplify model type check logic - Replaced the inline check for 'function_calling' model type with a call to the new utility function isUserSelectedModelType, enhancing code clarity and maintainability. * feat(collection): add utility functions for array operations - Introduced `findIntersection`, `findDifference`, and `findUnion` functions to handle array operations with support for custom key selectors and comparison functions. - Removed previous implementations from `index.ts` to streamline utility exports. - Added comprehensive tests for new functions covering basic types and object types with various edge cases. * refactor(collection): rename utility functions for clarity - Renamed `findIntersection`, `findDifference`, and `findUnion` to `getIntersection`, `getDifference`, and `getUnion` respectively for improved clarity and consistency in naming. - Updated corresponding tests to reflect the new function names, ensuring all tests pass with the updated utility functions. * refactor(ModelEditContent): update model type management and improve selection logic - Replaced utility function calls to `findDifference` and `findUnion` with `getDifference` and `getUnion` for consistency. - Introduced temporary state management for model types to enhance user selection handling. - Added a reset functionality for model type selections, improving user experience. - Updated the rendering logic to conditionally disable certain model types based on user selections. * fix(ModelEditContent): enhance model type selection logic with conditional disabling - Introduced logic to conditionally disable 'rerank' and 'embedding' model types based on user selections. - Updated the state management for model types to ensure correct user selection handling. - Improved the confirmation modal to reflect the updated selection logic for better user experience. * fix(ModelEditContent): refine model type selection and update confirmation logic - Enhanced the logic for model type selection to ensure accurate user selections for 'rerank' and 'embedding'. - Updated the confirmation modal to reflect changes in selection handling, improving user experience. - Adjusted state management to correctly handle updates based on selected model types. * fix(models): update model support logic to include 'qwen3-235b-a22b-instruct' * refactor(models): rename 'newType' to 'capabilities' and update related logic in ModelEditContent and migration scripts * refactor(ModelEditContent): remove maskClosable prop for improved modal behavior * fix(ThinkingTagExtraction): add new tag configuration for 'kimi-vl-a3b-thinking' model (#8459) * feat(ThinkingTagExtraction): add new tag configuration for 'kimi-vl-a3b-thinking' model and update model regex patterns in config - Introduced a new tag configuration for the 'kimi-vl-a3b-thinking' model in ThinkingTagExtractionMiddleware. - Updated models.ts to include regex patterns for 'kimi-vl-a3b-thinking', 'llama-guard-4', and 'llama-4' to enhance model compatibility. * feat(models): add regex pattern for 'gemma3' model to enhance model compatibility * fix(RawStreamListenerMiddleware): update model check (#8433) * fix(RawStreamListenerMiddleware): update model check for Anthropic API integration - Replaced provider type check with model ID check to enhance compatibility with Claude models. - Improved clarity in the middleware logic for handling raw output from the SDK. * refactor(RawStreamListenerMiddleware): enhance model identification for Anthropic integration - Introduced a new utility function `isAnthropicModel` to streamline model checks across the codebase. - Updated middleware logic to utilize the new function for improved clarity and maintainability. - Adjusted related tests to ensure compatibility with the updated model identification approach. * test(ApiService.test): add mock for isAnthropicModel to enhance test coverage for model identification * refactor(ChatNavbar, Navbar): simplify toggle functions and remove unused fullscreen hook - Removed unnecessary useCallback functions for toggling assistants and topics, directly using the toggle functions instead. - Eliminated the unused fullscreen hook import to clean up the code. - Updated click handlers in the Navbar components for better readability and efficiency. * chore(version): 1.5.3 * style(MinAppsPage): adjust padding for AppsContainerWrapper based on navbar position - Increased padding for the AppsContainerWrapper to 50px for better spacing. - Added conditional padding for when the navbar is positioned at the top, reverting to 20px for improved layout consistency. * fix(AiProvider): remove unnecessary middleware removal logic for… (#8437) * refactor(AiProvider): remove unnecessary middleware removal logic for improved clarity * feat(PPIOAPIClient): add compatibility type check for OpenAIAPIClient * refactor(ModelEditContent): rename state variable for clarity and update model capabilities handling - Renamed `tempModelTypes` to `modelCapabilities` for improved clarity in the ModelEditContent component. - Updated state management and logic to consistently use the new `modelCapabilities` variable throughout the component, enhancing readability and maintainability. * Feat/vertex-claude-support (#7564) * feat(migrate): add default settings for assistants during migration - Introduced a new migration step to assign default settings for assistants that lack configuration. - Default settings include temperature, context count, and other parameters to ensure consistent behavior across the application. * chore(store): increment version number to 115 for persisted reducer * feat(vertex-sdk): integrate Anthropic Vertex SDK and add access token retrieval - Added support for the new `@anthropic-ai/vertex-sdk` in the project. - Introduced a new IPC channel `VertexAI_GetAccessToken` to retrieve access tokens. - Implemented `getAccessToken` method in `VertexAIService` to handle service account authentication. - Updated the `IpcChannel` enum and related IPC handlers to support the new functionality. - Enhanced the `VertexAPIClient` to utilize the `AnthropicVertexClient` for model handling. - Refactored existing code to accommodate the integration of the Vertex SDK and improve modularity. * feat(vertex-ai): enhance VertexAI settings and API host management - Added a new method to format the API host URL in both AnthropicVertexClient and VertexAPIClient. - Updated getBaseURL methods to utilize the new formatting logic. - Enhanced VertexAISettings component to include an input for API host configuration, with help text for user guidance. - Updated localization files to include new help text for the API host field in multiple languages. * fix(vertex-sdk): update baseURL handling and patch dependencies - Refactored baseURL assignment in AnthropicVertexClient to ensure it defaults to undefined when the URL is empty. - Updated yarn.lock to reflect changes in dependency resolution and checksum for @anthropic-ai/vertex-sdk patch. * refactor(VertexAISetting): use provider.id rather than provider * refactor: improve API host formatting in AnthropicVertexClient - Updated the `formatApiHost` method to streamline host URL handling. - Introduced a helper function to determine if the original host should be used based on its format. - Ensured consistent appending of the `/v1/` path for valid API requests. * fix: handle empty host in AnthropicVertexClient - Added a check in the `getBaseURL` method to return the host if it is empty, preventing potential errors. - Included a console log for the base URL to aid in debugging and verification of the URL formatting. * feat(AnthropicVertexClient): add logging for authentication errors and mock client in tests - Introduced logging functionality in AnthropicVertexClient to replace console.error with logger service for better error tracking. - Added mock implementation for AnthropicVertexClient in tests to enhance testing capabilities. - Updated package.json to include the @aws-sdk/client-s3 dependency. * feat(tests): add comprehensive tests for client compatibility types - Introduced a new test file to validate compatibility types for various API clients including OpenAI, Anthropic, Gemini, Aihubmix, NewAPI, and Vertex. - Implemented mock services to facilitate testing and ensure isolation of client behavior. - Added tests for both direct API clients and decorator pattern clients, ensuring correct compatibility type returns. - Enhanced middleware compatibility logic tests to verify correct identification of compatible clients. --------- Co-authored-by: one <wangan.cs@gmail.com> * fix(mcp-tools): enhance tool lookup logic to support partial matches (#8473) * fix(mcp-tools): enhance tool lookup logic to support partial matches - Updated the tool lookup logic in `geminiFunctionCallToMcpTool` to include partial matches for both tool IDs and names, improving the flexibility of tool identification. * refactor(mcp-tools): simplify tool lookup logic for improved clarity - Refactored the tool lookup logic in `geminiFunctionCallToMcpTool` to streamline the identification process by consolidating checks for tool IDs and names into a single variable. This enhances readability and maintains functionality for partial matches. * chore(deps): update vite to rolldown-vite (#8460) * chore(deps): update vite to rolldown-vite and add new dependencies - Updated vite dependency to rolldown-vite@latest in package.json. - Added new dependencies including @emnapi/core, @emnapi/runtime, and @napi-rs/wasm-runtime in yarn.lock. - Introduced patches for atomically and file-stream-rotator packages. - Added process import in index.ts for improved functionality. * updrade vitest * not package graceful-fs * update yarn.lock * fix(AppUpdater): improve update handling and logging for test plans - Enhanced the update logic in AppUpdater to prevent sending an 'update not available' event when a test plan is enabled and the channel is not the latest. - Refactored the feed URL and channel setting into a private method for better code organization. - Added logging to provide clearer insights into the update check results and channel settings, particularly when the test plan is active. --------- Co-authored-by: kangfenmao <kangfenmao@qq.com> Co-authored-by: SuYao <sy20010504@gmail.com> Co-authored-by: one <wangan.cs@gmail.com> |
||
|
|
0453402242
|
chore(languages): update languages with a script (#8445)
* chore(languages): update languages with a script * refactor: update languages and merge it into constants * refactor: add usf and ush |
||
|
|
8bf84b26f3
|
feat(constant): add Godot scene files(.tscn) (#8362)
* feat(constant): add Godot scene files(.tscn) * fix(AttachmentPreview): consolidate file extension checks |
||
|
|
1fd92d6a5d
|
feat(constant): add .fxml file extension (#8125)
feat(常量配置): 添加对JavaFX XML文件扩展名.fxml的支持 |
||
|
|
b5f2abc930
|
fix: update default timeout configuration across API clients (#7686)
- Increased the default timeout value from 5 minutes to 10 minutes in constant.ts. - Updated GeminiAPIClient and ImageGenerationMiddleware to utilize the new defaultTimeout constant for API call timeouts, ensuring consistent timeout handling across the application. |
||
|
|
780373d5f7
|
fix: 测试版本 (#7590)
* feat(AppUpdater): add support for pre-release versions and enhance feed URL logic - Introduced a new FeedUrl for the lowest pre-release version. - Updated AppUpdater to handle early access and upgrade channel settings more effectively. - Enhanced IPC logging for early access and upgrade channel changes. - Refactored feed URL setting logic to streamline update processes. * fix(AppUpdater, ipc): enhance early access and upgrade channel handling - Added checks to prevent unnecessary cancellation of downloads when early access and upgrade channel settings remain unchanged. - Updated IPC handlers to ensure early access is enabled when switching upgrade channels if it was previously disabled. - Improved logging for better traceability of changes in early access and upgrade channel settings. * delete code * delete logs * refactor(AboutSettings): enhance upgrade channel management - Introduced logic to determine the current upgrade channel based on version. - Refactored available test channels to use a more structured approach with tooltips and labels. - Updated the method for retrieving available test channels to improve clarity and maintainability. * feat(IpcChannel, ConfigManager, AppUpdater): implement test plan and channel management - Replaced early access features with test plan and test channel options in IpcChannel and ConfigManager. - Updated IPC handlers to manage test plan and test channel settings, including logging enhancements. - Refactored AppUpdater to support fetching pre-release versions based on the selected test channel. - Modified settings and localization files to reflect the new test plan functionality. - Adjusted AboutSettings and related components to integrate test plan management and improve user experience. * format code * refactor(AppUpdater, AboutSettings): improve test channel logic and localization updates - Refactored the logic in AppUpdater to enhance the handling of test channels, ensuring correct channel retrieval based on the current version. - Updated the AboutSettings component to include useEffect for managing test channel changes and displaying appropriate warnings. - Modified localization files for multiple languages to clarify the behavior of test version switching, aligning with the new logic. |
||
|
|
4c66b205bb
|
feat: implement early access feature toggle and update related configurations (#7304)
* 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
|
||
|
|
3640d846b9
|
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. |
||
|
|
a8e23966fa
|
feat(FileStorage): add support for .doc files using word-extractor (#7374)
* feat(FileStorage): add support for .doc files and integrate word-extractor * chore(package): add word-extractor to devdependencies |
||
|
|
5f4d73b00d
|
feat: add middleware support for provider (#6176)
* feat: add middleware support for OpenAIProvider with logging capabilities - Introduced middleware functionality in OpenAIProvider to enhance completions processing. - Created AiProviderMiddlewareTypes for defining middleware interfaces and contexts. - Implemented sampleLoggingMiddleware for logging message content and processing times. - Updated OpenAIProvider constructor to accept middleware as an optional parameter. - Refactored completions method to utilize middleware for improved extensibility and logging. * refactor: streamline OpenAIProvider initialization and middleware application - Removed optional middleware parameter from OpenAIProvider constructor for simplicity. - Refactored ProviderFactory to create instances of providers and apply logging middleware consistently. - Enhanced completions method visibility by changing it from private to public. - Cleaned up unused code related to middleware handling in OpenAIProvider. * feat: enhance AiProvider with new middleware capabilities and completion context - Added public getter for provider info in BaseProvider. - Introduced finalizeSdkRequestParams hook for middleware to modify SDK-specific request parameters. - Refactored completions method in OpenAIProvider to accept a context object, improving middleware integration. - Updated middleware types to include new context structure and callback functions for better extensibility. - Enhanced logging middleware to utilize new context structure for improved logging capabilities. * refactor: enhance middleware structure and context handling in AiProvider - Updated BaseProvider and AiProvider to utilize AiProviderMiddlewareCompletionsContext for completions method. - Introduced new utility functions for middleware context creation and execution. - Refactored middleware application logic to improve extensibility and maintainability. - Replaced sampleLoggingMiddleware with a more robust LoggingMiddleware implementation. - Added new context management features for better middleware integration. * refactor: update AiProvider and middleware structure for improved completions handling - Refactored BaseProvider and AiProvider to change completions method signature from context to params. - Removed unused AiProviderMiddlewareCompletionsContext and related code for cleaner implementation. - Enhanced middleware configuration by introducing a dedicated middleware registration file. - Implemented logging middleware for completions to improve observability during processing. - Streamlined middleware application logic in ProviderFactory for better maintainability. * docs: 添加中间件编写指南文档 - 新增《如何为 AI Provider 编写中间件》文档,详细介绍中间件架构、类型及编写示例。 - 说明了中间件的执行顺序、注册方法及最佳实践,旨在帮助开发者有效创建和维护中间件。 * refactor: update completions method signatures and introduce CompletionsResult type - Changed the completions method signature in BaseProvider and AiProvider to return CompletionsResult instead of void. - Added CompletionsResult type definition to encapsulate streaming and usage metrics. - Updated middleware and related components to handle the new CompletionsResult structure, ensuring compatibility with existing functionality. - Introduced new middleware for stream adaptation to enhance chunk processing during completions. * refactor: enhance AiProvider middleware and streaming handling - Updated CompletionsResult type to support both OpenAI SDK stream and ReadableStream. - Modified CompletionsMiddleware to return CompletionsResult, improving type safety. - Introduced StreamAdapterMiddleware to adapt OpenAI SDK streams to application-specific chunk streams. - Enhanced logging in CompletionsLoggingMiddleware to capture and return results from next middleware calls. * refactor: update AiProvider and middleware for OpenAI completions handling - Renamed CompletionsResult to CompletionsOpenAIResult for clarity and updated its structure to support both OpenAI SDK and application-specific streams. - Modified completions method signatures in AiProvider and OpenAIProvider to return CompletionsOpenAIResult. - Enhanced middleware to process and adapt OpenAI SDK streams into standard chunk formats, improving overall streaming handling. - Introduced new middleware components: FinalChunkConsumerAndNotifierMiddleware and OpenAISDKChunkToStandardChunkMiddleware for better chunk processing and logging. * 删除 ExtractReasoningCompletionsMiddleware.ts 文件,清理未使用的中间件代码以提高代码整洁性和可维护性。 * refactor: consolidate middleware types and improve imports - Replaced references to AiProviderMiddlewareTypes with the new middlewareTypes file across various middleware components for better organization. - Introduced TextChunkMiddleware to enhance chunk processing from OpenAI SDK streams. - Cleaned up imports in multiple files to reflect the new structure, improving code clarity and maintainability. * feat: enhance abort handling with AbortController in middleware chain - Update CompletionsOpenAIResult interface to use AbortController instead of AbortSignal - Modify OpenAIProvider to pass abortController in completions method return - Update AbortHandlerMiddleware to use controller from upstream result - Improve abort handling flexibility by exposing full controller capabilities - Enable middleware to actively control abort operations beyond passive monitoring This change provides better control over request cancellation and enables more sophisticated abort handling patterns in the middleware pipeline. * refactor: enhance AiProvider and middleware for improved completions handling - Updated BaseProvider to expose additional methods and properties, including getMessageParam and createAbortController. - Modified OpenAIProvider to streamline completions processing and integrate new middleware for tool handling. - Introduced TransformParamsBeforeCompletions middleware to standardize parameter transformation before completions. - Added McpToolChunkMiddleware for managing tool calls within the completions stream. - Enhanced middleware types to support new functionalities and improve overall structure. These changes improve the flexibility and maintainability of the AiProvider and its middleware, facilitating better handling of OpenAI completions and tool interactions. * refactor: enhance middleware for recursive handling and internal state management - Introduced internal state management in middleware to support recursive calls, including enhanced dispatch functionality. - Updated middleware types to include new internal fields for managing recursion depth and call status. - Improved logging for better traceability of recursive calls and state transitions. - Adjusted various middleware components to utilize the new internal state, ensuring consistent behavior during recursive processing. These changes enhance the middleware's ability to handle complex scenarios involving recursive calls, improving overall robustness and maintainability. * fix(OpenAIProvider): return empty object for missing sdkParams in completions handling - Updated OpenAIProvider to return an empty object instead of undefined when sdkParams are not found, ensuring consistent return types. - Enhanced TransformParamsBeforeCompletions middleware to include a flag for built-in web search functionality based on assistant settings. * refactor(OpenAIProvider): enhance completions handling and middleware integration - Updated the completions method in OpenAIProvider to include an onChunk callback for improved streaming support. - Enabled the ThinkChunkMiddleware in the middleware registration for better handling of reasoning content. - Increased the maximum recursion depth in McpToolChunkMiddleware to prevent infinite loops. - Refined TextChunkMiddleware to directly enqueue chunks without unnecessary type checks. - Improved the ThinkChunkMiddleware to better manage reasoning tags and streamline chunk processing. These changes enhance the overall functionality and robustness of the AI provider and middleware components. * feat(WebSearchMiddleware): add web search handling and integration - Introduced WebSearchMiddleware to process various web search results, including annotations and citations, and generate LLM_WEB_SEARCH_COMPLETE chunks. - Enhanced TextChunkMiddleware to support link conversion based on the model and assistant settings, improving the handling of TEXT_DELTA chunks. - Updated middleware registration to include WebSearchMiddleware for comprehensive search result processing. These changes enhance the AI provider's capabilities in handling web search functionalities and improve the overall middleware architecture. * fix(middleware): improve optional chaining for chunk processing - Updated McpToolChunkMiddleware and ThinkChunkMiddleware to use optional chaining for accessing choices, enhancing robustness against undefined values. - Removed commented-out code in ThinkChunkMiddleware to streamline the chunk handling process. These changes improve the reliability of middleware when processing OpenAI API responses. * feat(middleware): enhance AbortHandlerMiddleware with recursion handling - Added logic to detect and handle recursive calls, preventing unnecessary creation of AbortControllers. - Improved logging for better visibility into middleware operations, including recursion depth and cleanup processes. - Streamlined cleanup process for non-stream responses to ensure resources are released promptly. These changes enhance the robustness and efficiency of the AbortHandlerMiddleware in managing API requests. * docs(middleware): 迁移步骤 * feat(middleware): implement FinalChunkConsumerMiddleware for usage and metrics accumulation - Introduced FinalChunkConsumerMiddleware to replace the deprecated FinalChunkConsumerAndNotifierMiddleware. - This new middleware accumulates usage and metrics data from OpenAI API responses, enhancing tracking capabilities. - Updated middleware registration to utilize the new FinalChunkConsumerMiddleware, ensuring proper integration. - Added support for handling recursive calls and improved logging for better debugging and monitoring. These changes enhance the middleware's ability to manage and report usage metrics effectively during API interactions. * refactor(migrate): update API request and response structures to TypeScript types - Changed the definitions of `CoreCompletionsRequest` and `Chunk` to use TypeScript types instead of Zod Schemas for better type safety and clarity. - Updated middleware and service classes to handle the new `Chunk` type, ensuring compatibility with the revised API client structure. - Enhanced the response processing logic to standardize the handling of raw SDK chunks into application-level `Chunk` objects. - Adjusted middleware to consume the new `Chunk` type, streamlining the overall architecture and improving maintainability. These changes facilitate a more robust and type-safe integration with AI provider APIs. * feat(AiProvider): implement API client architecture - Introduced ApiClientFactory for creating instances of API clients based on provider configuration. - Added BaseApiClient as an abstract class to provide common functionality for specific client implementations. - Implemented OpenAIApiClient for OpenAI and Azure OpenAI, including request and response handling. - Defined types and interfaces for API client operations, enhancing type safety and clarity. - Established middleware schemas for standardized request processing across AI providers. These changes lay the groundwork for a modular and extensible API client architecture, improving the integration of various AI providers. * refactor(StreamAdapterMiddleware): simplify stream adaptation logic - Updated StreamAdapterMiddleware to directly use AsyncIterable instead of wrapping it with rawSdkChunkAdapter, streamlining the adaptation process. - Modified asyncGeneratorToReadableStream to accept AsyncIterable, enhancing its flexibility and usability. These changes improve the efficiency of stream handling in the middleware. * refactor(AiProvider): simplify ResponseChunkTransformer interface and streamline OpenAIApiClient response handling - Changed ResponseChunkTransformer from an interface to a type for improved clarity and simplicity. - Refactored OpenAIApiClient to streamline the response transformation logic, reducing unnecessary complexity in handling tool calls and reasoning content. - Enhanced type safety by ensuring consistent handling of optional properties in response processing. These changes improve the maintainability and readability of the codebase while ensuring robust response handling in the API client. * doc(technicalArchitecture): add comprehensive documentation for AI Provider architecture * feat(architecture): introduce AI Core Design documentation and middleware specification - Added a comprehensive technical architecture document for the new AI Provider (`aiCore`), outlining core design principles, component details, and execution flow. - Established a middleware specification document to define the design, implementation, and usage of middleware within the `aiCore` module, promoting a flexible and maintainable system. - These additions provide clarity and guidance for future development and integration of AI functionalities within Cherry Studio. * refactor(middleware): consolidate and enhance middleware architecture - Removed deprecated extractReasoningMiddleware and integrated its functionality into existing middleware. - Streamlined middleware registration and improved type definitions for better clarity and maintainability. - Introduced new middleware components for handling chunk processing, web search, and reasoning tags, enhancing overall functionality. - Updated various middleware to utilize the new structures and improve logging for better debugging. These changes enhance the middleware's efficiency and maintainability, providing a more robust framework for API interactions. * refactor(AiProvider): enhance API client and middleware integration - Updated ApiClientFactory to include new SDK types for improved type safety and clarity. - Refactored BaseApiClient to support additional parameters in the completions method, enhancing flexibility for processing states. - Streamlined OpenAIApiClient to better handle tool calls and responses, including the introduction of new chunk types for tool management. - Improved middleware architecture by integrating processing states and refining message handling, ensuring a more robust interaction with the API. These changes enhance the overall maintainability and functionality of the API client and middleware, providing a more efficient framework for AI interactions. * fix(McpToolChunkMiddleware): remove redundant logging in recursion state update * refactor(McpToolChunkMiddleware): update tool call handling and type definitions - Replaced ChatCompletionMessageToolCall with SdkToolCall for improved type consistency. - Updated return types of executeToolCalls and executeToolUses functions to SdkMessage[], enhancing clarity in message handling. - Removed unused import to streamline the code. These changes enhance the maintainability and type safety of the middleware, ensuring better integration with the SDK. * refactor(middleware): enhance middleware structure and type handling - Updated middleware components to utilize new SDK types, improving type safety and clarity across the board. - Refactored various middleware to streamline processing logic, including enhanced handling of SDK messages and tool calls. - Improved logging and error handling for better debugging and maintainability. - Consolidated middleware functions to reduce redundancy and improve overall architecture. These changes enhance the robustness and maintainability of the middleware framework, ensuring a more efficient interaction with the API. * refactor(middleware): unify type imports and enhance middleware structure - Updated middleware components to import types from a unified 'types' file, improving consistency and clarity across the codebase. - Removed the deprecated 'type.ts' file to streamline the middleware structure. - Enhanced middleware registration and export mechanisms for better accessibility and maintainability. These changes contribute to a more organized and efficient middleware framework, facilitating easier future development and integration. * refactor(AiProvider): enhance API client and middleware integration - Updated AiProvider components to support new SDK types, improving type safety and clarity. - Refactored middleware to streamline processing logic, including enhanced handling of tool calls and responses. - Introduced new middleware for tool use extraction and raw stream listening, improving overall functionality. - Improved logging and error handling for better debugging and maintainability. These changes enhance the robustness and maintainability of the API client and middleware, ensuring a more efficient interaction with the API. * feat(middleware): add new middleware components for raw stream listening and tool use extraction - Introduced RawStreamListenerMiddleware and ToolUseExtractionMiddleware to enhance middleware capabilities. - Updated MiddlewareRegistry to include new middleware entries, improving overall functionality and extensibility. These changes expand the middleware framework, facilitating better handling of streaming and tool usage scenarios. * refactor(AiProvider): integrate new API client and middleware architecture - Replaced BaseProvider with ApiClientFactory to enhance API client instantiation. - Updated completions method to utilize new middleware architecture for improved processing. - Added TODOs for refactoring remaining methods to align with the new API client structure. - Removed deprecated middleware wrapping logic from ApiClientFactory for cleaner implementation. These changes improve the overall structure and maintainability of the AiProvider, facilitating better integration with the new middleware system. * refactor(middleware): update middleware architecture and documentation - Revised middleware naming conventions and introduced a centralized MiddlewareRegistry for better management and accessibility. - Enhanced MiddlewareBuilder to support named middleware and streamline the construction of middleware chains. - Updated documentation to reflect changes in middleware usage and structure, improving clarity for future development. These changes improve the organization and usability of the middleware framework, facilitating easier integration and maintenance. * refactor(AiProvider): enhance completions middleware logic and API client handling - Updated the completions method to conditionally remove middleware based on parameters, improving flexibility in processing. - Refactored the response chunk transformer in OpenAIApiClient and AnthropicAPIClient to utilize a more streamlined approach with TransformStream. - Simplified middleware context handling by removing unnecessary custom state management. - Improved logging and error handling across middleware components for better debugging and maintainability. These changes enhance the efficiency and clarity of the AiProvider's middleware integration, ensuring a more adaptable and robust processing framework. * refactor(AiProvider, middleware): clean up logging and improve method naming - Removed unnecessary logging of parameters in AiProvider to streamline the code. - Updated method name assignment in middleware to enhance clarity and consistency. These changes contribute to a cleaner codebase and improve the readability of the middleware and provider components. * feat(middleware): enhance middleware types and add RawStreamListenerMiddleware - Introduced RawStreamListenerMiddleware to the MiddlewareName enum for improved middleware capabilities. - Updated type definitions across middleware components to enhance type safety and clarity, including the addition of new SDK types. - Refactored context and middleware API interfaces to support more specific type parameters, improving overall maintainability. These changes expand the middleware framework, facilitating better handling of streaming scenarios and enhancing type safety across the codebase. * refactor(messageThunk): convert callback functions to async and handle errors during database updates This commit updates several callback functions in the messageThunk to be asynchronous, ensuring that block transitions are awaited properly. Additionally, error handling is added for the database update function to log any failures when saving blocks. This improves the reliability and responsiveness of the message processing flow. * refactor: enhance message block handling in messageThunk This commit refactors the message processing logic in messageThunk to improve the management of message blocks. Key changes include the introduction of dedicated IDs for different block types (main text, thinking, tool, and image) to streamline updates and transitions. The handling of placeholder blocks has been improved, ensuring that they are correctly converted to their respective types during processing. Additionally, error handling has been enhanced for better reliability in database updates. * feat(AiProvider): add default timeout configuration and enhance API client aborthandler - Introduced a default timeout constant to the configuration for improved API client timeout management. - Updated BaseApiClient and its derived classes to utilize the new timeout setting, ensuring consistent timeout behavior across different API clients. - Enhanced middleware to pass the timeout value during API calls, improving error handling and responsiveness. These changes improve the overall robustness and configurability of the API client interactions, facilitating better control over request timeouts. * feat(GeminiProvider): implement Gemini API client and enhance file handling - Introduced GeminiAPIClient to facilitate interactions with the Gemini API, replacing the previous GoogleGenAI integration. - Refactored GeminiProvider to utilize the new API client, improving code organization and maintainability. - Enhanced file handling capabilities, including support for PDF uploads and retrieval of file metadata. - Updated message processing to accommodate new SDK types and improve content generation logic. These changes significantly enhance the functionality and robustness of the GeminiProvider, enabling better integration with the Gemini API and improving overall user experience. * refactor(AiProvider, middleware): streamline API client and middleware integration - Removed deprecated methods and types from various API clients, enhancing code clarity and maintainability. - Updated the CompletionsParams interface to support messages as a string or array, improving flexibility in message handling. - Refactored middleware components to eliminate unnecessary state management and improve type safety. - Enhanced the handling of streaming responses and added utility functions for better stream management. These changes contribute to a more robust and efficient architecture for the AiProvider and its associated middleware, facilitating improved API interactions and user experience. * refactor(middleware): translation 适配 - Deleted SdkCallMiddleware to streamline middleware architecture and improve maintainability. - Commented out references to SdkCallModule in examples and registration files to prevent usage. - Enhanced logging in AbortHandlerMiddleware for better debugging and tracking of middleware execution. - Updated parameters in ResponseTransformMiddleware to improve flexibility in handling response settings. These changes contribute to a cleaner and more efficient middleware framework, facilitating better integration and performance. * refactor(ApiCheck): streamline API validation and error handling - Updated the API check logic to simplify validation processes and improve error handling across various components. - Refactored the `checkApi` function to throw errors directly instead of returning validation objects, enhancing clarity in error management. - Improved the handling of API key checks in `checkModelWithMultipleKeys` to provide more informative error messages. - Added a new method `getEmbeddingDimensions` in the `AiProvider` class to facilitate embedding dimension retrieval, enhancing model compatibility checks. These changes contribute to a more robust and maintainable API validation framework, improving overall user experience and error reporting. * refactor(HealthCheckService, ModelService): improve error handling and performance metrics - Updated error handling in `checkModelWithMultipleKeys` to truncate error messages for better readability. - Refactored `performModelCheck` to remove unnecessary error handling, focusing on performance metrics by returning only latency. - Enhanced the `checkModel` function to ensure consistent return types, improving clarity in API interactions. These changes contribute to a more efficient and user-friendly error reporting and performance tracking system. * refactor(AiProvider, models): enhance model handling and API client integration - Updated the `listModels` method in various API clients to improve model retrieval and ensure consistent return types. - Refactored the `EditModelsPopup` component to handle model properties more robustly, including fallback options for `id`, `name`, and other attributes. - Enhanced type definitions for models in the SDK to support new integrations and improve type safety. These changes contribute to a more reliable and maintainable model management system within the AiProvider, enhancing overall user experience and API interactions. * refactor(AiProvider, clients): implement image generation functionality - Refactored the `generateImage` method in the `AiProvider` class to utilize the `apiClient` for image generation, replacing the previous placeholder implementation. - Updated the `BaseApiClient` to include an abstract `generateImage` method, ensuring all derived clients implement this functionality. - Implemented the `generateImage` method in `GeminiAPIClient` and `OpenAIAPIClient`, providing specific logic for image generation based on the respective SDKs. - Added type definitions for `GenerateImageParams` across relevant files to enhance type safety and clarity in image generation parameters. These changes enhance the image generation capabilities of the AiProvider, improving integration with various API clients and overall user experience. * refactor(AiProvider, clients): restructure API client architecture and remove deprecated components - Refactored the `ProviderFactory` and removed the `AihubmixProvider` to streamline the API client architecture. - Updated the import paths for `isOpenAIProvider` to reflect the new structure. - Introduced `AihubmixAPIClient` and `OpenAIResponseAPIClient` to enhance client handling based on model types. - Improved the `AiProvider` class to utilize the new clients for better model-specific API interactions. - Enhanced type definitions and error handling across various components to improve maintainability and clarity. These changes contribute to a more efficient and organized API client structure, enhancing overall integration and user experience. * fix: update system prompt handling in API clients to use await for asynchronous operations - Modified the `AnthropicAPIClient`, `GeminiAPIClient`, `OpenAIAPIClient`, and `OpenAIResponseAPIClient` to ensure `buildSystemPrompt` is awaited, improving the handling of system prompts. - Adjusted the `fetchMessagesSummary` function to utilize the last five user messages for better context in API calls and added a utility function to clean up topic names. These changes enhance the reliability of prompt generation and improve the overall API interaction experience. * refactor(middleware): remove examples.ts to streamline middleware documentation - Deleted the `examples.ts` file containing various middleware usage examples to simplify the middleware structure and documentation. - This change contributes to a cleaner codebase and focuses on essential middleware components, enhancing maintainability. * refactor(AiProvider, middleware): enhance middleware handling and error management - Updated the `CompletionsParams` interface to include a new `callType` property for better middleware decision-making based on the context of the API call. - Introduced `ErrorHandlerMiddleware` to standardize error handling across middleware, allowing errors to be captured and processed as `ErrorChunk` objects. - Modified the `AbortHandlerMiddleware` to conditionally remove itself based on the `callType`, improving middleware efficiency. - Cleaned up logging in `AbortHandlerMiddleware` to reduce console output and enhance performance. - Updated middleware registration to include the new `ErrorHandlerMiddleware`, ensuring comprehensive error management in the middleware pipeline. These changes contribute to a more robust and maintainable middleware architecture, improving error handling and overall API interaction efficiency. * feat: implement token estimation for message handling - Added an abstract method `estimateMessageTokens` to the `BaseApiClient` class for estimating token usage based on message content. - Implemented the `estimateMessageTokens` method in `AnthropicAPIClient`, `GeminiAPIClient`, `OpenAIAPIClient`, and `OpenAIResponseAPIClient` to calculate token consumption for various message types. - Enhanced middleware to accumulate token usage for new messages, improving tracking of API call costs. These changes improve the efficiency of message processing and provide better insights into token usage across different API clients. * feat: add support for image generation and model handling - Introduced `SUPPORTED_DISABLE_GENERATION_MODELS` to manage models that disable image generation. - Updated `isSupportedDisableGenerationModel` function to check model compatibility. - Enhanced `Inputbar` logic to conditionally enable image generation based on model support. - Modified API clients to handle image generation calls and responses, including new chunk types for image data. - Updated middleware and service layers to incorporate image generation parameters and improve overall processing. These changes enhance the application's capabilities for image generation and improve the handling of various model types. * feat: enhance GeminiAPIClient for image generation support - Added `getGenerateImageParameter` method to configure image generation parameters. - Updated request handling in `GeminiAPIClient` to include image generation options. - Enhanced response processing to handle image data and enqueue it correctly. These changes improve the GeminiAPIClient's capabilities for generating and processing images, aligning with recent enhancements in image generation support. * feat: enhance image generation handling in OpenAIResponseAPIClient and middleware - Updated OpenAIResponseAPIClient to improve user message processing for image generation. - Added handling for image creation events in TransformCoreToSdkParamsMiddleware. - Adjusted ApiService to streamline image generation event handling. - Modified messageThunk to reflect changes in image block status during processing. These enhancements improve the integration and responsiveness of image generation features across the application. * refactor: remove unused AI provider classes - Deleted `AihubmixProvider`, `AnthropicProvider`, `BaseProvider`, `GeminiProvider`, and `OpenAIProvider` as they are no longer utilized in the codebase. - This cleanup reduces code complexity and improves maintainability by removing obsolete components related to AI provider functionality. * chore: remove obsolete test files for middleware - Deleted test files for `AbortHandlerMiddleware`, `LoggingMiddleware`, `TextChunkMiddleware`, `ThinkChunkMiddleware`, and `WebSearchMiddleware` as they are no longer needed. - This cleanup helps streamline the codebase and reduces maintenance overhead by removing outdated tests. * chore: remove Suggestions component and related functionality - Deleted the `Suggestions` component from the home page as it is no longer needed. - Removed associated imports and functions related to suggestion fetching, streamlining the codebase. - This cleanup helps improve maintainability by eliminating unused components. * feat: enhance OpenAIAPIClient and StreamProcessingService for tool call handling - Updated OpenAIAPIClient to conditionally include tool calls in the assistant message, improving message processing logic. - Enhanced tool call handling in the response transformer to correctly manage and enqueue tool call data. - Added a new callback for LLM response completion in StreamProcessingService, allowing better integration of response handling. These changes improve the functionality and responsiveness of the OpenAI API client and stream processing capabilities. * fix: copilot error * fix: improve chunk handling in TextChunkMiddleware and ThinkChunkMiddleware - Updated TextChunkMiddleware to enqueue LLM_RESPONSE_COMPLETE chunks based on accumulated text content. - Refactored ThinkChunkMiddleware to generate THINKING_COMPLETE chunks when receiving non-THINKING_DELTA chunks, ensuring proper handling of accumulated thinking content. - These changes enhance the middleware's responsiveness and accuracy in processing text and thinking chunks. * chore: update dependencies and improve styling - Updated `selection-hook` dependency to version 0.9.23 in `package.json` and `yarn.lock`. - Removed unused styles from `container.scss` and adjusted padding in `index.scss`. - Enhanced message rendering and layout in various components, including `Message`, `MessageHeader`, and `MessageMenubar`. - Added tooltip support for message divider settings in `SettingsTab`. - Improved handling of citation display in `CitationsList` and `CitationBlock`. These changes streamline the codebase and enhance the user interface for better usability. * feat: implement image generation middleware and enhance model handling - Added `ImageGenerationMiddleware` to handle dedicated image generation models, integrating image processing and OpenAI's image generation API. - Updated `AiProvider` to utilize the new middleware for dedicated image models, ensuring proper middleware chaining. - Introduced constants for dedicated image models in `models.ts` to streamline model identification. - Refactored error handling in `ErrorHandlerMiddleware` to use a utility function for better error management. - Cleaned up imports and removed unused code in various files for improved maintainability. * fix: update dedicated image models identification logic - Modified the `DEDICATED_IMAGE_MODELS` array to include 'grok-2-image' for improved model handling. - Enhanced the `isDedicatedImageGenerationModel` function to use a more robust check for model identification, ensuring better accuracy in middleware processing. * refactor: remove OpenAIResponseProvider class - Deleted the `OpenAIResponseProvider` class from the `AiProvider` module, streamlining the codebase by eliminating unused code. - This change enhances maintainability and reduces complexity in the provider architecture. * fix: usermessage * refactor: simplify AbortHandlerMiddleware for improved abort handling - Removed direct dependency on ApiClient for creating AbortController, enhancing modularity. - Introduced utility functions to manage abort controllers, streamlining the middleware's responsibilities. - Delegated abort signal handling to downstream middlewares, allowing for cleaner separation of concerns. * refactor(aiCore): Consolidate AI provider and middleware architecture This commit refactors the AI-related modules by unifying the `clients` and `middleware` directories under a single `aiCore` directory. This change simplifies the project structure, improves modularity, and makes the architecture more cohesive. Key changes: - Relocated provider-specific clients and middleware into the `aiCore` directory, removing the previous `providers/AiProvider` structure. - Updated the architectural documentation (`AI_CORE_DESIGN.md`) to accurately reflect the new, streamlined directory layout and execution flow. - The main `AiProvider` class is now the primary export of `aiCore/index.ts`, serving as the central access point for AI functionalities. * refactor: update imports and enhance middleware functionality - Adjusted import statements in `AnthropicAPIClient` and `GeminiAPIClient` for better organization. - Improved `AbortHandlerMiddleware` to handle abort signals more effectively, including the conversion of streams to handle abort scenarios. - Enhanced `ErrorHandlerMiddleware` to differentiate between abort errors and other types, ensuring proper error handling. - Cleaned up commented-out code in `FinalChunkConsumerMiddleware` for better readability and maintainability. * refactor: streamline middleware logging and improve error handling - Removed excessive debug logging from various middleware components, including `AbortHandlerMiddleware`, `FinalChunkConsumerMiddleware`, and `McpToolChunkMiddleware`, to enhance readability and performance. - Updated logging levels to use warnings for potential issues in `ResponseTransformMiddleware`, `TextChunkMiddleware`, and `ThinkChunkMiddleware`, ensuring better visibility of important messages. - Cleaned up commented-out code and unnecessary debug statements across multiple middleware files for improved maintainability. --------- Co-authored-by: suyao <sy20010504@gmail.com> Co-authored-by: eeee0717 <chentao020717Work@outlook.com> Co-authored-by: lizhixuan <zhixuan.li@banosuperapp.com> |
||
|
|
d47c93b4d8
|
feat: add set feed url functionality for early access (#5723)
* feat: add update channel functionality for beta testing - Introduced a new IPC channel for setting the update channel. - Implemented logic in AppUpdater to handle update channel changes. - Updated settings to include a beta testing toggle, allowing users to switch between stable and beta update channels. - Enhanced the settings UI to reflect the new beta testing option. * add i18n * update i18n * update i18n * refactor: rename update channel to feed URL and update related functionality - Changed IPC channel from App_SetUpdateChannel to App_SetFeedUrl. - Updated AppUpdater to set feed URL instead of update channel. - Modified preload and settings to reflect the new feed URL functionality. - Added constants for production and early access feed URLs. * refactor: remove setAutoUpdate method from API - Eliminated the setAutoUpdate method from the API object in preload index, streamlining the IPC communication interface. * refactor: update early access feed URL and improve tooltip descriptions - Changed EARLY_ACCESS_FEED_URL to point to the latest GitHub release. - Simplified the setEarlyAccess function to directly set the feed URL. - Added tooltips for early access settings in multiple languages to inform users about potential instability and the need for data backup. * feat(migrate): add early access setting to state configuration - Introduced a new state setting 'earlyAccess' and initialized it to false in the migration configuration. * fix(i18n): update early access tooltip translations for clarity - Revised the tooltip descriptions for the early access feature in English, Simplified Chinese, and Traditional Chinese to enhance clarity and ensure consistency in messaging regarding potential instability and the importance of data backup. * feat: introduce FeedUrl enum for centralized feed URL management - Added a new enum `FeedUrl` in the constants file to define production and early access feed URLs. - Updated relevant IPC handlers and services to utilize the `FeedUrl` enum for type safety and consistency. - Refactored the configuration manager to include methods for getting and setting the feed URL using the new enum. * feat(settings): initialize early access and auto-update settings in AboutSettings component - Added initialization for early access and auto-check update settings in the AboutSettings component to enhance user configuration options. --------- Co-authored-by: beyondkmp <beyondkmkp@gmail.com> |
||
|
|
e479ee3dbc
|
feat(constants): expand supported file extensions and categorize text… (#6815)
* feat(constants): expand supported file extensions and categorize text file types * refactor(constants): remove binary file extensions * refactor(constants): remove Xcode project |
||
|
|
930074a717
|
feat: add zoom factor setting and localization support (#5665)
* feat: add zoom factor setting and localization support - Introduced App_SetZoomFactor IPC channel for managing zoom levels. - Implemented zoom factor functionality in the main IPC handler. - Added setZoomFactor method in the settings store and corresponding UI in DisplaySettings. - Included localization for zoom settings in English and Chinese. * add i18n * recover file * delete code * fix: update zoom factor handling to apply to all windows - Modified the IPC handler for App_SetZoomFactor to set the zoom factor for all non-destroyed windows instead of just the main window. * add getzoomfactor api * feat: synchronize zoom factor with Redux state on app initialization - Added functionality to fetch the zoom factor from the main process and dispatch it to the Redux store during app initialization. - Removed redundant zoom factor fetching logic from DisplaySettings component. * feat: enhance zoom factor management with IPC updates - Added a new IPC channel for zoom factor updates to notify all renderer processes. - Introduced a constant for predefined zoom levels to streamline zoom adjustments. - Updated the zoom handling logic to utilize the new zoom levels and ensure smooth transitions. - Implemented a listener in the preload script to handle zoom factor updates from the main process. - Refactored the app initialization to include real-time updates for the zoom factor in the Redux state. * feat: integrate zoom options into DisplaySettings component - Added ZOOM_OPTIONS constant to generate structured options for Ant Design Select from predefined zoom levels. - Refactored DisplaySettings to utilize ZOOM_OPTIONS, removing redundant zoom option definitions. - Simplified the zoom factor fetching logic in useAppInit for better readability and efficiency. * refactor: streamline zoom factor handling and remove unused IPC channel - Removed the App_GetZoomFactor IPC channel as it was no longer needed. - Updated zoom factor handling to directly set and notify the main window of changes. - Simplified the logic for setting the zoom factor in the WindowService and ShortcutService. - Adjusted the useAppInit hook to utilize the new zoom factor management approach. * refactor: improve zoom factor handling in WindowService and useAppInit hook - Simplified the zoom factor setting in WindowService by directly using the config manager. - Updated useAppInit to ensure the zoom factor is set correctly on initialization, enhancing responsiveness to changes. |
||
|
|
3290ac4b1b
|
refactor(Constants): 优化一些常量和枚举值 (#3773)
* refactor(main): 使用枚举管理 IPC 通道 - 新增 IpcChannel 枚举,用于统一管理所有的 IPC 通道 - 修改相关代码,使用 IpcChannel 枚举替代硬编码的字符串通道名称 - 此改动有助于提高代码的可维护性和可读性,避免因通道名称变更导致的错误 * refactor(ipc): 将字符串通道名称替换为 IpcChannel 枚举 - 在多个文件中将硬编码的字符串通道名称替换为 IpcChannel 枚举值 - 更新了相关文件的导入,增加了对 IpcChannel 的引用 - 通过使用枚举来管理 IPC 通道名称,提高了代码的可维护性和可读性 * refactor(ipc): 调整 IPC 通道枚举和预加载脚本 - 移除了 IpcChannel 枚举中的未使用注释 - 更新了预加载脚本中 IpcChannel 的导入路径 * refactor(ipc): 更新 IpcChannel导入路径 - 将 IpcChannel 的导入路径从 @main/enum/IpcChannel 修改为 @shared/IpcChannel - 此修改涉及多个文件,包括 AppUpdater、BackupManager、EditMcpJsonPopup 等 - 同时移除了 tsconfig.web.json 中对 src/main/**/* 的引用 * refactor(ipc): 添加 ReduxStoreReady 事件并更新事件监听 - 在 IpcChannel 枚举中添加 ReduxStoreReady 事件 - 更新 ReduxService 中的事件监听,使用新的枚举值 * refactor(main): 重构 ReduxService 中的状态变化事件处理 - 将状态变化事件名称定义为常量 STATUS_CHANGE_EVENT - 更新事件监听和触发使用新的常量 - 优化了代码结构,提高了可维护性 * refactor(i18n): 优化国际化配置和语言选择逻辑 - 在多个文件中引入 defaultLanguage 常量,统一默认语言设置 - 调整 i18n 初始化和语言变更逻辑,使用新配置 - 更新相关组件和 Hook 中的语言选择逻辑 * refactor(ConfigManager): 重构配置管理器 - 添加 ConfigKeys 枚举,用于统一配置项的键名 - 引入 defaultLanguage,作为默认语言设置 - 重构 get 和 set 方法,使用 ConfigKeys 枚举作为键名 - 优化类型定义和方法签名,提高代码可读性和可维护性 * refactor(ConfigManager): 重命名配置键 ZoomFactor 将配置键 zoomFactor 重命名为 ZoomFactor,以符合命名规范。 更新了相关方法和属性以反映这一变更。 * refactor(shared): 重构常量定义并优化文件大小格式化逻辑 - 在 constant.ts 中添加 KB、MB、GB 常量定义 - 将 defaultLanguage 移至 constant.ts - 更新 ConfigManager、useAppInit、i18n、GeneralSettings 等文件中的导入路径 - 优化 formatFileSize 函数,使用新定义的常量 * refactor(FileSize): 使用 GB/MB/KB 等常量处理文件大小计算 * refactor(ipc): 将字符串通道名称替换为 IpcChannel 枚举 - 在多个文件中将硬编码的字符串通道名称替换为 IpcChannel 枚举值 - 更新了相关文件的导入,增加了对 IpcChannel 的引用 - 通过使用枚举来管理 IPC 通道名称,提高了代码的可维护性和可读性 * refactor(ipc): 更新 IpcChannel导入路径 - 将 IpcChannel 的导入路径从 @main/enum/IpcChannel 修改为 @shared/IpcChannel - 此修改涉及多个文件,包括 AppUpdater、BackupManager、EditMcpJsonPopup 等 - 同时移除了 tsconfig.web.json 中对 src/main/**/* 的引用 * refactor(i18n): 优化国际化配置和语言选择逻辑 - 在多个文件中引入 defaultLanguage 常量,统一默认语言设置 - 调整 i18n 初始化和语言变更逻辑,使用新配置 - 更新相关组件和 Hook 中的语言选择逻辑 * refactor(shared): 重构常量定义并优化文件大小格式化逻辑 - 在 constant.ts 中添加 KB、MB、GB 常量定义 - 将 defaultLanguage 移至 constant.ts - 更新 ConfigManager、useAppInit、i18n、GeneralSettings 等文件中的导入路径 - 优化 formatFileSize 函数,使用新定义的常量 * refactor: 移除重复的导入语句 - 在 HomeWindow.tsx 和 useAppInit.ts 文件中移除了重复的 defaultLanguage导入语句 - 这个改动简化了代码结构,提高了代码的可读性和维护性 |
||
|
|
6dff8b2725 |
feat: Update text-based file extensions for EDAs
远期可以进一步考虑直接自动使用 https://github.com/github-linguist/linguist/blob/main/lib/linguist/languages.yml 加上自定义扩展集的方式,减轻维护负担 Should consider directly and automatically using https://github.com/github-linguist/linguist/blob/main/lib/linguist/languages.yml along with a custom extension set to reduce the maintenance burden. |
||
|
|
cd6c0a1f66
|
fix: update file extensions for Fortran source files (#3683)
* Enhance update error logging and fix duplicate type import - Improve error logging in AppUpdater with more detailed error information and timestamps - Remove duplicate MCPServer type import in Inputbar component * feat(constants): 添加 Fortran 源文件扩展名支持 |
||
|
|
0250ec6f2e | feat(constants): Add BibTeX file extension to supported text files | ||
|
|
0789ccedbb | feat: 知识库支持更多txt based格式 | ||
|
|
ff14dcc559 |
feat: 添加更多C++文件扩展名支持
在 `textExts` 数组中添加了以下C++文件扩展名: - `.hpp`: C++ 头文件 - `.cc`: C++ 源文件 - `.cxx`: C++ 源文件 - `.cppm`: C++20 模块接口文件 - `.ipp`: 模板实现文件 - `.ixx`: C++20 模块实现文件 |
||
|
|
12c9d810a2 |
feat: Add C and C++ file extensions to supported text files
close #2066 |
||
|
|
574d02a8c9
|
feat: support json and draftsExport file in knowledge base (#1717) | ||
|
|
253fc6f4e1 | fix: Separate EPUB files into dedicated book file extension category | ||
|
|
99aa0d3255 | feat: Add EPUB file support to document loader | ||
|
|
dc9444a9d4 |
feat(constants): add C# file extension to textExts array #835
- Updated the textExts array in constant.ts to include '.cs' for C# files, enhancing the file type recognition capabilities. |
||
|
|
408976e5dc | feat: add shortcut for assistant and topic show | ||
|
|
7f2f3ad88a | refactor: shortcuts feature |