@sansavision/atlas 0.1.3 → 0.1.4

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/bin/atlas-mcp.js CHANGED
@@ -11,13 +11,28 @@ const fs = require("fs");
11
11
  const name = os.platform() === "win32" ? "atlas-mcp.exe" : "atlas-mcp";
12
12
  const binary = path.join(__dirname, name);
13
13
 
14
+ function ensureInstalled() {
15
+ if (fs.existsSync(binary)) return true;
16
+ const installer = path.join(__dirname, "..", "install.js");
17
+ const node = process.execPath;
18
+
19
+ const r = spawnSync(node, [installer], { stdio: "inherit" });
20
+ if (r.error) {
21
+ console.error("atlas-mcp: failed to run installer:", r.error.message);
22
+ return false;
23
+ }
24
+ return fs.existsSync(binary);
25
+ }
26
+
14
27
  if (!fs.existsSync(binary)) {
15
- console.error(
16
- "atlas-mcp: native binary not found.\n" +
17
- "Try reinstalling: npm install @sansavision/atlas\n" +
18
- "Or build from source: https://github.com/Sansa-Organisation/atlas#building",
19
- );
20
- process.exit(1);
28
+ if (!ensureInstalled()) {
29
+ console.error(
30
+ "atlas-mcp: native binary not found.\n" +
31
+ "Try reinstalling: npm install @sansavision/atlas\n" +
32
+ "Or build from source: https://github.com/Sansa-Organisation/atlas#building",
33
+ );
34
+ process.exit(1);
35
+ }
21
36
  }
22
37
 
23
38
  const result = spawnSync(binary, process.argv.slice(2), { stdio: "inherit" });
package/bin/atlas.js CHANGED
@@ -11,13 +11,30 @@ const fs = require("fs");
11
11
  const name = os.platform() === "win32" ? "atlas.exe" : "atlas";
12
12
  const binary = path.join(__dirname, name);
13
13
 
14
+ function ensureInstalled() {
15
+ if (fs.existsSync(binary)) return true;
16
+ const installer = path.join(__dirname, "..", "install.js");
17
+ const node = process.execPath;
18
+
19
+ // Some runners (notably bunx) may skip npm lifecycle scripts.
20
+ // If the native binary isn't present, run the installer on-demand.
21
+ const r = spawnSync(node, [installer], { stdio: "inherit" });
22
+ if (r.error) {
23
+ console.error("atlas: failed to run installer:", r.error.message);
24
+ return false;
25
+ }
26
+ return fs.existsSync(binary);
27
+ }
28
+
14
29
  if (!fs.existsSync(binary)) {
15
- console.error(
16
- "atlas: native binary not found.\n" +
17
- "Try reinstalling: npm install @sansavision/atlas\n" +
18
- "Or build from source: https://github.com/Sansa-Organisation/atlas#building",
19
- );
20
- process.exit(1);
30
+ if (!ensureInstalled()) {
31
+ console.error(
32
+ "atlas: native binary not found.\n" +
33
+ "Try reinstalling: npm install @sansavision/atlas\n" +
34
+ "Or build from source: https://github.com/Sansa-Organisation/atlas#building",
35
+ );
36
+ process.exit(1);
37
+ }
21
38
  }
22
39
 
23
40
  const result = spawnSync(binary, process.argv.slice(2), { stdio: "inherit" });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sansavision/atlas",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Atlas Context Engine — MCP-native context engine for AI coding agents",
5
5
  "private": false,
6
6
  "publishConfig": {