diff --git a/.changeset/fix-history-filters.md b/.changeset/fix-history-filters.md index 6cb2d32e..16b7da20 100644 --- a/.changeset/fix-history-filters.md +++ b/.changeset/fix-history-filters.md @@ -1,5 +1,5 @@ --- -"claude-dev": patch +"cline-chinese": patch --- Fix Workspace and Favorites history filters to work independently instead of being mutually exclusive diff --git a/.changeset/lazy-mice-explode.md b/.changeset/lazy-mice-explode.md index 0d8f991a..ffbfbb8e 100644 --- a/.changeset/lazy-mice-explode.md +++ b/.changeset/lazy-mice-explode.md @@ -1,5 +1,5 @@ --- -"claude-dev": patch +"cline-chinese": patch --- Add a new api provider. diff --git a/.changeset/three-areas-cheer.md b/.changeset/three-areas-cheer.md index 1a34f08a..0f28bdae 100644 --- a/.changeset/three-areas-cheer.md +++ b/.changeset/three-areas-cheer.md @@ -1,5 +1,5 @@ --- -"claude-dev": patch +"cline-chinese": patch --- fix regression that broke JSON parsing for SAP AI Core provider in native API mode for claude models diff --git a/.clinerules/workflows/extension-release.md b/.clinerules/workflows/extension-release.md index 0a3d0421..7101e64a 100644 --- a/.clinerules/workflows/extension-release.md +++ b/.clinerules/workflows/extension-release.md @@ -9,7 +9,7 @@ For reference, here are some examples of how we converted previous changesets to This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and publish to npm yourself or setup this action to publish automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. Releases -claude-dev@3.14.0 +cline-chinese@3.14.0 Minor Changes 77c9863: create clinerules folder if its currently a file and creating new rule 0ffb7dd: disabling shift hint for now & improving tooltip behavior @@ -369,7 +369,7 @@ This PR was opened by the [Changesets release](https://github.com/changesets/act # Releases -## claude-dev@3.16.0 +## cline-chinese@3.16.0 ### Minor Changes diff --git a/.clinerules/workflows/pr-review.md b/.clinerules/workflows/pr-review.md index 24b07855..fe61a73f 100644 --- a/.clinerules/workflows/pr-review.md +++ b/.clinerules/workflows/pr-review.md @@ -331,7 +331,7 @@ Hey, the PR looks good overall but I'm concerned about removing those timeouts. Could you add back the timeouts after focusing the sidebar? Something like: ```typescript -await vscode.commands.executeCommand("claude-dev.SidebarProvider.focus") +await vscode.commands.executeCommand("cline-chinese.SidebarProvider.focus") await setTimeoutPromise(100) // Give UI time to update visibleWebview = WebviewProvider.getSidebarInstance() ``` diff --git a/.vscode/launch.json b/.vscode/launch.json index b7a59bff..d7e8b92a 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -13,7 +13,7 @@ "--extensionDevelopmentPath=${workspaceFolder}", "--disable-workspace-trust", "--disable-extension", - "saoudrizwan.claude-dev", // Avoid conflicts with installed Cline + "saoudrizwan.cline-chinese", // Avoid conflicts with installed Cline "--disable-extension", "saoudrizwan.cline-nightly", // Avoid conflicts with installed Cline Nightly "${workspaceFolder}" @@ -37,7 +37,7 @@ "--extensionDevelopmentPath=${workspaceFolder}", "--disable-workspace-trust", "--disable-extension", - "saoudrizwan.claude-dev", // Avoid conflicts with installed Cline + "saoudrizwan.cline-chinese", // Avoid conflicts with installed Cline "--disable-extension", "saoudrizwan.cline-nightly", // Avoid conflicts with installed Cline Nightly "${workspaceFolder}" @@ -61,7 +61,7 @@ "--extensionDevelopmentPath=${workspaceFolder}", "--disable-workspace-trust", "--disable-extension", - "saoudrizwan.claude-dev", // Avoid conflicts with installed Cline + "saoudrizwan.cline-chinese", // Avoid conflicts with installed Cline "--disable-extension", "saoudrizwan.cline-nightly", // Avoid conflicts with installed Cline Nightly "${workspaceFolder}" @@ -87,7 +87,7 @@ "--profile-temp", "--sync=off", "--disable-extension", - "saoudrizwan.claude-dev", // Avoid conflicts with installed Cline + "saoudrizwan.cline-chinese", // Avoid conflicts with installed Cline "--disable-extension", "saoudrizwan.cline-nightly", // Avoid conflicts with installed Cline Nightly "--extensionDevelopmentPath=${workspaceFolder}", diff --git a/README.md b/README.md index ca9f4a1f..26e17aa2 100644 --- a/README.md +++ b/README.md @@ -84,8 +84,8 @@ Reka AI |Reka Core 国际 Github: https://github.com/SSYCloud/cline-chinese-ssy
中国大陆
-Gitcode:https://gitcode.com/shengsuan-cloud/cline-chinese-ssy
-Gitee: https://gitee.com/shengsuan-cloud/cline-chinese-ssy
+Gitcode:https://gitcode.com/HybridTalentComputing/cline-chinese-ssy
+Gitee: https://gitee.com/HybridTalentComputing/cline-chinese-ssy
--- ## 文档地址(包括使用方法,MCP知识,常见问题解答等)
https://modelmesh.gitbook.io/cline-zhong-wen-ban-docs/
@@ -93,10 +93,10 @@ https://modelmesh.gitbook.io/cline-zhong-wen-ban-docs/
## 其他支持插件 Kilo SSY Code Agent
-https://marketplace.visualstudio.com/items?itemName=shengsuan-cloud.kilo-ssy
+https://marketplace.visualstudio.com/items?itemName=HybridTalentComputing.kilo-ssy
Roo Code Chinese SSY
-https://marketplace.visualstudio.com/items?itemName=shengsuan-cloud.roo-vibecoding
+https://marketplace.visualstudio.com/items?itemName=HybridTalentComputing.roo-vibecoding
--- ## 欢迎关注我的自媒体账号 diff --git a/docs/features/commands-and-shortcuts/keyboard-shortcuts.mdx b/docs/features/commands-and-shortcuts/keyboard-shortcuts.mdx index 788713cd..7a948bdb 100644 --- a/docs/features/commands-and-shortcuts/keyboard-shortcuts.mdx +++ b/docs/features/commands-and-shortcuts/keyboard-shortcuts.mdx @@ -29,7 +29,7 @@ Cline 配备以下内置键盘快捷键来简化您的工作流程: | [`cline.explainCode`](/features/commands-and-shortcuts/code-commands) | 解释选中的代码 | | [`cline.improveCode`](/features/commands-and-shortcuts/code-commands) | 为选中的代码建议改进 | | [`cline.fixWithCline`](/features/commands-and-shortcuts/code-commands) | 修复有错误的代码 | -| `claude-dev.SidebarProvider.focus` | 打开并聚焦 Cline 侧边栏 | +| `cline-chinese.SidebarProvider.focus` | 打开并聚焦 Cline 侧边栏 | ## 自定义键盘快捷键 @@ -54,7 +54,7 @@ Cline 配备以下内置键盘快捷键来简化您的工作流程: | 操作 | 建议快捷键 | 命令 ID | 描述 | | --------------------- | ------------------------------ | ----------------------------------------- | ----------------------------- | -| 打开 Cline 侧边栏 | `Ctrl+Shift+C` / `Cmd+Shift+C` | `claude-dev.SidebarProvider.focus` | 打开 Cline 侧边栏面板 | +| 打开 Cline 侧边栏 | `Ctrl+Shift+C` / `Cmd+Shift+C` | `cline-chinese.SidebarProvider.focus` | 打开 Cline 侧边栏面板 | | 新任务 | `Alt+N` | `cline.plusButtonClicked` | 启动新的 Cline 任务 | | 将终端添加到 Cline | `Alt+T` | `cline.addTerminalOutputToChat` | 将终端输出添加到 Cline | | 清除当前任务 | `Alt+C` | (需要自定义键绑定到 UI 操作) | 清除当前任务 | diff --git a/docs/features/slash-commands/workflows.mdx b/docs/features/slash-commands/workflows.mdx index 493d9a32..3230b680 100644 --- a/docs/features/slash-commands/workflows.mdx +++ b/docs/features/slash-commands/workflows.mdx @@ -385,7 +385,7 @@ Hey, the PR looks good overall but I'm concerned about removing those timeouts. Could you add back the timeouts after focusing the sidebar? Something like: ```typescript -await vscode.commands.executeCommand("claude-dev.SidebarProvider.focus") +await vscode.commands.executeCommand("cline-chinese.SidebarProvider.focus") await setTimeoutPromise(100) // Give UI time to update visibleWebview = WebviewProvider.getSidebarInstance() ``` diff --git a/docs/mcp/mcp-marketplace.mdx b/docs/mcp/mcp-marketplace.mdx index 5e5464d2..efafcb27 100644 --- a/docs/mcp/mcp-marketplace.mdx +++ b/docs/mcp/mcp-marketplace.mdx @@ -56,7 +56,7 @@ MCP 市场为各种类别的数百个 MCP 服务器提供一键安装体验。 ### 2. 配置 - MCP 设置文件使用您的服务器配置进行更新 -- 此文件位于:`/Users//Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json` +- 此文件位于:`/Users//Library/Application Support/Code/User/globalStorage/saoudrizwan.cline-chinese/settings/cline_mcp_settings.json` - 环境变量(如 API 密钥)被安全存储 - 注册服务器路径 @@ -109,7 +109,7 @@ MCP 市场为各种类别的数百个 MCP 服务器提供一键安装体验。 要完全删除有问题的 MCP 服务器: -1. 打开 MCP 设置文件:`/Users//Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json` +1. 打开 MCP 设置文件:`/Users//Library/Application Support/Code/User/globalStorage/saoudrizwan.cline-chinese/settings/cline_mcp_settings.json` 2. 从 `mcpServers` 对象中删除服务器的整个条目 3. 保存文件 4. 重启 Cline diff --git a/docs/troubleshooting/task-history-recovery.mdx b/docs/troubleshooting/task-history-recovery.mdx index 895d3cec..d6e6c2fd 100644 --- a/docs/troubleshooting/task-history-recovery.mdx +++ b/docs/troubleshooting/task-history-recovery.mdx @@ -38,21 +38,21 @@ Sometimes when you update Cline or when certain settings change, you might lose ```bash # macOS - ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/ + ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.cline-chinese/ # Windows - %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\ + %APPDATA%\Code\User\globalStorage\saoudrizwan.cline-chinese\ # Linux - ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/ + ~/.config/Code/User/globalStorage/saoudrizwan.cline-chinese/ ``` ```bash # macOS - ~/Library/Application Support/JetBrains//globalStorage/saoudrizwan.claude-dev/ + ~/Library/Application Support/JetBrains//globalStorage/saoudrizwan.cline-chinese/ # Windows - %APPDATA%\JetBrains\\globalStorage\saoudrizwan.claude-dev\ + %APPDATA%\JetBrains\\globalStorage\saoudrizwan.cline-chinese\ # Linux - ~/.config/JetBrains//globalStorage/saoudrizwan.claude-dev/ + ~/.config/JetBrains//globalStorage/saoudrizwan.cline-chinese/ ``` @@ -62,7 +62,7 @@ For VS Code Insiders, replace `Code` with `Code - Insiders`. For JetBrains IDEs, ### Directory Structure ``` -saoudrizwan.claude-dev/ +saoudrizwan.cline-chinese/ ├── state/ │ ├── taskHistory.json # Main history index │ └── taskHistory.backup.*.json # Backups @@ -112,7 +112,7 @@ Cline creates backups automatically. Find them in the `state/` folder: ```bash # macOS/Linux - cd ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/state/ + cd ~/.config/Code/User/globalStorage/saoudrizwan.cline-chinese/state/ ls taskHistory.backup.*.json # Pick the most recent one and restore it @@ -122,7 +122,7 @@ Cline creates backups automatically. Find them in the `state/` folder: ```bash # macOS - cd ~/Library/Application\ Support/JetBrains//globalStorage/saoudrizwan.claude-dev/state/ + cd ~/Library/Application\ Support/JetBrains//globalStorage/saoudrizwan.cline-chinese/state/ ls taskHistory.backup.*.json # Pick the most recent one and restore it @@ -137,7 +137,7 @@ Switching to a new computer? You can bring all your Cline conversations with you - On your **old machine**, find the `saoudrizwan.claude-dev` folder using the [storage paths above](#storage-paths) and copy the entire folder. + On your **old machine**, find the `saoudrizwan.cline-chinese` folder using the [storage paths above](#storage-paths) and copy the entire folder. On your **new machine**, install your IDE (VS Code or JetBrains) and the Cline extension. @@ -146,7 +146,7 @@ Switching to a new computer? You can bring all your Cline conversations with you Make sure your IDE is completely closed before proceeding. - Paste the `saoudrizwan.claude-dev` folder to the same storage path on your new machine. + Paste the `saoudrizwan.cline-chinese` folder to the same storage path on your new machine. Open your IDE. Your task history should now appear in Cline. diff --git a/evals/cli/src/utils/vscode.ts b/evals/cli/src/utils/vscode.ts index a7d4eeaa..10b1dd56 100644 --- a/evals/cli/src/utils/vscode.ts +++ b/evals/cli/src/utils/vscode.ts @@ -121,7 +121,7 @@ export async function spawnVSCode(workspacePath: string, vsixPath?: string): Pro // Show the activity bar and sidebar "workbench.activityBar.visible": true, "workbench.sideBar.visible": true, - "workbench.view.extension.shengsuan-cloud.cline-shengsuan-ActivityBar.visible": true, + "workbench.view.extension.HybridTalentComputing.cline-chinese-ActivityBar.visible": true, "workbench.view.alwaysShowHeaderActions": true, "workbench.editor.openSideBySideDirection": "right", @@ -145,13 +145,13 @@ export async function spawnVSCode(workspacePath: string, vsixPath?: string): Pro const keybindings = [ { key: "alt+c", - command: "workbench.view.extension.shengsuan-cloud.cline-shengsuan-ActivityBar", - when: "viewContainer.workbench.view.extension.shengsuan-cloud.cline-shengsuan-ActivityBar.enabled", + command: "workbench.view.extension.HybridTalentComputing.cline-chinese-ActivityBar", + when: "viewContainer.workbench.view.extension.HybridTalentComputing.cline-chinese-ActivityBar.enabled", }, { key: "alt+shift+c", command: "cline.openInNewTab", - when: "viewContainer.workbench.view.extension.shengsuan-cloud.cline-shengsuan-ActivityBar.enabled", + when: "viewContainer.workbench.view.extension.HybridTalentComputing.cline-chinese-ActivityBar.enabled", }, ] fs.writeFileSync(keybindingsPath, JSON.stringify(keybindings, null, 2)) @@ -171,10 +171,10 @@ export async function spawnVSCode(workspacePath: string, vsixPath?: string): Pro workspacePath, // Force the extension to be activated on startup "--start-up-extension", - "shengsuan-cloud.cline-shengsuan", + "HybridTalentComputing.cline-chinese", // Run a command on startup to open Cline "--command", - "workbench.view.extension.shengsuan-cloud.cline-shengsuan-ActivityBar", + "workbench.view.extension.HybridTalentComputing.cline-chinese-ActivityBar", // Additional flags to help with extension activation "--disable-gpu=false", "--max-memory=4096", @@ -186,7 +186,7 @@ export async function spawnVSCode(workspacePath: string, vsixPath?: string): Pro // This script will be executed when VS Code starts setTimeout(() => { // Try to open Cline in the sidebar - require('vscode').commands.executeCommand('workbench.view.extension.shengsuan-cloud.cline-shengsuan-ActivityBar'); + require('vscode').commands.executeCommand('workbench.view.extension.HybridTalentComputing.cline-chinese-ActivityBar'); // Also try to open Cline in a tab as a fallback setTimeout(() => { @@ -270,7 +270,7 @@ export async function spawnVSCode(workspacePath: string, vsixPath?: string): Pro let disposable = vscode.commands.registerCommand('cline-activator.activate', async function () { try { // Make sure the Cline extension is activated - const extension = vscode.extensions.getExtension('shengsuan-cloud.cline-shengsuan'); + const extension = vscode.extensions.getExtension('HybridTalentComputing.cline-chinese'); if (!extension) { console.error('Cline extension not found'); return; @@ -283,7 +283,7 @@ export async function spawnVSCode(workspacePath: string, vsixPath?: string): Pro // Show the Cline sidebar console.log('Opening Cline sidebar...'); - await vscode.commands.executeCommand('workbench.view.extension.shengsuan-cloud.cline-shengsuan-ActivityBar'); + await vscode.commands.executeCommand('workbench.view.extension.HybridTalentComputing.cline-chinese-ActivityBar'); // Wait a moment for the sidebar to initialize await new Promise(resolve => setTimeout(resolve, 2000)); diff --git a/locales/ar-sa/README.md b/locales/ar-sa/README.md index 1b6d0a10..35585cac 100644 --- a/locales/ar-sa/README.md +++ b/locales/ar-sa/README.md @@ -12,7 +12,7 @@
-تنزيل من متجر VS +تنزيل من متجر VS Discord diff --git a/locales/de/README.md b/locales/de/README.md index c40de41d..a4de2057 100644 --- a/locales/de/README.md +++ b/locales/de/README.md @@ -8,7 +8,7 @@
-Im VS Marketplace herunterladen +Im VS Marketplace herunterladen Discord diff --git a/locales/es/README.md b/locales/es/README.md index 03cc8cbd..417b47d0 100644 --- a/locales/es/README.md +++ b/locales/es/README.md @@ -8,7 +8,7 @@
-Descargar en VS Marketplace +Descargar en VS Marketplace Discord diff --git a/locales/ja/README.md b/locales/ja/README.md index 0bb2f625..c0b2402e 100644 --- a/locales/ja/README.md +++ b/locales/ja/README.md @@ -8,7 +8,7 @@
-VS Marketplaceでダウンロード +VS Marketplaceでダウンロード Discord diff --git a/locales/ko/README.md b/locales/ko/README.md index 173b847c..24e8d103 100644 --- a/locales/ko/README.md +++ b/locales/ko/README.md @@ -8,7 +8,7 @@
-VS Marketplace에서 다운로드 +VS Marketplace에서 다운로드 Discord diff --git a/locales/pt-BR/README.md b/locales/pt-BR/README.md index 70af85b1..774236c9 100644 --- a/locales/pt-BR/README.md +++ b/locales/pt-BR/README.md @@ -8,7 +8,7 @@
-Baixar no VS Marketplace +Baixar no VS Marketplace Discord diff --git a/locales/zh-cn/README.md b/locales/zh-cn/README.md index b24b4e94..13cd4e1c 100644 --- a/locales/zh-cn/README.md +++ b/locales/zh-cn/README.md @@ -8,7 +8,7 @@
-在 VS Marketplace 下载 +在 VS Marketplace 下载 Discord diff --git a/locales/zh-tw/README.md b/locales/zh-tw/README.md index 1b32dbee..1780f29e 100644 --- a/locales/zh-tw/README.md +++ b/locales/zh-tw/README.md @@ -12,7 +12,7 @@
-從 VS Marketplace 下載 +從 VS Marketplace 下載 Discord diff --git a/package-lock.json b/package-lock.json index 1a82d37c..c1a6ab14 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "claude-dev", + "name": "cline-chinese", "version": "3.46.5", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "claude-dev", + "name": "cline-chinese", "version": "3.46.2", "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index aaab904b..b2370706 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "claude-dev", - "displayName": "Cline", + "name": "cline-chinese", + "displayName": "Cline Chinese", "description": "%cline.description%", "version": "3.46.5", "icon": "assets/icons/icon.png", @@ -8,15 +8,15 @@ "vscode": "^1.84.0" }, "author": { - "name": "Cline Bot Inc." + "name": "HybridTalentComputing" }, "license": "Apache-2.0", - "publisher": "saoudrizwan", + "publisher": "HybridTalentComputing", "repository": { "type": "git", - "url": "https://github.com/cline/cline" + "url": "https://github.com/HybridTalentComputing/cline-chinese" }, - "homepage": "https://cline.bot", + "homepage": "https://github.com/HybridTalentComputing/cline-chinese", "categories": [ "AI", "Chat", @@ -46,6 +46,15 @@ ], "main": "./dist/extension.js", "contributes": { + "chatParticipants": [ + { + "id": "claude-code", + "name": "Claude Code", + "description": "Chat with Claude Code", + "isDefault": true, + "icon": "assets/icons/icon.png" + } + ], "icons": { "cline-icon": { "description": "cline", @@ -110,17 +119,17 @@ "viewsContainers": { "activitybar": [ { - "id": "claude-dev-ActivityBar", + "id": "cline-chinese-ActivityBar", "title": "Cline", "icon": "assets/icons/icon.svg" } ] }, "views": { - "claude-dev-ActivityBar": [ + "cline-chinese-ActivityBar": [ { "type": "webview", - "id": "claude-dev.SidebarProvider", + "id": "cline-chinese.SidebarProvider", "name": "", "icon": "assets/icons/icon.svg" } @@ -256,27 +265,27 @@ { "command": "cline.plusButtonClicked", "group": "navigation@1", - "when": "view == claude-dev.SidebarProvider" + "when": "view == cline-chinese.SidebarProvider" }, { "command": "cline.mcpButtonClicked", "group": "navigation@2", - "when": "view == claude-dev.SidebarProvider" + "when": "view == cline-chinese.SidebarProvider" }, { "command": "cline.historyButtonClicked", "group": "navigation@3", - "when": "view == claude-dev.SidebarProvider" + "when": "view == cline-chinese.SidebarProvider" }, { "command": "cline.accountButtonClicked", "group": "navigation@5", - "when": "view == claude-dev.SidebarProvider" + "when": "view == cline-chinese.SidebarProvider" }, { "command": "cline.settingsButtonClicked", "group": "navigation@6", - "when": "view == claude-dev.SidebarProvider" + "when": "view == cline-chinese.SidebarProvider" } ], "editor/context": [ diff --git a/proto/cline/account.proto b/proto/cline/account.proto index 55e96f5f..95711351 100644 --- a/proto/cline/account.proto +++ b/proto/cline/account.proto @@ -65,6 +65,7 @@ message UserInfo { optional string email = 3; optional string photo_url = 4; optional string app_base_url = 5; // Cline app base URL + optional double balance = 6; } message UserOrganization { @@ -84,10 +85,11 @@ message UserOrganizationUpdateRequest { } message UserCreditsData { - UserCreditsBalance balance = 1; + optional UserCreditsBalance balance = 1; repeated UsageTransaction usage_transactions = 2; repeated PaymentTransaction payment_transactions = 3; optional UserInfo user = 4; + optional float rate = 5; } message GetOrganizationCreditsRequest { diff --git a/proto/host/env.proto b/proto/host/env.proto index 3aac9002..72cab2e2 100644 --- a/proto/host/env.proto +++ b/proto/host/env.proto @@ -20,7 +20,7 @@ service EnvService { rpc getHostVersion(cline.EmptyRequest) returns (GetHostVersionResponse); // Returns a URI that will redirect to the host environment. - // e.g. vscode://saoudrizwan.claude-dev, idea://, pycharm://, etc. + // e.g. vscode://saoudrizwan.cline-chinese, idea://, pycharm://, etc. // If the host does not support URIs it should return empty. rpc getIdeRedirectUri(cline.EmptyRequest) returns (cline.String); diff --git a/scripts/publish-nightly.mjs b/scripts/publish-nightly.mjs index df26ef29..67162fa2 100755 --- a/scripts/publish-nightly.mjs +++ b/scripts/publish-nightly.mjs @@ -167,9 +167,11 @@ class NightlyPublisher { * Update package.json with nightly configuration */ updatePackageJson() { - // Replace any occurrences cline. or claude-dev with nightly name + // Replace any occurrences cline. or cline-chinese with nightly name const rawContent = fs.readFileSync(config.packageJsonPath, "utf-8") - const content = rawContent.replaceAll("claude-dev", config.nightlyName).replaceAll('"cline.', `"${config.nightlyName}.`) + const content = rawContent + .replaceAll("cline-chinese", config.nightlyName) + .replaceAll('"cline.', `"${config.nightlyName}.`) const pkg = JSON.parse(content) const currentVersion = pkg.version diff --git a/scripts/report-issue.js b/scripts/report-issue.js index 93dd5d9e..592ababd 100644 --- a/scripts/report-issue.js +++ b/scripts/report-issue.js @@ -12,7 +12,7 @@ const ask = (question) => new Promise((resolve) => rl.question(`\n${question}`, const getClineVersion = () => { try { const extensions = execSync("code --list-extensions --show-versions").toString() - const clineMatch = extensions.match(/claude-dev@(\d+\.\d+\.\d+)/) + const clineMatch = extensions.match(/cline-chinese@(\d+\.\d+\.\d+)/) return clineMatch ? clineMatch[1] : "Not installed" } catch (_err) { return "Error getting version" diff --git a/src/core/api/providers/shengsuanyun.ts b/src/core/api/providers/shengsuanyun.ts index 7d9dba63..2019bbe8 100644 --- a/src/core/api/providers/shengsuanyun.ts +++ b/src/core/api/providers/shengsuanyun.ts @@ -42,7 +42,7 @@ export class ShengSuanYunHandler implements ApiHandler { baseURL: "https://router.shengsuanyun.com/api/v1", apiKey: this.options.shengSuanYunApiKey, defaultHeaders: { - "HTTP-Referer": `vscode://shengsuan-cloud.cline-shengsuan/ssy`, + "HTTP-Referer": `vscode://HybridTalentComputing.cline-chinese/ssy`, "X-Title": "cline", }, }) diff --git a/src/core/controller/account/shengSuanYunLoginClicked.ts b/src/core/controller/account/shengSuanYunLoginClicked.ts index 103ff0dc..a60df30d 100644 --- a/src/core/controller/account/shengSuanYunLoginClicked.ts +++ b/src/core/controller/account/shengSuanYunLoginClicked.ts @@ -1,15 +1,13 @@ import { EmptyRequest, String } from "@shared/proto/cline/common" -// import vscode from "vscode" +import { HostProvider } from "@/hosts/host-provider" import { openExternal } from "@/utils/env" import { Controller } from ".." -export async function shengSuanYunLoginClicked(_controller: Controller, _: EmptyRequest): Promise { - const id = "cline-shengsuan" - const channel = "CH_R39YE8W1" - const author = "shengsuan-cloud" - const authUrl = new URL( - `https://router.shengsuanyun.com/auth?from=${channel}&callback_url=${encodeURIComponent(`vscode://${author}.${id}/ssy`)}`, - ) +export async function shengSuanYunLoginClicked(controller: Controller, _: EmptyRequest): Promise { + const callbackHost = await HostProvider.get().getCallbackUrl() + const callbackUrl = `${callbackHost}/ssy` + const id = "cline-chinese" + const authUrl = new URL(`https://router.shengsuanyun.com/auth?from=${id}&callback_url=${callbackUrl}`) const authUrlString = authUrl.toString() await openExternal(authUrlString) return String.create({ value: authUrlString }) diff --git a/src/core/controller/index.ts b/src/core/controller/index.ts index 366a9fda..3b0226c6 100644 --- a/src/core/controller/index.ts +++ b/src/core/controller/index.ts @@ -688,7 +688,6 @@ export class Controller { } // OpenRouter - async handleOpenRouterCallback(code: string) { let apiKey: string try { @@ -725,13 +724,12 @@ export class Controller { // shengsuanyun Auth async handleShengSuanYunCallback(code: string) { - // console.log("handleShengSuanYunCallback() with code:", code) try { let shengSuanYunApiKey: string let shengSuanYunToken: string const res = await axios.post("https://api.shengsuanyun.com/auth/keys", { code: code, - callback_url: `vscode://shengsuan-cloud.cline-shengsuan/ssy`, + callback_url: `vscode://HybridTalentComputing.cline-chinese/ssy`, }) // console.log("https://api.shengsuanyun.com/auth/keys :", res.data) if (res.data && res.data.data && res.data.data.api_key) { @@ -758,8 +756,8 @@ export class Controller { if (this.task) { this.task.api = buildApiHandler({ ...updatedConfig, ulid: this.task.ulid }, currentMode) } - const user: UserInfo = await this.accountServiceSSY.getUserInfo() - // console.log("Controller.fetchUserCreditsData().user", user) + const user: UserInfo = await this.accountServiceSSY.getUserInfo(shengSuanYunToken) + console.log("Controller.fetchUserCreditsData().user ------------", user) this.stateManager.setGlobalState("userInfo", user) await this.postStateToWebview() } catch (error) { diff --git a/src/core/controller/ui/openWalkthrough.ts b/src/core/controller/ui/openWalkthrough.ts index 8eab6d6b..02d43cb5 100644 --- a/src/core/controller/ui/openWalkthrough.ts +++ b/src/core/controller/ui/openWalkthrough.ts @@ -15,7 +15,7 @@ export async function openWalkthrough(_controller: Controller, _request: EmptyRe try { await vscode.commands.executeCommand( "workbench.action.openWalkthrough", - `shengsuan-cloud.${ExtensionRegistryInfo.name}#ClineWalkthrough`, + `HybridTalentComputing.${ExtensionRegistryInfo.name}#ClineWalkthrough`, ) // telemetryService.captureButtonClick("webview_openWalkthrough") return Empty.create({}) diff --git a/src/exports/README.md b/src/exports/README.md index 155a0e17..5b9589ab 100644 --- a/src/exports/README.md +++ b/src/exports/README.md @@ -7,7 +7,7 @@ The Cline extension exposes an API that can be used by other extensions. To use 3. Get access to the API with the following code: ```ts - const clineExtension = vscode.extensions.getExtension("shengsuan-cloud.cline-shengsuan") + const clineExtension = vscode.extensions.getExtension("HybridTalentComputing.cline-chinese") if (!clineExtension?.isActive) { throw new Error("Cline extension is not activated") @@ -37,11 +37,11 @@ The Cline extension exposes an API that can be used by other extensions. To use } ``` - **Note:** To ensure that the `shengsuan-cloud.cline-shengsuan` extension is activated before your extension, add it to the `extensionDependencies` in your `package.json`: + **Note:** To ensure that the `HybridTalentComputing.cline-chinese` extension is activated before your extension, add it to the `extensionDependencies` in your `package.json`: ```json "extensionDependencies": [ - "shengsuan-cloud.cline-shengsuan" + "HybridTalentComputing.cline-chinese" ] ``` diff --git a/src/hosts/vscode/hostbridge/env/getIdeRedirectUri.ts b/src/hosts/vscode/hostbridge/env/getIdeRedirectUri.ts index 5404e1ab..a18df532 100644 --- a/src/hosts/vscode/hostbridge/env/getIdeRedirectUri.ts +++ b/src/hosts/vscode/hostbridge/env/getIdeRedirectUri.ts @@ -3,6 +3,6 @@ import * as vscode from "vscode" export async function getIdeRedirectUri(_: EmptyRequest): Promise { const uriScheme = vscode.env.uriScheme || "vscode" - const url = `${uriScheme}://saoudrizwan.claude-dev` + const url = `${uriScheme}://saoudrizwan.cline-chinese` return { value: url } } diff --git a/src/registry.ts b/src/registry.ts index f33a623a..8118b881 100644 --- a/src/registry.ts +++ b/src/registry.ts @@ -1,6 +1,6 @@ import { name, publisher, version } from "../package.json" -const prefix = name === "claude-dev" ? "cline" : "cline" +const prefix = "cline" /** * List of commands with the name of the extension they are registered under. @@ -31,7 +31,7 @@ const ClineCommands = { * These should match the name + view IDs defined in package.json. */ const ClineViewIds = { - Sidebar: "claude-dev.SidebarProvider", + Sidebar: "cline-chinese.SidebarProvider", } /** diff --git a/src/services/account/SSYAccountService.ts b/src/services/account/SSYAccountService.ts index 3cd1284e..540c320e 100644 --- a/src/services/account/SSYAccountService.ts +++ b/src/services/account/SSYAccountService.ts @@ -10,16 +10,18 @@ export class SSYAccountService { } private async authenticatedRequest(endpoint: string, config: AxiosRequestConfig = {}): Promise { const ssyApiKey = await this.getSSYApiKey() - if (!ssyApiKey) { - throw new Error("未找到胜算云 Auth API") + const hasToken = config?.headers?.["x-token"] + if (!ssyApiKey && !hasToken) { + throw new Error("未找到胜算云 Auth API Key") } const reqConfig: AxiosRequestConfig = { ...config, headers: { - "x-token": ssyApiKey, - "Content-Type": "application/json", ...config.headers, + "x-token": ssyApiKey || hasToken, + "Content-Type": "application/json", }, + timeout: 50000, } const url = `${this.baseUrl}${endpoint}` // console.log("SSYAccountService.authenticatedRequest():", url, reqConfig) @@ -34,13 +36,12 @@ export class SSYAccountService { async fetchUserDataRPC(): Promise { try { const dqs = this.dateQueryString() - let [rate, usage, payment, user] = await Promise.all([ + let [rate, usage, payment] = await Promise.all([ this.authenticatedRequest("/base/rate"), this.authenticatedRequest(`/modelrouter/userlog?page=1&pageSize=1000&${dqs}`), this.authenticatedRequest("/modelrouter/listrecharge?page=1&pageSize=10000"), - this.authenticatedRequest("/user/info"), ]) - if (!rate || !user) { + if (!rate) { throw new Error(`获取胜算云账户信息失败!`) } if (!usage || !Array.isArray(usage?.logs)) { @@ -66,22 +67,11 @@ export class SSYAccountService { credits: 0, })) } - - let balance = { currentBalance: 0 } - if (user.Wallet && user.Wallet.Assets) { - balance = { currentBalance: (rate * user.Wallet.Assets) / 10000 } - } - console.log("UserCreditsData", balance, usage, payment, user) + console.log("UserCreditsData", usage, payment) return UserCreditsData.create({ - balance: balance, + rate: rate, usageTransactions: usage, paymentTransactions: payment, - user: { - uid: user.ID, - displayName: user.Nickname || user.Username || user.Phone, - email: user.Email, - photoUrl: user.HeadImg, - }, }) } catch (error) { console.error("Failed fetchUserDataRPC:", error) @@ -89,21 +79,25 @@ export class SSYAccountService { } } - async getUserInfo(): Promise { + async getUserInfo(token: string = ""): Promise { + const headers = { ...(token ? { "x-token": token } : {}) } try { - const res = await this.authenticatedRequest("/user/info") - if (!res.data || !res.data.data || res.data.code !== 0) { + const res = await this.authenticatedRequest("/user/info", { headers }) + if (!res) { + console.log(res) throw new Error(`Invalid response from API: /user/info`) } const user: UserInfo = { - displayName: res.data.data.Nickname || res.data.data.Username || undefined, - email: res.data.data.Email ?? undefined, - photoUrl: res.data.data.HeadImg ?? undefined, - uid: res.data.data.ID || undefined, + displayName: res.Nickname || res.Username || undefined, + email: res.Email ?? undefined, + photoUrl: res.HeadImg ?? undefined, + uid: res.ID || undefined, + balance: res.Wallet.Assets / 10000, } return user } catch (error) { console.error("getUserInfo():", error) + console.log("headers: ", headers) throw error } } diff --git a/src/shared/UserInfo.ts b/src/shared/UserInfo.ts index 0cd86c38..bbf4cd1a 100644 --- a/src/shared/UserInfo.ts +++ b/src/shared/UserInfo.ts @@ -3,4 +3,5 @@ export interface UserInfo { email?: string photoUrl?: string apiBaseUrl?: string // Base URL for API requests + balance?: number } diff --git a/src/test/suite/extension.test.js b/src/test/suite/extension.test.js index 7c2cfc2d..8def432f 100644 --- a/src/test/suite/extension.test.js +++ b/src/test/suite/extension.test.js @@ -25,7 +25,7 @@ describe("Extension Tests", function () { it("should activate extension successfully", async () => { // Get the extension - const extension = vscode.extensions.getExtension("shengsuan-cloud.cline-shengsuan") + const extension = vscode.extensions.getExtension("HybridTalentComputing.cline-chinese") expect(extension).to.not.be.undefined // Activate the extension if not already activated diff --git a/webview-ui/src/components/account/CreditsHistoryTable.tsx b/webview-ui/src/components/account/CreditsHistoryTable.tsx index e7d67bb8..0e56b10f 100644 --- a/webview-ui/src/components/account/CreditsHistoryTable.tsx +++ b/webview-ui/src/components/account/CreditsHistoryTable.tsx @@ -59,9 +59,9 @@ const CreditsHistoryTable = memo(({ isLoading, usageData, paymentsData, showPaym {`${row.model}`} - {Number(row.credits).toFixed(4)} + {Number(row.credits).toFixed(5)} - + {/* {row.operation === "web_search" ? t("account.creditsHistory.webSearch") : row.operation === "web_fetch" @@ -69,9 +69,9 @@ const CreditsHistoryTable = memo(({ isLoading, usageData, paymentsData, showPaym : row.operation === "search_chat_completion" ? t("account.creditsHistory.webFetchLlm") : row.aiModelName} - + */} {/* {`${row.promptTokens} → ${row.completionTokens}`} */} - {`$${Number(row.creditsUsed / 1000000).toFixed(4)}`} + {/* {`$${Number(row.credits).toFixed(4)}`} */} ))} diff --git a/webview-ui/src/components/account/SSYAccountView.tsx b/webview-ui/src/components/account/SSYAccountView.tsx index cc212ce1..0a20a801 100644 --- a/webview-ui/src/components/account/SSYAccountView.tsx +++ b/webview-ui/src/components/account/SSYAccountView.tsx @@ -10,30 +10,31 @@ import CreditsHistoryTable from "./CreditsHistoryTable" import { StyledCreditDisplaySSY } from "./StyledCreditDisplaySSY" export const SSYAccountView = () => { - const { userInfo, setUserInfo } = useExtensionState() + const { userInfo } = useExtensionState() console.log("SSYAccountView() userInfo: ", userInfo) - const [balance, setBalance] = useState(0) + const [rate, setRate] = useState(0) const [isLoading, setIsLoading] = useState(true) const [usageData, setUsageData] = useState([]) const [paymentsData, setPaymentsData] = useState([]) // Fetch all account data when component mounts using gRPC useEffect(() => { + if (!userInfo || !userInfo.displayName) { + return + } setIsLoading(true) AccountServiceClient.shengSuanYunUserData(EmptyRequest.create()) .then((res: any) => { - setBalance(res.balance?.currentBalance || 0) + setRate(res.rate || 0) setUsageData(res.usageTransactions) setPaymentsData(res.paymentTransactions) - setUserInfo(res.user) }) .catch((error: any) => { console.error("Failed to fetch user credits data:", error) - setUserInfo(undefined) }) .finally(() => setIsLoading(false)) - }, []) + }, [userInfo]) return (
@@ -95,7 +96,7 @@ export const SSYAccountView = () => { ) : ( <> $ - + { setIsLoading(true) AccountServiceClient.shengSuanYunUserData(EmptyRequest.create()) .then((res) => { - setBalance(res.balance?.currentBalance || 0) + setRate(res.rate || 0) setUsageData(res.usageTransactions as any) setPaymentsData(res.paymentTransactions) }) @@ -137,11 +138,15 @@ export const SSYAccountView = () => {

注册帐户访问最新模型,进群联系客服,获得100万Tokens免费额度,以及更多即将推出的功能。

- AccountServiceClient.shengSuanYunLoginClicked(EmptyRequest.create()).catch((err) => - console.error("Failed to get login URL:", err), - ) - }> + disabled={isLoading} + onClick={() => { + setIsLoading(true) + AccountServiceClient.shengSuanYunLoginClicked(EmptyRequest.create()) + .catch((err) => console.error("Failed to get login URL:", err)) + .finally(() => { + setIsLoading(false) + }) + }}> 注册 Cline 胜算云

diff --git a/webview-ui/src/components/chat/CreditLimitErrorSSY.tsx b/webview-ui/src/components/chat/CreditLimitErrorSSY.tsx index 73dc7342..dbe0e4fa 100644 --- a/webview-ui/src/components/chat/CreditLimitErrorSSY.tsx +++ b/webview-ui/src/components/chat/CreditLimitErrorSSY.tsx @@ -19,7 +19,7 @@ const CreditLimitErrorSSY: React.FC = ({ buyCreditsUrl = "https://console.shengsuanyun.com/user/recharge", }) => { const { uriScheme } = useExtensionState() - const callbackUrl = `${uriScheme || "vscode"}://shengsuan-cloud.cline-shengsuan` + const callbackUrl = `${uriScheme || "vscode"}://HybridTalentComputing.cline-chinese` const fullPurchaseUrl = new URL(buyCreditsUrl) fullPurchaseUrl.searchParams.set("callback_url", callbackUrl) diff --git a/webview-ui/src/components/common/WhatsNewModal.tsx b/webview-ui/src/components/common/WhatsNewModal.tsx index 3a9c2fc4..7df725ca 100644 --- a/webview-ui/src/components/common/WhatsNewModal.tsx +++ b/webview-ui/src/components/common/WhatsNewModal.tsx @@ -66,7 +66,7 @@ export const WhatsNewModal: React.FC = ({ open, onClose, ver

{children}
) : ( ) diff --git a/webview-ui/src/context/ShengSuanYunAuthContext.tsx b/webview-ui/src/context/ShengSuanYunAuthContext.tsx index eefb1985..8f64d648 100644 --- a/webview-ui/src/context/ShengSuanYunAuthContext.tsx +++ b/webview-ui/src/context/ShengSuanYunAuthContext.tsx @@ -1,115 +1,6 @@ -import { AuthStateChangedRequest } from "@shared/proto/cline/account" import { EmptyRequest } from "@shared/proto/cline/common" -import axios, { AxiosRequestConfig } from "axios" -import React, { createContext, useCallback, useContext, useEffect, useState } from "react" +import { useCallback, useState } from "react" import { AccountServiceClient } from "@/services/grpc-client" -import { useExtensionState } from "./ExtensionStateContext" - -interface ShengSuanYunAuthContextType { - userSSY: any | null - isInitSSY: boolean - signInWithTokenSSY: (token: string) => Promise - handleSignOutSSY: () => Promise -} - -const ShengSuanYunAuthContext = createContext(undefined) -export const ShengSuanYunAuthProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => { - const [userSSY, setUser] = useState(null) - const [isInitSSY, setIsInitialized] = useState(false) - const { apiConfiguration, setUserInfo } = useExtensionState() - - useEffect(() => { - if (apiConfiguration?.shengSuanYunToken) { - signInWithTokenSSY(apiConfiguration?.shengSuanYunToken) - } - }, [apiConfiguration?.shengSuanYunToken]) - - const signInWithTokenSSY = async (token: string) => { - try { - const reqConfig: AxiosRequestConfig = { - headers: { - "x-token": token, - "Content-Type": "application/json", - }, - } - const uri = "https://api.shengsuanyun.com/user/info" - const res = await axios.get(uri, reqConfig) - if (!res.data || !res.data.data || res.data.code !== 0) { - throw new Error(`Invalid response from ${uri} API`) - } - const user: any = { - displayName: res.data.data.Nickname || res.data.data.Username || undefined, - email: res.data.data.Email ?? undefined, - photoURL: res.data.data.HeadImg ?? undefined, - uid: res.data.data.ID || undefined, - } - setUser(user) - setIsInitialized(true) - AccountServiceClient.authStateChanged(AuthStateChangedRequest.create({ user })) - .then((res) => { - setUserInfo(res.user) - }) - .catch((error) => { - console.error("Error updating auth state via gRPC:", error) - }) - } catch (error) { - console.error("signInWithTokenSSY():", error) - console.log("signInWithTokenSSY(token):", token) - // throw error - } - } - - useEffect(() => { - const cleanup = AccountServiceClient.subscribeSsyAuthCallback(EmptyRequest.create({}), { - onResponse: (event) => { - if (event.value) { - signInWithTokenSSY(event.value) - } - }, - onError: (error) => { - console.error("Error in signInWithTokenSSY subscription:", error) - }, - onComplete: () => {}, - }) - return cleanup - }, [signInWithTokenSSY]) - - const handleSignOutSSY = useCallback(async () => { - try { - AccountServiceClient.shengSuanYunLogoutClicked(EmptyRequest.create()).catch((err) => - console.error("shengSuanYunLogoutClicked Failed to logout:", err), - ) - console.log("Successfully signed out of ssy") - } catch (error) { - console.error("Error signing out of ssy:", error) - throw error - } - }, []) - - return ( - - {children} - - ) -} - -export const handleSignInSSY = async () => { - try { - AccountServiceClient.shengSuanYunLoginClicked(EmptyRequest.create()).catch((err) => - console.error("Failed to get login URL:", err), - ) - } catch (error) { - console.error("Error signing in:", error) - throw error - } -} -export const useShengSuanYunAuth = () => { - const context = useContext(ShengSuanYunAuthContext) - if (context === undefined) { - throw new Error("useShengSuanYunAuth must be used within a ShengSuanYunAuthProvider") - } - return context -} export const useSignIn = () => { const [isLoading, setIsLoading] = useState(false)