alvin-bot 4.8.0 ā 4.8.1
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/CHANGELOG.md +14 -0
- package/bin/cli.js +63 -12
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to Alvin Bot are documented here.
|
|
4
4
|
|
|
5
|
+
## [4.8.1] ā 2026-04-11
|
|
6
|
+
|
|
7
|
+
### š Offline setup: Homebrew preferred on macOS
|
|
8
|
+
|
|
9
|
+
Caught during the first real run of the new offline setup wizard on a fresh test MacBook: the official Ollama `install.sh` script on macOS wants to drop `Ollama.app` into `/Applications` and start it as a GUI app. That requires a real user session with sudo and completely breaks over SSH or any non-interactive context. The install downloads the 25 MB .app, then fails at `Unable to find application named 'Ollama'` and drops the wizard back to the fallback provider picker.
|
|
10
|
+
|
|
11
|
+
Fix in `bin/cli.js` `installOllama()`:
|
|
12
|
+
|
|
13
|
+
- **macOS preferred path**: if Homebrew is available (`brew --version` succeeds), use `brew install ollama`. Brew installs `/opt/homebrew/bin/ollama` as a CLI binary with no sudo prompt, no /Applications drop, no GUI dependency ā works over SSH and in any CI/non-interactive context.
|
|
14
|
+
- **Fallback**: if brew is not installed or `brew install` itself fails, fall through to the official `install.sh` with an explicit heads-up that the installer may prompt for admin password and may only work in a local terminal.
|
|
15
|
+
- **Better error messaging**: on macOS install failure, suggest `brew install ollama` or the `.dmg` from ollama.com/download as alternatives. On Linux, unchanged.
|
|
16
|
+
|
|
17
|
+
Linux always uses `install.sh` ā systemd user units work non-interactively there.
|
|
18
|
+
|
|
5
19
|
## [4.8.0] ā 2026-04-11
|
|
6
20
|
|
|
7
21
|
### ⨠Offline mode ā Gemma 4 E4B via Ollama in the setup wizard
|
package/bin/cli.js
CHANGED
|
@@ -143,26 +143,77 @@ function hasOllama() {
|
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
/**
|
|
146
|
-
*
|
|
146
|
+
* Check whether Homebrew is available on PATH (macOS only path normally).
|
|
147
|
+
*/
|
|
148
|
+
function hasBrew() {
|
|
149
|
+
try {
|
|
150
|
+
execSync("brew --version", { stdio: "pipe" });
|
|
151
|
+
return true;
|
|
152
|
+
} catch {
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Install Ollama. On macOS prefers `brew install ollama` because the
|
|
159
|
+
* official install.sh wants to drop Ollama.app into /Applications and
|
|
160
|
+
* start it as a GUI app ā that needs a real user session with sudo and
|
|
161
|
+
* breaks over SSH or in any non-interactive context.
|
|
162
|
+
*
|
|
163
|
+
* Linux always uses the official install.sh (systemd user services work
|
|
164
|
+
* non-interactively).
|
|
165
|
+
*
|
|
147
166
|
* Returns true on success, false on failure.
|
|
148
167
|
*/
|
|
149
168
|
function installOllama() {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
169
|
+
if (process.platform !== "darwin" && process.platform !== "linux") {
|
|
170
|
+
console.log(" ā Offline mode only supported on macOS and Linux.");
|
|
171
|
+
console.log(" Windows users: download from https://ollama.com/download");
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// macOS preferred path: Homebrew (non-interactive, no sudo, no GUI dependency)
|
|
176
|
+
if (process.platform === "darwin" && hasBrew()) {
|
|
177
|
+
console.log("\nš„ Installing Ollama via Homebrew (non-interactive)...");
|
|
178
|
+
try {
|
|
179
|
+
execSync("brew install ollama", {
|
|
154
180
|
stdio: "inherit",
|
|
155
|
-
timeout: 300_000,
|
|
181
|
+
timeout: 300_000,
|
|
156
182
|
});
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
183
|
+
if (hasOllama()) {
|
|
184
|
+
console.log(" ā
Ollama installed via Homebrew");
|
|
185
|
+
return true;
|
|
186
|
+
}
|
|
187
|
+
console.log(" ā ļø Homebrew finished but `ollama` not on PATH yet.");
|
|
188
|
+
} catch (err) {
|
|
189
|
+
console.log(`\n ā ļø brew install ollama failed: ${err.message || err}`);
|
|
190
|
+
console.log(" Falling back to the official install.sh ā this may need sudo and a GUI session.\n");
|
|
162
191
|
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// Fallback: official installer
|
|
195
|
+
console.log("\nš„ Installing Ollama (official installer)...");
|
|
196
|
+
if (process.platform === "darwin") {
|
|
197
|
+
console.log(" ā ļø Heads-up: on macOS the installer drops Ollama.app into");
|
|
198
|
+
console.log(" /Applications and wants to start it ā this may prompt for");
|
|
199
|
+
console.log(" your admin password and only works in a local terminal,");
|
|
200
|
+
console.log(" not over SSH.\n");
|
|
201
|
+
}
|
|
202
|
+
try {
|
|
203
|
+
execSync("curl -fsSL https://ollama.com/install.sh | sh", {
|
|
204
|
+
stdio: "inherit",
|
|
205
|
+
timeout: 300_000,
|
|
206
|
+
});
|
|
207
|
+
return hasOllama();
|
|
163
208
|
} catch (err) {
|
|
164
209
|
console.log(`\n ā Ollama install failed: ${err.message || err}`);
|
|
165
|
-
|
|
210
|
+
if (process.platform === "darwin") {
|
|
211
|
+
console.log(" On macOS, try one of:");
|
|
212
|
+
console.log(" ⢠brew install ollama (recommended)");
|
|
213
|
+
console.log(" ⢠download the .dmg from https://ollama.com/download");
|
|
214
|
+
} else {
|
|
215
|
+
console.log(" Try manually: curl -fsSL https://ollama.com/install.sh | sh");
|
|
216
|
+
}
|
|
166
217
|
return false;
|
|
167
218
|
}
|
|
168
219
|
}
|