agent-takkub 1.0.85 → 1.0.87

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.
@@ -55,29 +55,32 @@ function findWheelForVersion(distDir, version) {
55
55
  // leave the file locked/hard to overwrite during recovery.
56
56
  const MIN_PYTHON_EXE_BYTES = 40 * 1024; // a real venv python.exe/python is comfortably >90KB
57
57
 
58
+ // Opens the path exactly once and stats/reads that same descriptor for the
59
+ // rest of the check — never stat a path and then separately open it, which
60
+ // leaves a window for the file at that name to change between the two
61
+ // syscalls (CodeQL js/file-system-race, alert #29).
58
62
  function pythonLooksExecutable(py) {
59
- let stat;
63
+ let fd;
60
64
  try {
61
- stat = fs.statSync(py);
65
+ fd = fs.openSync(py, 'r');
62
66
  } catch (_e) {
63
67
  return false;
64
68
  }
65
- if (!stat.isFile() || stat.size < MIN_PYTHON_EXE_BYTES) return false;
66
- if (process.platform === 'win32') {
67
- // Windows PE executables always start with the 'MZ' DOS-header magic.
68
- let fd;
69
- try {
70
- fd = fs.openSync(py, 'r');
69
+ try {
70
+ const stat = fs.fstatSync(fd);
71
+ if (!stat.isFile() || stat.size < MIN_PYTHON_EXE_BYTES) return false;
72
+ if (process.platform === 'win32') {
73
+ // Windows PE executables always start with the 'MZ' DOS-header magic.
71
74
  const buf = Buffer.alloc(2);
72
75
  fs.readSync(fd, buf, 0, 2, 0);
73
76
  return buf[0] === 0x4d && buf[1] === 0x5a; // 'M', 'Z'
74
- } catch (_e) {
75
- return false;
76
- } finally {
77
- if (fd !== undefined) fs.closeSync(fd);
78
77
  }
78
+ return true;
79
+ } catch (_e) {
80
+ return false;
81
+ } finally {
82
+ fs.closeSync(fd);
79
83
  }
80
- return true;
81
84
  }
82
85
 
83
86
  function brokenInterpreterMessage(py, home) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-takkub",
3
- "version": "1.0.85",
3
+ "version": "1.0.87",
4
4
  "description": "Desktop cockpit for orchestrating a team of Claude Code agents (Windows + macOS). Install globally: npm i -g agent-takkub",
5
5
  "keywords": [
6
6
  "claude",