novaprime 1.6.1 → 1.6.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/bin/novaprime.js +3 -2
- package/package.json +1 -1
- package/src/prompt.js +3 -1
- package/src/ui.js +9 -1
package/bin/novaprime.js
CHANGED
|
@@ -88,9 +88,9 @@ async function repl() {
|
|
|
88
88
|
|
|
89
89
|
ui.hint(' Tip: press ' + c.indigo('Shift+Tab') + c.dim(' for auto-accept (no permission prompts), or answer ') + c.indigo('a') + c.dim(' at any prompt.'));
|
|
90
90
|
|
|
91
|
-
// push the first input box toward the lower part of the screen
|
|
91
|
+
// push the first input box toward the lower part of the screen (a bit lower than before)
|
|
92
92
|
const rows = process.stdout.rows || 24;
|
|
93
|
-
process.stdout.write('\n'.repeat(Math.max(0, rows -
|
|
93
|
+
process.stdout.write('\n'.repeat(Math.max(0, rows - 23)));
|
|
94
94
|
|
|
95
95
|
let messages = [];
|
|
96
96
|
while (true) {
|
|
@@ -105,6 +105,7 @@ async function repl() {
|
|
|
105
105
|
if (input === '/usage') { me = await fetchMe(config.getServer(), cfg.key); showUsage(me); continue; }
|
|
106
106
|
if (input === '/clear') { console.clear(); me = await fetchMe(config.getServer(), cfg.key); ui.banner(meToBanner(cfg, me)); continue; }
|
|
107
107
|
|
|
108
|
+
ui.userBubble(input); // show the sent message as a clean bubble (box already erased)
|
|
108
109
|
messages.push({ role: 'user', content: input });
|
|
109
110
|
try { await runTurn(config.getServer(), cfg.key, messages); }
|
|
110
111
|
catch (err) { ui.error(err.message); }
|
package/package.json
CHANGED
package/src/prompt.js
CHANGED
|
@@ -149,7 +149,9 @@ function boxInput(top, bottom, prompt) {
|
|
|
149
149
|
}
|
|
150
150
|
function finish(val) {
|
|
151
151
|
state.finished = true;
|
|
152
|
-
|
|
152
|
+
// erase the whole box (top border + dynamic region) — the REPL replaces it
|
|
153
|
+
// with a clean message bubble. prevUp+1 lines up = the top border line.
|
|
154
|
+
process.stdout.write('\x1b[' + (prevUp + 1) + 'A\r\x1b[0J');
|
|
153
155
|
cleanup();
|
|
154
156
|
resolve(val);
|
|
155
157
|
}
|
package/src/ui.js
CHANGED
|
@@ -100,6 +100,14 @@ function inputBoxClose() { process.stdout.write('\n'); }
|
|
|
100
100
|
|
|
101
101
|
function aiLabel(model) { process.stdout.write('\n' + c.violet('● ') + c.violet.bold('Nova Prime') + (model ? c.dim(' · ' + model) : '') + '\n'); }
|
|
102
102
|
|
|
103
|
+
// User's sent message rendered as a clean chat bubble (background color, no input border).
|
|
104
|
+
function userBubble(text) {
|
|
105
|
+
const bub = chalk.bgHex('#2a3566').hex('#eef2ff');
|
|
106
|
+
const lines = String(text).split('\n');
|
|
107
|
+
process.stdout.write('\n ' + c.indigo.bold('You') + '\n');
|
|
108
|
+
for (const line of lines) console.log(' ' + bub(' ' + line + ' '));
|
|
109
|
+
}
|
|
110
|
+
|
|
103
111
|
// Live "model switch" report — shows what the free Flash brain decided for this request.
|
|
104
112
|
function routeReport(r) {
|
|
105
113
|
if (!r) return;
|
|
@@ -126,4 +134,4 @@ function error(msg) { console.log(c.red(' ✕ ') + c.red(msg)); }
|
|
|
126
134
|
function ok(msg) { console.log(c.green(' ✓ ') + c.body(msg)); }
|
|
127
135
|
function tool(name, detail) { console.log(c.dim(' · ' + name + (detail ? ' ' + detail : ''))); }
|
|
128
136
|
|
|
129
|
-
module.exports = { chalk, boxen, c, banner, maskKey, aiLabel, routeReport, inputTop, inputBottom, inputPrompt, inputBoxOpen, inputBoxClose, info, hint, warn, error, ok, tool };
|
|
137
|
+
module.exports = { chalk, boxen, c, banner, maskKey, aiLabel, userBubble, routeReport, inputTop, inputBottom, inputPrompt, inputBoxOpen, inputBoxClose, info, hint, warn, error, ok, tool };
|