blun-king-cli 3.0.4 → 3.0.5
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/bin/blun.js +18 -2
- package/package.json +1 -1
package/bin/blun.js
CHANGED
|
@@ -583,21 +583,31 @@ var _globalEraseUI = null;
|
|
|
583
583
|
async function sendChat(message) {
|
|
584
584
|
try {
|
|
585
585
|
printUserMessage(message);
|
|
586
|
-
// Animated thinking
|
|
586
|
+
// Animated thinking
|
|
587
587
|
var dots = 0;
|
|
588
588
|
var thinkFrames = ["thinking", "thinking.", "thinking..", "thinking..."];
|
|
589
|
+
var thinkLine = (process.stdout.rows || 24);
|
|
589
590
|
console.log(""); // space for thinking text
|
|
590
591
|
var thinkTimer = setInterval(function() {
|
|
592
|
+
process.stdout.write("\x1b[s"); // save cursor
|
|
591
593
|
process.stdout.write("\r\x1b[2K" + C.dim + " " + BOX.bot + " " + thinkFrames[dots % 4] + " " + C.reset);
|
|
594
|
+
process.stdout.write("\x1b[u"); // restore cursor
|
|
592
595
|
dots++;
|
|
593
596
|
}, 300);
|
|
597
|
+
// Show input box below thinking so user can type ahead
|
|
598
|
+
console.log("");
|
|
599
|
+
if (_globalDrawPrompt) { processing = false; _globalDrawPrompt(); processing = true; }
|
|
600
|
+
|
|
594
601
|
var resp = await apiCall("POST", "/chat", {
|
|
595
602
|
message: message,
|
|
596
603
|
history: chatHistory.slice(-10)
|
|
597
604
|
});
|
|
598
605
|
|
|
599
606
|
clearInterval(thinkTimer);
|
|
607
|
+
// Clear thinking line
|
|
608
|
+
if (_globalDrawPrompt) { process.stdout.write("\x1b[s"); }
|
|
600
609
|
process.stdout.write("\r\x1b[2K");
|
|
610
|
+
if (_globalDrawPrompt) { process.stdout.write("\x1b[u"); }
|
|
601
611
|
|
|
602
612
|
if (resp.status !== 200) {
|
|
603
613
|
printError(resp.data.error || "API Error " + resp.status);
|
|
@@ -1517,12 +1527,18 @@ async function cmdAgent(args) {
|
|
|
1517
1527
|
var context = [];
|
|
1518
1528
|
var workdir = config.workdir;
|
|
1519
1529
|
|
|
1520
|
-
// Show thinking animation
|
|
1530
|
+
// Show thinking animation
|
|
1521
1531
|
console.log(""); // space for status
|
|
1522
1532
|
var thinkTimer = setInterval(function() {
|
|
1523
1533
|
var phase = loop === 0 ? "planning" : "step " + loop + "/" + maxLoops;
|
|
1534
|
+
process.stdout.write("\x1b[s"); // save cursor
|
|
1524
1535
|
process.stdout.write("\r\x1b[2K" + C.dim + " " + BOX.bot + " [" + phase + "] working..." + C.reset);
|
|
1536
|
+
process.stdout.write("\x1b[u"); // restore cursor
|
|
1525
1537
|
}, 300);
|
|
1538
|
+
// Show input box below thinking
|
|
1539
|
+
console.log("");
|
|
1540
|
+
if (_globalDrawPrompt) { processing = false; _globalDrawPrompt(); processing = true; }
|
|
1541
|
+
|
|
1526
1542
|
while (loop < maxLoops) {
|
|
1527
1543
|
loop++;
|
|
1528
1544
|
|