blun-king-cli 5.1.1 → 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.
- package/blun-cli.js +20 -69
- package/package.json +1 -1
package/blun-cli.js
CHANGED
|
@@ -2608,45 +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
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
];
|
|
2616
|
-
var trustSel = 0;
|
|
2617
|
-
|
|
2618
|
-
// Arrow key menu for trust selection
|
|
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
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
}
|
|
2629
|
-
// Initial render
|
|
2630
|
-
console.log(""); console.log(""); console.log("");
|
|
2631
|
-
renderTrustMenu();
|
|
2632
|
-
|
|
2633
|
-
process.stdin.setRawMode(true);
|
|
2634
|
-
process.stdin.resume();
|
|
2635
|
-
process.stdin.setEncoding("utf8");
|
|
2636
|
-
function onKey(key) {
|
|
2637
|
-
if (key === "\x1b[A") { trustSel = Math.max(0, trustSel - 1); renderTrustMenu(); return; }
|
|
2638
|
-
if (key === "\x1b[B") { trustSel = Math.min(2, trustSel + 1); renderTrustMenu(); return; }
|
|
2639
|
-
if (key === "1") { trustSel = 0; process.stdin.removeListener("data", onKey); process.stdin.setRawMode(false); resolve(trustOptions[0].action); return; }
|
|
2640
|
-
if (key === "2") { trustSel = 1; process.stdin.removeListener("data", onKey); process.stdin.setRawMode(false); resolve(trustOptions[1].action); return; }
|
|
2641
|
-
if (key === "3") { trustSel = 2; process.stdin.removeListener("data", onKey); process.stdin.setRawMode(false); resolve(trustOptions[2].action); return; }
|
|
2642
|
-
if (key === "\r" || key === "\n") {
|
|
2643
|
-
process.stdin.removeListener("data", onKey);
|
|
2644
|
-
process.stdin.setRawMode(false);
|
|
2645
|
-
resolve(trustOptions[trustSel].action);
|
|
2646
|
-
return;
|
|
2647
|
-
}
|
|
2648
|
-
}
|
|
2649
|
-
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
|
+
});
|
|
2650
2624
|
});
|
|
2651
2625
|
|
|
2652
2626
|
if (trustChoice === "always") {
|
|
@@ -2733,38 +2707,15 @@ async function main() {
|
|
|
2733
2707
|
console.log("");
|
|
2734
2708
|
console.log(C.brightWhite + C.bold + " How do you want to work?" + C.reset);
|
|
2735
2709
|
console.log("");
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
];
|
|
2740
|
-
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("");
|
|
2741
2713
|
var modeChoice = await new Promise(function(resolve) {
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
process.stdout.write("\x1b[2K" + prefix + color + (i + 1) + ". " + opt.label + C.reset + "\n");
|
|
2748
|
-
});
|
|
2749
|
-
}
|
|
2750
|
-
console.log(""); console.log("");
|
|
2751
|
-
renderModeMenu();
|
|
2752
|
-
process.stdin.setRawMode(true);
|
|
2753
|
-
process.stdin.resume();
|
|
2754
|
-
process.stdin.setEncoding("utf8");
|
|
2755
|
-
function onKey(key) {
|
|
2756
|
-
if (key === "\x1b[A") { modeSel = 0; renderModeMenu(); return; }
|
|
2757
|
-
if (key === "\x1b[B") { modeSel = 1; renderModeMenu(); return; }
|
|
2758
|
-
if (key === "1") { process.stdin.removeListener("data", onKey); process.stdin.setRawMode(false); resolve("chat"); return; }
|
|
2759
|
-
if (key === "2") { process.stdin.removeListener("data", onKey); process.stdin.setRawMode(false); resolve("agent"); return; }
|
|
2760
|
-
if (key === "\r" || key === "\n") {
|
|
2761
|
-
process.stdin.removeListener("data", onKey);
|
|
2762
|
-
process.stdin.setRawMode(false);
|
|
2763
|
-
resolve(modeOptions[modeSel].mode);
|
|
2764
|
-
return;
|
|
2765
|
-
}
|
|
2766
|
-
}
|
|
2767
|
-
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
|
+
});
|
|
2768
2719
|
});
|
|
2769
2720
|
sessionMode = modeChoice;
|
|
2770
2721
|
printSuccess("Mode: " + (sessionMode === "agent" ? "Agent (autonomous)" : "Chat (interactive)"));
|