krysta 0.1.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.
- package/bin/krysta.js +28 -0
- package/package.json +16 -0
- package/scripts/download-binary.js +64 -0
package/bin/krysta.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { execFileSync } = require("child_process");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const fs = require("fs");
|
|
6
|
+
|
|
7
|
+
const binaryPath = path.join(__dirname, "..", "bin", getBinaryName());
|
|
8
|
+
|
|
9
|
+
if (!fs.existsSync(binaryPath)) {
|
|
10
|
+
console.error("krysta binary not found. Try reinstalling: npm install -g krysta");
|
|
11
|
+
process.exit(1);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
try {
|
|
15
|
+
execFileSync(binaryPath, process.argv.slice(2), { stdio: "inherit" });
|
|
16
|
+
} catch (err) {
|
|
17
|
+
process.exit(err.status || 1);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function getBinaryName() {
|
|
21
|
+
const platform = process.platform;
|
|
22
|
+
const arch = process.arch;
|
|
23
|
+
|
|
24
|
+
if (platform === "win32") return "krysta-probe-windows-x86_64.exe";
|
|
25
|
+
if (platform === "darwin" && arch === "arm64") return "krysta-probe-macos-arm64";
|
|
26
|
+
if (platform === "darwin") return "krysta-probe-macos-x86_64";
|
|
27
|
+
return "krysta-probe-linux-x86_64";
|
|
28
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "krysta",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "AI agent infrastructure security — scan MCP servers for vulnerabilities",
|
|
5
|
+
"bin": {
|
|
6
|
+
"krysta": "./bin/krysta.js"
|
|
7
|
+
},
|
|
8
|
+
"scripts": {
|
|
9
|
+
"postinstall": "node scripts/download-binary.js"
|
|
10
|
+
},
|
|
11
|
+
"keywords": ["mcp", "security", "ai-agents", "vulnerability-scanner"],
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"axios": "^1.6.0"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
const https = require("https");
|
|
2
|
+
const fs = require("fs");
|
|
3
|
+
const path = require("path");
|
|
4
|
+
const { execSync } = require("child_process");
|
|
5
|
+
|
|
6
|
+
const GITHUB_ORG = "KrystaWing";
|
|
7
|
+
const GITHUB_REPO = "krysta-probe";
|
|
8
|
+
const VERSION = "v0.1.0";
|
|
9
|
+
|
|
10
|
+
function getBinaryName() {
|
|
11
|
+
const platform = process.platform;
|
|
12
|
+
const arch = process.arch;
|
|
13
|
+
|
|
14
|
+
if (platform === "win32") return "krysta-probe-windows-x86_64.exe";
|
|
15
|
+
if (platform === "darwin" && arch === "arm64") return "krysta-probe-macos-arm64";
|
|
16
|
+
if (platform === "darwin") return "krysta-probe-macos-x86_64";
|
|
17
|
+
return "krysta-probe-linux-x86_64";
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const binaryName = getBinaryName();
|
|
21
|
+
const downloadUrl = `https://github.com/${GITHUB_ORG}/${GITHUB_REPO}/releases/download/${VERSION}/${binaryName}`;
|
|
22
|
+
const outputPath = path.join(__dirname, "..", "bin", binaryName);
|
|
23
|
+
|
|
24
|
+
console.log(`Downloading krysta binary for ${process.platform}/${process.arch}...`);
|
|
25
|
+
console.log(`From: ${downloadUrl}`);
|
|
26
|
+
|
|
27
|
+
const file = fs.createWriteStream(outputPath);
|
|
28
|
+
|
|
29
|
+
https.get(downloadUrl, (response) => {
|
|
30
|
+
if (response.statusCode === 302 || response.statusCode === 301) {
|
|
31
|
+
https.get(response.headers.location, (redirected) => {
|
|
32
|
+
redirected.pipe(file);
|
|
33
|
+
file.on("finish", () => {
|
|
34
|
+
file.close();
|
|
35
|
+
if (process.platform !== "win32") {
|
|
36
|
+
fs.chmodSync(outputPath, "755");
|
|
37
|
+
}
|
|
38
|
+
console.log("✅ krysta installed successfully");
|
|
39
|
+
console.log("Run: npx krysta probe --deep");
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (response.statusCode !== 200) {
|
|
46
|
+
console.error(`❌ Failed to download binary: HTTP ${response.statusCode}`);
|
|
47
|
+
console.error("Binary not available yet — check https://github.com/KrystaWing/krysta-probe/releases");
|
|
48
|
+
process.exit(0); // don't fail install
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
response.pipe(file);
|
|
53
|
+
file.on("finish", () => {
|
|
54
|
+
file.close();
|
|
55
|
+
if (process.platform !== "win32") {
|
|
56
|
+
fs.chmodSync(outputPath, "755");
|
|
57
|
+
}
|
|
58
|
+
console.log("✅ krysta installed successfully");
|
|
59
|
+
console.log("Run: npx krysta probe --deep");
|
|
60
|
+
});
|
|
61
|
+
}).on("error", (err) => {
|
|
62
|
+
console.error("❌ Download failed:", err.message);
|
|
63
|
+
process.exit(0);
|
|
64
|
+
});
|