heides 0.13.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 AbduljabbarBXR
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,45 @@
1
+ # heides (npm installer)
2
+
3
+ Installs the prebuilt [HEIDES](https://github.com/AbduljabbarBXR/heides) binary for your platform and exposes the `heides` command. HEIDES is a deterministic code analysis harness that gives AI agents senses, memory and judgment for code.
4
+
5
+ ```bash
6
+ npm install -g heides
7
+ heides --help
8
+ ```
9
+
10
+ On install, the matching binary is downloaded from GitHub Releases into the package `bin/` folder. No Rust toolchain needed.
11
+
12
+ ## Supported platforms
13
+
14
+ | OS | Arch | Asset |
15
+ |----|------|-------|
16
+ | Linux (glibc) | x64 | `heides-x86_64-unknown-linux-gnu` |
17
+ | macOS | arm64 | `heides-aarch64-apple-darwin` |
18
+ | macOS | x64 | `heides-x86_64-apple-darwin` |
19
+ | Windows | x64 | `heides-x86_64-pc-windows-msvc.exe` |
20
+
21
+ Not listed, e.g. Linux arm64, Android, or musl/Alpine: the installer stops with a clear error. Install from source instead (`cargo install heides`) or pick a build from the [releases page](https://github.com/AbduljabbarBXR/heides/releases).
22
+
23
+ ## Usage
24
+
25
+ Same as the native binary:
26
+
27
+ ```bash
28
+ heides scan .
29
+ heides check .
30
+ heides mcp # MCP server over stdio for agents
31
+ ```
32
+
33
+ ## Versions
34
+
35
+ npm package version tracks the HEIDES release version. `heides@0.13.1` installs HEIDES 0.13.1.
36
+
37
+ ## Uninstall
38
+
39
+ ```bash
40
+ npm uninstall -g heides
41
+ ```
42
+
43
+ ## License
44
+
45
+ MIT. See [LICENSE](./LICENSE). Binary builds follow the [HEIDES repo license](https://github.com/AbduljabbarBXR/heides).
package/bin/heides.js ADDED
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env node
2
+ /* heides launcher. Runs the platform binary downloaded by postinstall. */
3
+ "use strict";
4
+
5
+ const { spawnSync } = require("child_process");
6
+ const fs = require("fs");
7
+ const path = require("path");
8
+
9
+ function binaryPath() {
10
+ const exe = process.platform === "win32" ? "heides.exe" : "heides";
11
+ return path.join(__dirname, exe);
12
+ }
13
+
14
+ function main() {
15
+ const bin = binaryPath();
16
+ if (!fs.existsSync(bin)) {
17
+ console.error("heides: binary not found. Reinstall with: npm install -g heides");
18
+ process.exit(1);
19
+ }
20
+ const result = spawnSync(bin, process.argv.slice(2), { stdio: "inherit" });
21
+ if (result.error) {
22
+ console.error(`heides: could not run the binary (${result.error.message}).`);
23
+ console.error("Your platform may need a different build:");
24
+ console.error("https://github.com/AbduljabbarBXR/heides/releases");
25
+ process.exit(1);
26
+ }
27
+ process.exit(result.status === null ? 1 : result.status);
28
+ }
29
+
30
+ if (require.main === module) main();
31
+
32
+ module.exports = { binaryPath };
package/install.js ADDED
@@ -0,0 +1,101 @@
1
+ #!/usr/bin/env node
2
+ /*
3
+ * heides npm installer.
4
+ * Downloads the prebuilt HEIDES binary for the current platform from
5
+ * GitHub Releases into ./bin/ next to the launcher.
6
+ */
7
+ "use strict";
8
+
9
+ const fs = require("fs");
10
+ const https = require("https");
11
+ const os = require("os");
12
+ const path = require("path");
13
+
14
+ const VERSION = require("./package.json").version;
15
+ const REPO = "AbduljabbarBXR/heides";
16
+ const BIN_NAME = "heides";
17
+
18
+ const ASSETS = {
19
+ "linux-x64": "heides-x86_64-unknown-linux-gnu",
20
+ "darwin-arm64": "heides-aarch64-apple-darwin",
21
+ "darwin-x64": "heides-x86_64-apple-darwin",
22
+ "win32-x64": "heides-x86_64-pc-windows-msvc.exe",
23
+ };
24
+
25
+ function currentKey() {
26
+ if (process.env.HEIDES_TEST_PLATFORM) return process.env.HEIDES_TEST_PLATFORM;
27
+ return `${process.platform}-${process.arch}`;
28
+ }
29
+
30
+ function assetFor(key) {
31
+ return ASSETS[key] || null;
32
+ }
33
+
34
+ function exeName() {
35
+ return process.platform === "win32" ? `${BIN_NAME}.exe` : BIN_NAME;
36
+ }
37
+
38
+ function isMusl() {
39
+ try {
40
+ if (fs.existsSync("/etc/alpine-release")) return true;
41
+ const osRelease = fs.readFileSync("/etc/os-release", "utf8");
42
+ return /(^|\n)ID_LIKE=.*musl/.test(osRelease) || /(^|\n)ID=alpine/.test(osRelease);
43
+ } catch {
44
+ return false;
45
+ }
46
+ }
47
+
48
+ function download(url, dest, redirects = 5) {
49
+ return new Promise((resolve, reject) => {
50
+ https
51
+ .get(url, { headers: { "User-Agent": "heides-npm-installer" } }, (res) => {
52
+ if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
53
+ if (redirects === 0) return reject(new Error("too many redirects"));
54
+ res.resume();
55
+ return resolve(download(res.headers.location, dest, redirects - 1));
56
+ }
57
+ if (res.statusCode !== 200) {
58
+ res.resume();
59
+ return reject(new Error(`download failed: HTTP ${res.statusCode} for ${url}`));
60
+ }
61
+ const out = fs.createWriteStream(dest, { mode: 0o755 });
62
+ res.pipe(out);
63
+ out.on("finish", () => resolve());
64
+ out.on("error", reject);
65
+ })
66
+ .on("error", reject);
67
+ });
68
+ }
69
+
70
+ async function main() {
71
+ const key = currentKey();
72
+ const asset = assetFor(key);
73
+ if (!asset) {
74
+ console.error(`heides: no prebuilt binary for ${process.platform}-${process.arch}.`);
75
+ console.error("Install from source instead: cargo install heides");
76
+ console.error(`Or pick a build manually: https://github.com/${REPO}/releases`);
77
+ process.exit(1);
78
+ }
79
+ if (process.platform === "linux" && isMusl()) {
80
+ console.error("heides: prebuilt binaries are glibc linked and will not run on musl (Alpine).");
81
+ console.error("Install from source instead: cargo install heides");
82
+ process.exit(1);
83
+ }
84
+ const binDir = path.join(__dirname, "bin");
85
+ fs.mkdirSync(binDir, { recursive: true });
86
+ const dest = path.join(binDir, exeName());
87
+ const url = `https://github.com/${REPO}/releases/download/v${VERSION}/${asset}`;
88
+ console.log(`heides: downloading ${asset} ...`);
89
+ await download(url, dest);
90
+ if (process.platform !== "win32") fs.chmodSync(dest, 0o755);
91
+ console.log(`heides: installed ${dest}`);
92
+ }
93
+
94
+ if (require.main === module) {
95
+ main().catch((err) => {
96
+ console.error(`heides install failed: ${err.message}`);
97
+ process.exit(1);
98
+ });
99
+ }
100
+
101
+ module.exports = { assetFor, currentKey, exeName, isMusl, VERSION };
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "heides",
3
+ "version": "0.13.1",
4
+ "description": "HEIDES installer. Downloads the prebuilt HEIDES binary for your platform and exposes the heides command. Deterministic code analysis harness for AI agents.",
5
+ "bin": {
6
+ "heides": "bin/heides.js"
7
+ },
8
+ "scripts": {
9
+ "postinstall": "node ./install.js",
10
+ "test": "node ./test.js"
11
+ },
12
+ "license": "MIT",
13
+ "engines": {
14
+ "node": ">=18"
15
+ },
16
+ "keywords": [
17
+ "heides",
18
+ "code-analysis",
19
+ "static-analysis",
20
+ "mcp",
21
+ "model-context-protocol",
22
+ "ai-agents",
23
+ "cli",
24
+ "binary"
25
+ ],
26
+ "author": "AbduljabbarBXR",
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "git+https://github.com/AbduljabbarBXR/heides.git",
30
+ "directory": "npm"
31
+ },
32
+ "homepage": "https://github.com/AbduljabbarBXR/heides#readme",
33
+ "bugs": {
34
+ "url": "https://github.com/AbduljabbarBXR/heides/issues"
35
+ },
36
+ "files": [
37
+ "bin/",
38
+ "install.js",
39
+ "test.js",
40
+ "README.md",
41
+ "LICENSE"
42
+ ]
43
+ }
package/test.js ADDED
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ // Unit tests for the installer mapping. No dependencies. Run: npm test
3
+ const assert = require("assert");
4
+ const { assetFor } = require("./install.js");
5
+
6
+ assert.strictEqual(assetFor("linux-x64"), "heides-x86_64-unknown-linux-gnu");
7
+ assert.strictEqual(assetFor("darwin-arm64"), "heides-aarch64-apple-darwin");
8
+ assert.strictEqual(assetFor("darwin-x64"), "heides-x86_64-apple-darwin");
9
+ assert.strictEqual(assetFor("win32-x64"), "heides-x86_64-pc-windows-msvc.exe");
10
+ assert.strictEqual(assetFor("linux-arm64"), null);
11
+ assert.strictEqual(assetFor("android-arm64"), null);
12
+ assert.strictEqual(assetFor("freebsd-x64"), null);
13
+
14
+ console.log("heides installer mapping: 7/7 ok");