@tedbrain/vlink 0.1.69 → 0.1.71

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
@@ -66,6 +66,28 @@ npm exec --registry=https://registry.npmmirror.com \
66
66
  npx --registry=https://registry.npmmirror.com -y @tedbrain/vlink@latest install --no-setup
67
67
  ```
68
68
 
69
+ ## 安装 Web 通道
70
+
71
+ 用于网页接入、终端和协议命令调用时,执行:
72
+
73
+ ```bash
74
+ npx --registry=https://registry.npmmirror.com -y @tedbrain/vlink@latest install --web
75
+ ```
76
+
77
+ 该选项复用原生二进制下载、更新、安装路径、PATH 和补全配置,跳过
78
+ `vlink setup tedbrain`,随后使用安装后的二进制绝对路径依次执行:
79
+
80
+ ```bash
81
+ vlink channel web install-protocol
82
+ vlink channel web start
83
+ ```
84
+
85
+ 协议注册或服务启动失败时,安装命令返回非零退出码。
86
+ `--web` 可与 `--verbose`、`--no-setup` 一起使用;`--no-setup`
87
+ 仅控制 TedBrain 向导,不会禁用 Web 初始化。
88
+ 服务已运行时沿用 `channel web start` 的幂等复用行为,不强制重启现有终端。
89
+ 该选项启动当前服务并注册 `vlink://` 唤起入口,不配置开机自启动。
90
+
69
91
  ## 下载地址
70
92
 
71
93
  安装脚本优先从 Gitee Release 解析当前版本对应平台的附件并下载;Gitee 不可用、
package/bin/vlink.js CHANGED
@@ -15,7 +15,7 @@ function verbose(message) {
15
15
  }
16
16
 
17
17
  function diagnosticArgs(args) {
18
- const safe = new Set(['install', '--verbose', '--no-setup', '--help', '-h']);
18
+ const safe = new Set(['install', '--verbose', '--no-setup', '--web', '--help', '-h']);
19
19
  return args.map((arg) => {
20
20
  if (safe.has(arg)) return arg;
21
21
  if (arg.startsWith('--')) return arg.split('=', 1)[0];
package/binaries.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
- "version": "0.1.69",
2
+ "version": "0.1.71",
3
3
  "binaries": {
4
- "linux-x86_64": "2164a91d468721580169be9f86a1f6da81231d6b524e94ba39976520116a1784",
5
- "linux-x86_64-glibc2.17": "108655953bead4ae476298704a8660116403b9901490a25aada2a69e85dbea55",
6
- "linux-aarch64": "0240adcbf151ee25f6addbc84ad6f4c81d9dd83a87b175fb21e3674c468da81a",
7
- "macos-x86_64": "d3a355ed4619adda489e3cc648c101dcf06758080ed5b646835bc8c6681c2d1b",
8
- "macos-aarch64": "a48cb73a8eb673d1e917f85f2b9aad9ca627a4b676074dd4a155f3eee81be3ef",
9
- "windows-x86_64.exe": "7cce4b670152450ccdbf419dcec33ceb617f9f3376be461b782fc504a502fff3",
10
- "windows-aarch64.exe": "8831deb04f46f2095d6e105808aad18da2ac8bc687567479e2efbf62eaf0e4f2"
4
+ "linux-x86_64": "db8e756fdaaa42409708a4016c62ec3dbb858d44df480a14243f08ac944c4c5f",
5
+ "linux-x86_64-glibc2.17": "7e036c611021b237c8f6e7e6589022569f2888de4b8e4b225bdfa020cde42231",
6
+ "linux-aarch64": "af8420be1c1b72f7a9b143846f587fb66eb6e0e5a5bfa7529c6ffef5d499695e",
7
+ "macos-x86_64": "2f4febce4497ed090aa17e5444e9fba523110396bb09a83595be40b524924c07",
8
+ "macos-aarch64": "8f3dd2fabb4508779b5add6adc7f521423cf94fb33d07ccd7c9c820fedb6ea14",
9
+ "windows-x86_64.exe": "b95983ee9a03c3b226c708c1d4a170fe48a779a712562b0978c6207cb312fe7d",
10
+ "windows-aarch64.exe": "10d849842530a362bce1622e17a16874695f584c7c65f462492e28bd9db867aa"
11
11
  }
12
12
  }
package/installer.js CHANGED
@@ -435,7 +435,8 @@ async function runInstaller(options = {}) {
435
435
  const env = options.env || process.env;
436
436
  const platform = options.platform || env.VLINK_PLATFORM || process.platform;
437
437
  const arch = options.arch || env.VLINK_ARCH || process.arch;
438
- const skipSetup = Boolean(options.skipSetup);
438
+ const web = Boolean(options.web);
439
+ const skipSetup = web || Boolean(options.skipSetup);
439
440
  const verbose = verboseEnabled(options);
440
441
  const home = options.home || os.homedir();
441
442
  const fsImpl = options.fs || fs;
@@ -578,19 +579,34 @@ async function runInstaller(options = {}) {
578
579
  verboseLog('setup stage: completed successfully', sharedOptions);
579
580
  }
580
581
 
582
+ if (web) {
583
+ for (const operation of ['install-protocol', 'start']) {
584
+ const args = ['channel', 'web', operation];
585
+ log(operation === 'install-protocol'
586
+ ? 'registering the vlink:// protocol'
587
+ : 'starting the Web channel service', output);
588
+ verboseLog(`web stage: executing ${vlinkPath} ${args.join(' ')}`, sharedOptions);
589
+ const result = spawnSyncImpl(vlinkPath, args, { env, stdio: 'inherit' });
590
+ const failure = commandFailure(result, `vlink ${args.join(' ')}`);
591
+ if (failure) throw new VlinkSetupError(failure);
592
+ }
593
+ log('Web channel is ready', output);
594
+ }
595
+
581
596
  log(`installation complete: ${vlinkPath}`, output);
582
597
  log('open a new terminal to use the updated PATH', output);
583
- return { installDir, vlinkPath, commandShimPath, setupSkipped: skipSetup };
598
+ return { installDir, vlinkPath, commandShimPath, setupSkipped: skipSetup, webStarted: web };
584
599
  }
585
600
 
586
601
  function printInstallHelp(output = process.stdout) {
587
602
  output.write(
588
603
  [
589
- 'Usage: npx --registry=https://registry.npmmirror.com -y @tedbrain/vlink@latest install [--no-setup] [--verbose]',
604
+ 'Usage: npx --registry=https://registry.npmmirror.com -y @tedbrain/vlink@latest install [--no-setup] [--web] [--verbose]',
590
605
  '',
591
606
  'Installs or updates vlink and adds it to the user PATH.',
592
607
  '',
593
608
  ' --no-setup Install without starting the TedBrain setup wizard.',
609
+ ' --web Register vlink:// and start the Web channel instead of TedBrain setup.',
594
610
  ' --verbose Print diagnostics for every installation stage.'
595
611
  ].join('\n') + '\n'
596
612
  );
@@ -603,10 +619,13 @@ async function runInstallerFromArgs(args, options = {}) {
603
619
  }
604
620
 
605
621
  let skipSetup = false;
622
+ let web = false;
606
623
  let verbose = verboseEnabled(options);
607
624
  for (const arg of args) {
608
625
  if (arg === '--no-setup') {
609
626
  skipSetup = true;
627
+ } else if (arg === '--web') {
628
+ web = true;
610
629
  } else if (arg === '--verbose') {
611
630
  verbose = true;
612
631
  } else {
@@ -614,7 +633,7 @@ async function runInstallerFromArgs(args, options = {}) {
614
633
  throw new VlinkSetupError(`unknown install option: ${displayArg}`);
615
634
  }
616
635
  }
617
- return runInstaller({ ...options, skipSetup, verbose });
636
+ return runInstaller({ ...options, skipSetup, web, verbose });
618
637
  }
619
638
 
620
639
  module.exports = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tedbrain/vlink",
3
- "version": "0.1.69",
3
+ "version": "0.1.71",
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": {