vtrix-skills 1.0.0 → 1.0.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.
- package/bin/vtrix-skills +0 -0
- package/package.json +2 -6
- package/bin/vtrix-skills.js +0 -15
- package/install.js +0 -88
package/bin/vtrix-skills
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vtrix-skills",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "CLI tool for discovering and installing agent skills from Vtrix SkillHub",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vtrix",
|
|
@@ -18,14 +18,10 @@
|
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"author": "Vtrix Team",
|
|
20
20
|
"bin": {
|
|
21
|
-
"vtrix-skills": "
|
|
22
|
-
},
|
|
23
|
-
"scripts": {
|
|
24
|
-
"postinstall": "node ./install.js"
|
|
21
|
+
"vtrix-skills": "bin/vtrix-skills"
|
|
25
22
|
},
|
|
26
23
|
"files": [
|
|
27
24
|
"bin/",
|
|
28
|
-
"install.js",
|
|
29
25
|
"README.md"
|
|
30
26
|
],
|
|
31
27
|
"engines": {
|
package/bin/vtrix-skills.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const { spawn } = require('child_process');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
|
|
6
|
-
const binPath = path.join(__dirname, 'vtrix-skills');
|
|
7
|
-
|
|
8
|
-
const child = spawn(binPath, process.argv.slice(2), {
|
|
9
|
-
stdio: 'inherit',
|
|
10
|
-
windowsHide: true
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
child.on('exit', (code) => {
|
|
14
|
-
process.exit(code);
|
|
15
|
-
});
|
package/install.js
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const https = require('https');
|
|
4
|
-
const fs = require('fs');
|
|
5
|
-
const path = require('path');
|
|
6
|
-
const { execSync } = require('child_process');
|
|
7
|
-
|
|
8
|
-
const GITHUB_RELEASE_URL = 'https://github.com/vtrix/vtrix-skills/releases/latest/download';
|
|
9
|
-
|
|
10
|
-
function getPlatform() {
|
|
11
|
-
const platform = process.platform;
|
|
12
|
-
const arch = process.arch;
|
|
13
|
-
|
|
14
|
-
if (platform === 'darwin') {
|
|
15
|
-
if (arch === 'x64') return 'macos-x64';
|
|
16
|
-
if (arch === 'arm64') return 'macos-arm64';
|
|
17
|
-
} else if (platform === 'linux') {
|
|
18
|
-
if (arch === 'x64') return 'linux-x64';
|
|
19
|
-
if (arch === 'arm64') return 'linux-arm64';
|
|
20
|
-
} else if (platform === 'win32') {
|
|
21
|
-
if (arch === 'x64') return 'windows-x64';
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
throw new Error(`Unsupported platform: ${platform}-${arch}`);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function downloadBinary() {
|
|
28
|
-
const platformName = getPlatform();
|
|
29
|
-
const binaryName = process.platform === 'win32' ? 'vtrix-skills.exe' : 'vtrix-skills';
|
|
30
|
-
const downloadUrl = `${GITHUB_RELEASE_URL}/vtrix-skills-${platformName}${process.platform === 'win32' ? '.exe' : ''}`;
|
|
31
|
-
const binDir = path.join(__dirname, 'bin');
|
|
32
|
-
const binPath = path.join(binDir, binaryName);
|
|
33
|
-
|
|
34
|
-
console.log(`Downloading vtrix-skills for ${platformName}...`);
|
|
35
|
-
console.log(`From: ${downloadUrl}`);
|
|
36
|
-
|
|
37
|
-
if (!fs.existsSync(binDir)) {
|
|
38
|
-
fs.mkdirSync(binDir, { recursive: true });
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const file = fs.createWriteStream(binPath);
|
|
42
|
-
|
|
43
|
-
https.get(downloadUrl, (response) => {
|
|
44
|
-
if (response.statusCode === 302 || response.statusCode === 301) {
|
|
45
|
-
// Follow redirect
|
|
46
|
-
https.get(response.headers.location, (res) => {
|
|
47
|
-
res.pipe(file);
|
|
48
|
-
file.on('finish', () => {
|
|
49
|
-
file.close();
|
|
50
|
-
fs.chmodSync(binPath, 0o755);
|
|
51
|
-
console.log('✓ vtrix-skills installed successfully!');
|
|
52
|
-
});
|
|
53
|
-
}).on('error', (err) => {
|
|
54
|
-
fs.unlinkSync(binPath);
|
|
55
|
-
throw err;
|
|
56
|
-
});
|
|
57
|
-
} else if (response.statusCode === 200) {
|
|
58
|
-
response.pipe(file);
|
|
59
|
-
file.on('finish', () => {
|
|
60
|
-
file.close();
|
|
61
|
-
fs.chmodSync(binPath, 0o755);
|
|
62
|
-
console.log('✓ vtrix-skills installed successfully!');
|
|
63
|
-
});
|
|
64
|
-
} else {
|
|
65
|
-
throw new Error(`Failed to download: HTTP ${response.statusCode}`);
|
|
66
|
-
}
|
|
67
|
-
}).on('error', (err) => {
|
|
68
|
-
fs.unlinkSync(binPath);
|
|
69
|
-
console.error('Download failed. Installing local binary...');
|
|
70
|
-
// Fallback: copy local binary if available
|
|
71
|
-
const localBinary = path.join(__dirname, '..', 'target', 'release', binaryName);
|
|
72
|
-
if (fs.existsSync(localBinary)) {
|
|
73
|
-
fs.copyFileSync(localBinary, binPath);
|
|
74
|
-
fs.chmodSync(binPath, 0o755);
|
|
75
|
-
console.log('✓ Local binary installed successfully!');
|
|
76
|
-
} else {
|
|
77
|
-
throw new Error('No binary available');
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
try {
|
|
83
|
-
downloadBinary();
|
|
84
|
-
} catch (error) {
|
|
85
|
-
console.error('Installation failed:', error.message);
|
|
86
|
-
console.error('\nPlease install manually from: https://github.com/vtrix/vtrix-skills/releases');
|
|
87
|
-
process.exit(1);
|
|
88
|
-
}
|