@holt-os/holt 0.5.0 → 0.5.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/dist/cli.js +29 -8
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -471,12 +471,21 @@ function printStatus(cfg) {
|
|
|
471
471
|
console.log("\n " + c.dim("[d] default brain [t] toggle brain [c] connect API brain [x] remove API brain [a] launch command [enter] done"));
|
|
472
472
|
}
|
|
473
473
|
async function connectApiBrain(ask, cfg) {
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
474
|
+
let provider = null;
|
|
475
|
+
for (let tries = 0; tries < 3 && !provider; tries++) {
|
|
476
|
+
const provRaw = (await ask(` provider [${PROVIDERS.join("/")}] (enter for ${PROVIDERS[0]}, or "skip"): `) ?? "skip").trim().toLowerCase();
|
|
477
|
+
if (provRaw === "skip" || provRaw === "q" || provRaw === "n" || provRaw === "no") {
|
|
478
|
+
console.log(c.dim(' skipped. Add one later with "holt setting" then "c".'));
|
|
479
|
+
return null;
|
|
480
|
+
}
|
|
481
|
+
if (provRaw === "") provider = PROVIDERS[0];
|
|
482
|
+
else if (PROVIDERS.includes(provRaw)) provider = provRaw;
|
|
483
|
+
else console.log(c.dim(` "${provRaw}" is not a provider. Type one of: ${PROVIDERS.join(", ")}`));
|
|
484
|
+
}
|
|
485
|
+
if (!provider) {
|
|
486
|
+
console.log(c.dim(' skipped after three tries. Add one later with "holt setting" then "c".'));
|
|
477
487
|
return null;
|
|
478
488
|
}
|
|
479
|
-
const provider = provRaw;
|
|
480
489
|
const suggestion = PROVIDER_MODEL_SUGGESTION[provider];
|
|
481
490
|
const modelRaw = (await ask(` model (enter for ${suggestion}): `) ?? "").trim();
|
|
482
491
|
const model = modelRaw || suggestion;
|
|
@@ -637,10 +646,12 @@ Default brain? [${chosen.join("/")}] (${defPick}): `) ?? "").trim();
|
|
|
637
646
|
const defaultBrain = chosen.includes(dans) ? dans : defPick;
|
|
638
647
|
const aliasAns = (await ask('Launch command? Type a custom word like "ai", or press enter to keep "holt": ') ?? "").trim();
|
|
639
648
|
let aliasNote = "";
|
|
649
|
+
let aliasRcFile = "";
|
|
640
650
|
if (aliasAns && aliasAns !== "holt") {
|
|
641
651
|
if (isInstalled(aliasAns)) console.log(c.dim(` note: "${aliasAns}" already exists; the alias will shadow it in new shells.`));
|
|
642
652
|
const r = installAlias(aliasAns);
|
|
643
|
-
|
|
653
|
+
if (r.ok) aliasRcFile = r.file;
|
|
654
|
+
aliasNote = r.ok ? c.green(` alias "${aliasAns}" -> holt chat added to ${r.file}`) : c.red(" " + r.message);
|
|
644
655
|
}
|
|
645
656
|
let wantMemorySetup = false;
|
|
646
657
|
const embedReady = await embeddingsAvailable();
|
|
@@ -696,8 +707,18 @@ Default brain? [${chosen.join("/")}] (${defPick}): `) ?? "").trim();
|
|
|
696
707
|
saveConfig(cfg);
|
|
697
708
|
console.log("\n" + c.green("Saved to ./.holt/config.json"));
|
|
698
709
|
if (aliasNote) console.log(aliasNote);
|
|
699
|
-
if (cfg.defaultBrain)
|
|
700
|
-
|
|
710
|
+
if (cfg.defaultBrain) {
|
|
711
|
+
if (aliasRcFile) {
|
|
712
|
+
console.log("\nStart chatting:");
|
|
713
|
+
console.log(" " + c.accent(`source ${aliasRcFile}`) + c.dim(" (once; new terminals will not need it)"));
|
|
714
|
+
console.log(" " + c.accent(aliasAns) + "\n");
|
|
715
|
+
console.log(c.dim(" Or right now, without sourcing: holt chat\n"));
|
|
716
|
+
} else {
|
|
717
|
+
console.log("Start chatting: " + c.accent("holt chat") + "\n");
|
|
718
|
+
}
|
|
719
|
+
} else {
|
|
720
|
+
console.log(c.dim('No brain is ready yet. Install one, then run "holt init" again.\n'));
|
|
721
|
+
}
|
|
701
722
|
}
|
|
702
723
|
|
|
703
724
|
// src/commands/chat.ts
|
|
@@ -2387,7 +2408,7 @@ async function graph(args = []) {
|
|
|
2387
2408
|
}
|
|
2388
2409
|
|
|
2389
2410
|
// src/cli.ts
|
|
2390
|
-
var VERSION = "0.5.
|
|
2411
|
+
var VERSION = "0.5.1";
|
|
2391
2412
|
var BANNER = `
|
|
2392
2413
|
\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557
|
|
2393
2414
|
\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D
|