@aptove/aptove 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/aptove +77 -0
- package/package.json +43 -0
- package/postinstall.js +60 -0
package/bin/aptove
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* aptove - ACP AI coding agent
|
|
5
|
+
*
|
|
6
|
+
* This script finds and executes the platform-specific binary.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const { execFileSync } = require('child_process');
|
|
10
|
+
const path = require('path');
|
|
11
|
+
const fs = require('fs');
|
|
12
|
+
|
|
13
|
+
const PLATFORM_PACKAGES = {
|
|
14
|
+
'darwin-arm64': '@aptove/aptove-darwin-arm64',
|
|
15
|
+
'darwin-x64': '@aptove/aptove-darwin-x64',
|
|
16
|
+
'linux-arm64': '@aptove/aptove-linux-arm64',
|
|
17
|
+
'linux-x64': '@aptove/aptove-linux-x64',
|
|
18
|
+
'win32-x64': '@aptove/aptove-win32-x64',
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
function getBinaryPath() {
|
|
22
|
+
const platformKey = `${process.platform}-${process.arch}`;
|
|
23
|
+
const packageName = PLATFORM_PACKAGES[platformKey];
|
|
24
|
+
|
|
25
|
+
if (!packageName) {
|
|
26
|
+
console.error(`Unsupported platform: ${platformKey}`);
|
|
27
|
+
console.error('Supported platforms: darwin-arm64, darwin-x64, linux-arm64, linux-x64, win32-x64');
|
|
28
|
+
process.exit(1);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const binaryName = process.platform === 'win32' ? 'aptove.exe' : 'aptove';
|
|
32
|
+
|
|
33
|
+
const possiblePaths = [
|
|
34
|
+
// npm/pnpm hoisted
|
|
35
|
+
path.join(__dirname, '..', packageName, 'bin', binaryName),
|
|
36
|
+
// npm nested node_modules
|
|
37
|
+
path.join(__dirname, '..', '..', packageName, 'bin', binaryName),
|
|
38
|
+
// pnpm virtual store
|
|
39
|
+
path.join(__dirname, '..', 'node_modules', packageName, 'bin', binaryName),
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
for (const binaryPath of possiblePaths) {
|
|
43
|
+
if (fs.existsSync(binaryPath)) {
|
|
44
|
+
return binaryPath;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Try require.resolve as fallback
|
|
49
|
+
try {
|
|
50
|
+
const packagePath = require.resolve(`${packageName}/package.json`);
|
|
51
|
+
const binaryPath = path.join(path.dirname(packagePath), 'bin', binaryName);
|
|
52
|
+
if (fs.existsSync(binaryPath)) {
|
|
53
|
+
return binaryPath;
|
|
54
|
+
}
|
|
55
|
+
} catch (e) {
|
|
56
|
+
// Package not found
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
console.error(`Could not find aptove binary for ${platformKey}`);
|
|
60
|
+
console.error(`Please ensure ${packageName} is installed.`);
|
|
61
|
+
console.error('');
|
|
62
|
+
console.error('Try reinstalling with:');
|
|
63
|
+
console.error(' npm install -g @aptove/aptove');
|
|
64
|
+
process.exit(1);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const binaryPath = getBinaryPath();
|
|
68
|
+
const args = process.argv.slice(2);
|
|
69
|
+
|
|
70
|
+
try {
|
|
71
|
+
execFileSync(binaryPath, args, { stdio: 'inherit' });
|
|
72
|
+
} catch (error) {
|
|
73
|
+
if (error.status !== undefined) {
|
|
74
|
+
process.exit(error.status);
|
|
75
|
+
}
|
|
76
|
+
throw error;
|
|
77
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aptove/aptove",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "ACP AI coding agent — connects to Claude, Gemini, and OpenAI",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/aptove/aptove.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/aptove/aptove#readme",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/aptove/aptove/issues"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"acp",
|
|
16
|
+
"agent",
|
|
17
|
+
"ai",
|
|
18
|
+
"claude",
|
|
19
|
+
"gemini",
|
|
20
|
+
"openai",
|
|
21
|
+
"cli"
|
|
22
|
+
],
|
|
23
|
+
"bin": {
|
|
24
|
+
"aptove": "bin/aptove"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"bin",
|
|
28
|
+
"postinstall.js"
|
|
29
|
+
],
|
|
30
|
+
"scripts": {
|
|
31
|
+
"postinstall": "node postinstall.js"
|
|
32
|
+
},
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=16"
|
|
35
|
+
},
|
|
36
|
+
"optionalDependencies": {
|
|
37
|
+
"@aptove/aptove-darwin-arm64": "0.1.0",
|
|
38
|
+
"@aptove/aptove-darwin-x64": "0.1.0",
|
|
39
|
+
"@aptove/aptove-linux-arm64": "0.1.0",
|
|
40
|
+
"@aptove/aptove-linux-x64": "0.1.0",
|
|
41
|
+
"@aptove/aptove-win32-x64": "0.1.0"
|
|
42
|
+
}
|
|
43
|
+
}
|
package/postinstall.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* aptove postinstall script
|
|
3
|
+
*
|
|
4
|
+
* Verifies the correct platform-specific package was installed
|
|
5
|
+
* and the binary is executable.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const { execSync } = require('child_process');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const fs = require('fs');
|
|
11
|
+
|
|
12
|
+
const PLATFORM_PACKAGES = {
|
|
13
|
+
'darwin-arm64': '@aptove/aptove-darwin-arm64',
|
|
14
|
+
'darwin-x64': '@aptove/aptove-darwin-x64',
|
|
15
|
+
'linux-arm64': '@aptove/aptove-linux-arm64',
|
|
16
|
+
'linux-x64': '@aptove/aptove-linux-x64',
|
|
17
|
+
'win32-x64': '@aptove/aptove-win32-x64',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
function main() {
|
|
21
|
+
const platformKey = `${process.platform}-${process.arch}`;
|
|
22
|
+
const packageName = PLATFORM_PACKAGES[platformKey];
|
|
23
|
+
|
|
24
|
+
if (!packageName) {
|
|
25
|
+
console.warn(`⚠️ aptove: Unsupported platform ${platformKey}`);
|
|
26
|
+
console.warn(' Supported platforms: darwin-arm64, darwin-x64, linux-arm64, linux-x64, win32-x64');
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
try {
|
|
31
|
+
const packagePath = require.resolve(`${packageName}/package.json`);
|
|
32
|
+
const binaryName = process.platform === 'win32' ? 'aptove.exe' : 'aptove';
|
|
33
|
+
const binaryPath = path.join(path.dirname(packagePath), 'bin', binaryName);
|
|
34
|
+
|
|
35
|
+
if (!fs.existsSync(binaryPath)) {
|
|
36
|
+
console.warn(`⚠️ aptove: Binary not found at ${binaryPath}`);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (process.platform !== 'win32') {
|
|
41
|
+
try {
|
|
42
|
+
fs.chmodSync(binaryPath, 0o755);
|
|
43
|
+
} catch (e) {
|
|
44
|
+
// Not critical
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
try {
|
|
49
|
+
execSync(`"${binaryPath}" --version`, { stdio: 'pipe' });
|
|
50
|
+
console.log(`✓ aptove installed successfully for ${platformKey}`);
|
|
51
|
+
} catch (e) {
|
|
52
|
+
console.warn(`⚠️ aptove: Binary exists but failed to execute on ${platformKey}`);
|
|
53
|
+
}
|
|
54
|
+
} catch (e) {
|
|
55
|
+
console.warn(`⚠️ aptove: Platform package ${packageName} not installed`);
|
|
56
|
+
console.warn(' This is expected on CI or unsupported platforms');
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
main();
|