tsunami-code 3.11.1 → 3.11.2
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/index.js +1 -2
- package/lib/ui.js +10 -6
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -508,7 +508,7 @@ async function run() {
|
|
|
508
508
|
});
|
|
509
509
|
|
|
510
510
|
ui.start(historyEntries);
|
|
511
|
-
ui.setModelLabel(
|
|
511
|
+
ui.setModelLabel(`Tsunami Code CLI v${VERSION}`);
|
|
512
512
|
|
|
513
513
|
// ── Memory commands ───────────────────────────────────────────────────────────
|
|
514
514
|
async function handleMemoryCommand(args) {
|
|
@@ -974,7 +974,6 @@ async function run() {
|
|
|
974
974
|
case 'model':
|
|
975
975
|
if (rest[0]) {
|
|
976
976
|
setModel(rest[0]);
|
|
977
|
-
ui.setModelLabel(rest[0]);
|
|
978
977
|
console.log(green(` Model changed to: ${rest[0]}\n`));
|
|
979
978
|
} else {
|
|
980
979
|
console.log(dim(` Current model: ${getModel()}\n`));
|
package/lib/ui.js
CHANGED
|
@@ -13,7 +13,7 @@ const cyan = (s) => chalk.cyan(s);
|
|
|
13
13
|
const yellow = (s) => chalk.yellow(s);
|
|
14
14
|
const dim = (s) => chalk.dim(s);
|
|
15
15
|
|
|
16
|
-
const BOX_LINES =
|
|
16
|
+
const BOX_LINES = 5; // top border + input + bottom border + footer label + blank row
|
|
17
17
|
|
|
18
18
|
export function createUI({ planMode: initPlanMode = false, onLine, onTab, onExit }) {
|
|
19
19
|
let planMode = initPlanMode;
|
|
@@ -52,10 +52,11 @@ export function createUI({ planMode: initPlanMode = false, onLine, onTab, onExit
|
|
|
52
52
|
function drawBox() {
|
|
53
53
|
const w = cols();
|
|
54
54
|
const r = rows(); // last row of terminal
|
|
55
|
-
const rT = r -
|
|
56
|
-
const rI = r -
|
|
57
|
-
const rB = r -
|
|
58
|
-
const rM = r;
|
|
55
|
+
const rT = r - 4; // top border ╭─────╮
|
|
56
|
+
const rI = r - 3; // input line │ ❯ │
|
|
57
|
+
const rB = r - 2; // bottom border ╰─────╯
|
|
58
|
+
const rM = r - 1; // footer label
|
|
59
|
+
// r // blank spacing row
|
|
59
60
|
|
|
60
61
|
process.stdout.write('\x1b[s'); // save cursor
|
|
61
62
|
|
|
@@ -90,10 +91,13 @@ export function createUI({ planMode: initPlanMode = false, onLine, onTab, onExit
|
|
|
90
91
|
const botLine = `╰${'─'.repeat(w - 2)}╯`;
|
|
91
92
|
process.stdout.write(`\x1b[${rB};1H\x1b[2K${botLine.slice(0, w)}`);
|
|
92
93
|
|
|
93
|
-
//
|
|
94
|
+
// Footer label (version string) ───────────────────────────────────
|
|
94
95
|
const ml = modelLabel ? ` ${dim(modelLabel)}` : '';
|
|
95
96
|
process.stdout.write(`\x1b[${rM};1H\x1b[2K${ml}`);
|
|
96
97
|
|
|
98
|
+
// Blank spacing row at very bottom ────────────────────────────────
|
|
99
|
+
process.stdout.write(`\x1b[${r};1H\x1b[2K`);
|
|
100
|
+
|
|
97
101
|
// Position cursor in input line at correct column ─────────────────
|
|
98
102
|
const curCol = 1 + prefixVis.length + 1 + Math.min(dispCursor, display.length);
|
|
99
103
|
process.stdout.write(`\x1b[${rI};${curCol}H`);
|