complior 0.9.0 → 0.9.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.
Files changed (2) hide show
  1. package/bin/run.js +19 -3
  2. package/package.json +5 -2
package/bin/run.js CHANGED
@@ -1,21 +1,37 @@
1
1
  #!/usr/bin/env node
2
- // Launcher for Complior TUI binary installed via npm
2
+ // Launcher for Complior CLI binary installed via npm
3
3
  import { execFileSync } from "node:child_process";
4
4
  import { join, dirname } from "node:path";
5
5
  import { fileURLToPath } from "node:url";
6
6
  import { existsSync } from "node:fs";
7
+ import { createRequire } from "node:module";
7
8
 
8
9
  const __dirname = dirname(fileURLToPath(import.meta.url));
9
10
  const binaryName = process.platform === "win32" ? "complior.exe" : "complior";
10
11
  const binaryPath = join(__dirname, binaryName);
11
12
 
12
13
  if (!existsSync(binaryPath)) {
13
- console.error("Complior binary not found. Run: npm rebuild ai-comply");
14
+ console.error("Complior binary not found. Run: npm rebuild complior");
14
15
  process.exit(1);
15
16
  }
16
17
 
18
+ // Resolve @complior/engine location so the Rust binary can find & start it
19
+ const require = createRequire(import.meta.url);
20
+ let engineDir;
17
21
  try {
18
- execFileSync(binaryPath, process.argv.slice(2), { stdio: "inherit" });
22
+ const enginePkg = require.resolve("@complior/engine/package.json");
23
+ engineDir = dirname(enginePkg);
24
+ } catch {
25
+ // Engine not found — binary will show its own error
26
+ }
27
+
28
+ const env = { ...process.env };
29
+ if (engineDir) {
30
+ env.COMPLIOR_ENGINE_DIR = engineDir;
31
+ }
32
+
33
+ try {
34
+ execFileSync(binaryPath, process.argv.slice(2), { stdio: "inherit", env });
19
35
  } catch (err) {
20
36
  process.exit(err.status ?? 1);
21
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "complior",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "type": "module",
5
5
  "description": "AI Act Compliance Scanner & Fixer — EU AI Act compliance for your AI systems. CLI, TUI dashboard, and background daemon.",
6
6
  "license": "AGPL-3.0-only",
@@ -47,7 +47,10 @@
47
47
  "bin/",
48
48
  "scripts/"
49
49
  ],
50
+ "dependencies": {
51
+ "@complior/engine": "0.9.1"
52
+ },
50
53
  "engines": {
51
- "node": ">=18"
54
+ "node": ">=22"
52
55
  }
53
56
  }