konductor 0.4.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/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # konductor
2
+
3
+ Spec-driven development orchestrator for [Kiro CLI](https://kiro.dev).
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install -g konductor
9
+ ```
10
+
11
+ Or run without installing:
12
+
13
+ ```bash
14
+ npx konductor mcp
15
+ ```
16
+
17
+ The npm package automatically downloads the correct prebuilt binary for your platform (macOS/Linux, x64/arm64).
18
+
19
+ ## Usage
20
+
21
+ ```bash
22
+ kiro-cli --agent konductor
23
+ ```
24
+
25
+ ## Documentation
26
+
27
+ See the [main repository](https://github.com/bnusunny/konductor) for full documentation.
28
+
29
+ ## License
30
+
31
+ MIT
package/bin/konductor ADDED
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ const path = require("path");
5
+ const { spawnSync } = require("child_process");
6
+ const fs = require("fs");
7
+
8
+ const bin = path.join(__dirname, "konductor-native");
9
+
10
+ if (!fs.existsSync(bin)) {
11
+ console.error("Error: konductor binary not found.");
12
+ console.error("Try reinstalling: npm install -g konductor");
13
+ console.error("Or use the shell installer: https://github.com/bnusunny/konductor");
14
+ process.exit(1);
15
+ }
16
+
17
+ const result = spawnSync(bin, process.argv.slice(2), { stdio: "inherit" });
18
+ process.exit(result.status ?? 1);
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "konductor",
3
+ "version": "0.4.1",
4
+ "description": "Spec-driven development orchestrator for Kiro CLI — MCP server and hook processor",
5
+ "bin": {
6
+ "konductor": "bin/konductor"
7
+ },
8
+ "scripts": {
9
+ "postinstall": "node scripts/postinstall.js"
10
+ },
11
+ "os": [
12
+ "darwin",
13
+ "linux"
14
+ ],
15
+ "cpu": [
16
+ "x64",
17
+ "arm64"
18
+ ],
19
+ "engines": {
20
+ "node": ">=16"
21
+ },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/bnusunny/konductor.git"
25
+ },
26
+ "homepage": "https://github.com/bnusunny/konductor",
27
+ "license": "MIT",
28
+ "keywords": [
29
+ "kiro",
30
+ "mcp",
31
+ "orchestrator",
32
+ "spec-driven",
33
+ "development"
34
+ ]
35
+ }
@@ -0,0 +1,80 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ const https = require("https");
5
+ const http = require("http");
6
+ const fs = require("fs");
7
+ const path = require("path");
8
+ const crypto = require("crypto");
9
+
10
+ const REPO = "bnusunny/konductor";
11
+ const PLATFORM_MAP = {
12
+ "darwin-x64": "konductor-macos-x86_64",
13
+ "darwin-arm64": "konductor-macos-arm64",
14
+ "linux-x64": "konductor-linux-x86_64",
15
+ "linux-arm64": "konductor-linux-arm64",
16
+ };
17
+
18
+ function getAssetName() {
19
+ const key = `${process.platform}-${process.arch}`;
20
+ const name = PLATFORM_MAP[key];
21
+ if (!name) {
22
+ throw new Error(`Unsupported platform: ${key}. Supported: ${Object.keys(PLATFORM_MAP).join(", ")}`);
23
+ }
24
+ return name;
25
+ }
26
+
27
+ function fetch(url) {
28
+ return new Promise((resolve, reject) => {
29
+ const mod = url.startsWith("https") ? https : http;
30
+ mod.get(url, { headers: { "User-Agent": "konductor-npm" } }, (res) => {
31
+ if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
32
+ return fetch(res.headers.location).then(resolve, reject);
33
+ }
34
+ if (res.statusCode !== 200) {
35
+ return reject(new Error(`HTTP ${res.statusCode} for ${url}`));
36
+ }
37
+ const chunks = [];
38
+ res.on("data", (c) => chunks.push(c));
39
+ res.on("end", () => resolve(Buffer.concat(chunks)));
40
+ res.on("error", reject);
41
+ }).on("error", reject);
42
+ });
43
+ }
44
+
45
+ async function main() {
46
+ const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, "..", "package.json"), "utf8"));
47
+ const version = pkg.version;
48
+ const asset = getAssetName();
49
+ const baseUrl = `https://github.com/${REPO}/releases/download/v${version}`;
50
+ const binDir = path.join(__dirname, "..", "bin");
51
+ const dest = path.join(binDir, "konductor-native");
52
+
53
+ console.log(`Downloading konductor v${version} (${asset})...`);
54
+
55
+ const binary = await fetch(`${baseUrl}/${asset}`);
56
+
57
+ // Verify checksum
58
+ try {
59
+ const checksumData = await fetch(`${baseUrl}/${asset}.sha256`);
60
+ const expected = checksumData.toString("utf8").trim().split(/\s+/)[0];
61
+ const actual = crypto.createHash("sha256").update(binary).digest("hex");
62
+ if (expected !== actual) {
63
+ throw new Error(`Checksum mismatch: expected ${expected}, got ${actual}`);
64
+ }
65
+ console.log("Checksum verified.");
66
+ } catch (e) {
67
+ console.warn(`Warning: checksum verification skipped (${e.message})`);
68
+ }
69
+
70
+ fs.mkdirSync(binDir, { recursive: true });
71
+ fs.writeFileSync(dest, binary);
72
+ fs.chmodSync(dest, 0o755);
73
+ console.log("konductor binary installed.");
74
+ }
75
+
76
+ main().catch((err) => {
77
+ console.warn(`Warning: failed to download konductor binary: ${err.message}`);
78
+ console.warn("The binary will need to be installed manually. See: https://github.com/bnusunny/konductor");
79
+ process.exit(0); // Don't fail npm install
80
+ });
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ const fs = require("fs");
5
+ const path = require("path");
6
+
7
+ const version = fs.readFileSync(path.join(__dirname, "..", "..", "version.txt"), "utf8").trim();
8
+ const pkgPath = path.join(__dirname, "..", "package.json");
9
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
10
+ pkg.version = version;
11
+ fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + "\n");
12
+ console.log(`Synced version to ${version}`);