@novastorm-ai/cli 0.1.5 → 0.1.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/dist/bin/nova.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  run
4
- } from "../chunk-J573S7XU.js";
4
+ } from "../chunk-7ZE7J73C.js";
5
5
  import "../chunk-KE7XWO5N.js";
6
- import "../chunk-RZGTRPQL.js";
7
- import "../chunk-ACJAMJVU.js";
6
+ import "../chunk-53K63TXF.js";
7
+ import "../chunk-3FVS3SB3.js";
8
8
  import "../chunk-3RG5ZIWI.js";
9
9
 
10
10
  // bin/nova.ts
@@ -2007,7 +2007,12 @@ var FRAMEWORK_DEPS = [
2007
2007
  { dep: "@sveltejs/kit", framework: "sveltekit" },
2008
2008
  { dep: "astro", framework: "astro" },
2009
2009
  { dep: "vite", framework: "vite" },
2010
- { dep: "react-scripts", framework: "cra" }
2010
+ { dep: "react-scripts", framework: "cra" },
2011
+ { dep: "express", framework: "express" },
2012
+ { dep: "@nestjs/core", framework: "nest" },
2013
+ { dep: "fastify", framework: "fastify" },
2014
+ { dep: "koa", framework: "koa" },
2015
+ { dep: "@hapi/hapi", framework: "hapi" }
2011
2016
  ];
2012
2017
  var PYTHON_FRAMEWORKS = [
2013
2018
  { dep: "django", framework: "django" },
@@ -2021,6 +2026,12 @@ var DEFAULT_PORTS = {
2021
2026
  "sveltekit": 5173,
2022
2027
  "astro": 4321,
2023
2028
  "vite": 5173,
2029
+ "express": 3e3,
2030
+ "nest": 3e3,
2031
+ "fastify": 3e3,
2032
+ "koa": 3e3,
2033
+ "hapi": 3e3,
2034
+ "node": 3e3,
2024
2035
  "dotnet": 5e3,
2025
2036
  "django": 8e3,
2026
2037
  "fastapi": 8e3,
@@ -2036,37 +2047,70 @@ var DEFAULT_PORTS = {
2036
2047
  };
2037
2048
  var StackDetector = class {
2038
2049
  async detectStack(projectPath) {
2039
- const pkgResult = await this.detectFromPackageJson(projectPath);
2040
- if (pkgResult) {
2041
- return pkgResult;
2042
- }
2043
- if (await this.hasCsproj(projectPath)) {
2050
+ const detected = [];
2051
+ const [pkgResult, hasDotnet, pythonFw, rubyFw, phpFw, javaFw, hasGo, hasRust] = await Promise.all([
2052
+ this.detectFromPackageJson(projectPath),
2053
+ this.hasDotnet(projectPath),
2054
+ this.detectPython(projectPath),
2055
+ this.detectRuby(projectPath),
2056
+ this.detectPhp(projectPath),
2057
+ this.detectJava(projectPath),
2058
+ this.fileExists(join9(projectPath, "go.mod")),
2059
+ this.fileExists(join9(projectPath, "Cargo.toml"))
2060
+ ]);
2061
+ if (pkgResult) detected.push(pkgResult);
2062
+ if (hasDotnet) {
2044
2063
  const typescript = await this.hasTypescript(projectPath);
2045
- return { framework: "dotnet", language: "csharp", typescript };
2046
- }
2047
- const pythonFramework = await this.detectPython(projectPath);
2048
- if (pythonFramework) {
2049
- return { framework: pythonFramework, language: "python", typescript: false };
2050
- }
2051
- const rubyFramework = await this.detectRuby(projectPath);
2052
- if (rubyFramework) {
2053
- return { framework: rubyFramework, language: "ruby", typescript: false };
2054
- }
2055
- const phpFramework = await this.detectPhp(projectPath);
2056
- if (phpFramework) {
2057
- return { framework: phpFramework, language: "php", typescript: false };
2058
- }
2059
- const javaFramework = await this.detectJava(projectPath);
2060
- if (javaFramework) {
2061
- return { framework: javaFramework, language: "java", typescript: false };
2062
- }
2063
- if (await this.fileExists(join9(projectPath, "go.mod"))) {
2064
- return { framework: "go", language: "go", typescript: false };
2065
- }
2066
- if (await this.fileExists(join9(projectPath, "Cargo.toml"))) {
2067
- return { framework: "rust", language: "rust", typescript: false };
2064
+ detected.push({ framework: "dotnet", language: "csharp", typescript });
2065
+ }
2066
+ if (pythonFw) detected.push({ framework: pythonFw, language: "python", typescript: false });
2067
+ if (rubyFw) detected.push({ framework: rubyFw, language: "ruby", typescript: false });
2068
+ if (phpFw) detected.push({ framework: phpFw, language: "php", typescript: false });
2069
+ if (javaFw) detected.push({ framework: javaFw, language: "java", typescript: false });
2070
+ if (hasGo) detected.push({ framework: "go", language: "go", typescript: false });
2071
+ if (hasRust) detected.push({ framework: "rust", language: "rust", typescript: false });
2072
+ if (detected.length === 0) {
2073
+ return { framework: "unknown", language: "unknown", typescript: false };
2074
+ }
2075
+ const PRIORITY = [
2076
+ "next.js",
2077
+ "nuxt",
2078
+ "sveltekit",
2079
+ "astro",
2080
+ "vite",
2081
+ "cra",
2082
+ "dotnet",
2083
+ "django",
2084
+ "fastapi",
2085
+ "flask",
2086
+ "rails",
2087
+ "sinatra",
2088
+ "laravel",
2089
+ "symfony",
2090
+ "spring-boot",
2091
+ "express",
2092
+ "nest",
2093
+ "fastify",
2094
+ "koa",
2095
+ "hapi",
2096
+ "node",
2097
+ "python",
2098
+ "ruby",
2099
+ "php",
2100
+ "java",
2101
+ "go",
2102
+ "rust"
2103
+ ];
2104
+ detected.sort((a, b) => {
2105
+ const ai = PRIORITY.indexOf(a.framework);
2106
+ const bi = PRIORITY.indexOf(b.framework);
2107
+ return (ai === -1 ? 999 : ai) - (bi === -1 ? 999 : bi);
2108
+ });
2109
+ const primary = detected[0];
2110
+ if (detected.length > 1) {
2111
+ primary.additionalStacks = detected.slice(1).map((s) => s.framework);
2068
2112
  }
2069
- return { framework: "unknown", language: "unknown", typescript: false };
2113
+ return primary;
2070
2114
  }
2071
2115
  async detectDevCommand(stack, projectPath) {
2072
2116
  const { framework, language, packageManager } = stack;
@@ -2113,20 +2157,19 @@ var StackDetector = class {
2113
2157
  ...pkg.devDependencies
2114
2158
  };
2115
2159
  const framework = FRAMEWORK_DEPS.find((f) => f.dep in allDeps);
2116
- if (!framework) return null;
2117
2160
  const typescript = await this.hasTypescript(projectPath);
2118
2161
  const packageManager = await this.detectPackageManager(projectPath);
2119
2162
  return {
2120
- framework: framework.framework,
2163
+ framework: framework?.framework ?? "node",
2121
2164
  language: typescript ? "typescript" : "javascript",
2122
2165
  packageManager,
2123
2166
  typescript
2124
2167
  };
2125
2168
  }
2126
- async hasCsproj(projectPath) {
2169
+ async hasDotnet(projectPath) {
2127
2170
  try {
2128
2171
  const entries = await readdir3(projectPath);
2129
- return entries.some((e) => e.endsWith(".csproj"));
2172
+ return entries.some((e) => e.endsWith(".csproj") || e.endsWith(".sln"));
2130
2173
  } catch {
2131
2174
  return false;
2132
2175
  }
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ConfigError,
3
3
  DEFAULT_CONFIG
4
- } from "./chunk-ACJAMJVU.js";
4
+ } from "./chunk-3FVS3SB3.js";
5
5
 
6
6
  // src/setup.ts
7
7
  import * as fs2 from "fs/promises";
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  ConfigReader,
8
8
  runSetup
9
- } from "./chunk-RZGTRPQL.js";
9
+ } from "./chunk-53K63TXF.js";
10
10
  import {
11
11
  AgentPromptLoader,
12
12
  Brain,
@@ -27,7 +27,7 @@ import {
27
27
  ProviderFactory,
28
28
  SCAFFOLD_PRESETS,
29
29
  StackDetector
30
- } from "./chunk-ACJAMJVU.js";
30
+ } from "./chunk-3FVS3SB3.js";
31
31
  import {
32
32
  __require
33
33
  } from "./chunk-3RG5ZIWI.js";
@@ -1083,7 +1083,7 @@ async function startCommand() {
1083
1083
  projectHash = createHash2("sha256").update(cwd).digest("hex");
1084
1084
  }
1085
1085
  const telemetry = new Telemetry();
1086
- const cliPkg = await import("./package-K5FGL7BD.js").catch(
1086
+ const cliPkg = await import("./package-4UBQQT6Y.js").catch(
1087
1087
  () => ({ default: { version: "0.0.1" } })
1088
1088
  );
1089
1089
  telemetry.send({
@@ -1114,7 +1114,7 @@ ${nudgeMessage}
1114
1114
  }
1115
1115
  if (!config.apiKeys.key && config.apiKeys.provider !== "ollama" && config.apiKeys.provider !== "claude-cli") {
1116
1116
  console.log(chalk6.yellow("\nNo API key configured. Running setup...\n"));
1117
- const { runSetup: runSetup2 } = await import("./setup-DNA6KT2A.js");
1117
+ const { runSetup: runSetup2 } = await import("./setup-33G3DXAH.js");
1118
1118
  await runSetup2(cwd);
1119
1119
  const updatedConfig = await configReader.read(cwd);
1120
1120
  config.apiKeys = updatedConfig.apiKeys;
@@ -1134,9 +1134,12 @@ ${nudgeMessage}
1134
1134
  let stack = await stackDetector.detectStack(cwd);
1135
1135
  let detectedDevCommand = await stackDetector.detectDevCommand(stack, cwd);
1136
1136
  let detectedPort = await stackDetector.detectPort(stack, cwd);
1137
- spinner.succeed(`Detecting project... ${chalk6.cyan(stack.framework || "unknown")} + ${chalk6.cyan(stack.typescript ? "TypeScript" : stack.language || "unknown")}`);
1137
+ const allStacks = [stack.framework, ...stack.additionalStacks ?? []];
1138
+ const stackLabel = allStacks.filter((s) => s !== "unknown").join(" + ") || "unknown";
1139
+ const langLabel = stack.typescript ? "TypeScript" : stack.language || "unknown";
1140
+ spinner.succeed(`Detecting project... ${chalk6.cyan(stackLabel)} (${chalk6.dim(langLabel)})`);
1138
1141
  if (stack.framework !== "unknown") {
1139
- console.log(chalk6.green(` Detected: ${stack.framework} + ${stack.language}`));
1142
+ console.log(chalk6.green(` Detected: ${stackLabel}`));
1140
1143
  } else {
1141
1144
  const dirFiles = readdirSync(cwd).slice(0, 10).join(", ");
1142
1145
  console.log(chalk6.yellow(` Could not detect framework. Files in directory: ${dirFiles}`));
@@ -1148,11 +1151,11 @@ ${nudgeMessage}
1148
1151
  const hasProjectFiles = projectMarkers.some((f) => existsSync(join2(cwd, f))) || readdirSync(cwd).some((f) => f.endsWith(".sln") || f.endsWith(".csproj"));
1149
1152
  if (hasProjectFiles) {
1150
1153
  const defaultCmd = stack.framework === "dotnet" ? "dotnet run" : stack.framework === "django" ? "python manage.py runserver" : stack.framework === "fastapi" ? "uvicorn main:app --reload" : stack.framework === "flask" ? "flask run" : stack.framework === "rails" ? "bin/rails server" : stack.framework === "laravel" ? "php artisan serve" : stack.framework === "spring-boot" ? "./mvnw spring-boot:run" : existsSync(join2(cwd, "package.json")) ? "npm run dev" : "";
1151
- const stackLabel = stack.framework !== "unknown" ? ` (${chalk6.cyan(stack.framework)} detected)` : "";
1154
+ const stackLabel2 = stack.framework !== "unknown" ? ` (${chalk6.cyan(stack.framework)} detected)` : "";
1152
1155
  let devCmd;
1153
1156
  try {
1154
1157
  devCmd = await input2({
1155
- message: `Dev command not found${stackLabel}. Enter your dev command:`,
1158
+ message: `Dev command not found${stackLabel2}. Enter your dev command:`,
1156
1159
  default: defaultCmd || void 0
1157
1160
  });
1158
1161
  } catch {
@@ -1193,9 +1196,8 @@ ${nudgeMessage}
1193
1196
  stack = await stackDetector.detectStack(cwd);
1194
1197
  detectedDevCommand = await stackDetector.detectDevCommand(stack, cwd);
1195
1198
  detectedPort = await stackDetector.detectPort(stack, cwd);
1196
- spinner.succeed(
1197
- `Detecting project... ${chalk6.cyan(stack.framework || "unknown")} + ${chalk6.cyan(stack.typescript ? "TypeScript" : stack.language || "unknown")}`
1198
- );
1199
+ const reStacks = [stack.framework, ...stack.additionalStacks ?? []].filter((s) => s !== "unknown").join(" + ") || "unknown";
1200
+ spinner.succeed(`Detecting project... ${chalk6.cyan(reStacks)} (${chalk6.dim(stack.typescript ? "TypeScript" : stack.language || "unknown")})`);
1199
1201
  devCommand = config.project.devCommand || detectedDevCommand;
1200
1202
  devPort = config.project.port || detectedPort;
1201
1203
  if (!devCommand) {
@@ -1218,7 +1220,7 @@ ${nudgeMessage}
1218
1220
  throw err;
1219
1221
  }
1220
1222
  spinner.succeed("Project indexed.");
1221
- const { ProjectAnalyzer, RagIndexer, createEmbeddingService } = await import("./dist-IDA76B3L.js");
1223
+ const { ProjectAnalyzer, RagIndexer, createEmbeddingService } = await import("./dist-NVKTAKZX.js");
1222
1224
  const { ProjectMapApi } = await import("./dist-5FLNK6MH.js");
1223
1225
  const projectAnalyzer = new ProjectAnalyzer();
1224
1226
  spinner.start("Analyzing project structure...");
@@ -1226,7 +1228,7 @@ ${nudgeMessage}
1226
1228
  spinner.succeed(`Project analyzed: ${analysis.fileCount} files, ${analysis.methods.length} methods.`);
1227
1229
  let ragIndexer = null;
1228
1230
  try {
1229
- const { VectorStore } = await import("./dist-IDA76B3L.js");
1231
+ const { VectorStore } = await import("./dist-NVKTAKZX.js");
1230
1232
  let embeddingProvider = "tfidf";
1231
1233
  let embeddingApiKey;
1232
1234
  let embeddingBaseUrl;
@@ -1282,6 +1284,21 @@ ${nudgeMessage}
1282
1284
  process.exit(1);
1283
1285
  }
1284
1286
  spinner.succeed("Ports available");
1287
+ const NODE_FRAMEWORKS = ["node", "express", "nest", "fastify", "koa", "hapi", "next.js", "nuxt", "sveltekit", "astro", "vite", "cra"];
1288
+ if (NODE_FRAMEWORKS.includes(stack.framework) && !existsSync(join2(cwd, "node_modules"))) {
1289
+ const pm = stack.packageManager ?? "npm";
1290
+ const installCmd = pm === "yarn" ? "yarn" : `${pm} install`;
1291
+ spinner.stop();
1292
+ console.log(chalk6.dim(` Installing dependencies (${installCmd})...`));
1293
+ try {
1294
+ const { execSync } = await import("child_process");
1295
+ execSync(installCmd, { cwd, stdio: "inherit" });
1296
+ console.log(chalk6.green(" Dependencies installed."));
1297
+ } catch {
1298
+ console.log(chalk6.red(` Failed to install dependencies. Run "${installCmd}" manually.`));
1299
+ process.exit(1);
1300
+ }
1301
+ }
1285
1302
  spinner.start(`Starting dev server (${chalk6.dim(devCommand)})...`);
1286
1303
  try {
1287
1304
  await devServer.spawn(devCommand, cwd, devPort);
@@ -1318,7 +1335,7 @@ Tips:`));
1318
1335
  wsServer.start(httpServer);
1319
1336
  }
1320
1337
  proxyServer.setProjectMapApi(projectMapApi);
1321
- const { GraphStore: GS, SearchRouter: SR } = await import("./dist-IDA76B3L.js");
1338
+ const { GraphStore: GS, SearchRouter: SR } = await import("./dist-NVKTAKZX.js");
1322
1339
  const novaPath = novaDir.getPath(cwd);
1323
1340
  const graphStoreForApi = new GS(novaPath);
1324
1341
  const searchRouterForApi = new SR(graphStoreForApi);
@@ -73,7 +73,7 @@ import {
73
73
  parseManifest,
74
74
  parseMixedBlocks,
75
75
  streamWithEvents
76
- } from "./chunk-ACJAMJVU.js";
76
+ } from "./chunk-3FVS3SB3.js";
77
77
  import "./chunk-3RG5ZIWI.js";
78
78
  export {
79
79
  AgentPromptLoader,
package/dist/index.js CHANGED
@@ -4,13 +4,13 @@ import {
4
4
  createCli,
5
5
  promptAndScaffold,
6
6
  run
7
- } from "./chunk-J573S7XU.js";
7
+ } from "./chunk-7ZE7J73C.js";
8
8
  import "./chunk-KE7XWO5N.js";
9
9
  import {
10
10
  ConfigReader,
11
11
  runSetup
12
- } from "./chunk-RZGTRPQL.js";
13
- import "./chunk-ACJAMJVU.js";
12
+ } from "./chunk-53K63TXF.js";
13
+ import "./chunk-3FVS3SB3.js";
14
14
  import "./chunk-3RG5ZIWI.js";
15
15
  export {
16
16
  ConfigReader,
@@ -4,7 +4,7 @@ import "./chunk-3RG5ZIWI.js";
4
4
  var package_default = {
5
5
  name: "@novastorm-ai/cli",
6
6
  publishConfig: { access: "public" },
7
- version: "0.1.5",
7
+ version: "0.1.6",
8
8
  license: "SEE LICENSE IN LICENSE.md",
9
9
  type: "module",
10
10
  main: "dist/index.js",
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  runSetup
3
- } from "./chunk-RZGTRPQL.js";
4
- import "./chunk-ACJAMJVU.js";
3
+ } from "./chunk-53K63TXF.js";
4
+ import "./chunk-3FVS3SB3.js";
5
5
  import "./chunk-3RG5ZIWI.js";
6
6
  export {
7
7
  runSetup
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.1.5",
6
+ "version": "0.1.6",
7
7
  "license": "SEE LICENSE IN LICENSE.md",
8
8
  "type": "module",
9
9
  "main": "dist/index.js",
@@ -35,9 +35,9 @@
35
35
  "devDependencies": {
36
36
  "tsup": "^8.4.0",
37
37
  "typescript": "^5.7.0",
38
- "@novastorm-ai/licensing": "0.0.1",
38
+ "@novastorm-ai/core": "0.0.1",
39
39
  "@novastorm-ai/proxy": "0.0.1",
40
- "@novastorm-ai/core": "0.0.1"
40
+ "@novastorm-ai/licensing": "0.0.1"
41
41
  },
42
42
  "scripts": {
43
43
  "build": "tsup",