qryon 0.19.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 +48 -0
- package/bin/qryon-wrapper.js +36 -0
- package/bin/rma-wrapper.js +36 -0
- package/install.js +150 -0
- package/package.json +53 -0
package/README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Qryon
|
|
2
|
+
|
|
3
|
+
Ultra-fast Rust-native code intelligence and security analysis platform for large enterprise monorepos.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g rma-cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Scan current directory
|
|
15
|
+
qryon scan .
|
|
16
|
+
|
|
17
|
+
# Scan with AI-powered analysis
|
|
18
|
+
qryon scan ./src --ai
|
|
19
|
+
|
|
20
|
+
# Watch mode for continuous analysis
|
|
21
|
+
qryon watch .
|
|
22
|
+
|
|
23
|
+
# Generate SARIF output for CI/CD
|
|
24
|
+
qryon scan . --output sarif -f results.sarif
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Alternative Installation
|
|
28
|
+
|
|
29
|
+
If npm installation fails, try:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# Cargo (requires Rust)
|
|
33
|
+
cargo install rma-cli
|
|
34
|
+
|
|
35
|
+
# Shell script (Linux/macOS)
|
|
36
|
+
curl -fsSL https://raw.githubusercontent.com/bumahkib7/qryon/master/install.sh | bash
|
|
37
|
+
|
|
38
|
+
# Homebrew (macOS/Linux)
|
|
39
|
+
brew install bumahkib7/tap/qryon
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Documentation
|
|
43
|
+
|
|
44
|
+
Full documentation: https://github.com/bumahkib7/qryon
|
|
45
|
+
|
|
46
|
+
## License
|
|
47
|
+
|
|
48
|
+
MIT OR Apache-2.0
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Qryon wrapper script for npm
|
|
5
|
+
* Spawns the native Qryon binary with all arguments passed through
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const { spawn } = require('child_process');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const fs = require('fs');
|
|
11
|
+
|
|
12
|
+
const BINARY_NAME = process.platform === 'win32' ? 'qryon.exe' : 'qryon';
|
|
13
|
+
const binaryPath = path.join(__dirname, BINARY_NAME);
|
|
14
|
+
|
|
15
|
+
// Check if binary exists
|
|
16
|
+
if (!fs.existsSync(binaryPath)) {
|
|
17
|
+
console.error('Error: Qryon binary not found.');
|
|
18
|
+
console.error('Try reinstalling: npm install -g qryon');
|
|
19
|
+
console.error('Or install directly: cargo install rma-cli');
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Spawn the binary with all arguments
|
|
24
|
+
const child = spawn(binaryPath, process.argv.slice(2), {
|
|
25
|
+
stdio: 'inherit',
|
|
26
|
+
windowsHide: true,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
child.on('error', (err) => {
|
|
30
|
+
console.error(`Failed to start Qryon: ${err.message}`);
|
|
31
|
+
process.exit(1);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
child.on('close', (code) => {
|
|
35
|
+
process.exit(code || 0);
|
|
36
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* RMA wrapper script for npm
|
|
5
|
+
* Spawns the native RMA binary with all arguments passed through
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const { spawn } = require('child_process');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const fs = require('fs');
|
|
11
|
+
|
|
12
|
+
const BINARY_NAME = process.platform === 'win32' ? 'rma.exe' : 'rma';
|
|
13
|
+
const binaryPath = path.join(__dirname, BINARY_NAME);
|
|
14
|
+
|
|
15
|
+
// Check if binary exists
|
|
16
|
+
if (!fs.existsSync(binaryPath)) {
|
|
17
|
+
console.error('Error: RMA binary not found.');
|
|
18
|
+
console.error('Try reinstalling: npm install -g rma-cli');
|
|
19
|
+
console.error('Or install directly: cargo install rma-cli');
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Spawn the binary with all arguments
|
|
24
|
+
const child = spawn(binaryPath, process.argv.slice(2), {
|
|
25
|
+
stdio: 'inherit',
|
|
26
|
+
windowsHide: true,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
child.on('error', (err) => {
|
|
30
|
+
console.error(`Failed to start RMA: ${err.message}`);
|
|
31
|
+
process.exit(1);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
child.on('close', (code) => {
|
|
35
|
+
process.exit(code || 0);
|
|
36
|
+
});
|
package/install.js
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Qryon npm package installer
|
|
5
|
+
* Downloads the pre-built binary for the current platform on npm install
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const https = require('https');
|
|
9
|
+
const http = require('http');
|
|
10
|
+
const fs = require('fs');
|
|
11
|
+
const path = require('path');
|
|
12
|
+
const { execFileSync } = require('child_process');
|
|
13
|
+
const os = require('os');
|
|
14
|
+
|
|
15
|
+
const REPO = 'bumahkib7/qryon';
|
|
16
|
+
const BINARY_NAME = process.platform === 'win32' ? 'qryon.exe' : 'qryon';
|
|
17
|
+
const BIN_DIR = path.join(__dirname, 'bin');
|
|
18
|
+
|
|
19
|
+
function getPlatform() {
|
|
20
|
+
const platform = os.platform();
|
|
21
|
+
const arch = os.arch();
|
|
22
|
+
|
|
23
|
+
const platforms = {
|
|
24
|
+
'darwin-x64': 'x86_64-apple-darwin',
|
|
25
|
+
'darwin-arm64': 'aarch64-apple-darwin',
|
|
26
|
+
'linux-x64': 'x86_64-unknown-linux-gnu',
|
|
27
|
+
'linux-arm64': 'aarch64-unknown-linux-gnu',
|
|
28
|
+
'win32-x64': 'x86_64-pc-windows-msvc',
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const key = `${platform}-${arch}`;
|
|
32
|
+
const target = platforms[key];
|
|
33
|
+
|
|
34
|
+
if (!target) {
|
|
35
|
+
throw new Error(`Unsupported platform: ${key}. Supported: ${Object.keys(platforms).join(', ')}`);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return { target, ext: platform === 'win32' ? 'zip' : 'tar.gz' };
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function getVersion() {
|
|
42
|
+
const packageJson = require('./package.json');
|
|
43
|
+
return packageJson.version;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function downloadFile(url) {
|
|
47
|
+
return new Promise((resolve, reject) => {
|
|
48
|
+
const client = url.startsWith('https') ? https : http;
|
|
49
|
+
|
|
50
|
+
client.get(url, { headers: { 'User-Agent': 'qryon-npm-installer' } }, (response) => {
|
|
51
|
+
// Handle redirects
|
|
52
|
+
if (response.statusCode >= 300 && response.statusCode < 400 && response.headers.location) {
|
|
53
|
+
return downloadFile(response.headers.location).then(resolve).catch(reject);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (response.statusCode !== 200) {
|
|
57
|
+
reject(new Error(`Failed to download: HTTP ${response.statusCode}`));
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const chunks = [];
|
|
62
|
+
response.on('data', (chunk) => chunks.push(chunk));
|
|
63
|
+
response.on('end', () => resolve(Buffer.concat(chunks)));
|
|
64
|
+
response.on('error', reject);
|
|
65
|
+
}).on('error', reject);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function extractTarGz(buffer, destDir) {
|
|
70
|
+
// Safe extraction using execFileSync with explicit arguments (no shell interpolation)
|
|
71
|
+
const tmpFile = path.join(os.tmpdir(), `qryon-${Date.now()}.tar.gz`);
|
|
72
|
+
fs.writeFileSync(tmpFile, buffer);
|
|
73
|
+
|
|
74
|
+
try {
|
|
75
|
+
execFileSync('tar', ['-xzf', tmpFile, '-C', destDir], { stdio: 'pipe' });
|
|
76
|
+
} finally {
|
|
77
|
+
fs.unlinkSync(tmpFile);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function extractZip(buffer, destDir) {
|
|
82
|
+
const tmpFile = path.join(os.tmpdir(), `qryon-${Date.now()}.zip`);
|
|
83
|
+
fs.writeFileSync(tmpFile, buffer);
|
|
84
|
+
|
|
85
|
+
try {
|
|
86
|
+
if (process.platform === 'win32') {
|
|
87
|
+
execFileSync('powershell', [
|
|
88
|
+
'-command',
|
|
89
|
+
`Expand-Archive -Path '${tmpFile}' -DestinationPath '${destDir}'`
|
|
90
|
+
], { stdio: 'pipe' });
|
|
91
|
+
} else {
|
|
92
|
+
execFileSync('unzip', ['-o', tmpFile, '-d', destDir], { stdio: 'pipe' });
|
|
93
|
+
}
|
|
94
|
+
} finally {
|
|
95
|
+
fs.unlinkSync(tmpFile);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
async function install() {
|
|
100
|
+
console.log('Installing Qryon binary...');
|
|
101
|
+
|
|
102
|
+
const { target, ext } = getPlatform();
|
|
103
|
+
const version = getVersion();
|
|
104
|
+
|
|
105
|
+
console.log(` Platform: ${target}`);
|
|
106
|
+
console.log(` Version: v${version}`);
|
|
107
|
+
|
|
108
|
+
const downloadUrl = `https://github.com/${REPO}/releases/download/v${version}/qryon-${target}.${ext}`;
|
|
109
|
+
console.log(` Downloading from: ${downloadUrl}`);
|
|
110
|
+
|
|
111
|
+
// Ensure bin directory exists
|
|
112
|
+
if (!fs.existsSync(BIN_DIR)) {
|
|
113
|
+
fs.mkdirSync(BIN_DIR, { recursive: true });
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
try {
|
|
117
|
+
const buffer = await downloadFile(downloadUrl);
|
|
118
|
+
console.log(` Downloaded ${(buffer.length / 1024 / 1024).toFixed(2)} MB`);
|
|
119
|
+
|
|
120
|
+
if (ext === 'zip') {
|
|
121
|
+
extractZip(buffer, BIN_DIR);
|
|
122
|
+
} else {
|
|
123
|
+
extractTarGz(buffer, BIN_DIR);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const binaryPath = path.join(BIN_DIR, BINARY_NAME);
|
|
127
|
+
|
|
128
|
+
// Make executable on Unix
|
|
129
|
+
if (process.platform !== 'win32') {
|
|
130
|
+
fs.chmodSync(binaryPath, 0o755);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Verify installation
|
|
134
|
+
if (fs.existsSync(binaryPath)) {
|
|
135
|
+
console.log(` Binary installed: ${binaryPath}`);
|
|
136
|
+
console.log(' Qryon installed successfully!');
|
|
137
|
+
} else {
|
|
138
|
+
throw new Error(`Binary not found at ${binaryPath}`);
|
|
139
|
+
}
|
|
140
|
+
} catch (error) {
|
|
141
|
+
console.error(`\nFailed to download pre-built binary: ${error.message}`);
|
|
142
|
+
console.error('\nAlternative installation methods:');
|
|
143
|
+
console.error(' 1. cargo install rma-cli');
|
|
144
|
+
console.error(' 2. curl -fsSL https://raw.githubusercontent.com/bumahkib7/qryon/master/install.sh | bash');
|
|
145
|
+
console.error(' 3. brew install bumahkib7/tap/qryon (macOS)');
|
|
146
|
+
process.exit(1);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
install();
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "qryon",
|
|
3
|
+
"version": "0.19.1",
|
|
4
|
+
"description": "Qryon - Ultra-fast code intelligence and security analyzer for polyglot projects",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"security",
|
|
7
|
+
"static-analysis",
|
|
8
|
+
"linter",
|
|
9
|
+
"sast",
|
|
10
|
+
"code-analysis",
|
|
11
|
+
"vulnerability",
|
|
12
|
+
"rust",
|
|
13
|
+
"javascript",
|
|
14
|
+
"typescript",
|
|
15
|
+
"python",
|
|
16
|
+
"go",
|
|
17
|
+
"java"
|
|
18
|
+
],
|
|
19
|
+
"homepage": "https://github.com/bumahkib7/qryon",
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/bumahkib7/qryon/issues"
|
|
22
|
+
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/bumahkib7/qryon.git"
|
|
26
|
+
},
|
|
27
|
+
"license": "MIT OR Apache-2.0",
|
|
28
|
+
"author": "bumahkib7",
|
|
29
|
+
"bin": {
|
|
30
|
+
"qryon": "./bin/qryon-wrapper.js"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"postinstall": "node install.js",
|
|
34
|
+
"test": "node bin/qryon-wrapper.js --version"
|
|
35
|
+
},
|
|
36
|
+
"engines": {
|
|
37
|
+
"node": ">=14.0.0"
|
|
38
|
+
},
|
|
39
|
+
"os": [
|
|
40
|
+
"darwin",
|
|
41
|
+
"linux",
|
|
42
|
+
"win32"
|
|
43
|
+
],
|
|
44
|
+
"cpu": [
|
|
45
|
+
"x64",
|
|
46
|
+
"arm64"
|
|
47
|
+
],
|
|
48
|
+
"files": [
|
|
49
|
+
"bin/",
|
|
50
|
+
"install.js",
|
|
51
|
+
"README.md"
|
|
52
|
+
]
|
|
53
|
+
}
|