offgrid-ai 0.2.9 → 0.3.0
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 +25 -1
- package/src/profiles.mjs +1 -0
package/package.json
CHANGED
package/src/cli.mjs
CHANGED
|
@@ -619,7 +619,31 @@ async function onboardFlow() {
|
|
|
619
619
|
}
|
|
620
620
|
console.log(pc.green(`✓ llama-server: ${llamaBinary}`));
|
|
621
621
|
|
|
622
|
-
// 3.
|
|
622
|
+
// 3. Pi coding agent
|
|
623
|
+
const piInstalled = await hasPi();
|
|
624
|
+
if (!piInstalled) {
|
|
625
|
+
const install = await prompt.yesNo("Pi coding agent is required to chat with models. Install via npm?", true);
|
|
626
|
+
if (!install) {
|
|
627
|
+
console.log(pc.red("offgrid-ai needs Pi to run models."));
|
|
628
|
+
console.log(pc.dim("Install it manually: npm install -g --ignore-scripts @earendil-works/pi-coding-agent"));
|
|
629
|
+
return;
|
|
630
|
+
}
|
|
631
|
+
console.log(pc.cyan("Installing Pi..."));
|
|
632
|
+
try {
|
|
633
|
+
await run("npm", ["install", "-g", "--ignore-scripts", "@earendil-works/pi-coding-agent"], "Pi");
|
|
634
|
+
} catch {
|
|
635
|
+
console.log(pc.red("✗ Failed to install Pi."));
|
|
636
|
+
console.log(pc.dim("Install it manually: npm install -g --ignore-scripts @earendil-works/pi-coding-agent"));
|
|
637
|
+
return;
|
|
638
|
+
}
|
|
639
|
+
if (!(await hasPi())) {
|
|
640
|
+
console.log(pc.yellow("Pi was installed but not found on PATH. Restart your terminal and run offgrid-ai again."));
|
|
641
|
+
return;
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
console.log(pc.green("✓ Pi found"));
|
|
645
|
+
|
|
646
|
+
// 4. Model backends — at least one is mandatory
|
|
623
647
|
const ggufModels = await scanGgufModels();
|
|
624
648
|
const managedModels = await scanManagedModels();
|
|
625
649
|
const totalManaged = managedModels.reduce((sum, m) => sum + m.models.length, 0);
|
package/src/profiles.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import { mkdir, readdir, rm, unlink, writeFile } 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";
|
|
6
|
+
import { computeFlags } from "./autodetect.mjs";
|
|
6
7
|
import { readJson, writeJson } from "./json.mjs";
|
|
7
8
|
|
|
8
9
|
// ── Path helpers ───────────────────────────────────────────────────────────
|