@mvpscale/aoa 0.0.0

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/install.js +39 -0
  2. package/package.json +16 -0
package/install.js ADDED
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ const os = require("os");
5
+ const fs = require("fs");
6
+ const path = require("path");
7
+
8
+ const PLATFORM_MAP = {
9
+ "linux-x64": "@mvpscale/aoa-linux-x64",
10
+ "linux-arm64": "@mvpscale/aoa-linux-arm64",
11
+ "darwin-x64": "@mvpscale/aoa-darwin-x64",
12
+ "darwin-arm64": "@mvpscale/aoa-darwin-arm64",
13
+ };
14
+
15
+ const key = `${os.platform()}-${os.arch()}`;
16
+ const pkg = PLATFORM_MAP[key];
17
+
18
+ if (!pkg) {
19
+ console.error(`aoa: unsupported platform ${key}`);
20
+ console.error(`Supported: ${Object.keys(PLATFORM_MAP).join(", ")}`);
21
+ process.exit(1);
22
+ }
23
+
24
+ let binPath;
25
+ try {
26
+ binPath = require.resolve(`${pkg}/bin/aoa`);
27
+ } catch {
28
+ console.error(`aoa: platform package ${pkg} not installed.`);
29
+ console.error("Try reinstalling: npm install -g aoa");
30
+ process.exit(1);
31
+ }
32
+
33
+ // Create bin/ directory and symlink
34
+ const binDir = path.join(__dirname, "bin");
35
+ fs.mkdirSync(binDir, { recursive: true });
36
+ const dest = path.join(binDir, "aoa");
37
+ try { fs.unlinkSync(dest); } catch {}
38
+ fs.symlinkSync(binPath, dest);
39
+ fs.chmodSync(dest, 0o755);
package/package.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "@mvpscale/aoa",
3
+ "version": "0.0.0",
4
+ "description": "aOa — semantic code search engine",
5
+ "bin": { "aoa": "bin/aoa" },
6
+ "scripts": { "postinstall": "node install.js" },
7
+ "optionalDependencies": {
8
+ "@mvpscale/aoa-linux-x64": "0.0.0",
9
+ "@mvpscale/aoa-linux-arm64": "0.0.0",
10
+ "@mvpscale/aoa-darwin-x64": "0.0.0",
11
+ "@mvpscale/aoa-darwin-arm64": "0.0.0"
12
+ },
13
+ "license": "MIT",
14
+ "repository": { "type": "git", "url": "https://github.com/mvp-scale/aOa-go" },
15
+ "keywords": ["code-search", "semantic-search", "developer-tools"]
16
+ }