@must-b/must-b 1.71.21 → 1.71.24

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/install.sh DELETED
@@ -1,150 +0,0 @@
1
- #!/usr/bin/env bash
2
- # ── Must-b Universal Installer (Linux / macOS) ────────────────────────────
3
- # Usage: curl -fsSL https://must-b.com/install.sh | bash
4
- set -euo pipefail
5
-
6
- REPO="https://github.com/aytac43-0/must-b.git"
7
- DIR="must-b"
8
- REQUIRED_MAJOR=22
9
- REQUIRED_MINOR=5
10
-
11
- cyan() { printf '\033[38;2;0;204;255m%s\033[0m\n' "$*"; }
12
- green() { printf '\033[32m%s\033[0m\n' "$*"; }
13
- red() { printf '\033[31m%s\033[0m\n' "$*"; }
14
- yellow(){ printf '\033[33m%s\033[0m\n' "$*"; }
15
- dim() { printf '\033[2m%s\033[0m\n' "$*"; }
16
-
17
- echo ""
18
- cyan " ══════════════════════════════════════════════"
19
- cyan " Must-b — Installer (Linux / macOS)"
20
- cyan " ══════════════════════════════════════════════"
21
- echo ""
22
-
23
- # ── helpers ───────────────────────────────────────────────────────────────
24
-
25
- semver_ok() {
26
- # $1 = full version string like "22.6.0"
27
- local maj min
28
- maj=$(echo "$1" | cut -d. -f1)
29
- min=$(echo "$1" | cut -d. -f2)
30
- if [ "$maj" -gt "$REQUIRED_MAJOR" ]; then return 0
31
- elif [ "$maj" -eq "$REQUIRED_MAJOR" ] && [ "$min" -ge "$REQUIRED_MINOR" ]; then return 0
32
- else return 1
33
- fi
34
- }
35
-
36
- install_node22() {
37
- yellow " ⟳ Attempting to install Node.js v22 automatically..."
38
- local plat
39
- plat="$(uname -s)"
40
- if [ "$plat" = "Darwin" ]; then
41
- if command -v brew &>/dev/null; then
42
- brew install node@22 || brew upgrade node
43
- brew link --overwrite node@22 2>/dev/null || true
44
- else
45
- red " ✗ Homebrew not found. Install it first: https://brew.sh"
46
- red " Then run: brew install node@22"
47
- exit 1
48
- fi
49
- else
50
- # Linux — try nodesource v22 (Debian/Ubuntu) else nvm
51
- if command -v apt-get &>/dev/null; then
52
- curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
53
- sudo apt-get install -y nodejs
54
- elif command -v dnf &>/dev/null; then
55
- curl -fsSL https://rpm.nodesource.com/setup_22.x | sudo bash -
56
- sudo dnf install -y nodejs
57
- elif command -v yum &>/dev/null; then
58
- curl -fsSL https://rpm.nodesource.com/setup_22.x | sudo bash -
59
- sudo yum install -y nodejs
60
- else
61
- yellow " ⚠ Could not auto-install Node.js on this distro."
62
- yellow " Install nvm and run: nvm install 22 && nvm use 22"
63
- exit 1
64
- fi
65
- fi
66
- }
67
-
68
- # ── 1. Check / install Node.js ────────────────────────────────────────────
69
- if ! command -v node &>/dev/null; then
70
- red " ✗ Node.js not found — will attempt automatic install..."
71
- install_node22
72
- fi
73
-
74
- NODE_VER=$(node -e "process.stdout.write(process.versions.node)")
75
- if ! semver_ok "$NODE_VER"; then
76
- red " ✗ Node.js v${NODE_VER} found, but v${REQUIRED_MAJOR}.${REQUIRED_MINOR}+ is required."
77
- yellow " Attempting upgrade..."
78
- install_node22
79
- NODE_VER=$(node -e "process.stdout.write(process.versions.node)")
80
- fi
81
-
82
- if ! semver_ok "$NODE_VER"; then
83
- red " ✗ Node.js v${NODE_VER} still below requirement. Please upgrade manually:"
84
- if [ "$(uname -s)" = "Darwin" ]; then
85
- echo " brew install node@22"
86
- else
87
- echo " curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -"
88
- echo " sudo apt-get install -y nodejs"
89
- fi
90
- exit 1
91
- fi
92
- green " ✓ Node.js v${NODE_VER} (>= v${REQUIRED_MAJOR}.${REQUIRED_MINOR} ✓)"
93
-
94
- # ── 2. Check Git ──────────────────────────────────────────────────────────
95
- if ! command -v git &>/dev/null; then
96
- red " ✗ Git not found. Install it:"
97
- echo " Debian/Ubuntu: sudo apt install git"
98
- echo " macOS: xcode-select --install"
99
- exit 1
100
- fi
101
- green " ✓ $(git --version)"
102
-
103
- # ── 3. Clone or update ────────────────────────────────────────────────────
104
- echo ""
105
- if [ -d "$DIR" ]; then
106
- dim " Directory '$DIR' already exists — pulling latest..."
107
- cd "$DIR"
108
- git pull --ff-only
109
- else
110
- dim " [1/4] Cloning Must-b..."
111
- git clone "$REPO" "$DIR"
112
- cd "$DIR"
113
- fi
114
-
115
- # ── 4. npm install (force fresh, ignore cache) ────────────────────────────
116
- dim " [2/4] Installing dependencies (--prefer-online)..."
117
- npm install --prefer-online
118
-
119
- # ── 5. .env setup ─────────────────────────────────────────────────────────
120
- dim " [3/4] Setting up environment config..."
121
- if [ ! -f .env ]; then
122
- cp .env.example .env
123
- green " ✓ .env created from .env.example"
124
- echo " Edit .env and set your OPENROUTER_API_KEY before starting."
125
- else
126
- dim " .env already exists — skipping."
127
- fi
128
-
129
- # ── 6. Global link ────────────────────────────────────────────────────────
130
- dim " [4/4] Linking global 'must-b' command..."
131
- npm link 2>/dev/null || {
132
- echo ""
133
- dim " npm link requires write permission to the global node_modules."
134
- dim " Try: sudo npm link or npm link --prefix ~/.local"
135
- }
136
-
137
- echo ""
138
- cyan " ══════════════════════════════════════════════"
139
- green " Installation complete!"
140
- echo ""
141
- dim " Run the first-time setup wizard:"
142
- echo " must-b onboard"
143
- echo ""
144
- dim " Quick reference:"
145
- echo " must-b → web UI at http://localhost:4309"
146
- echo " must-b cli → terminal chat"
147
- echo " must-b doctor → system health check"
148
- echo " must-b --version → show installed version"
149
- cyan " ══════════════════════════════════════════════"
150
- echo ""