蜂鸟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:
ccdojox-crypto
2025-12-18 11:21:52 +08:00
parent f310ca7b97
commit 73a71f198f
202 changed files with 19142 additions and 252 deletions

View File

@@ -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;

View File

@@ -1,7 +1,7 @@
'use strict';
// ============================================
// CursorPro SQLite Utils - 反混淆版本
// 蜂鸟Pro SQLite Utils - 反混淆版本
// ============================================
Object.defineProperty(exports, "__esModule", { value: true });