novaprime 1.2.4 → 1.2.6
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/novaprime.js +4 -4
- package/package.json +1 -1
- package/src/ui.js +10 -4
package/bin/novaprime.js
CHANGED
|
@@ -80,16 +80,16 @@ async function repl() {
|
|
|
80
80
|
ui.banner(meToBanner(cfg, me));
|
|
81
81
|
get().on('SIGINT', () => { console.log(c.muted('\n bye')); close(); process.exit(0); });
|
|
82
82
|
|
|
83
|
-
// push the first input box toward the
|
|
83
|
+
// push the first input box toward the lower part of the screen, leaving a bottom margin
|
|
84
84
|
const rows = process.stdout.rows || 24;
|
|
85
|
-
process.stdout.write('\n'.repeat(Math.max(0, rows -
|
|
85
|
+
process.stdout.write('\n'.repeat(Math.max(0, rows - 29)));
|
|
86
86
|
|
|
87
87
|
let messages = [];
|
|
88
88
|
while (true) {
|
|
89
89
|
console.log('');
|
|
90
|
-
|
|
90
|
+
ui.inputBoxOpen();
|
|
91
91
|
const raw = await ask(ui.inputPrompt());
|
|
92
|
-
|
|
92
|
+
ui.inputBoxClose();
|
|
93
93
|
|
|
94
94
|
if (raw === null) { console.log(c.muted(' bye')); break; }
|
|
95
95
|
const input = raw.trim();
|
package/package.json
CHANGED
package/src/ui.js
CHANGED
|
@@ -80,8 +80,8 @@ function banner({ folder, key, name, plan, model, windowUsed, windowLimit, weekl
|
|
|
80
80
|
}));
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
// ---- Claude-style chat input box (
|
|
84
|
-
function boxWidth() { return Math.
|
|
83
|
+
// ---- Claude-style chat input box (full width, complete box) ----
|
|
84
|
+
function boxWidth() { return Math.max(24, (process.stdout.columns || 80) - 1); }
|
|
85
85
|
function inputTop() {
|
|
86
86
|
const w = boxWidth();
|
|
87
87
|
return c.dim('╭─ ') + c.indigo('message') + ' ' + c.dim('─'.repeat(Math.max(2, w - 12)) + '╮');
|
|
@@ -89,8 +89,14 @@ function inputTop() {
|
|
|
89
89
|
function inputPrompt() { return c.dim('│ ') + c.indigoBold('› '); }
|
|
90
90
|
function inputBottom() {
|
|
91
91
|
const w = boxWidth();
|
|
92
|
-
return c.dim('╰' + '─'.repeat(Math.max(2, w -
|
|
92
|
+
return c.dim('╰' + '─'.repeat(Math.max(2, w - 2)) + '╯');
|
|
93
93
|
}
|
|
94
|
+
// draw the FULL box (top, empty input line, bottom), then move the cursor up onto the input line
|
|
95
|
+
function inputBoxOpen() {
|
|
96
|
+
const ESC = String.fromCharCode(27);
|
|
97
|
+
process.stdout.write(inputTop() + '\n\n' + inputBottom() + '\n' + ESC + '[2A');
|
|
98
|
+
}
|
|
99
|
+
function inputBoxClose() { process.stdout.write('\n'); }
|
|
94
100
|
|
|
95
101
|
function aiLabel() { process.stdout.write('\n' + c.violet('● ') + c.violet.bold('Nova Prime') + '\n'); }
|
|
96
102
|
|
|
@@ -101,4 +107,4 @@ function error(msg) { console.log(c.red(' ✕ ') + c.red(msg)); }
|
|
|
101
107
|
function ok(msg) { console.log(c.green(' ✓ ') + c.body(msg)); }
|
|
102
108
|
function tool(name, detail) { console.log(c.dim(' · ' + name + (detail ? ' ' + detail : ''))); }
|
|
103
109
|
|
|
104
|
-
module.exports = { chalk, boxen, c, banner, maskKey, aiLabel, inputTop, inputPrompt,
|
|
110
|
+
module.exports = { chalk, boxen, c, banner, maskKey, aiLabel, inputTop, inputBottom, inputPrompt, inputBoxOpen, inputBoxClose, info, hint, warn, error, ok, tool };
|