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.
- package/blun-cli.js +20 -72
- 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
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
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
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
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
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
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
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
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)"));
|