@sicario-labs/kode 3.1.2

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/cli.js +13 -0
  2. package/install.js +59 -0
  3. package/package.json +20 -0
package/cli.js ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+ const { spawnSync } = require("child_process");
3
+ const { join } = require("path");
4
+
5
+ const plat = process.platform;
6
+ const ext = plat === "win32" ? ".exe" : "";
7
+ const binaryPath = join(__dirname, "bin", `kode${ext}`);
8
+
9
+ const result = spawnSync(binaryPath, process.argv.slice(2), {
10
+ stdio: "inherit",
11
+ });
12
+
13
+ process.exit(result.status ?? 1);
package/install.js ADDED
@@ -0,0 +1,59 @@
1
+ const { spawnSync } = require("child_process");
2
+ const { existsSync, chmodSync, mkdirSync, writeFileSync } = require("fs");
3
+ const { join } = require("path");
4
+ const https = require("https");
5
+
6
+ const pkg = require("./package.json");
7
+ const version = pkg.version;
8
+ const repo = "sicario-labs/kode";
9
+
10
+ const platformMap = {
11
+ win32: { os: "windows", ext: ".exe" },
12
+ darwin: { os: "darwin", ext: "" },
13
+ linux: { os: "linux", ext: "" },
14
+ };
15
+
16
+ const archMap = {
17
+ x64: "amd64",
18
+ arm64: "arm64",
19
+ };
20
+
21
+ const plat = platformMap[process.platform];
22
+ const arch = archMap[process.arch];
23
+
24
+ if (!plat || !arch) {
25
+ console.error(`Unsupported platform: ${process.platform} ${process.arch}`);
26
+ process.exit(1);
27
+ }
28
+
29
+ const binaryName = `kode-${plat.os}-${arch}${plat.ext}`;
30
+ const url = `https://github.com/${repo}/releases/download/v${version}/${binaryName}`;
31
+ const installDir = join(__dirname, "bin");
32
+ const binaryPath = join(installDir, `kode${plat.ext}`);
33
+
34
+ if (existsSync(binaryPath)) {
35
+ process.exit(0);
36
+ }
37
+
38
+ console.log(`Downloading Kode v${version} (${binaryName})...`);
39
+
40
+ mkdirSync(installDir, { recursive: true });
41
+
42
+ const file = require("fs").createWriteStream(binaryPath);
43
+
44
+ https.get(url, (res) => {
45
+ if (res.statusCode !== 200) {
46
+ console.error(`Download failed (HTTP ${res.statusCode})`);
47
+ console.error(`URL: ${url}`);
48
+ process.exit(1);
49
+ }
50
+ res.pipe(file);
51
+ file.on("finish", () => {
52
+ file.close();
53
+ try { chmodSync(binaryPath, 0o755); } catch {}
54
+ console.log(`Kode v${version} installed to ${binaryPath}`);
55
+ });
56
+ }).on("error", (err) => {
57
+ console.error(`Download error: ${err.message}`);
58
+ process.exit(1);
59
+ });
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@sicario-labs/kode",
3
+ "version": "3.1.2",
4
+ "description": "The safe AI coding agent — zero-config, gatekeeper-verified patches",
5
+ "bin": {
6
+ "kode": "cli.js"
7
+ },
8
+ "scripts": {
9
+ "postinstall": "node install.js"
10
+ },
11
+ "repository": "github:sicario-labs/kode",
12
+ "homepage": "https://trykode.xyz",
13
+ "bugs": "https://github.com/sicario-labs/kode/issues",
14
+ "license": "MIT",
15
+ "engines": { "node": ">=18" },
16
+ "preferUnplugged": true,
17
+ "os": ["win32", "darwin", "linux"],
18
+ "cpu": ["x64", "arm64"],
19
+ "keywords": ["ai", "coding", "agent", "cli", "code-generation", "go"]
20
+ }