@tedbrain/vlink 0.1.162 → 0.1.164

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.
Files changed (3) hide show
  1. package/binaries.json +22 -22
  2. package/install.js +50 -3
  3. package/package.json +1 -1
package/binaries.json CHANGED
@@ -1,40 +1,40 @@
1
1
  {
2
- "version": "0.1.162",
2
+ "version": "0.1.164",
3
3
  "binaries": {
4
4
  "linux-x86_64": {
5
- "url": "https://cloud.tsinghua.edu.cn/f/28806d4398b04f86b2cd/?dl=1",
6
- "sha256": "7c6169a9fb2446438987e8e434c99af4cb760209b2327551f0b35f88893720f0",
7
- "size": 24807677
5
+ "url": "https://cloud.tsinghua.edu.cn/f/f858911fb5ee4fc680b1/?dl=1",
6
+ "sha256": "086438fd412c0ff7e1f67d645926aba0d485d6ca171718cff353c74a2363caf3",
7
+ "size": 25106877
8
8
  },
9
9
  "linux-x86_64-glibc2.17": {
10
- "url": "https://cloud.tsinghua.edu.cn/f/0ad134b039424d01b114/?dl=1",
11
- "sha256": "ce5510d2932bc03f7da80624aab84a8222068cf0dfe4c0feb026b8728d736c25",
12
- "size": 25529721
10
+ "url": "https://cloud.tsinghua.edu.cn/f/84c17e070f1a431fa69e/?dl=1",
11
+ "sha256": "3e873f2e7609ccb554cc9c56673baf691b64fdb0cfd62c1233e20561e279c9b9",
12
+ "size": 25836753
13
13
  },
14
14
  "linux-aarch64": {
15
- "url": "https://cloud.tsinghua.edu.cn/f/1971610875924db4b176/?dl=1",
16
- "sha256": "1b5a7ad7996f52f032290dcc7a68b6ba3b4775f0f25c56692b2aabd29f77c2e9",
17
- "size": 21113645
15
+ "url": "https://cloud.tsinghua.edu.cn/f/e09681dd99ed467c85df/?dl=1",
16
+ "sha256": "f2ba91d3e982c32dac3eaff2578cddc9deee8bfc97ccfa3175e56d66cb5ba750",
17
+ "size": 21310437
18
18
  },
19
19
  "macos-x86_64": {
20
- "url": "https://cloud.tsinghua.edu.cn/f/9a1be749932f45769d4a/?dl=1",
21
- "sha256": "d775b4e5ec4b83a3231421868ac1cc9c7bf163fec5c6a665995b1e784d9f8924",
22
- "size": 22185609
20
+ "url": "https://cloud.tsinghua.edu.cn/f/4d2cbd7595014859bf2c/?dl=1",
21
+ "sha256": "434390c6020e26a1f681c3f27df6643889b17fc4df165ce86e39073270bea957",
22
+ "size": 22362033
23
23
  },
24
24
  "macos-aarch64": {
25
- "url": "https://cloud.tsinghua.edu.cn/f/594358ec14ac4fc09ce3/?dl=1",
26
- "sha256": "64116b5fc377629bc05ff1d2ff7a4dccb2f817b2c474cd7745c475a5b13b79e8",
27
- "size": 17972709
25
+ "url": "https://cloud.tsinghua.edu.cn/f/9f6df7190ab74afb9c30/?dl=1",
26
+ "sha256": "8f156fac19cedbe2f31b1adab54790e5a68dd8016971d0c6bff4337ee2cb5e1b",
27
+ "size": 18105013
28
28
  },
29
29
  "windows-x86_64.exe": {
30
- "url": "https://cloud.tsinghua.edu.cn/f/aa5b9c3d1e7d4f43bbdb/?dl=1",
31
- "sha256": "ffb28876ed49b0ee1d0d2c0514b8da892ccd2a47d08068dd221d79e9922b08c7",
32
- "size": 9775397
30
+ "url": "https://cloud.tsinghua.edu.cn/f/d90153e5fd4f49f48322/?dl=1",
31
+ "sha256": "fbe079214b540e8381bbe745f1165aa69266d4241b8092bb03db9764011d2694",
32
+ "size": 9820453
33
33
  },
34
34
  "windows-aarch64.exe": {
35
- "url": "https://cloud.tsinghua.edu.cn/f/8ffd00a6b6f44aab90c0/?dl=1",
36
- "sha256": "b4a37128ab2ab3b5362a092e1da6042c41662432b309e6494a63464d8e840bed",
37
- "size": 11270441
35
+ "url": "https://cloud.tsinghua.edu.cn/f/dbc67e7d4aa1457db7ae/?dl=1",
36
+ "sha256": "0ea9ef3418b8b96e2651341ea08d926ec3eb895a72267d2ecc10911b62b9bf4e",
37
+ "size": 11327785
38
38
  }
39
39
  }
40
40
  }
package/install.js CHANGED
@@ -482,9 +482,56 @@ function sha256File(filePath) {
482
482
  });
483
483
  }
484
484
 
485
- async function downloadFile(url, destPath, options = {}) {
486
- const response = await httpResponse(url, downloadTimeoutMs(), options);
487
- await pipeline(response, fs.createWriteStream(destPath, { mode: 0o755 }));
485
+ function downloadFile(url, destPath, options = {}) {
486
+ return new Promise((resolve, reject) => {
487
+ const fileStream = fs.createWriteStream(destPath, { mode: 0o755 });
488
+
489
+ const finish = () => {
490
+ fileStream.close((closeErr) => {
491
+ if (closeErr) reject(closeErr);
492
+ else resolve();
493
+ });
494
+ };
495
+
496
+ const request = (target, redirects) => {
497
+ const transport = target.startsWith('https:') ? https : http;
498
+ const req = transport.get(
499
+ target,
500
+ {
501
+ agent: requestAgent(target, options),
502
+ headers: { 'user-agent': `${PKG.name}/${PKG.version}` }
503
+ },
504
+ (res) => {
505
+ if (
506
+ res.statusCode >= 300 &&
507
+ res.statusCode < 400 &&
508
+ res.headers.location &&
509
+ redirects < 5
510
+ ) {
511
+ res.resume();
512
+ const next = new URL(res.headers.location, target).toString();
513
+ return request(next, redirects + 1);
514
+ }
515
+ if (res.statusCode !== 200) {
516
+ res.resume();
517
+ return reject(
518
+ new VlinkInstallError(
519
+ `download failed: HTTP ${res.statusCode} from ${displayUrl(target)}`
520
+ )
521
+ );
522
+ }
523
+ res.pipe(fileStream);
524
+ }
525
+ );
526
+
527
+ req.on('error', reject);
528
+ req.setTimeout(downloadTimeoutMs(), () => req.destroy(new VlinkInstallError('download timed out')));
529
+ };
530
+
531
+ fileStream.on('finish', finish);
532
+ fileStream.on('error', reject);
533
+ request(url, 0);
534
+ });
488
535
  }
489
536
 
490
537
  function verifyBinary(binaryPath) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tedbrain/vlink",
3
- "version": "0.1.162",
3
+ "version": "0.1.164",
4
4
  "description": "vlink Virtuoso bridge CLI installer. Installs the matching platform binary at npm install time, like Claude Code / Codex.",
5
5
  "license": "UNLICENSED",
6
6
  "bin": {