From 993cd2dfe1084896aaa0493f1e0f5fd76f1c5baf Mon Sep 17 00:00:00 2001 From: Zhang Jianbin <1257817341@qq.com> Date: Wed, 9 Apr 2025 18:13:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B1=89=E5=8C=96v2;=E6=B7=BB=E5=8A=A04?= =?UTF-8?q?=E4=B8=AA=E6=96=B0=E6=A8=A1=E5=9E=8B=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/shared/api.ts | 32 +++++++++ webview-ui/src/components/chat/ChatRow.tsx | 67 +++++++++---------- .../configuration/McpConfigurationView.tsx | 2 +- .../tabs/marketplace/McpMarketplaceView.tsx | 4 +- 4 files changed, 67 insertions(+), 38 deletions(-) diff --git a/src/shared/api.ts b/src/shared/api.ts index e4b245bb..fd0d2d37 100644 --- a/src/shared/api.ts +++ b/src/shared/api.ts @@ -1508,6 +1508,38 @@ export const shengsuanyunModels = { inputPrice: 0.1, outputPrice: 0.4, }, + "google/gemini-2.5-pro-preview-03-25": { + maxTokens: 66_000, + contextWindow: 1000_000, + supportsImages: false, + supportsPromptCache: false, + inputPrice: 1.25, + outputPrice: 10, + }, + "openai/gpt-4o-2024-11-20": { + maxTokens: 16_000, + contextWindow: 128_000, + supportsImages: false, + supportsPromptCache: false, + inputPrice: 5, + outputPrice: 15, + }, + "openai/gpt-4o-mini": { + maxTokens: 16_000, + contextWindow: 128_000, + supportsImages: false, + supportsPromptCache: false, + inputPrice: 0.15, + outputPrice: 0.6, + }, + "doubao/doubao-pro-256k": { + maxTokens: 4_000, + contextWindow: 33_000, + supportsImages: false, + supportsPromptCache: false, + inputPrice: 0.68, + outputPrice: 1.22, + }, "deepseek/deepseek-v3": { maxTokens: 164_000, contextWindow: 164_000, diff --git a/webview-ui/src/components/chat/ChatRow.tsx b/webview-ui/src/components/chat/ChatRow.tsx index 0e2dcd0a..b7f63474 100644 --- a/webview-ui/src/components/chat/ChatRow.tsx +++ b/webview-ui/src/components/chat/ChatRow.tsx @@ -189,7 +189,7 @@ export const ChatRowContent = ({ message, isExpanded, onToggleExpand, lastModifi color: errorColor, marginBottom: "-1.5px", }}>, - Error, + 错误, ] case "mistake_limit_reached": return [ @@ -199,7 +199,7 @@ export const ChatRowContent = ({ message, isExpanded, onToggleExpand, lastModifi color: errorColor, marginBottom: "-1.5px", }}>, - Cline is having trouble..., + Cline 出错了..., ] case "auto_approval_max_req_reached": return [ @@ -209,7 +209,7 @@ export const ChatRowContent = ({ message, isExpanded, onToggleExpand, lastModifi color: errorColor, marginBottom: "-1.5px", }}>, - Maximum Requests Reached, + 达到最大请求数, ] case "command": return [ @@ -223,7 +223,7 @@ export const ChatRowContent = ({ message, isExpanded, onToggleExpand, lastModifi marginBottom: "-1.5px", }}> ), - Cline wants to execute this command:, + Cline 需要执行这个命令:, ] case "use_mcp_server": const mcpServerUse = JSON.parse(message.text || "{}") as ClineAskUseMcpServer @@ -254,7 +254,7 @@ export const ChatRowContent = ({ message, isExpanded, onToggleExpand, lastModifi color: successColor, marginBottom: "-1.5px", }}>, - Task Completed, + 任务完成, ] case "api_req_started": const getIconSpan = (iconName: string, color: string) => ( @@ -292,21 +292,21 @@ export const ChatRowContent = ({ message, isExpanded, onToggleExpand, lastModifi (() => { if (apiReqCancelReason != null) { return apiReqCancelReason === "user_cancelled" ? ( - API Request Cancelled + API 请求被取消 ) : ( - API Streaming Failed + API 流式输出失败 ) } if (cost != null) { - return API Request + return API 请求 } if (apiRequestFailedMessage) { - return API Request Failed + return API 请求失败 } - return API Request... + return API 请求... })(), ] case "followup": @@ -317,7 +317,7 @@ export const ChatRowContent = ({ message, isExpanded, onToggleExpand, lastModifi color: normalColor, marginBottom: "-1.5px", }}>, - Cline has a question:, + Cline 需要知道:, ] default: return [null, null] @@ -361,7 +361,7 @@ export const ChatRowContent = ({ message, isExpanded, onToggleExpand, lastModifi <>
{toolIcon("edit")} - Cline wants to edit this file: + Cline 需要编辑这个文件:
{toolIcon("new-file")} - Cline wants to create a new file: + Cline 需要创建新文件:
{/* {message.type === "ask" ? "" : "Cline read this file:"} */} - Cline wants to read this file: + Cline 需要读取这个文件:
{toolIcon("search")} - Cline wants to search this directory for {tool.regex}: + Cline 需要查找这个目录 {tool.regex}:
- Command Output + 命令输出 {isExpanded && } @@ -608,7 +608,7 @@ export const ChatRowContent = ({ message, isExpanded, onToggleExpand, lastModifi color: "var(--vscode-editorWarning-foreground)", }}> - The model has determined this command requires explicit approval. + 模型已确定此命令需要明确批准。 )} @@ -763,14 +763,14 @@ export const ChatRowContent = ({ message, isExpanded, onToggleExpand, lastModifi <>

- It seems like you're having Windows PowerShell issues, please see this{" "} + 您似乎遇到了 Windows PowerShell 问题,请参阅此处{" "} - troubleshooting guide + 故障排除指南 . @@ -937,9 +937,9 @@ export const ChatRowContent = ({ message, isExpanded, onToggleExpand, lastModifi fontSize: 14, color: "var(--vscode-descriptionForeground)", }}> - Diff Edit Mismatch + 差异编辑不匹配 -
The model used search patterns that don't match anything in the file. Retrying...
+
该模型使用的搜索模式与文件中的任何内容都不匹配。重试...
) @@ -973,13 +973,11 @@ export const ChatRowContent = ({ message, isExpanded, onToggleExpand, lastModifi fontWeight: 500, color: "#FFA500", }}> - Access Denied + 访问被拒绝
- Cline tried to access {message.text} which is blocked by the{" "} - .clineignore - file. + Cline 尝试读取 {message.text} 文件被 .clineignore阻止
@@ -1002,7 +1000,7 @@ export const ChatRowContent = ({ message, isExpanded, onToggleExpand, lastModifi padding: "4px 0", }}> - Loading MCP documentation + 加载 MCP 文档 ) case "completion_result": @@ -1052,7 +1050,7 @@ export const ChatRowContent = ({ message, isExpanded, onToggleExpand, lastModifi width: "100%", }}> - See new changes + 查看新更改 )} @@ -1088,21 +1086,20 @@ export const ChatRowContent = ({ message, isExpanded, onToggleExpand, lastModifi fontWeight: 500, color: "#FFA500", }}> - Shell Integration Unavailable + Shell 集成不可用
- Cline won't be able to view the command's output. Please update VSCode ( - CMD/CTRL + Shift + P → "Update") and make sure you're using a supported shell: - zsh, bash, fish, or PowerShell (CMD/CTRL + Shift + P → "Terminal: Select Default - Profile").{" "} + Cline 将无法查看命令的输出。请更新 VSCode (CMD/CTRL + Shift + P → "更新") + 并确保你使用的是受支持的 shell: zsh、bash、fish 或 PowerShell( + CMD/CTRL + Shift + P → "Terminal: Select Default Profile").{" "} - Still having trouble? + 仍有问题?
@@ -1207,7 +1204,7 @@ export const ChatRowContent = ({ message, isExpanded, onToggleExpand, lastModifi cursor: seeNewChangesDisabled ? "wait" : "pointer", }} /> - See new changes + 查看新更改 )} @@ -1259,7 +1256,7 @@ export const ChatRowContent = ({ message, isExpanded, onToggleExpand, lastModifi color: normalColor, marginBottom: "-1.5px", }}> - Cline wants to start a new task: + Cline 需要开始一个新任务: diff --git a/webview-ui/src/components/mcp/configuration/McpConfigurationView.tsx b/webview-ui/src/components/mcp/configuration/McpConfigurationView.tsx index 87787ce3..0f92afe5 100644 --- a/webview-ui/src/components/mcp/configuration/McpConfigurationView.tsx +++ b/webview-ui/src/components/mcp/configuration/McpConfigurationView.tsx @@ -52,7 +52,7 @@ const McpConfigurationView = ({ onDone }: McpViewProps) => { padding: "10px 17px 5px 20px", }}>

MCP 服务

- Done + 确定
diff --git a/webview-ui/src/components/mcp/configuration/tabs/marketplace/McpMarketplaceView.tsx b/webview-ui/src/components/mcp/configuration/tabs/marketplace/McpMarketplaceView.tsx index e87e4163..d2c21331 100644 --- a/webview-ui/src/components/mcp/configuration/tabs/marketplace/McpMarketplaceView.tsx +++ b/webview-ui/src/components/mcp/configuration/tabs/marketplace/McpMarketplaceView.tsx @@ -184,7 +184,7 @@ const McpMarketplaceView = () => { fontWeight: 500, flexShrink: 0, }}> - Filter: + 过滤:
{ fontWeight: 500, marginTop: "3px", }}> - Sort: + 排序: