blun-king-cli 7.2.2 → 7.2.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/lib/chat.js +16 -10
- package/package.json +1 -1
package/lib/chat.js
CHANGED
|
@@ -129,29 +129,35 @@ function startChat() {
|
|
|
129
129
|
// Save cursor position in scroll region
|
|
130
130
|
process.stdout.write(saveCursor());
|
|
131
131
|
|
|
132
|
-
// Row 1: Top frame
|
|
132
|
+
// Row 1: Top frame ╭─ BLUN ─────...──╮
|
|
133
133
|
process.stdout.write(cursorTo(panelTop, 1) + clearLine());
|
|
134
|
-
|
|
134
|
+
var topLeft = "╭─ BLUN ";
|
|
135
|
+
var fillTop = cols - topLeft.length - 1; // -1 for ╮
|
|
136
|
+
process.stdout.write(t.frame(topLeft) + t.frame("─".repeat(Math.max(1, fillTop))) + t.frame("╮"));
|
|
135
137
|
|
|
136
|
-
// Row 2: Input line
|
|
138
|
+
// Row 2: Input line │ > text... │
|
|
137
139
|
var displayInput = inputBuffer || "";
|
|
138
|
-
var maxInputLen =
|
|
140
|
+
var maxInputLen = cols - 6; // "│ > " (4) + " │" (2)
|
|
139
141
|
var showInput = displayInput.length > maxInputLen ? displayInput.slice(displayInput.length - maxInputLen) : displayInput;
|
|
140
142
|
process.stdout.write(cursorTo(panelTop + 1, 1) + clearLine());
|
|
141
|
-
process.stdout.write(t.frame("│ ") + chalk.bold.green("> ") + chalk.white(showInput)
|
|
143
|
+
process.stdout.write(t.frame("│ ") + chalk.bold.green("> ") + chalk.white(showInput));
|
|
144
|
+
process.stdout.write(cursorTo(panelTop + 1, cols) + t.frame("│"));
|
|
142
145
|
|
|
143
|
-
// Row 3: Empty separator
|
|
146
|
+
// Row 3: Empty separator │ │
|
|
144
147
|
process.stdout.write(cursorTo(panelTop + 2, 1) + clearLine());
|
|
145
|
-
process.stdout.write(t.frame("│")
|
|
148
|
+
process.stdout.write(t.frame("│"));
|
|
149
|
+
process.stdout.write(cursorTo(panelTop + 2, cols) + t.frame("│"));
|
|
146
150
|
|
|
147
|
-
// Row 4: Status line
|
|
151
|
+
// Row 4: Status line │ normal | model:auto ... │
|
|
148
152
|
process.stdout.write(cursorTo(panelTop + 3, 1) + clearLine());
|
|
149
153
|
process.stdout.write(t.frame("│ ") + statusLine);
|
|
150
154
|
process.stdout.write(cursorTo(panelTop + 3, cols) + t.frame("│"));
|
|
151
155
|
|
|
152
|
-
// Row 5: Bottom frame
|
|
156
|
+
// Row 5: Bottom frame ╰─ Tab: ... ──╯
|
|
153
157
|
process.stdout.write(cursorTo(panelTop + 4, 1) + clearLine());
|
|
154
|
-
|
|
158
|
+
var bottomHint = "╰─ Tab: autocomplete /: commands Esc: exit ";
|
|
159
|
+
var fillBottom = cols - bottomHint.length - 1; // -1 for ╯
|
|
160
|
+
process.stdout.write(t.frame(bottomHint) + t.frame("─".repeat(Math.max(1, fillBottom))) + t.frame("╯"));
|
|
155
161
|
|
|
156
162
|
// Restore cursor back to input line
|
|
157
163
|
var cursorCol = 5 + cursorPos; // "│ > " = 4 chars + 1
|