@cocorograph/hub-agent 0.6.75 → 0.6.76

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 (2) hide show
  1. package/package.json +1 -1
  2. package/scripts/install.sh +23 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocorograph/hub-agent",
3
- "version": "0.6.75",
3
+ "version": "0.6.76",
4
4
  "description": "Hub Hosted Cockpit のローカル常駐 agent。Hub と outbound WSS で接続し、ローカルの tmux/pty を中継する。",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -491,6 +491,27 @@ _install_node_lts_brew() {
491
491
  hash -r 2>/dev/null || true
492
492
  }
493
493
 
494
+ # Linux で Active LTS の node を導入する。
495
+ # Ubuntu の apt 素 nodejs は 24.04 でも v18 でポリシー (>=22) を満たせないため、
496
+ # NodeSource (setup_<major>.x) を使ってシステムワイドに最新 LTS を導入する。既存の
497
+ # apt 版 nodejs があっても apt-get install -y nodejs が NodeSource 版へ置き換える。
498
+ _install_node_lts_linux() {
499
+ local major="${NODE_DEFAULT_BREW_FORMULA##*@}" # "node@24" -> "24"
500
+ color_step "NodeSource 経由で Node ${major} (Active LTS) を install"
501
+ if present apt-get; then
502
+ retry 3 bash -c "curl -fsSL https://deb.nodesource.com/setup_${major}.x | sudo -E bash -"
503
+ retry 3 sudo apt-get install -y nodejs
504
+ elif present dnf; then
505
+ retry 3 bash -c "curl -fsSL https://rpm.nodesource.com/setup_${major}.x | sudo -E bash -"
506
+ retry 3 sudo dnf install -y nodejs
507
+ else
508
+ color_err "NodeSource 非対応の環境です。Node ${NODE_MIN_MAJOR}+ を手動で install してください (nvm 推奨)"
509
+ exit 1
510
+ fi
511
+ hash -r 2>/dev/null || true
512
+ color_ok "node $(node --version 2>/dev/null || echo '?') を導入"
513
+ }
514
+
494
515
  # Node.js のサポート範囲ポリシー判定。
495
516
  # - 未インストール → LTS を install
496
517
  # - [MIN, MAX] 範囲内 → 現状維持(ユーザーの環境を尊重)
@@ -507,7 +528,7 @@ ensure_node_version() {
507
528
  if [[ "$(uname)" == "Darwin" ]]; then
508
529
  _install_node_lts_brew
509
530
  else
510
- ensure_pkg node node nodejs
531
+ _install_node_lts_linux
511
532
  fi
512
533
  return
513
534
  fi
@@ -525,8 +546,7 @@ ensure_node_version() {
525
546
  if [[ "$(uname)" == "Darwin" ]]; then
526
547
  _install_node_lts_brew
527
548
  else
528
- color_err "Node $NODE_MIN_MAJOR〜$NODE_MAX_MAJOR の LTS を手動で install してください (nvm 推奨)"
529
- exit 1
549
+ _install_node_lts_linux
530
550
  fi
531
551
  }
532
552