terminal-bridge-setup 3.3.2 → 3.3.3

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/bin/setup.mjs CHANGED
@@ -126,20 +126,27 @@ function installProxyDeps() {
126
126
  // 支持 --registry 透传(国内网络/公司内网常用)
127
127
  // 用法:npx terminal-bridge-setup --registry=https://registry.npmmirror.com
128
128
  const registryArg = process.argv.find(a => a.startsWith("--registry="));
129
- const npmArgs = ["install", "--no-audit", "--no-fund"];
129
+ const baseArgs = ["install", "--no-audit", "--no-fund"];
130
+ const runNpm = (args) => {
131
+ console.log(c.dim(` 运行 npm ${args.join(" ")} ...`));
132
+ return spawnSync("npm", args, { cwd: proxyDir, stdio: "inherit" });
133
+ };
134
+
135
+ let result;
130
136
  if (registryArg) {
131
- npmArgs.push(registryArg);
132
137
  console.log(c.dim(` 使用 registry: ${registryArg.split("=")[1]}`));
138
+ result = runNpm([...baseArgs, registryArg]);
133
139
  } else {
134
- npmArgs.push("--silent");
140
+ // 不加 --silent:私有源缺包/认证失败等真实错误必须可见,不能吞掉
141
+ result = runNpm(baseArgs);
142
+ if (result.status !== 0) {
143
+ // 内网镜像未同步/缺包是高频原因(verdaccio 同步延迟实测踩过),
144
+ // 自动用官方源兜底重试一次再判失败
145
+ console.log(c.yellow(" 默认 registry 安装失败,用官方源 npmjs.org 重试..."));
146
+ result = runNpm([...baseArgs, "--registry=https://registry.npmjs.org"]);
147
+ }
135
148
  }
136
149
 
137
- console.log(c.dim(" 运行 npm install ..."));
138
- const result = spawnSync("npm", npmArgs, {
139
- cwd: proxyDir,
140
- stdio: "inherit",
141
- });
142
-
143
150
  if (result.status !== 0) {
144
151
  // 失败时给出明确的排查建议
145
152
  console.error("");
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "JumpServer 终端桥接",
4
- "version": "3.3.2",
4
+ "version": "3.3.3",
5
5
  "description": "终端桥接:JumpServer / Arthas / Yearning,让 Agent 能通过浏览器执行命令、收结果与查数据",
6
6
  "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtsnqR6PcFUueZwYria79tVbstvjk+tM7PpvIXILm5xbd6bAdjDIhzg3lsnKioVfvxjfvT+s6vJsiOYa9ojVZyJMFc5m/05TYqr770ovYwQmz0e88fmiy6dUoSulbtKvBCSLbN6OOL7u+ul8ixLZ/HautxSmou/eNgAFPmhE+4UueE7wfCqcgMYvjLvEzlqTVumMW+5LKw9YsRk6WhHPghY1a3MVUn3eQOWXBtQTEUy3wBM3v4wHxLwDeinVOR4f/P87IlUNo84C5DeimoFit0qCj3K04hS8MIYCLCYZc3v9ftRJDJBkAoah6Eaqj7JajbS3KvLR1ctOYfDhubgmURQIDAQAB",
7
7
  "permissions": ["debugger", "tabs", "alarms", "webNavigation", "nativeMessaging", "scripting", "downloads", "storage"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "terminal-bridge-setup",
3
- "version": "3.3.2",
3
+ "version": "3.3.3",
4
4
  "description": "一次性安装器:释放终端桥接(JumpServer / Arthas / Yearning)的本地代理 + Chrome 插件,并注册 native messaging host。让 Agent 能通过浏览器 xterm 终端执行命令并拿回输出。",
5
5
  "license": "MIT",
6
6
  "author": "encorearon",