@cocorograph/hub-agent 0.6.76 → 0.6.77

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 +28 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocorograph/hub-agent",
3
- "version": "0.6.76",
3
+ "version": "0.6.77",
4
4
  "description": "Hub Hosted Cockpit のローカル常駐 agent。Hub と outbound WSS で接続し、ローカルの tmux/pty を中継する。",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -512,6 +512,31 @@ _install_node_lts_linux() {
512
512
  color_ok "node $(node --version 2>/dev/null || echo '?') を導入"
513
513
  }
514
514
 
515
+ # ネイティブアドオン (node-pty 等) のビルドに必要な make / g++ / python3 を導入する。
516
+ # node-pty は prebuild が無いと node-gyp rebuild にフォールバックするが、クリーンな
517
+ # Ubuntu には build-essential が無く `gyp ERR! not found: make` で失敗する
518
+ # (WSL クリーン Ubuntu で発覚)。macOS は Xcode CLT 前提なので何もしない。
519
+ ensure_build_tools() {
520
+ [[ "$(uname)" == "Darwin" ]] && return 0
521
+ if present make && present g++; then
522
+ color_ok "build tools (make / g++) already installed"
523
+ return 0
524
+ fi
525
+ color_step "ネイティブビルド依存 (build-essential / python3) を install"
526
+ if present apt-get; then
527
+ retry 3 sudo apt-get update -y
528
+ retry 3 sudo apt-get install -y build-essential python3
529
+ elif present dnf; then
530
+ retry 3 sudo dnf groupinstall -y "Development Tools"
531
+ retry 3 sudo dnf install -y python3
532
+ elif present pacman; then
533
+ retry 3 sudo pacman -S --noconfirm base-devel python
534
+ else
535
+ color_err "対応するパッケージマネージャが見つかりません。make / g++ / python3 を手動で install してください"
536
+ exit 1
537
+ fi
538
+ }
539
+
515
540
  # Node.js のサポート範囲ポリシー判定。
516
541
  # - 未インストール → LTS を install
517
542
  # - [MIN, MAX] 範囲内 → 現状維持(ユーザーの環境を尊重)
@@ -731,7 +756,7 @@ EOF
731
756
 
732
757
  main() {
733
758
  color_step "hub-agent ワンライナーセットアップを開始"
734
- STEP_TOTAL=10
759
+ STEP_TOTAL=11
735
760
  STEP_NUM=0
736
761
 
737
762
  step_header "Homebrew"
@@ -740,6 +765,8 @@ main() {
740
765
  ensure_pkg tmux tmux tmux
741
766
  step_header "Node.js (Active LTS)"
742
767
  ensure_node_version
768
+ step_header "Build tools (native addons)"
769
+ ensure_build_tools
743
770
  step_header "npm global prefix"
744
771
  ensure_npm_user_prefix
745
772
  # ensure_node_version 直後だと brew link でシェルの command hash がズレている