蜂鸟Pro v2.0.1 - 基础框架版本 (待完善)
## 当前状态 - 插件界面已完成重命名 (cursorpro → hummingbird) - 双账号池 UI 已实现 (Auto/Pro 卡片) - 后端已切换到 MySQL 数据库 - 添加了 Cursor 官方用量 API 文档 ## 已知问题 (待修复) 1. 激活时检查账号导致无账号时激活失败 2. 未启用无感换号时不应获取账号 3. 账号用量模块不显示 (seamless 未启用时应隐藏) 4. 积分显示为 0 (后端未正确返回) 5. Auto/Pro 双密钥逻辑混乱,状态不同步 6. 账号添加后无自动分析功能 ## 下一版本计划 - 重构数据模型,优化账号状态管理 - 实现 Cursor API 自动分析账号 - 修复激活流程,不依赖账号 - 启用无感时才分配账号 - 完善账号用量实时显示 ## 文件说明 - docs/系统设计文档.md - 完整架构设计 - cursor 官方用量接口.md - Cursor API 文档 - 参考计费/ - Vibeviewer 开源项目参考 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Binary file not shown.
BIN
extension_clean/hummingbird-pro-2.0.1.vsix
Normal file
BIN
extension_clean/hummingbird-pro-2.0.1.vsix
Normal file
Binary file not shown.
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
// ============================================
|
||||
// CursorPro API Client - 反混淆版本
|
||||
// 蜂鸟Pro API Client
|
||||
// ============================================
|
||||
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
@@ -19,7 +19,7 @@ let onlineStatusCallbacks = [];
|
||||
* 获取 API URL (从配置或使用默认值)
|
||||
*/
|
||||
function getApiUrl() {
|
||||
const config = vscode.workspace.getConfiguration('cursorpro');
|
||||
const config = vscode.workspace.getConfiguration('hummingbird');
|
||||
return config.get('apiUrl') || DEFAULT_API_URL;
|
||||
}
|
||||
exports.getApiUrl = getApiUrl;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
// ============================================
|
||||
// CursorPro Extension - 反混淆版本
|
||||
// 蜂鸟Pro Extension
|
||||
// ============================================
|
||||
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
@@ -14,7 +14,7 @@ const path = require('path');
|
||||
let usageStatusBarItem;
|
||||
|
||||
// 创建输出通道
|
||||
exports.outputChannel = vscode.window.createOutputChannel('CursorPro');
|
||||
exports.outputChannel = vscode.window.createOutputChannel('蜂鸟Pro');
|
||||
|
||||
/**
|
||||
* 日志函数
|
||||
@@ -22,7 +22,7 @@ exports.outputChannel = vscode.window.createOutputChannel('CursorPro');
|
||||
function log(message) {
|
||||
const timestamp = new Date().toLocaleTimeString();
|
||||
exports.outputChannel.appendLine('[' + timestamp + '] ' + message);
|
||||
console.log('[CursorPro] ' + message);
|
||||
console.log('[蜂鸟Pro] ' + message);
|
||||
}
|
||||
exports.log = log;
|
||||
|
||||
@@ -70,7 +70,7 @@ function cleanServiceWorkerCache() {
|
||||
fs.unlinkSync(path.join(scriptCachePath, file));
|
||||
} catch (e) {}
|
||||
}
|
||||
console.log('[CursorPro] Service Worker ScriptCache 已清理:', scriptCachePath);
|
||||
console.log('[蜂鸟Pro] Service Worker ScriptCache 已清理:', scriptCachePath);
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ function cleanServiceWorkerCache() {
|
||||
if (fs.existsSync(cacheStoragePath)) {
|
||||
try {
|
||||
deleteFolderRecursive(cacheStoragePath);
|
||||
console.log('[CursorPro] Service Worker CacheStorage 已清理:', cacheStoragePath);
|
||||
console.log('[蜂鸟Pro] Service Worker CacheStorage 已清理:', cacheStoragePath);
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
@@ -88,12 +88,12 @@ function cleanServiceWorkerCache() {
|
||||
if (fs.existsSync(databasePath)) {
|
||||
try {
|
||||
deleteFolderRecursive(databasePath);
|
||||
console.log('[CursorPro] Service Worker Database 已清理:', databasePath);
|
||||
console.log('[蜂鸟Pro] Service Worker Database 已清理:', databasePath);
|
||||
} catch (e) {}
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('[CursorPro] 清理 Service Worker 缓存时出错:', error);
|
||||
console.log('[蜂鸟Pro] 清理 Service Worker 缓存时出错:', error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,22 +126,22 @@ function activate(context) {
|
||||
cleanServiceWorkerCache();
|
||||
|
||||
// 创建 WebView Provider
|
||||
const viewProvider = new provider_1.CursorProViewProvider(context.extensionUri, context);
|
||||
const viewProvider = new provider_1.HummingbirdProViewProvider(context.extensionUri, context);
|
||||
|
||||
// 注册 WebView
|
||||
context.subscriptions.push(
|
||||
vscode.window.registerWebviewViewProvider('cursorpro.mainView', viewProvider)
|
||||
vscode.window.registerWebviewViewProvider('hummingbird.mainView', viewProvider)
|
||||
);
|
||||
|
||||
// 创建状态栏项
|
||||
usageStatusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, 100);
|
||||
usageStatusBarItem.text = '$(dashboard) 用量: --';
|
||||
usageStatusBarItem.tooltip = '点击查看账号用量详情';
|
||||
usageStatusBarItem.command = 'cursorpro.showPanel';
|
||||
usageStatusBarItem.command = 'hummingbird.showPanel';
|
||||
usageStatusBarItem.backgroundColor = new vscode.ThemeColor('statusBarItem.prominentBackground');
|
||||
|
||||
// 如果有保存的 key,显示状态栏
|
||||
const savedKey = context.globalState.get('cursorpro.key');
|
||||
const savedKey = context.globalState.get('hummingbird.key');
|
||||
if (savedKey) {
|
||||
usageStatusBarItem.show();
|
||||
}
|
||||
@@ -149,12 +149,12 @@ function activate(context) {
|
||||
context.subscriptions.push(usageStatusBarItem);
|
||||
|
||||
// 设置同步的键
|
||||
context.globalState.setKeysForSync(['cursorpro.key']);
|
||||
context.globalState.setKeysForSync(['hummingbird.key']);
|
||||
|
||||
// 注册显示面板命令
|
||||
context.subscriptions.push(
|
||||
vscode.commands.registerCommand('cursorpro.showPanel', () => {
|
||||
vscode.commands.executeCommand('cursorpro.mainView.focus');
|
||||
vscode.commands.registerCommand('hummingbird.showPanel', () => {
|
||||
vscode.commands.executeCommand('hummingbird.mainView.focus');
|
||||
})
|
||||
);
|
||||
}
|
||||
@@ -164,7 +164,7 @@ exports.activate = activate;
|
||||
* 停用扩展
|
||||
*/
|
||||
function deactivate() {
|
||||
console.log('CursorPro 插件已停用');
|
||||
console.log('蜂鸟Pro 插件已停用');
|
||||
}
|
||||
exports.deactivate = deactivate;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
// ============================================
|
||||
// CursorPro Account Utils - 反混淆版本
|
||||
// 蜂鸟Pro Account Utils - 反混淆版本
|
||||
// ============================================
|
||||
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
@@ -65,9 +65,9 @@ async function writeAccountToLocal(accountData) {
|
||||
const cursorPaths = getCursorPaths();
|
||||
const { dbPath, storagePath, machineidPath } = cursorPaths;
|
||||
|
||||
console.log('[CursorPro] 数据库路径:', dbPath);
|
||||
console.log('[CursorPro] 数据库存在:', fs.existsSync(dbPath));
|
||||
console.log('[CursorPro] 账号数据:', JSON.stringify({
|
||||
console.log('[蜂鸟Pro] 数据库路径:', dbPath);
|
||||
console.log('[蜂鸟Pro] 数据库存在:', fs.existsSync(dbPath));
|
||||
console.log('[蜂鸟Pro] 账号数据:', JSON.stringify({
|
||||
hasAccessToken: !!accountData.accessToken,
|
||||
hasRefreshToken: !!accountData.refreshToken,
|
||||
hasWorkosToken: !!accountData.workosSessionToken,
|
||||
@@ -107,22 +107,22 @@ async function writeAccountToLocal(accountData) {
|
||||
entries.push(['serviceMachineId', accountData.serviceMachineId]);
|
||||
}
|
||||
|
||||
console.log('[CursorPro] 准备写入', entries.length, '个字段');
|
||||
console.log('[蜂鸟Pro] 准备写入', entries.length, '个字段');
|
||||
|
||||
const success = await sqlite_1.sqliteSetBatch(dbPath, entries);
|
||||
if (!success) {
|
||||
throw new Error('数据库写入失败');
|
||||
}
|
||||
|
||||
console.log('[CursorPro] 已写入', entries.length, '个字段');
|
||||
console.log('[蜂鸟Pro] 已写入', entries.length, '个字段');
|
||||
} catch (error) {
|
||||
console.error('[CursorPro] 数据库写入错误:', error);
|
||||
console.error('[蜂鸟Pro] 数据库写入错误:', error);
|
||||
vscode.window.showErrorMessage('数据库写入失败: ' + error);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
console.error('[CursorPro] 数据库文件不存在:', dbPath);
|
||||
vscode.window.showErrorMessage('[CursorPro] 数据库文件不存在');
|
||||
console.error('[蜂鸟Pro] 数据库文件不存在:', dbPath);
|
||||
vscode.window.showErrorMessage('[蜂鸟Pro] 数据库文件不存在');
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ async function writeAccountToLocal(accountData) {
|
||||
}
|
||||
|
||||
fs.writeFileSync(storagePath, JSON.stringify(storageData, null, 4));
|
||||
console.log('[CursorPro] storage.json 已更新');
|
||||
console.log('[蜂鸟Pro] storage.json 已更新');
|
||||
}
|
||||
|
||||
// 更新 machineid 文件
|
||||
@@ -157,7 +157,7 @@ async function writeAccountToLocal(accountData) {
|
||||
fs.mkdirSync(machineIdDir, { recursive: true });
|
||||
}
|
||||
fs.writeFileSync(machineidPath, accountData.machineId);
|
||||
console.log('[CursorPro] machineid 文件已更新');
|
||||
console.log('[蜂鸟Pro] machineid 文件已更新');
|
||||
}
|
||||
|
||||
// Windows: 更新注册表 (如果提供了 devDeviceId)
|
||||
@@ -165,15 +165,15 @@ async function writeAccountToLocal(accountData) {
|
||||
try {
|
||||
const regCommand = 'reg add "HKCU\\Software\\Cursor" /v devDeviceId /t REG_SZ /d "' + accountData.devDeviceId + '" /f';
|
||||
await execAsync(regCommand);
|
||||
console.log('[CursorPro] 注册表已更新');
|
||||
console.log('[蜂鸟Pro] 注册表已更新');
|
||||
} catch (error) {
|
||||
console.warn('[CursorPro] 注册表写入失败(可能需要管理员权限):', error);
|
||||
console.warn('[蜂鸟Pro] 注册表写入失败(可能需要管理员权限):', error);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
} catch (error) {
|
||||
console.error('[CursorPro] writeAccountToLocal 错误:', error);
|
||||
console.error('[蜂鸟Pro] writeAccountToLocal 错误:', error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -190,7 +190,7 @@ async function closeCursor() {
|
||||
await execAsync('pkill -9 -f Cursor').catch(() => {});
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn('[CursorPro] 关闭 Cursor 失败:', error);
|
||||
console.warn('[蜂鸟Pro] 关闭 Cursor 失败:', error);
|
||||
}
|
||||
}
|
||||
exports.closeCursor = closeCursor;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
// ============================================
|
||||
// CursorPro SQLite Utils - 反混淆版本
|
||||
// 蜂鸟Pro SQLite Utils - 反混淆版本
|
||||
// ============================================
|
||||
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
|
||||
2348
extension_clean/out/webview/panel.html
Normal file
2348
extension_clean/out/webview/panel.html
Normal file
File diff suppressed because it is too large
Load Diff
1995
extension_clean/out/webview/panel_formatted.html
Normal file
1995
extension_clean/out/webview/panel_formatted.html
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "hummingbird-cursorpro",
|
||||
"name": "hummingbird-pro",
|
||||
"displayName": "蜂鸟Pro",
|
||||
"description": "蜂鸟Pro - Cursor 账号管理与智能换号工具",
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.1",
|
||||
"publisher": "hummingbird",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -24,28 +24,28 @@
|
||||
"contributes": {
|
||||
"commands": [
|
||||
{
|
||||
"command": "cursorpro.showPanel",
|
||||
"command": "hummingbird.showPanel",
|
||||
"title": "蜂鸟Pro: 打开控制面板"
|
||||
},
|
||||
{
|
||||
"command": "cursorpro.switchAccount",
|
||||
"command": "hummingbird.switchAccount",
|
||||
"title": "蜂鸟Pro: 立即换号"
|
||||
}
|
||||
],
|
||||
"viewsContainers": {
|
||||
"activitybar": [
|
||||
{
|
||||
"id": "cursorpro-sidebar",
|
||||
"id": "hummingbird-sidebar",
|
||||
"title": "蜂鸟Pro",
|
||||
"icon": "media/icon.svg"
|
||||
}
|
||||
]
|
||||
},
|
||||
"views": {
|
||||
"cursorpro-sidebar": [
|
||||
"hummingbird-sidebar": [
|
||||
{
|
||||
"type": "webview",
|
||||
"id": "cursorpro.mainView",
|
||||
"id": "hummingbird.mainView",
|
||||
"name": "控制面板"
|
||||
}
|
||||
]
|
||||
@@ -53,7 +53,7 @@
|
||||
"configuration": {
|
||||
"title": "蜂鸟Pro",
|
||||
"properties": {
|
||||
"cursorpro.cursorPath": {
|
||||
"hummingbird.cursorPath": {
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"description": "手动设置 Cursor 安装路径(如果自动检测失败)。例如:C:\\Program Files\\cursor 或 /Applications/Cursor.app"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# ==============================================
|
||||
# CursorPro - macOS 机器码重置脚本
|
||||
# 蜂鸟Pro - macOS 机器码重置脚本
|
||||
# 一次授权,永久免密
|
||||
# 纯 Shell 实现,不依赖 Python
|
||||
# ==============================================
|
||||
@@ -26,11 +26,11 @@ STATE_VSCDB="$CURSOR_DATA/User/globalStorage/state.vscdb"
|
||||
MACHINEID_FILE="$CURSOR_DATA/machineid"
|
||||
|
||||
# 备份目录
|
||||
BACKUP_DIR="$USER_HOME/CursorPro_backups"
|
||||
BACKUP_DIR="$USER_HOME/HummingbirdPro_backups"
|
||||
|
||||
echo ""
|
||||
echo -e "${BLUE}======================================${NC}"
|
||||
echo -e "${BLUE} CursorPro macOS 机器码重置工具${NC}"
|
||||
echo -e "${BLUE} 蜂鸟Pro macOS 机器码重置工具${NC}"
|
||||
echo -e "${BLUE}======================================${NC}"
|
||||
echo ""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user