@vera-ai/cli 0.11.5 → 0.11.7

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 (3) hide show
  1. package/README.md +1 -1
  2. package/bin/vera.js +29 -2
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Code search for AI agents. Vera indexes your codebase using tree-sitter parsing and hybrid search (BM25 + vector similarity + cross-encoder reranking), then returns ranked code snippets as structured JSON.
4
4
 
5
- This package downloads and wraps the native Vera binary for your platform.
5
+ This package downloads and wraps the native Vera binary for your platform. On musl-based Linux (Alpine, NixOS), the correct static binary is selected automatically. Set `VERA_TARGET` to override target detection (e.g., `VERA_TARGET=x86_64-unknown-linux-musl npm install -g @vera-ai/cli`).
6
6
 
7
7
  Current benchmark snapshot: on Vera's local 21-task, 4-repo release benchmark, `v0.7.0` reaches `0.78` Recall@5, `0.83` Recall@10, `0.91` MRR@10, and `0.84` nDCG@10 with the local Jina CUDA ONNX stack. Full details live in the main repo docs.
8
8
 
package/bin/vera.js CHANGED
@@ -24,10 +24,34 @@ function parseArgs(argv) {
24
24
  return { command: argv[0], rest: argv.slice(1) };
25
25
  }
26
26
 
27
+ function detectMusl() {
28
+ if (process.platform !== "linux") return false;
29
+ try {
30
+ const result = spawnSync("ldd", ["--version"], {
31
+ stdio: ["pipe", "pipe", "pipe"],
32
+ });
33
+ const output = (result.stdout || "").toString() + (result.stderr || "").toString();
34
+ return /musl/i.test(output);
35
+ } catch {
36
+ // Fallback: check for musl dynamic linker.
37
+ try {
38
+ const entries = fs.readdirSync("/lib");
39
+ return entries.some((e) => e.startsWith("ld-musl-"));
40
+ } catch {
41
+ return false;
42
+ }
43
+ }
44
+ }
45
+
27
46
  function resolveTarget(platform, arch) {
47
+ const override = process.env.VERA_TARGET;
48
+ if (override) return override;
49
+
28
50
  const key = `${platform}:${arch}`;
29
51
  const targets = {
30
- "linux:x64": "x86_64-unknown-linux-gnu",
52
+ "linux:x64": detectMusl()
53
+ ? "x86_64-unknown-linux-musl"
54
+ : "x86_64-unknown-linux-gnu",
31
55
  "linux:arm64": "aarch64-unknown-linux-gnu",
32
56
  "darwin:x64": "x86_64-apple-darwin",
33
57
  "darwin:arm64": "aarch64-apple-darwin",
@@ -84,7 +108,7 @@ async function readInstallMetadata() {
84
108
  }
85
109
  }
86
110
 
87
- async function writeInstallMetadata({ installMethod, version, binaryPath }) {
111
+ async function writeInstallMetadata({ installMethod, version, binaryPath, target }) {
88
112
  const metadataPath = installMetadataPath();
89
113
  await fsp.mkdir(path.dirname(metadataPath), { recursive: true });
90
114
  const current = await readInstallMetadata();
@@ -92,6 +116,7 @@ async function writeInstallMetadata({ installMethod, version, binaryPath }) {
92
116
  install_method: installMethod ?? current.install_method ?? null,
93
117
  version: version ?? current.version ?? null,
94
118
  binary_path: binaryPath ?? current.binary_path ?? null,
119
+ target: target ?? current.target ?? null,
95
120
  };
96
121
  const tmpPath = `${metadataPath}.tmp.${process.pid}`;
97
122
  await fsp.writeFile(tmpPath, `${JSON.stringify(next, null, 2)}\n`, "utf8");
@@ -300,6 +325,7 @@ async function ensureBinaryInstalled() {
300
325
  installMethod: currentInstallMethod(),
301
326
  version,
302
327
  binaryPath,
328
+ target,
303
329
  });
304
330
  return { binaryPath, version };
305
331
  }
@@ -334,6 +360,7 @@ async function ensureBinaryInstalled() {
334
360
  installMethod: currentInstallMethod(),
335
361
  version,
336
362
  binaryPath,
363
+ target,
337
364
  });
338
365
  return { binaryPath, version };
339
366
  } finally {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vera-ai/cli",
3
- "version": "0.11.5",
3
+ "version": "0.11.7",
4
4
  "description": "Bootstrap installer and wrapper for the Vera CLI",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/lemon07r/Vera#readme",