offgrid-ai 0.3.1 → 0.3.4
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/package.json +1 -1
- package/src/cli.mjs +17 -1
- package/src/profiles.mjs +1 -1
package/package.json
CHANGED
package/src/cli.mjs
CHANGED
|
@@ -40,7 +40,23 @@ export async function mainFlow() {
|
|
|
40
40
|
const hasAnyModels = ggufModels.length > 0 || managedModels.some((m) => m.models.length > 0);
|
|
41
41
|
const totalManaged = managedModels.reduce((sum, m) => sum + m.models.length, 0);
|
|
42
42
|
|
|
43
|
-
// 2.
|
|
43
|
+
// 2. Check mandatory deps — if anything essential is missing, re-offer onboarding
|
|
44
|
+
const piInstalled = await hasPi();
|
|
45
|
+
const brewInstalled = await hasHomebrew();
|
|
46
|
+
const missingDeps = [];
|
|
47
|
+
if (!brewInstalled) missingDeps.push("Homebrew");
|
|
48
|
+
if (!llamaBinary) missingDeps.push("llama-server");
|
|
49
|
+
if (!piInstalled) missingDeps.push("Pi");
|
|
50
|
+
if (missingDeps.length > 0) {
|
|
51
|
+
if (!process.stdin.isTTY) {
|
|
52
|
+
throw new Error(`Missing dependencies: ${missingDeps.join(", ")}. Run offgrid-ai interactively to install.`);
|
|
53
|
+
}
|
|
54
|
+
console.log(pc.yellow(`Missing: ${missingDeps.join(", ")}`));
|
|
55
|
+
console.log(pc.dim("offgrid-ai needs these to run. Let's finish setup.\n"));
|
|
56
|
+
return await onboardFlow();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// 3. Nothing available at all — need onboarding
|
|
44
60
|
if (!hasAnyBackend && !hasAnyModels && profiles.length === 0) {
|
|
45
61
|
if (!process.stdin.isTTY) {
|
|
46
62
|
throw new Error("No local LLM backends found. Run offgrid-ai interactively to set up.");
|
package/src/profiles.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { existsSync, statSync } from "node:fs";
|
|
2
|
-
import { mkdir, readdir, rm, unlink, writeFile } from "node:fs/promises";
|
|
2
|
+
import { mkdir, readdir, rm, unlink, writeFile, readFile } from "node:fs/promises";
|
|
3
3
|
import { dirname, join } from "node:path";
|
|
4
4
|
import { PROFILE_DIR, RUN_DIR, LOG_DIR } from "./config.mjs";
|
|
5
5
|
import { backendFor } from "./backends.mjs";
|