blun-king-cli 7.3.4 → 7.3.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/lib/chat.js +25 -7
- package/lib/ui.js +1 -1
- package/package.json +1 -1
package/lib/chat.js
CHANGED
|
@@ -389,7 +389,10 @@ function startChat() {
|
|
|
389
389
|
function openDropdownBelow(items, onSelect, onClose) {
|
|
390
390
|
var active = true;
|
|
391
391
|
var selected = 0;
|
|
392
|
-
var
|
|
392
|
+
var maxVisible = 10; // max visible items
|
|
393
|
+
var scrollOffset = 0;
|
|
394
|
+
var visibleCount = Math.min(items.length, maxVisible);
|
|
395
|
+
var menuHeight = visibleCount + 2; // visible items + help + padding
|
|
393
396
|
// Temporarily increase panel height to make room for menu below panel
|
|
394
397
|
var savedHeight = INPUT_PANEL_HEIGHT;
|
|
395
398
|
INPUT_PANEL_HEIGHT = 5 + menuHeight; // 5 = panel itself
|
|
@@ -407,13 +410,18 @@ function startChat() {
|
|
|
407
410
|
INPUT_PANEL_HEIGHT = savedHeight;
|
|
408
411
|
var rows = getRows();
|
|
409
412
|
// Clear the entire menu + panel area
|
|
410
|
-
for (var r = rows -
|
|
413
|
+
for (var r = rows - savedHeight - menuHeight - 2; r <= rows; r++) {
|
|
411
414
|
process.stdout.write(cursorTo(Math.max(1, r), 1) + clearLine());
|
|
412
415
|
}
|
|
413
416
|
setupLayout();
|
|
414
417
|
drawInputPanel();
|
|
415
418
|
}
|
|
416
419
|
|
|
420
|
+
function updateScroll() {
|
|
421
|
+
if (selected < scrollOffset) scrollOffset = selected;
|
|
422
|
+
if (selected >= scrollOffset + visibleCount) scrollOffset = selected - visibleCount + 1;
|
|
423
|
+
}
|
|
424
|
+
|
|
417
425
|
function drawMenu() {
|
|
418
426
|
var cols = getCols();
|
|
419
427
|
var t = ui.getTheme();
|
|
@@ -421,17 +429,27 @@ function startChat() {
|
|
|
421
429
|
|
|
422
430
|
process.stdout.write(saveCursor());
|
|
423
431
|
|
|
424
|
-
|
|
432
|
+
updateScroll();
|
|
433
|
+
for (var i = 0; i < visibleCount; i++) {
|
|
434
|
+
var idx = scrollOffset + i;
|
|
425
435
|
var row = start + i;
|
|
426
436
|
process.stdout.write(cursorTo(row, 1) + clearLine());
|
|
427
|
-
|
|
428
|
-
|
|
437
|
+
if (idx < items.length) {
|
|
438
|
+
var marker = idx === selected ? chalk.cyan(" ▸ ") : " ";
|
|
439
|
+
process.stdout.write(marker + items[idx].display);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
// Scroll indicator
|
|
444
|
+
var scrollInfo = "";
|
|
445
|
+
if (items.length > visibleCount) {
|
|
446
|
+
scrollInfo = chalk.dim(" [" + (selected + 1) + "/" + items.length + "]");
|
|
429
447
|
}
|
|
430
448
|
|
|
431
449
|
// Help line
|
|
432
|
-
var helpRow = start +
|
|
450
|
+
var helpRow = start + visibleCount;
|
|
433
451
|
process.stdout.write(cursorTo(helpRow, 1) + clearLine());
|
|
434
|
-
process.stdout.write(chalk.dim(" ↑↓ select " + (items[0].help || "Enter confirm Esc close")));
|
|
452
|
+
process.stdout.write(chalk.dim(" ↑↓ select " + (items[0].help || "Enter confirm Esc close")) + scrollInfo);
|
|
435
453
|
|
|
436
454
|
process.stdout.write(restoreCursor());
|
|
437
455
|
}
|
package/lib/ui.js
CHANGED
|
@@ -61,7 +61,7 @@ function setTheme(name) {
|
|
|
61
61
|
// ── Settings Fields ───────────────────────────────────────
|
|
62
62
|
var SETTINGS_FIELDS = [
|
|
63
63
|
// Core
|
|
64
|
-
{ section: "Core", key: "model", label: "Model", values: ["auto", "
|
|
64
|
+
{ section: "Core", key: "model", label: "Model", values: ["auto", "king", "queen", "prince"], help: "Welches Modell standardmaessig antwortet." },
|
|
65
65
|
{ section: "Core", key: "language", label: "Language", values: ["de", "en", "tr", "fr", "es"], help: "Primaere Antwortsprache." },
|
|
66
66
|
{ section: "Core", key: "permissionMode", label: "Permission", values: ["safe", "normal", "god"], help: "Welche Aktionen BLUN ausfuehren darf." },
|
|
67
67
|
{ section: "Core", key: "defaultMode", label: "Mode", values: ["agent", "chat"], help: "Agent-Modus oder reiner Chat." },
|