bingocode 1.1.139 → 1.1.141

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.
@@ -8,7 +8,8 @@
8
8
  "Bash(git:*)",
9
9
  "WebFetch(domain:docs.anthropic.com)",
10
10
  "WebSearch",
11
- "WebFetch(domain:www.anthropic.com)"
11
+ "WebFetch(domain:www.anthropic.com)",
12
+ "Bash(grep -v \"node_modules\\\\|bun:\\\\|bun/\\\\|bun@\\\\|\\\\.bun\\\\|bunfig\\\\|bundl\\\\|bunny\\\\|abun\\\\|debug\\\\|comment\\\\|//.*bun\\\\|bunta\\\\|buno\")"
12
13
  ]
13
14
  }
14
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bingocode",
3
- "version": "1.1.139",
3
+ "version": "1.1.141",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "claude": "bin/claude-win.cjs",
@@ -41,12 +41,42 @@
41
41
  }
42
42
  throw new Error(`Health check timeout: ${lastErr?.message || 'unknown'}`);
43
43
  }
44
- function resolveBunPath() {
44
+ function resolveBunPath(): string {
45
+ // 优先环境变量
45
46
  const fromEnv = process.env.BUN_PATH;
46
- if (fromEnv) return fromEnv;
47
- const r = spawnSync('bun', ['--version'], { stdio: 'ignore' });
48
- if (r.status === 0) return 'bun';
49
- throw new Error('Bun not detected. Please install https://bun.sh or set BUN_PATH');
47
+ if (fromEnv && fs.existsSync(fromEnv)) return fromEnv;
48
+
49
+ // Windows:查找真实 bun.exe 绝对路径,避免 spawn 'bun' ENOENT
50
+ if (process.platform === 'win32') {
51
+ // npm install -g bun 的真实位置:{npm prefix -g}/node_modules/bun/bin/bun.exe
52
+ try {
53
+ const npmPrefix = spawnSync('npm', ['prefix', '-g'], { shell: true, encoding: 'utf-8' });
54
+ if (npmPrefix.status === 0) {
55
+ const npmBun = path.join(npmPrefix.stdout.trim(), 'node_modules', 'bun', 'bin', 'bun.exe');
56
+ if (fs.existsSync(npmBun)) return npmBun;
57
+ }
58
+ } catch (_) {}
59
+ // ~/.bun/bin/bun.exe(bun 官方安装脚本位置)
60
+ const homeBun = path.join(os.homedir(), '.bun', 'bin', 'bun.exe');
61
+ if (fs.existsSync(homeBun)) return homeBun;
62
+ // where bun.exe 兜底
63
+ try {
64
+ const where = spawnSync('where', ['bun.exe'], { shell: true, encoding: 'utf-8' });
65
+ if (where.status === 0) {
66
+ const found = where.stdout.trim().split(/\r?\n/)[0];
67
+ if (found && fs.existsSync(found)) return found;
68
+ }
69
+ } catch (_) {}
70
+ } else {
71
+ // Linux/macOS:which bun
72
+ const r = spawnSync('which', ['bun'], { encoding: 'utf-8' });
73
+ if (r.status === 0) {
74
+ const found = r.stdout.trim();
75
+ if (found) return found;
76
+ }
77
+ }
78
+
79
+ throw new Error('Bun not detected. Please install via: npm install -g bun');
50
80
  }
51
81
 
52
82
  async function acquireLease(): Promise<string> {
@@ -664,7 +664,7 @@ export class ConversationService {
664
664
  }
665
665
 
666
666
  if (/\.(?:[cm]?[jt]s|tsx?)$/i.test(cliCommand)) {
667
- return ['bun', cliCommand, ...baseArgs]
667
+ return [process.execPath, cliCommand, ...baseArgs]
668
668
  }
669
669
 
670
670
  const cliBaseName = path.basename(cliCommand)
@@ -413,7 +413,7 @@ export class CronScheduler {
413
413
 
414
414
  const proc = Bun.spawn(
415
415
  [
416
- 'bun',
416
+ process.execPath,
417
417
  '--preload',
418
418
  preloadPath,
419
419
  cliPath,