bingocode 1.1.137 → 1.1.139
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +4 -1
- package/bin/bingo-win.cjs +36 -14
- package/package.json +1 -1
|
@@ -5,7 +5,10 @@
|
|
|
5
5
|
"Bash(dir \"F:\\\\Leanchy\\\\VirtuosAgent\\\\BingoCode\\\\src\\\\server\\\\proxy\")",
|
|
6
6
|
"Bash(ls src/**/)",
|
|
7
7
|
"Bash(cat config/*.json)",
|
|
8
|
-
"Bash(git:*)"
|
|
8
|
+
"Bash(git:*)",
|
|
9
|
+
"WebFetch(domain:docs.anthropic.com)",
|
|
10
|
+
"WebSearch",
|
|
11
|
+
"WebFetch(domain:www.anthropic.com)"
|
|
9
12
|
]
|
|
10
13
|
}
|
|
11
14
|
}
|
package/bin/bingo-win.cjs
CHANGED
|
@@ -56,20 +56,37 @@ const ROOT_DIR = getProjectRoot();
|
|
|
56
56
|
}
|
|
57
57
|
})();
|
|
58
58
|
|
|
59
|
-
// 自动定位 bun
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
// 自动定位 bun 可执行路径(返回绝对路径或 null)
|
|
60
|
+
function resolveBunExe() {
|
|
61
|
+
// 优先环境变量
|
|
62
|
+
if (process.env.BUN_PATH && fs.existsSync(process.env.BUN_PATH)) {
|
|
63
|
+
return process.env.BUN_PATH;
|
|
64
|
+
}
|
|
65
|
+
// npm install -g bun 的真实位置:{npm prefix -g}/node_modules/bun/bin/bun.exe
|
|
66
|
+
try {
|
|
67
|
+
const npmPrefix = spawnSync('npm', ['prefix', '-g'], { shell: true, encoding: 'utf-8' });
|
|
68
|
+
if (npmPrefix.status === 0) {
|
|
69
|
+
const npmBun = path.join(npmPrefix.stdout.trim(), 'node_modules', 'bun', 'bin', 'bun.exe');
|
|
70
|
+
if (fs.existsSync(npmBun)) return npmBun;
|
|
71
|
+
}
|
|
72
|
+
} catch (_) {}
|
|
73
|
+
// ~/.bun/bin/bun.exe(bun 官方安装脚本的位置)
|
|
74
|
+
const homeBun = path.join(os.homedir(), '.bun', 'bin', 'bun.exe');
|
|
75
|
+
if (fs.existsSync(homeBun)) return homeBun;
|
|
76
|
+
// where bun.exe(PATH 兜底搜索)
|
|
77
|
+
try {
|
|
78
|
+
const where = spawnSync('where', ['bun.exe'], { shell: true, encoding: 'utf-8' });
|
|
79
|
+
if (where.status === 0) {
|
|
80
|
+
const found = where.stdout.trim().split(/\r?\n/)[0];
|
|
81
|
+
if (found && fs.existsSync(found)) return found;
|
|
82
|
+
}
|
|
83
|
+
} catch (_) {}
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
63
86
|
|
|
64
87
|
// 检查 bun 是否可用
|
|
65
88
|
function bunExists() {
|
|
66
|
-
|
|
67
|
-
try {
|
|
68
|
-
const result = spawnSync('bun', ['--version'], { stdio: 'ignore', shell: true });
|
|
69
|
-
return result.status === 0;
|
|
70
|
-
} catch (e) {
|
|
71
|
-
return false;
|
|
72
|
-
}
|
|
89
|
+
return resolveBunExe() !== null;
|
|
73
90
|
}
|
|
74
91
|
|
|
75
92
|
// 安装 bun(通过 npm install -g bun)
|
|
@@ -101,8 +118,12 @@ if (!bunExists()) {
|
|
|
101
118
|
}
|
|
102
119
|
}
|
|
103
120
|
|
|
104
|
-
//
|
|
105
|
-
const
|
|
121
|
+
// 安装完成后重新解析 bun 路径
|
|
122
|
+
const bunExe = resolveBunExe();
|
|
123
|
+
if (!bunExe) {
|
|
124
|
+
console.error('[bingocode] 安装后仍找不到 bun.exe,请重新打开终端后再试,或手动安装 bun: npm install -g bun');
|
|
125
|
+
process.exit(1);
|
|
126
|
+
}
|
|
106
127
|
|
|
107
128
|
// Bingo Manager 入口
|
|
108
129
|
const entry = path.join(ROOT_DIR, 'src', 'entrypoints', 'manager.tsx');
|
|
@@ -124,6 +145,7 @@ if (fs.existsSync(envPath)) {
|
|
|
124
145
|
const extraArgs = process.argv.slice(2);
|
|
125
146
|
const args = [`--preload=${preload}`, envFlag, entry, ...extraArgs].filter(Boolean);
|
|
126
147
|
|
|
127
|
-
|
|
148
|
+
// 用绝对路径 spawn,不依赖 shell 解析 PATH
|
|
149
|
+
const child = spawn(bunExe, args, { stdio: 'inherit' });
|
|
128
150
|
|
|
129
151
|
child.on('exit', (code) => process.exit(code));
|