@beads/bd 0.63.3 → 1.0.2

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/README.md CHANGED
@@ -100,7 +100,7 @@ This package downloads the appropriate native binary for your platform:
100
100
  For complete documentation, see the [beads GitHub repository](https://github.com/steveyegge/beads):
101
101
 
102
102
  - [Complete README](https://github.com/steveyegge/beads#readme)
103
- - [Quick Start Guide](https://github.com/steveyegge/beads/blob/main/docs/QUICKSTART.md)
103
+ - [Quick Start (documentation site)](https://steveyegge.github.io/beads/getting-started/quickstart) · [repo pointer](https://github.com/steveyegge/beads/blob/main/docs/QUICKSTART.md)
104
104
  - [Installation Guide](https://github.com/steveyegge/beads/blob/main/docs/INSTALLING.md)
105
105
  - [FAQ](https://github.com/steveyegge/beads/blob/main/docs/FAQ.md)
106
106
  - [Troubleshooting](https://github.com/steveyegge/beads/blob/main/docs/TROUBLESHOOTING.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beads/bd",
3
- "version": "0.63.3",
3
+ "version": "1.0.2",
4
4
  "description": "Beads issue tracker - lightweight memory system for coding agents with native binary support",
5
5
  "main": "bin/bd.js",
6
6
  "bin": {
@@ -26,13 +26,13 @@
26
26
  "license": "MIT",
27
27
  "repository": {
28
28
  "type": "git",
29
- "url": "https://github.com/steveyegge/beads.git",
29
+ "url": "https://github.com/gastownhall/beads.git",
30
30
  "directory": "npm-package"
31
31
  },
32
32
  "bugs": {
33
- "url": "https://github.com/steveyegge/beads/issues"
33
+ "url": "https://github.com/gastownhall/beads/issues"
34
34
  },
35
- "homepage": "https://github.com/steveyegge/beads#readme",
35
+ "homepage": "https://github.com/gastownhall/beads#readme",
36
36
  "engines": {
37
37
  "node": ">=14.0.0"
38
38
  },
@@ -64,15 +64,38 @@ function downloadFile(url, dest) {
64
64
  if (response.statusCode === 301 || response.statusCode === 302) {
65
65
  const redirectUrl = response.headers.location;
66
66
  console.log(`Following redirect to: ${redirectUrl}`);
67
- downloadFile(redirectUrl, dest).then(resolve).catch(reject);
67
+ response.destroy();
68
+ request.destroy();
69
+ file.close((closeErr) => {
70
+ if (closeErr) {
71
+ fs.unlink(dest, () => {});
72
+ reject(closeErr);
73
+ return;
74
+ }
75
+ fs.unlink(dest, () => {});
76
+ downloadFile(redirectUrl, dest).then(resolve).catch(reject);
77
+ });
68
78
  return;
69
79
  }
70
80
 
71
81
  if (response.statusCode !== 200) {
72
- reject(new Error(`Failed to download: HTTP ${response.statusCode}`));
82
+ const error = new Error(`Failed to download: HTTP ${response.statusCode}`);
83
+ response.destroy();
84
+ request.destroy();
85
+ file.close(() => {
86
+ fs.unlink(dest, () => {});
87
+ reject(error);
88
+ });
73
89
  return;
74
90
  }
75
91
 
92
+ response.on('error', (err) => {
93
+ file.close(() => {
94
+ fs.unlink(dest, () => {});
95
+ reject(err);
96
+ });
97
+ });
98
+
76
99
  response.pipe(file);
77
100
 
78
101
  file.on('finish', () => {
@@ -80,7 +103,10 @@ function downloadFile(url, dest) {
80
103
  // This is critical on Windows where the file may still be locked
81
104
  file.close((err) => {
82
105
  if (err) reject(err);
83
- else resolve();
106
+ else {
107
+ response.destroy();
108
+ resolve();
109
+ }
84
110
  });
85
111
  });
86
112
  });
@@ -137,7 +163,7 @@ async function waitForFileAccess(filePath, timeoutMs = 30000) {
137
163
 
138
164
  while (Date.now() - startTime < timeoutMs) {
139
165
  try {
140
- const fd = fs.openSync(filePath, 'r');
166
+ const fd = fs.openSync(filePath, 'r+');
141
167
  fs.closeSync(fd);
142
168
  return; // File is accessible
143
169
  } catch (err) {