copilot-hub-cli 1.1.6 → 1.1.7

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/run.js CHANGED
@@ -44,39 +44,38 @@ function getBinaryPath() {
44
44
 
45
45
  // ★ 自动更新:启动前检查 npm 是否有新版本
46
46
  function autoUpdate() {
47
- // 跳过更新检查:--no-update 参数
48
47
  if (process.argv.includes('--no-update')) return;
49
48
 
50
49
  try {
51
50
  const pkg = require('../package.json');
52
51
  const currentVersion = pkg.version;
53
52
 
54
- console.log(`🔍 检查更新... (当前 v${currentVersion})`);
53
+ process.stdout.write(`检查更新中...`);
55
54
  const latest = execSync('npm view copilot-hub-cli version 2>/dev/null', {
56
- encoding: 'utf8', timeout: 8000
55
+ encoding: 'utf8', timeout: 10000
57
56
  }).trim();
58
57
 
59
58
  if (latest && latest !== currentVersion && isNewer(latest, currentVersion)) {
60
- console.log(`🆕 发现新版本 v${latest},正在自动更新...`);
59
+ process.stdout.write(` 发现 v${latest}\n`);
60
+ console.log(`正在更新,请稍候...`);
61
61
  try {
62
- execSync('npm install -g copilot-hub-cli@latest', {
63
- stdio: 'inherit', timeout: 120000
62
+ execSync('npm install -g copilot-hub-cli@latest 2>/dev/null', {
63
+ stdio: ['pipe', 'pipe', 'pipe'], timeout: 180000
64
64
  });
65
- console.log(`✅ 更新成功!重新启动中...\n`);
66
- // 用新版本重新启动自己(带 --no-update 防止循环)
65
+ console.log(`✅ 更新完成,重新启动中...\n`);
67
66
  const child = spawn(process.argv[0], [process.argv[1], '--no-update', ...process.argv.slice(2)], {
68
67
  stdio: 'inherit', env: process.env
69
68
  });
70
69
  child.on('exit', (code) => process.exit(code || 0));
71
- return true; // 表示已接管,主流程不要继续
70
+ return true;
72
71
  } catch (e) {
73
- console.log(`⚠️ 自动更新失败,使用当前版本继续运行`);
72
+ console.log(`更新失败,使用当前版本继续`);
74
73
  }
75
74
  } else {
76
- console.log(`✅ 已是最新版本 v${currentVersion}`);
75
+ process.stdout.write(` v${currentVersion} ✓\n`);
77
76
  }
78
77
  } catch (e) {
79
- // 网络不通等,静默跳过
78
+ process.stdout.write(` 跳过\n`);
80
79
  }
81
80
  return false;
82
81
  }
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "copilot-hub-cli",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "description": "Copilot Hub CLI - AI 编程助手代理服务,一键启动 GitHub Copilot 代理 + Web 管理面板",
5
5
  "keywords": [
6
6
  "copilot",