novahiz 0.11.3 → 0.11.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/CHANGELOG.md CHANGED
@@ -5,6 +5,23 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [0.11.5] - 2026-10-23
9
+
10
+ ### Fixed
11
+
12
+ - **`novahiz setup` now completes on Linux with Node builds lacking TypeScript support** - `runSync()` and the installer spawned `home/src/cli.ts` directly, which fails with `ERR_UNKNOWN_FILE_EXTENSION` / `ERR_NO_TYPESCRIPT` on Node builds without TypeScript compiled in (e.g. Debian/Ubuntu Node 24.19.0). `runSync()` and all installer spawn sites now prefer `home/dist/cli.js` (JS compiled, present in the published package and copied into the home by the installer via `CORE_ITEMS`) and fall back to `src/cli.ts` with `--experimental-strip-types` only when `dist` is missing. `"dist"` was added to `CORE_ITEMS` so the file is copied into the home on every install.
13
+
14
+ ## [0.11.4] - 2026-10-22
15
+
16
+ ### Fixed
17
+
18
+ - **`novahiz setup` now completes on Linux** - `runSync()` executed
19
+ `home/src/cli.ts` directly with Node, which cannot read TypeScript
20
+ without `--experimental-strip-types`. On a fresh global install the home
21
+ has no `dist/` build, so the sync step failed with
22
+ `ERR_UNKNOWN_FILE_EXTENSION`. The flag is now added so the two-pass
23
+ install (core then extras) completes on Linux, macOS and Windows.
24
+
8
25
  ## [0.11.3] - 2026-10-22
9
26
 
10
27
  ### Fixed
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  17 catégories, 94 skills, 13 gate rules, 8 MCP providers — tout déterministe, tout local, tout JSON.
6
6
 
7
- > **Version 0.11.0** — `npm install -g novahiz` pose le CLI, et le premier `novahiz` lancé termine l'installation (core puis extras). `CHANGELOG.md` et `scripts/` sont dans le tarball.
7
+ > **Version 0.11.4** — `npm install -g novahiz` pose le CLI, et le premier `novahiz` lancé termine l'installation (core puis extras). `CHANGELOG.md` et `scripts/` sont dans le tarball.
8
8
 
9
9
  ```
10
10
  ┌──────────────────────────────────────────────────────────────────────────┐
package/dist/cli.js CHANGED
@@ -33,9 +33,22 @@ function homeDir() {
33
33
  }
34
34
  function runSync() {
35
35
  const home = homeDir();
36
- const cli = join(home, "src", "cli.ts");
37
- if (existsSync(cli)) {
38
- spawnSync(process.execPath, [cli, "sync"], {
36
+ const cliJs = join(home, "dist", "cli.js");
37
+ const cliTs = join(home, "src", "cli.ts");
38
+ if (existsSync(cliJs)) {
39
+ // dist/cli.js est du JS compilé : Node le lit nativement, sur tous les
40
+ // builds (y compris ceux sans support TypeScript compilé).
41
+ spawnSync(process.execPath, [cliJs, "sync"], {
42
+ encoding: "utf8",
43
+ stdio: "inherit",
44
+ env: { ...process.env, NOVAHIZ_HOME: home }
45
+ });
46
+ }
47
+ else if (existsSync(cliTs)) {
48
+ // Fallback pour un home qui ne contient que les sources (pas de build).
49
+ // --experimental-strip-types ne fonctionne que sur les builds Node avec
50
+ // support TypeScript compilé ; sinon l'utilisateur verra une erreur claire.
51
+ spawnSync(process.execPath, ["--experimental-strip-types", cliTs, "sync"], {
39
52
  encoding: "utf8",
40
53
  stdio: "inherit",
41
54
  env: { ...process.env, NOVAHIZ_HOME: home }
@@ -34,6 +34,22 @@ import {
34
34
  import { createPrompt } from "./prompt.mjs";
35
35
  import { createInstallerUI } from "./ui.mjs";
36
36
 
37
+ // Retourne les arguments complets pour spawnSync afin d'exécuter le CLI
38
+ // Novahiz depuis le home. Préfère dist/cli.js (JS compilé, fonctionne sur
39
+ // tous les builds Node, y compris ceux sans support TypeScript compilé) et
40
+ // tombe sur src/cli.ts avec --experimental-strip-types si dist manque.
41
+ function cliSpawnArgs(home, ...args) {
42
+ const cliJs = join(home, "dist", "cli.js");
43
+ const cliTs = join(home, "src", "cli.ts");
44
+ if (existsSync(cliJs)) {
45
+ return [process.execPath, cliJs, ...args];
46
+ }
47
+ if (existsSync(cliTs)) {
48
+ return [process.execPath, "--experimental-strip-types", cliTs, ...args];
49
+ }
50
+ return null;
51
+ }
52
+
37
53
  // Etapes visibles par l'utilisateur, dans l'ordre reel d'execution. La barre
38
54
  // de progression se base sur cette liste : toute section ajoutee ici doit
39
55
  // appeler ui.step() une fois (les sauts conditionnels passent par
@@ -77,6 +93,7 @@ const CORE_ITEMS = [
77
93
  "skills",
78
94
  "docs",
79
95
  "scripts",
96
+ "dist",
80
97
  "package.json",
81
98
  "tsconfig.json",
82
99
  "LICENSE",
@@ -485,10 +502,10 @@ async function main() {
485
502
  note("Catalog rebuild skipped (--extras): already built by the core pass.");
486
503
  }
487
504
  if (runCore && !dryRun) {
488
- const cli = join(home, "src", "cli.ts");
489
- if (existsSync(cli)) {
505
+ const cmd = cliSpawnArgs(home, "sync");
506
+ if (cmd) {
490
507
  note("Building catalog (sync)");
491
- const result = spawnSync(process.execPath, [cli, "sync"], {
508
+ const result = spawnSync(...cmd, {
492
509
  encoding: "utf8",
493
510
  env: { ...process.env, NOVAHIZ_HOME: home }
494
511
  });
@@ -503,7 +520,6 @@ async function main() {
503
520
  ui.finishStep("skip", "extras deferred");
504
521
  }
505
522
  if (runExtras && !dryRun) {
506
- const cli = join(home, "src", "cli.ts");
507
523
  const config = readJson(join(home, "novahiz.config.json"), {});
508
524
  // Installation automatique des dependances par defaut (2026-10-12):
509
525
  // - providers.acceptes (ou config autoInstall, defaut true) -> tout part
@@ -518,7 +534,7 @@ async function main() {
518
534
  ? providersChoice
519
535
  : Boolean(flags["install-providers"]) || config?.providers?.autoInstall !== false;
520
536
  note("Checking dependencies");
521
- const check = spawnSync(process.execPath, [cli, "deps"], {
537
+ const check = spawnSync(...cliSpawnArgs(home, "deps"), {
522
538
  encoding: "utf8",
523
539
  env: { ...process.env, NOVAHIZ_HOME: home }
524
540
  });
@@ -532,7 +548,7 @@ async function main() {
532
548
  note(autoInstall
533
549
  ? "Installing dependencies and providers (toolchain, MCP, skills, commands)"
534
550
  : "Installing core system dependencies (toolchain: python, uv — npm health)");
535
- const result = spawnSync(process.execPath, [cli, ...args], {
551
+ const result = spawnSync(...cliSpawnArgs(home, ...args), {
536
552
  encoding: "utf8",
537
553
  env: { ...process.env, NOVAHIZ_HOME: home }
538
554
  });
@@ -842,10 +858,10 @@ async function main() {
842
858
  note("Skipped (--no-vault).");
843
859
  ui.finishStep("skip");
844
860
  } else {
845
- const vaultCli = join(home, "src", "cli.ts");
846
- if (existsSync(vaultCli)) {
861
+ const vaultCmd = cliSpawnArgs(home, "second-memory", "init");
862
+ if (vaultCmd) {
847
863
  note("Creating the second-memory vault (structure + Obsidian plugins, ~10 downloads)...");
848
- const vault = spawnSync(process.execPath, [vaultCli, "second-memory", "init"], {
864
+ const vault = spawnSync(...vaultCmd, {
849
865
  encoding: "utf8",
850
866
  timeout: 180000,
851
867
  env: { ...process.env, NOVAHIZ_HOME: home }
@@ -930,10 +946,10 @@ async function main() {
930
946
  if (cleanup.removed.length > 0) {
931
947
  // L'index tient encore la liste des skills supprimes : on le rejoue une
932
948
  // fois, sinon le prochain routage classifiera vers un skill parti.
933
- const cleanupCli = join(home, "src", "cli.ts");
934
- if (existsSync(cleanupCli)) {
949
+ const cleanupCmd = cliSpawnArgs(home, "sync");
950
+ if (cleanupCmd) {
935
951
  note("Rebuilding catalog after cleanup (sync)");
936
- const rebuild = spawnSync(process.execPath, [cleanupCli, "sync"], {
952
+ const rebuild = spawnSync(...cleanupCmd, {
937
953
  encoding: "utf8",
938
954
  env: { ...process.env, NOVAHIZ_HOME: home }
939
955
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "novahiz",
3
- "version": "0.11.3",
3
+ "version": "0.11.5",
4
4
  "description": "Enforce AI agent skills before every file edit: prompt classifier, skill catalog, and pre-edit gate.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
package/src/cli.ts CHANGED
@@ -37,9 +37,21 @@ function homeDir(): string {
37
37
 
38
38
  function runSync(): void {
39
39
  const home = homeDir();
40
- const cli = join(home, "src", "cli.ts");
41
- if (existsSync(cli)) {
42
- spawnSync(process.execPath, [cli, "sync"], {
40
+ const cliJs = join(home, "dist", "cli.js");
41
+ const cliTs = join(home, "src", "cli.ts");
42
+ if (existsSync(cliJs)) {
43
+ // dist/cli.js est du JS compilé : Node le lit nativement, sur tous les
44
+ // builds (y compris ceux sans support TypeScript compilé).
45
+ spawnSync(process.execPath, [cliJs, "sync"], {
46
+ encoding: "utf8",
47
+ stdio: "inherit",
48
+ env: { ...process.env, NOVAHIZ_HOME: home }
49
+ });
50
+ } else if (existsSync(cliTs)) {
51
+ // Fallback pour un home qui ne contient que les sources (pas de build).
52
+ // --experimental-strip-types ne fonctionne que sur les builds Node avec
53
+ // support TypeScript compilé ; sinon l'utilisateur verra une erreur claire.
54
+ spawnSync(process.execPath, ["--experimental-strip-types", cliTs, "sync"], {
43
55
  encoding: "utf8",
44
56
  stdio: "inherit",
45
57
  env: { ...process.env, NOVAHIZ_HOME: home }