blun-king-cli 3.0.5 → 3.0.7
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 +9 -20
- package/package.json +1 -1
package/bin/blun.js
CHANGED
|
@@ -27,7 +27,7 @@ if (!fs.existsSync(SKILLS_DIR)) fs.mkdirSync(SKILLS_DIR, { recursive: true });
|
|
|
27
27
|
function loadConfig() {
|
|
28
28
|
var defaults = {
|
|
29
29
|
auth: { type: "api_key", api_key: "", oauth_token: "", oauth_expires: null },
|
|
30
|
-
api: { base_url: "http://176.9.158.30:3200", timeout:
|
|
30
|
+
api: { base_url: "http://176.9.158.30:3200", timeout: 300000, key: "" },
|
|
31
31
|
telegram: { enabled: false, bot_token: "", chat_id: "" },
|
|
32
32
|
model: "blun-king-v100",
|
|
33
33
|
workdir: process.cwd(),
|
|
@@ -578,25 +578,21 @@ async function handleCommand(input) {
|
|
|
578
578
|
// ── Global UI bridge (set by interactive mode) ──
|
|
579
579
|
var _globalDrawPrompt = null;
|
|
580
580
|
var _globalEraseUI = null;
|
|
581
|
+
var _globalUILines = 5; // how many lines the input box takes up
|
|
581
582
|
|
|
582
583
|
// ── Chat ──
|
|
583
584
|
async function sendChat(message) {
|
|
584
585
|
try {
|
|
585
586
|
printUserMessage(message);
|
|
586
|
-
|
|
587
|
+
|
|
588
|
+
// Show thinking status on a single line (no input box during thinking — simpler, more reliable)
|
|
587
589
|
var dots = 0;
|
|
588
590
|
var thinkFrames = ["thinking", "thinking.", "thinking..", "thinking..."];
|
|
589
|
-
|
|
590
|
-
console.log(""); // space for thinking text
|
|
591
|
+
console.log("");
|
|
591
592
|
var thinkTimer = setInterval(function() {
|
|
592
|
-
process.stdout.write("\x1b[s"); // save cursor
|
|
593
593
|
process.stdout.write("\r\x1b[2K" + C.dim + " " + BOX.bot + " " + thinkFrames[dots % 4] + " " + C.reset);
|
|
594
|
-
process.stdout.write("\x1b[u"); // restore cursor
|
|
595
594
|
dots++;
|
|
596
595
|
}, 300);
|
|
597
|
-
// Show input box below thinking so user can type ahead
|
|
598
|
-
console.log("");
|
|
599
|
-
if (_globalDrawPrompt) { processing = false; _globalDrawPrompt(); processing = true; }
|
|
600
596
|
|
|
601
597
|
var resp = await apiCall("POST", "/chat", {
|
|
602
598
|
message: message,
|
|
@@ -604,10 +600,7 @@ async function sendChat(message) {
|
|
|
604
600
|
});
|
|
605
601
|
|
|
606
602
|
clearInterval(thinkTimer);
|
|
607
|
-
// Clear thinking line
|
|
608
|
-
if (_globalDrawPrompt) { process.stdout.write("\x1b[s"); }
|
|
609
603
|
process.stdout.write("\r\x1b[2K");
|
|
610
|
-
if (_globalDrawPrompt) { process.stdout.write("\x1b[u"); }
|
|
611
604
|
|
|
612
605
|
if (resp.status !== 200) {
|
|
613
606
|
printError(resp.data.error || "API Error " + resp.status);
|
|
@@ -1527,17 +1520,12 @@ async function cmdAgent(args) {
|
|
|
1527
1520
|
var context = [];
|
|
1528
1521
|
var workdir = config.workdir;
|
|
1529
1522
|
|
|
1530
|
-
// Show thinking
|
|
1531
|
-
console.log("");
|
|
1523
|
+
// Show thinking status on single line
|
|
1524
|
+
console.log("");
|
|
1532
1525
|
var thinkTimer = setInterval(function() {
|
|
1533
1526
|
var phase = loop === 0 ? "planning" : "step " + loop + "/" + maxLoops;
|
|
1534
|
-
process.stdout.write("\x1b[s"); // save cursor
|
|
1535
1527
|
process.stdout.write("\r\x1b[2K" + C.dim + " " + BOX.bot + " [" + phase + "] working..." + C.reset);
|
|
1536
|
-
process.stdout.write("\x1b[u"); // restore cursor
|
|
1537
1528
|
}, 300);
|
|
1538
|
-
// Show input box below thinking
|
|
1539
|
-
console.log("");
|
|
1540
|
-
if (_globalDrawPrompt) { processing = false; _globalDrawPrompt(); processing = true; }
|
|
1541
1529
|
|
|
1542
1530
|
while (loop < maxLoops) {
|
|
1543
1531
|
loop++;
|
|
@@ -2755,12 +2743,13 @@ async function main() {
|
|
|
2755
2743
|
|
|
2756
2744
|
// Track for eraseUI: store how far up the start is from cursor
|
|
2757
2745
|
uiStartRow = totalLines; // repurpose as "total lines drawn"
|
|
2746
|
+
_globalUILines = totalLines;
|
|
2758
2747
|
|
|
2759
2748
|
process.stdout.write("\x1b[?25h"); // show cursor
|
|
2760
2749
|
}
|
|
2761
2750
|
|
|
2762
2751
|
// Override eraseUI to use line count
|
|
2763
|
-
eraseUI = function() {
|
|
2752
|
+
_globalEraseUI = eraseUI = function() {
|
|
2764
2753
|
if (uiStartRow <= 0) return;
|
|
2765
2754
|
process.stdout.write("\x1b[?25l");
|
|
2766
2755
|
// Cursor is on content line (line 1). Move up 1 to reach top.
|