blun-king-cli 5.1.2 → 5.1.3

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.
Files changed (2) hide show
  1. package/blun-cli.js +20 -72
  2. package/package.json +1 -1
package/blun-cli.js CHANGED
@@ -2608,46 +2608,19 @@ async function main() {
2608
2608
  console.log(C.gray + " Do you trust this folder? BLUN King will read/write files here." + C.reset);
2609
2609
  console.log("");
2610
2610
 
2611
- var trustOptions = [
2612
- { label: "Yes, trust this folder", action: "trust" },
2613
- { label: "Always trust this folder", action: "always" },
2614
- { label: "Choose another folder", action: "choose" }
2615
- ];
2616
- var trustSel = 0;
2617
-
2618
- // Arrow key menu for trust selection (PowerShell compatible)
2611
+ console.log(C.green + C.bold + " ❯ " + C.brightWhite + "1. Yes, trust this folder" + C.reset);
2612
+ console.log(" " + C.gray + "2. Always trust this folder" + C.reset);
2613
+ console.log(" " + C.gray + "3. Choose another folder" + C.reset);
2614
+ console.log("");
2619
2615
  var trustChoice = await new Promise(function(resolve) {
2620
- function renderTrustMenu() {
2621
- // Use VT100 cursor save/restore for Windows compatibility
2622
- process.stdout.write("\x1b[s"); // save cursor
2623
- trustOptions.forEach(function(opt, i) {
2624
- var prefix = i === trustSel ? C.green + C.bold + " \u276F " : " ";
2625
- var color = i === trustSel ? C.brightWhite + C.bold : C.gray;
2626
- process.stdout.write(prefix + color + (i + 1) + ". " + opt.label + C.reset + "\x1b[K\n");
2627
- });
2628
- process.stdout.write("\x1b[u"); // restore cursor
2629
- }
2630
- renderTrustMenu();
2631
-
2632
- process.stdin.setRawMode(true);
2633
- process.stdin.resume();
2634
- process.stdin.setEncoding("utf8");
2635
- function onKey(key) {
2636
- if (key === "\x1b[A") { trustSel = Math.max(0, trustSel - 1); renderTrustMenu(); return; }
2637
- if (key === "\x1b[B") { trustSel = Math.min(2, trustSel + 1); renderTrustMenu(); return; }
2638
- if (key === "1") { trustSel = 0; process.stdin.removeListener("data", onKey); process.stdin.setRawMode(false); process.stdout.write("\n\n\n"); resolve(trustOptions[0].action); return; }
2639
- if (key === "2") { trustSel = 1; process.stdin.removeListener("data", onKey); process.stdin.setRawMode(false); process.stdout.write("\n\n\n"); resolve(trustOptions[1].action); return; }
2640
- if (key === "3") { trustSel = 2; process.stdin.removeListener("data", onKey); process.stdin.setRawMode(false); process.stdout.write("\n\n\n"); resolve(trustOptions[2].action); return; }
2641
- if (key === "\r" || key === "\n") {
2642
- process.stdin.removeListener("data", onKey);
2643
- process.stdin.setRawMode(false);
2644
- process.stdout.write("\n\n\n");
2645
- resolve(trustOptions[trustSel].action);
2646
- return;
2647
- }
2648
- if (key === "\x03") { process.exit(0); }
2649
- }
2650
- process.stdin.on("data", onKey);
2616
+ var rlTrust = readline.createInterface({ input: process.stdin, output: process.stdout });
2617
+ rlTrust.question(C.brightBlue + " Choice (1/2/3): " + C.reset, function(answer) {
2618
+ rlTrust.close();
2619
+ var n = answer.trim();
2620
+ if (n === "2") resolve("always");
2621
+ else if (n === "3") resolve("choose");
2622
+ else resolve("trust");
2623
+ });
2651
2624
  });
2652
2625
 
2653
2626
  if (trustChoice === "always") {
@@ -2734,40 +2707,15 @@ async function main() {
2734
2707
  console.log("");
2735
2708
  console.log(C.brightWhite + C.bold + " How do you want to work?" + C.reset);
2736
2709
  console.log("");
2737
- var modeOptions = [
2738
- { label: "Chattalk back and forth", mode: "chat" },
2739
- { label: "Agent — give a goal, I do the rest autonomously", mode: "agent" }
2740
- ];
2741
- var modeSel = 0;
2710
+ console.log(C.green + C.bold + " ❯ " + C.brightWhite + "1. Chat — talk back and forth" + C.reset);
2711
+ console.log(" " + C.gray + "2. Agent give a goal, I do the rest autonomously" + C.reset);
2712
+ console.log("");
2742
2713
  var modeChoice = await new Promise(function(resolve) {
2743
- function renderModeMenu() {
2744
- process.stdout.write("\x1b[s");
2745
- modeOptions.forEach(function(opt, i) {
2746
- var prefix = i === modeSel ? C.green + C.bold + " \u276F " : " ";
2747
- var color = i === modeSel ? C.brightWhite + C.bold : C.gray;
2748
- process.stdout.write(prefix + color + (i + 1) + ". " + opt.label + C.reset + "\x1b[K\n");
2749
- });
2750
- process.stdout.write("\x1b[u");
2751
- }
2752
- renderModeMenu();
2753
- process.stdin.setRawMode(true);
2754
- process.stdin.resume();
2755
- process.stdin.setEncoding("utf8");
2756
- function onKey(key) {
2757
- if (key === "\x1b[A") { modeSel = 0; renderModeMenu(); return; }
2758
- if (key === "\x1b[B") { modeSel = 1; renderModeMenu(); return; }
2759
- if (key === "1") { process.stdin.removeListener("data", onKey); process.stdin.setRawMode(false); process.stdout.write("\n\n"); resolve("chat"); return; }
2760
- if (key === "2") { process.stdin.removeListener("data", onKey); process.stdin.setRawMode(false); process.stdout.write("\n\n"); resolve("agent"); return; }
2761
- if (key === "\r" || key === "\n") {
2762
- process.stdin.removeListener("data", onKey);
2763
- process.stdin.setRawMode(false);
2764
- process.stdout.write("\n\n");
2765
- resolve(modeOptions[modeSel].mode);
2766
- return;
2767
- }
2768
- if (key === "\x03") { process.exit(0); }
2769
- }
2770
- process.stdin.on("data", onKey);
2714
+ var rlMode = readline.createInterface({ input: process.stdin, output: process.stdout });
2715
+ rlMode.question(C.brightBlue + " Choice (1/2): " + C.reset, function(answer) {
2716
+ rlMode.close();
2717
+ resolve(answer.trim() === "2" ? "agent" : "chat");
2718
+ });
2771
2719
  });
2772
2720
  sessionMode = modeChoice;
2773
2721
  printSuccess("Mode: " + (sessionMode === "agent" ? "Agent (autonomous)" : "Chat (interactive)"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blun-king-cli",
3
- "version": "5.1.2",
3
+ "version": "5.1.3",
4
4
  "description": "BLUN King CLI — Your local AI assistant powered by Gemma4",
5
5
  "type": "commonjs",
6
6
  "bin": {