@zzp123/hapi 0.15.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/bin/hapi.cjs +41 -0
- package/package.json +19 -0
package/bin/hapi.cjs
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { execFileSync } = require('child_process');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
const platform = process.platform;
|
|
7
|
+
const arch = process.arch;
|
|
8
|
+
const pkgName = `@zzp123/hapi-${platform}-${arch}`;
|
|
9
|
+
|
|
10
|
+
function getBinaryPath() {
|
|
11
|
+
try {
|
|
12
|
+
const pkgPath = require.resolve(`${pkgName}/package.json`);
|
|
13
|
+
const binName = platform === 'win32' ? 'hapi.exe' : 'hapi';
|
|
14
|
+
return path.join(path.dirname(pkgPath), 'bin', binName);
|
|
15
|
+
} catch (e) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const binPath = getBinaryPath();
|
|
21
|
+
|
|
22
|
+
if (!binPath) {
|
|
23
|
+
console.error(`Unsupported platform: ${platform}-${arch}`);
|
|
24
|
+
console.error('');
|
|
25
|
+
console.error('Supported platforms:');
|
|
26
|
+
console.error(' - linux-x64');
|
|
27
|
+
console.error('');
|
|
28
|
+
console.error('You can download the binary manually from:');
|
|
29
|
+
console.error(' https://gitee.com/Mr_zoupeng/hapi/releases');
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
try {
|
|
34
|
+
execFileSync(binPath, process.argv.slice(2), { stdio: 'inherit' });
|
|
35
|
+
} catch (e) {
|
|
36
|
+
if (e.status !== undefined) {
|
|
37
|
+
process.exit(e.status);
|
|
38
|
+
}
|
|
39
|
+
console.error(`Failed to execute ${binPath}:`, e.message);
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@zzp123/hapi",
|
|
3
|
+
"version": "0.15.1",
|
|
4
|
+
"description": "HAPI - App for agentic coding with Claude Code CLI support",
|
|
5
|
+
"author": "zzp123",
|
|
6
|
+
"license": "AGPL-3.0-only",
|
|
7
|
+
"bin": {
|
|
8
|
+
"hapi": "bin/hapi.cjs"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"bin/hapi.cjs"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"postinstall": "node -e \"try{require('fs').chmodSync(require('path').join(__dirname,'bin','hapi.cjs'),0o755)}catch(e){}\""
|
|
15
|
+
},
|
|
16
|
+
"optionalDependencies": {
|
|
17
|
+
"@zzp123/hapi-linux-x64": "0.15.1"
|
|
18
|
+
}
|
|
19
|
+
}
|