blun-king-cli 3.0.3 → 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.
Files changed (2) hide show
  1. package/bin/blun.js +16 -13
  2. package/package.json +1 -1
package/bin/blun.js CHANGED
@@ -583,20 +583,20 @@ var _globalEraseUI = null;
583
583
  async function sendChat(message) {
584
584
  try {
585
585
  printUserMessage(message);
586
- // Animated thinking + redraw input box
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);
594
- // Redraw input box below thinking line so user sees the prompt
595
- if (_globalDrawPrompt) {
596
- processing = false;
597
- _globalDrawPrompt();
598
- processing = true;
599
- }
597
+ // Show input box below thinking so user can type ahead
598
+ console.log("");
599
+ if (_globalDrawPrompt) { processing = false; _globalDrawPrompt(); processing = true; }
600
600
 
601
601
  var resp = await apiCall("POST", "/chat", {
602
602
  message: message,
@@ -604,7 +604,10 @@ async function sendChat(message) {
604
604
  });
605
605
 
606
606
  clearInterval(thinkTimer);
607
+ // Clear thinking line
608
+ if (_globalDrawPrompt) { process.stdout.write("\x1b[s"); }
607
609
  process.stdout.write("\r\x1b[2K");
610
+ if (_globalDrawPrompt) { process.stdout.write("\x1b[u"); }
608
611
 
609
612
  if (resp.status !== 200) {
610
613
  printError(resp.data.error || "API Error " + resp.status);
@@ -1524,17 +1527,17 @@ async function cmdAgent(args) {
1524
1527
  var context = [];
1525
1528
  var workdir = config.workdir;
1526
1529
 
1527
- // Show thinking animation + keep input box
1530
+ // Show thinking animation
1528
1531
  console.log(""); // space for status
1529
1532
  var thinkTimer = setInterval(function() {
1530
1533
  var phase = loop === 0 ? "planning" : "step " + loop + "/" + maxLoops;
1534
+ process.stdout.write("\x1b[s"); // save cursor
1531
1535
  process.stdout.write("\r\x1b[2K" + C.dim + " " + BOX.bot + " [" + phase + "] working..." + C.reset);
1536
+ process.stdout.write("\x1b[u"); // restore cursor
1532
1537
  }, 300);
1533
- if (_globalDrawPrompt) {
1534
- processing = false;
1535
- _globalDrawPrompt();
1536
- processing = true;
1537
- }
1538
+ // Show input box below thinking
1539
+ console.log("");
1540
+ if (_globalDrawPrompt) { processing = false; _globalDrawPrompt(); processing = true; }
1538
1541
 
1539
1542
  while (loop < maxLoops) {
1540
1543
  loop++;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blun-king-cli",
3
- "version": "3.0.3",
3
+ "version": "3.0.5",
4
4
  "description": "BLUN King CLI — Premium KI Console",
5
5
  "bin": {
6
6
  "blun": "./bin/blun.js"