mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-27 21:01:32 +08:00
Merge branch 'main' of github.com:CherryHQ/cherry-studio into v2
This commit is contained in:
commit
355e5b269d
3
.vscode/extensions.json
vendored
3
.vscode/extensions.json
vendored
@ -6,7 +6,6 @@
|
||||
"bradlc.vscode-tailwindcss",
|
||||
"vitest.explorer",
|
||||
"oxc.oxc-vscode",
|
||||
"biomejs.biome",
|
||||
"typescriptteam.native-preview"
|
||||
"biomejs.biome"
|
||||
]
|
||||
}
|
||||
|
||||
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -48,6 +48,5 @@
|
||||
"search.exclude": {
|
||||
"**/dist/**": true,
|
||||
".yarn/releases/**": true
|
||||
},
|
||||
"typescript.experimental.useTsgo": true
|
||||
}
|
||||
}
|
||||
|
||||
@ -129,24 +129,19 @@ artifactBuildCompleted: scripts/artifact-build-completed.js
|
||||
releaseInfo:
|
||||
releaseNotes: |
|
||||
✨ 新功能:
|
||||
- 重构知识库模块,提升文档处理能力和搜索性能
|
||||
- 新增 PaddleOCR 支持,增强文档识别能力
|
||||
- 支持自定义窗口控制按钮样式
|
||||
- 新增 AI SDK 包,扩展 AI 能力集成
|
||||
- 支持标签页拖拽重排序功能
|
||||
- 增强笔记编辑器的同步和日志功能
|
||||
- 集成 Perplexity SDK 和 Anthropic OAuth
|
||||
- 支持 API 服务器模式,提供外部调用接口
|
||||
- 新增字体自定义设置功能
|
||||
- 笔记支持文件夹批量上传
|
||||
- 集成 HeroUI 和 Tailwind CSS 提升界面体验
|
||||
|
||||
🔧 性能优化:
|
||||
- 优化 MCP 服务的日志记录和错误处理
|
||||
- 改进 WebView 服务的 User-Agent 处理
|
||||
- 优化迷你应用的标题栏样式和状态栏适配
|
||||
- 重构依赖管理,清理和优化 package.json
|
||||
🚀 性能优化:
|
||||
- 优化大文件上传,支持 OpenAI 标准文件服务
|
||||
- 重构 MCP 服务,改进错误处理和状态管理
|
||||
|
||||
🐛 问题修复:
|
||||
- 修复输入栏无限状态更新循环问题
|
||||
- 修复窗口控制提示框的鼠标悬停延迟
|
||||
- 修复翻译输入框粘贴多内容源的处理
|
||||
- 修复导航服务初始化时序问题
|
||||
- 修复 MCP 通过 JSON 添加时的参数转换
|
||||
- 修复模型作用域服务器同步时的 URL 格式
|
||||
- 标准化工具提示图标样式
|
||||
- 修复 WebSearch RAG 并发问题
|
||||
- 修复翻译页面长文本渲染布局问题
|
||||
- 修复笔记拖拽排序和无限循环问题
|
||||
- 修复 macOS CodeTool 工作目录错误
|
||||
- 修复多个 UI 组件的响应式设计问题
|
||||
|
||||
@ -240,7 +240,6 @@
|
||||
"diff": "^8.0.2",
|
||||
"docx": "^9.0.2",
|
||||
"dompurify": "^3.2.6",
|
||||
"dotenv": "^17.2.2",
|
||||
"dotenv-cli": "^7.4.2",
|
||||
"drizzle-kit": "^0.31.4",
|
||||
"drizzle-orm": "^0.44.2",
|
||||
@ -339,7 +338,7 @@
|
||||
"tsx": "^4.20.3",
|
||||
"turndown-plugin-gfm": "^1.0.2",
|
||||
"tw-animate-css": "^1.3.8",
|
||||
"typescript": "^5.6.2",
|
||||
"typescript": "^5.8.2",
|
||||
"undici": "6.21.2",
|
||||
"unified": "^11.0.5",
|
||||
"uuid": "^10.0.0",
|
||||
@ -380,11 +379,11 @@
|
||||
"packageManager": "yarn@4.9.1",
|
||||
"lint-staged": {
|
||||
"*.{js,jsx,ts,tsx,cjs,mjs,cts,mts}": [
|
||||
"biome format --write",
|
||||
"biome format --write --no-errors-on-unmatched",
|
||||
"eslint --fix"
|
||||
],
|
||||
"*.{json,yml,yaml,css,html}": [
|
||||
"biome format --write"
|
||||
"biome format --write --no-errors-on-unmatched"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@ -216,5 +216,6 @@ export enum codeTools {
|
||||
qwenCode = 'qwen-code',
|
||||
claudeCode = 'claude-code',
|
||||
geminiCli = 'gemini-cli',
|
||||
openaiCodex = 'openai-codex'
|
||||
openaiCodex = 'openai-codex',
|
||||
iFlowCli = 'iflow-cli'
|
||||
}
|
||||
|
||||
@ -51,6 +51,8 @@ class CodeToolsService {
|
||||
return '@openai/codex'
|
||||
case codeTools.qwenCode:
|
||||
return '@qwen-code/qwen-code'
|
||||
case codeTools.iFlowCli:
|
||||
return '@iflow-ai/iflow-cli'
|
||||
default:
|
||||
throw new Error(`Unsupported CLI tool: ${cliTool}`)
|
||||
}
|
||||
@ -66,6 +68,8 @@ class CodeToolsService {
|
||||
return 'codex'
|
||||
case codeTools.qwenCode:
|
||||
return 'qwen'
|
||||
case codeTools.iFlowCli:
|
||||
return 'iflow'
|
||||
default:
|
||||
throw new Error(`Unsupported CLI tool: ${cliTool}`)
|
||||
}
|
||||
|
||||
@ -37,7 +37,7 @@ export function useAppInit() {
|
||||
const [proxyMode] = usePreference('app.proxy.mode')
|
||||
const [enableDataCollection] = usePreference('app.privacy.data_collection.enabled')
|
||||
|
||||
const { isTopNavbar } = useNavbarPosition()
|
||||
const { isLeftNavbar } = useNavbarPosition()
|
||||
const { minappShow } = useMinapps()
|
||||
const { updateAppUpdateState } = useAppUpdateState()
|
||||
const { setDefaultModel, setQuickModel, setTranslateModel } = useDefaultModel()
|
||||
@ -102,16 +102,15 @@ export function useAppInit() {
|
||||
}, [language])
|
||||
|
||||
useEffect(() => {
|
||||
const transparentWindow = windowStyle === 'transparent' && isMac && !minappShow
|
||||
const isMacTransparentWindow = windowStyle === 'transparent' && isMac
|
||||
|
||||
if (minappShow && isTopNavbar) {
|
||||
window.root.style.background =
|
||||
windowStyle === 'transparent' && isMac ? 'var(--color-background)' : 'var(--navbar-background)'
|
||||
if (minappShow && isLeftNavbar) {
|
||||
window.root.style.background = isMacTransparentWindow ? 'var(--color-background)' : 'var(--navbar-background)'
|
||||
return
|
||||
}
|
||||
|
||||
window.root.style.background = transparentWindow ? 'var(--navbar-background-mac)' : 'var(--navbar-background)'
|
||||
}, [windowStyle, minappShow, theme, isTopNavbar])
|
||||
window.root.style.background = isMacTransparentWindow ? 'var(--navbar-background-mac)' : 'var(--navbar-background)'
|
||||
}, [windowStyle, minappShow, theme, isLeftNavbar])
|
||||
|
||||
useEffect(() => {
|
||||
if (isLocalAi) {
|
||||
|
||||
@ -19,7 +19,8 @@ export const CLI_TOOLS = [
|
||||
{ value: codeTools.claudeCode, label: 'Claude Code' },
|
||||
{ value: codeTools.qwenCode, label: 'Qwen Code' },
|
||||
{ value: codeTools.geminiCli, label: 'Gemini CLI' },
|
||||
{ value: codeTools.openaiCodex, label: 'OpenAI Codex' }
|
||||
{ value: codeTools.openaiCodex, label: 'OpenAI Codex' },
|
||||
{ value: codeTools.iFlowCli, label: 'iFlow CLI' }
|
||||
]
|
||||
|
||||
export const GEMINI_SUPPORTED_PROVIDERS = ['aihubmix', 'dmxapi', 'new-api']
|
||||
@ -35,7 +36,8 @@ export const CLI_TOOL_PROVIDER_MAP: Record<string, (providers: Provider[]) => Pr
|
||||
providers.filter((p) => p.type === 'gemini' || GEMINI_SUPPORTED_PROVIDERS.includes(p.id)),
|
||||
[codeTools.qwenCode]: (providers) => providers.filter((p) => p.type.includes('openai')),
|
||||
[codeTools.openaiCodex]: (providers) =>
|
||||
providers.filter((p) => p.id === 'openai' || OPENAI_CODEX_SUPPORTED_PROVIDERS.includes(p.id))
|
||||
providers.filter((p) => p.id === 'openai' || OPENAI_CODEX_SUPPORTED_PROVIDERS.includes(p.id)),
|
||||
[codeTools.iFlowCli]: (providers) => providers.filter((p) => p.type.includes('openai'))
|
||||
}
|
||||
|
||||
export const getCodeToolsApiBaseUrl = (model: Model, type: EndpointType) => {
|
||||
@ -144,6 +146,12 @@ export const generateToolEnvironment = ({
|
||||
env.OPENAI_MODEL = model.id
|
||||
env.OPENAI_MODEL_PROVIDER = modelProvider.id
|
||||
break
|
||||
|
||||
case codeTools.iFlowCli:
|
||||
env.IFLOW_API_KEY = apiKey
|
||||
env.IFLOW_BASE_URL = baseUrl
|
||||
env.IFLOW_MODEL_NAME = model.id
|
||||
break
|
||||
}
|
||||
|
||||
return env
|
||||
|
||||
@ -160,23 +160,23 @@ const Chat: FC<Props> = (props) => {
|
||||
flex={1}
|
||||
justify="space-between"
|
||||
style={{ maxWidth: chatMaxWidth, height: mainHeight }}>
|
||||
<Messages
|
||||
key={props.activeTopic.id}
|
||||
assistant={assistant}
|
||||
topic={props.activeTopic}
|
||||
setActiveTopic={props.setActiveTopic}
|
||||
onComponentUpdate={messagesComponentUpdateHandler}
|
||||
onFirstUpdate={messagesComponentFirstUpdateHandler}
|
||||
/>
|
||||
<ContentSearch
|
||||
ref={contentSearchRef}
|
||||
searchTarget={mainRef as React.RefObject<HTMLElement>}
|
||||
filter={contentSearchFilter}
|
||||
includeUser={filterIncludeUser}
|
||||
onIncludeUserChange={userOutlinedItemClickHandler}
|
||||
/>
|
||||
{messageNavigation === 'buttons' && <ChatNavigation containerId="messages" />}
|
||||
<QuickPanelProvider>
|
||||
<Messages
|
||||
key={props.activeTopic.id}
|
||||
assistant={assistant}
|
||||
topic={props.activeTopic}
|
||||
setActiveTopic={props.setActiveTopic}
|
||||
onComponentUpdate={messagesComponentUpdateHandler}
|
||||
onFirstUpdate={messagesComponentFirstUpdateHandler}
|
||||
/>
|
||||
<ContentSearch
|
||||
ref={contentSearchRef}
|
||||
searchTarget={mainRef as React.RefObject<HTMLElement>}
|
||||
filter={contentSearchFilter}
|
||||
includeUser={filterIncludeUser}
|
||||
onIncludeUserChange={userOutlinedItemClickHandler}
|
||||
/>
|
||||
{messageNavigation === 'buttons' && <ChatNavigation containerId="messages" />}
|
||||
<Inputbar assistant={assistant} setActiveTopic={props.setActiveTopic} topic={props.activeTopic} />
|
||||
{isMultiSelectMode && <MultiSelectActionPopup topic={props.activeTopic} />}
|
||||
</QuickPanelProvider>
|
||||
|
||||
18
yarn.lock
18
yarn.lock
@ -15040,7 +15040,6 @@ __metadata:
|
||||
diff: "npm:^8.0.2"
|
||||
docx: "npm:^9.0.2"
|
||||
dompurify: "npm:^3.2.6"
|
||||
dotenv: "npm:^17.2.2"
|
||||
dotenv-cli: "npm:^7.4.2"
|
||||
drizzle-kit: "npm:^0.31.4"
|
||||
drizzle-orm: "npm:^0.44.2"
|
||||
@ -15152,7 +15151,7 @@ __metadata:
|
||||
turndown: "npm:7.2.0"
|
||||
turndown-plugin-gfm: "npm:^1.0.2"
|
||||
tw-animate-css: "npm:^1.3.8"
|
||||
typescript: "npm:^5.6.2"
|
||||
typescript: "npm:^5.8.2"
|
||||
undici: "npm:6.21.2"
|
||||
unified: "npm:^11.0.5"
|
||||
uuid: "npm:^10.0.0"
|
||||
@ -18424,13 +18423,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"dotenv@npm:^17.2.2":
|
||||
version: 17.2.2
|
||||
resolution: "dotenv@npm:17.2.2"
|
||||
checksum: 10c0/be66513504590aff6eccb14167625aed9bd42ce80547f4fe5d195860211971a7060949b57108dfaeaf90658f79e40edccd3f233f0a978bff507b5b1565ae162b
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"drizzle-kit@npm:^0.31.4":
|
||||
version: 0.31.4
|
||||
resolution: "drizzle-kit@npm:0.31.4"
|
||||
@ -30180,7 +30172,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"typescript@npm:^5.0.0":
|
||||
"typescript@npm:^5.0.0, typescript@npm:^5.6.2, typescript@npm:^5.8.2":
|
||||
version: 5.9.2
|
||||
resolution: "typescript@npm:5.9.2"
|
||||
bin:
|
||||
@ -30190,7 +30182,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"typescript@npm:^5.4.3, typescript@npm:^5.6.2":
|
||||
"typescript@npm:^5.4.3":
|
||||
version: 5.8.3
|
||||
resolution: "typescript@npm:5.8.3"
|
||||
bin:
|
||||
@ -30200,7 +30192,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"typescript@patch:typescript@npm%3A^5.0.0#optional!builtin<compat/typescript>":
|
||||
"typescript@patch:typescript@npm%3A^5.0.0#optional!builtin<compat/typescript>, typescript@patch:typescript@npm%3A^5.6.2#optional!builtin<compat/typescript>, typescript@patch:typescript@npm%3A^5.8.2#optional!builtin<compat/typescript>":
|
||||
version: 5.9.2
|
||||
resolution: "typescript@patch:typescript@npm%3A5.9.2#optional!builtin<compat/typescript>::version=5.9.2&hash=5786d5"
|
||||
bin:
|
||||
@ -30210,7 +30202,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"typescript@patch:typescript@npm%3A^5.4.3#optional!builtin<compat/typescript>, typescript@patch:typescript@npm%3A^5.6.2#optional!builtin<compat/typescript>":
|
||||
"typescript@patch:typescript@npm%3A^5.4.3#optional!builtin<compat/typescript>":
|
||||
version: 5.8.3
|
||||
resolution: "typescript@patch:typescript@npm%3A5.8.3#optional!builtin<compat/typescript>::version=5.8.3&hash=5786d5"
|
||||
bin:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user