novaprime 1.3.3 → 1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "novaprime",
3
- "version": "1.3.3",
3
+ "version": "1.3.5",
4
4
  "description": "NovaPrime — an AI coding assistant in your terminal, powered by GLM.",
5
5
  "bin": {
6
6
  "novaprime": "bin/novaprime.js"
package/src/agent.js CHANGED
@@ -15,6 +15,8 @@ const SYSTEM_PROMPT =
15
15
  `Always understand them and reply in the SAME language and style the user used — if they write Banglish, reply in friendly Banglish. ` +
16
16
  `Prefer making concrete changes with tools over only describing them. ` +
17
17
  `Use clear markdown: short paragraphs, bullet lists, and fenced code blocks with a language tag. ` +
18
+ `When asked to create or change files, call the tool RIGHT AWAY with at most a one-line intro — ` +
19
+ `do NOT write long explanations or feature lists before creating the file. Keep any summary to 1-2 short lines after. ` +
18
20
  `Be concise and warm. Current OS: ${os.platform()}. Working directory: ${process.cwd()}.`;
19
21
 
20
22
  // Fetch read-only account info for the header (name, plan, usage). Never throws.
@@ -30,6 +32,7 @@ async function streamMessage(server, key, messages) {
30
32
  const spinner = ora({ text: c.muted('thinking'), spinner: 'dots', color: 'magenta' }).start();
31
33
  let spinning = true;
32
34
  const stopSpin = () => { if (spinning) { spinner.stop(); spinning = false; } };
35
+ const ensureSpin = (text) => { if (!spinning) { spinner.start(); spinning = true; } spinner.text = text; };
33
36
 
34
37
  let res;
35
38
  try {
@@ -48,7 +51,7 @@ async function streamMessage(server, key, messages) {
48
51
  }
49
52
 
50
53
  const blocks = [];
51
- let stopReason = null, labelShown = false, buffer = '';
54
+ let stopReason = null, labelShown = false, buffer = '', usedModel = null;
52
55
  const renderer = new Renderer();
53
56
  const decoder = new TextDecoder();
54
57
  const reader = res.body.getReader();
@@ -64,22 +67,25 @@ async function streamMessage(server, key, messages) {
64
67
  if (!dataLine) continue;
65
68
  let json; try { json = JSON.parse(dataLine.slice(5).trim()); } catch (_) { continue; }
66
69
 
67
- if (json.type === 'content_block_start') {
70
+ if (json.type === 'message_start') {
71
+ usedModel = (json.message && json.message.model) || usedModel;
72
+ if (spinning) spinner.text = c.muted('thinking · ' + (usedModel || ''));
73
+ } else if (json.type === 'content_block_start') {
68
74
  const cb = json.content_block || {};
69
75
  blocks[json.index] = cb.type === 'tool_use'
70
76
  ? { type: 'tool_use', id: cb.id, name: cb.name, _json: '' }
71
77
  : { type: 'text', text: '' };
72
- if (cb.type === 'tool_use' && spinning) spinner.text = c.muted('preparing ' + cb.name + '…');
78
+ if (cb.type === 'tool_use') ensureSpin(c.muted('writing with ' + (usedModel || 'model') + '…'));
73
79
  } else if (json.type === 'content_block_delta') {
74
80
  const b = blocks[json.index]; if (!b) continue;
75
81
  if (json.delta.type === 'text_delta') {
76
82
  stopSpin();
77
- if (!labelShown) { aiLabel(); labelShown = true; }
83
+ if (!labelShown) { aiLabel(usedModel); labelShown = true; }
78
84
  b.text += json.delta.text;
79
85
  renderer.feed(json.delta.text);
80
86
  } else if (json.delta.type === 'input_json_delta') {
81
87
  b._json += json.delta.partial_json;
82
- if (spinning) spinner.text = c.muted((b.name === 'run_command' ? 'preparing command' : 'writing ' + (b.name || 'file')) + '… ' + b._json.length + ' chars');
88
+ ensureSpin(c.muted('writing with ' + (usedModel || 'model') + '… ' + b._json.length + ' chars'));
83
89
  }
84
90
  } else if (json.type === 'message_delta') {
85
91
  if (json.delta && json.delta.stop_reason) stopReason = json.delta.stop_reason;
package/src/ui.js CHANGED
@@ -98,7 +98,7 @@ function inputBoxOpen() {
98
98
  }
99
99
  function inputBoxClose() { process.stdout.write('\n'); }
100
100
 
101
- function aiLabel() { process.stdout.write('\n' + c.violet('● ') + c.violet.bold('Nova Prime') + '\n'); }
101
+ function aiLabel(model) { process.stdout.write('\n' + c.violet('● ') + c.violet.bold('Nova Prime') + (model ? c.dim(' · ' + model) : '') + '\n'); }
102
102
 
103
103
  function info(msg) { console.log(c.muted(msg)); }
104
104
  function hint(msg) { console.log(c.dim(msg)); }