@tedbrain/vlink 0.1.41 → 0.1.43

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
@@ -5,11 +5,11 @@ Codex 一样按当前平台下载对应的 vlink 二进制。推荐统一使用
5
5
  和 TedBrain 初始化:
6
6
 
7
7
  ```bash
8
- npx -y @tedbrain/vlink@latest install
8
+ npx --registry=https://registry.npmmirror.com -y @tedbrain/vlink@latest install
9
9
  ```
10
10
 
11
- 该命令会识别平台和架构、安装或更新 vlink、配置用户 PATH,并启动
12
- `vlink setup tedbrain`。安装完成后可直接运行:
11
+ 该命令会识别平台和架构,始终安装与当前 npm 包版本一致的 vlink,配置用户
12
+ PATH,并启动 `vlink setup tedbrain`。安装完成后可直接运行:
13
13
 
14
14
  ```bash
15
15
  vlink --version
@@ -18,7 +18,13 @@ vlink --version
18
18
  也可以只把 npm 包作为临时 CLI 使用:
19
19
 
20
20
  ```bash
21
- npx -y @tedbrain/vlink@latest --version
21
+ npx --registry=https://registry.npmmirror.com -y @tedbrain/vlink@latest --version
22
+ ```
23
+
24
+ 手动配置 Agent 时可以只安装或更新 vlink,并跳过 TedBrain 配置向导:
25
+
26
+ ```bash
27
+ npx --registry=https://registry.npmmirror.com -y @tedbrain/vlink@latest install --no-setup
22
28
  ```
23
29
 
24
30
  ## 下载地址
@@ -35,19 +41,19 @@ release 不存在或校验失败时,自动回退到 d01 下载服务器:
35
41
 
36
42
  ```bash
37
43
  # 跳过 Gitee,直接使用 d01/自定义下载源
38
- VLINK_SKIP_GITEE=1 npx -y @tedbrain/vlink@latest install
44
+ VLINK_SKIP_GITEE=1 npx --registry=https://registry.npmmirror.com -y @tedbrain/vlink@latest install
39
45
 
40
46
  # d01 回退源改用开发通道
41
- VLINK_DOWNLOAD_CHANNEL=oss-dev npx -y @tedbrain/vlink@latest install
47
+ VLINK_DOWNLOAD_CHANNEL=oss-dev npx --registry=https://registry.npmmirror.com -y @tedbrain/vlink@latest install
42
48
 
43
49
  # 自定义回退下载根路径(会自动拼接 <channel>/vlink/<version>/vlink-<platform>)
44
- VLINK_DOWNLOAD_BASE=https://internal.example/downloads npx -y @tedbrain/vlink@latest install
50
+ VLINK_DOWNLOAD_BASE=https://internal.example/downloads npx --registry=https://registry.npmmirror.com -y @tedbrain/vlink@latest install
45
51
 
46
52
  # 自定义回退下载目录(会自动拼接 vlink-<platform>)
47
- VLINK_DOWNLOAD_URL=https://internal.example/vlink npx -y @tedbrain/vlink@latest install
53
+ VLINK_DOWNLOAD_URL=https://internal.example/vlink npx --registry=https://registry.npmmirror.com -y @tedbrain/vlink@latest install
48
54
 
49
55
  # 指定不同版本(同时影响 Gitee release tag 与 d01 回退路径)
50
- VLINK_VERSION=0.1.21 npx -y @tedbrain/vlink@latest install
56
+ VLINK_VERSION=0.1.21 npx --registry=https://registry.npmmirror.com -y @tedbrain/vlink@latest install
51
57
  ```
52
58
 
53
59
  ## 平台映射
package/binaries.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
- "version": "0.1.41",
2
+ "version": "0.1.43",
3
3
  "binaries": {
4
- "linux-x86_64": "065a3cf541baf7b672fe473b89e8dae05fc66e003173a4544ac1aa3d2dab5404",
5
- "linux-x86_64-glibc2.17": "e2abdc8dba2e78e7c14b46f6d6f40d6a31fabe549e5382a838c29bb31edf1949",
6
- "linux-aarch64": "cce222db2492df3436179d0e5ca910596b4de987ce93a2b405928b0a4659fa8a",
7
- "macos-x86_64": "ab8c2e6c45ae26e91bb0400be5bb84547c2b5100a546202b6544f9cb4eb8e6a6",
8
- "macos-aarch64": "43a17faf833de8062dbbf2aa7f537c3db3c2ad43339f6ba1e54a269f3d978eda",
9
- "windows-x86_64.exe": "820e814133f07a191aaac1db9d4dcb666acba1ef7af1c0a2e4aab2f7f2bf65a7",
10
- "windows-aarch64.exe": "4afb398f65829ab977be64015d837a82fd3cd1ac43df3f9db7d4633e3a49b0f7"
4
+ "linux-x86_64": "cea6ec73c69fe0e8e0a0103073298bf26082aeda3e35442194646321df5fb52e",
5
+ "linux-x86_64-glibc2.17": "3641a7c0fcb8d2e14a15dfb2cbb477bc0f4aa0766cb3dd6432cacf9dcbb01388",
6
+ "linux-aarch64": "2f9f607ec7d562424dbb919d5b681fc6c2f37be5a7f98312c567f816f12353af",
7
+ "macos-x86_64": "4381e5e0ba28447367a44f62a23f7f51db7594ebde3938c5466ceacc0108af0f",
8
+ "macos-aarch64": "9b853aa9cc6b33cc366ad90fdb2a8240154b074ad0a115a69607541a088ad6de",
9
+ "windows-x86_64.exe": "8813df57d23b1b4043c955b19113cbbe3451241066cb87f0aceba614b352a207",
10
+ "windows-aarch64.exe": "ebf3f3c9cf1b89ff3651375de58ea53fdc06cb04a057b071ea47ff1a8df7be1d"
11
11
  }
12
12
  }
package/installer.js CHANGED
@@ -346,6 +346,7 @@ async function runInstaller(options = {}) {
346
346
  const env = options.env || process.env;
347
347
  const platform = options.platform || env.VLINK_PLATFORM || process.platform;
348
348
  const arch = options.arch || env.VLINK_ARCH || process.arch;
349
+ const skipSetup = Boolean(options.skipSetup);
349
350
  const home = options.home || os.homedir();
350
351
  const fsImpl = options.fs || fs;
351
352
  const output = options.output || process.stderr;
@@ -381,71 +382,63 @@ async function runInstaller(options = {}) {
381
382
  });
382
383
 
383
384
  if (vlinkPath) {
384
- log(`found vlink at ${vlinkPath}`, output);
385
+ log(
386
+ `found vlink at ${vlinkPath}; installing vlink ${installModule.VERSION}`,
387
+ output
388
+ );
385
389
  } else if (isExecutableFile(targetPath, platform, fsImpl)) {
386
390
  vlinkPath = targetPath;
387
391
  ensureUserPath(installDir, sharedOptions);
388
- log(`found vlink at ${vlinkPath}`, output);
392
+ log(
393
+ `found vlink at ${vlinkPath}; installing vlink ${installModule.VERSION}`,
394
+ output
395
+ );
389
396
  } else {
390
397
  log(`installing vlink ${installModule.VERSION}`, output);
391
- const sourcePath = await ensureBinary({});
392
- installBinary(sourcePath, targetPath, {
393
- ...sharedOptions,
394
- stopDaemon: false
395
- });
396
- ensureUserPath(installDir, sharedOptions);
397
- vlinkPath = targetPath;
398
398
  }
399
399
 
400
- const update = runVlinkUpdate(vlinkPath, { spawnSync: spawnSyncImpl });
401
- if (update.supported) {
402
- if (update.updateRequired) {
403
- log('a newer vlink release is available; applying it', output);
404
- if (
405
- update.installedPath &&
406
- isExecutableFile(update.installedPath, platform, fsImpl)
407
- ) {
408
- vlinkPath = update.installedPath;
409
- if (samePath(path.dirname(vlinkPath), installDir, platform)) {
410
- ensureUserPath(installDir, sharedOptions);
411
- }
412
- }
413
- } else {
414
- log('vlink is up to date', output);
415
- }
416
- } else {
417
- log('installed vlink does not support update checks; installing the latest release', output);
418
- const sourcePath = await ensureBinary({});
419
- installBinary(sourcePath, targetPath, {
420
- ...sharedOptions,
421
- stopDaemon: true
422
- });
400
+ const replacingExisting = Boolean(vlinkPath);
401
+ const installTarget = vlinkPath || targetPath;
402
+ const sourcePath = await ensureBinary({});
403
+ installBinary(sourcePath, installTarget, {
404
+ ...sharedOptions,
405
+ stopDaemon: replacingExisting
406
+ });
407
+ if (
408
+ !replacingExisting ||
409
+ samePath(path.dirname(installTarget), installDir, platform)
410
+ ) {
423
411
  ensureUserPath(installDir, sharedOptions);
424
- vlinkPath = targetPath;
425
412
  }
413
+ vlinkPath = installTarget;
426
414
 
427
415
  vlinkPath = await migrateStaticVlink(vlinkPath, spec, {
428
416
  ...sharedOptions,
429
417
  ensureBinary
430
418
  });
431
419
 
432
- log('starting TedBrain Agent setup', output);
433
- const setup = spawnSyncImpl(vlinkPath, ['setup', 'tedbrain'], {
434
- stdio: 'inherit'
435
- });
436
- const failure = commandFailure(setup, 'vlink setup tedbrain');
437
- if (failure) throw new VlinkSetupError(failure);
420
+ if (skipSetup) {
421
+ log('skipping TedBrain Agent setup', output);
422
+ } else {
423
+ log('starting TedBrain Agent setup', output);
424
+ const setup = spawnSyncImpl(vlinkPath, ['setup', 'tedbrain'], {
425
+ stdio: 'inherit'
426
+ });
427
+ const failure = commandFailure(setup, 'vlink setup tedbrain');
428
+ if (failure) throw new VlinkSetupError(failure);
429
+ }
438
430
 
439
- return { installDir, vlinkPath };
431
+ return { installDir, vlinkPath, setupSkipped: skipSetup };
440
432
  }
441
433
 
442
434
  function printInstallHelp(output = process.stdout) {
443
435
  output.write(
444
436
  [
445
- 'Usage: npx -y @tedbrain/vlink@latest install',
437
+ 'Usage: npx --registry=https://registry.npmmirror.com -y @tedbrain/vlink@latest install [--no-setup]',
438
+ '',
439
+ 'Installs or updates vlink and adds it to the user PATH.',
446
440
  '',
447
- 'Installs or updates vlink, adds it to the user PATH, and starts',
448
- 'the TedBrain setup wizard.'
441
+ ' --no-setup Install without starting the TedBrain setup wizard.'
449
442
  ].join('\n') + '\n'
450
443
  );
451
444
  }
@@ -455,10 +448,16 @@ async function runInstallerFromArgs(args, options = {}) {
455
448
  printInstallHelp(options.output || process.stdout);
456
449
  return null;
457
450
  }
458
- if (args.length > 0) {
459
- throw new VlinkSetupError(`unknown install option: ${args[0]}`);
451
+
452
+ let skipSetup = false;
453
+ for (const arg of args) {
454
+ if (arg === '--no-setup') {
455
+ skipSetup = true;
456
+ } else {
457
+ throw new VlinkSetupError(`unknown install option: ${arg}`);
458
+ }
460
459
  }
461
- return runInstaller(options);
460
+ return runInstaller({ ...options, skipSetup });
462
461
  }
463
462
 
464
463
  module.exports = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tedbrain/vlink",
3
- "version": "0.1.41",
3
+ "version": "0.1.43",
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": {