novaprime 1.5.0 → 1.5.1

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.5.0",
3
+ "version": "1.5.1",
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
@@ -17,6 +17,9 @@ const SYSTEM_PROMPT =
17
17
  `Use clear markdown: short paragraphs, bullet lists, and fenced code blocks with a language tag. ` +
18
18
  `When asked to create or change files, call the tool RIGHT AWAY with at most a one-line intro — ` +
19
19
  `do NOT write long explanations or feature lists before creating the file. Keep any summary to 1-2 short lines after. ` +
20
+ `NEVER start dev servers or long-running/blocking processes (e.g. "npm run dev", "npm start", "vite", "next dev", ` +
21
+ `"nodemon", watchers) — they block the session forever. After creating the files, finish, then tell the user the ` +
22
+ `commands to run it themselves (e.g. cd into the folder and run "npm run dev", then open the localhost URL). ` +
20
23
  `Be concise and warm. Current OS: ${os.platform()}. Working directory: ${process.cwd()}.`;
21
24
 
22
25
  // Fetch read-only account info for the header (name, plan, usage). Never throws.
package/src/tools.js CHANGED
@@ -124,6 +124,14 @@ async function execute(name, input) {
124
124
  return 'OK: edited ' + input.path;
125
125
  }
126
126
  case 'run_command': {
127
+ const cmd = String(input.command || '');
128
+ // Refuse blocking dev servers / watchers — they never exit and freeze the session.
129
+ if (/\b(npm|pnpm|yarn|bun)\s+(run\s+)?(dev|start|serve|watch)\b|\bvite\b(?!\s+build)|\bnext\s+dev\b|\bnodemon\b|webpack-dev-server|webpack\s+serve|\bnpx\s+serve\b|\bhttp-server\b|\blive-server\b|php\s+-S|python\s+-m\s+http\.server|flask\s+run|rails\s+s(erver)?\b|\bng\s+serve\b/i.test(cmd)) {
130
+ console.log('');
131
+ console.log(c.amber(' ! ') + c.amber('skipped dev server: ') + c.white(cmd));
132
+ console.log(c.dim(' (long-running — start it yourself in another terminal when ready)'));
133
+ return 'SKIPPED: "' + cmd + '" is a long-running dev/watch server and was NOT run (it would block the session forever). Do NOT start dev servers. Finish the work, then tell the user how to run it themselves in a separate terminal, e.g. `cd <project>` then `npm run dev`, and to open the localhost URL it prints.';
134
+ }
127
135
  console.log('');
128
136
  console.log(c.red(' ╭─ permission · run command ') + c.dim('───────────────────'));
129
137
  console.log(c.red(' │ ') + c.bold(input.command));