@memohjs/af 0.2.0-rc.4
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 +11 -0
- package/bin/af.js +52 -0
- package/package.json +38 -0
package/README.md
ADDED
package/bin/af.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawnSync } = require('node:child_process');
|
|
4
|
+
const path = require('node:path');
|
|
5
|
+
|
|
6
|
+
function detectLibc() {
|
|
7
|
+
if (process.platform !== 'linux') return null;
|
|
8
|
+
try {
|
|
9
|
+
const report = process.report && process.report.getReport ? process.report.getReport() : null;
|
|
10
|
+
const glibc = report && report.header ? report.header.glibcVersionRuntime : null;
|
|
11
|
+
return glibc ? 'gnu' : 'musl';
|
|
12
|
+
} catch {
|
|
13
|
+
return 'musl';
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function resolvePackageName() {
|
|
18
|
+
const key = `${process.platform}-${process.arch}`;
|
|
19
|
+
if (key === 'linux-x64') return '@memohai/af-linux-x64-musl';
|
|
20
|
+
if (key === 'linux-arm64') return '@memohai/af-linux-arm64-musl';
|
|
21
|
+
if (key === 'darwin-x64') return '@memohai/af-darwin-x64';
|
|
22
|
+
if (key === 'darwin-arm64') return '@memohai/af-darwin-arm64';
|
|
23
|
+
if (key === 'win32-x64') return '@memohai/af-win32-x64-msvc';
|
|
24
|
+
const libc = detectLibc();
|
|
25
|
+
throw new Error(`Unsupported platform: ${process.platform}-${process.arch}${libc ? `-${libc}` : ''}`);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function resolveBinaryPath(pkgName) {
|
|
29
|
+
const pkgJson = require.resolve(`${pkgName}/package.json`);
|
|
30
|
+
const pkgRoot = path.dirname(pkgJson);
|
|
31
|
+
const binName = process.platform === 'win32' ? 'af.exe' : 'af';
|
|
32
|
+
return path.join(pkgRoot, 'bin', binName);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function main() {
|
|
36
|
+
try {
|
|
37
|
+
const pkgName = resolvePackageName();
|
|
38
|
+
const binPath = resolveBinaryPath(pkgName);
|
|
39
|
+
const result = spawnSync(binPath, process.argv.slice(2), { stdio: 'inherit' });
|
|
40
|
+
if (result.error) {
|
|
41
|
+
throw result.error;
|
|
42
|
+
}
|
|
43
|
+
process.exit(result.status === null ? 1 : result.status);
|
|
44
|
+
} catch (err) {
|
|
45
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
46
|
+
console.error(`[af npm] ${msg}`);
|
|
47
|
+
console.error('[af npm] Try downloading binary from GitHub Releases: https://github.com/memohai/Auto-Fish/releases');
|
|
48
|
+
process.exit(1);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
main();
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@memohjs/af",
|
|
3
|
+
"version": "0.2.0-rc.4",
|
|
4
|
+
"description": "Auto Fish CLI",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/memohai/Auto-Fish.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/memohai/Auto-Fish",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/memohai/Auto-Fish/issues"
|
|
13
|
+
},
|
|
14
|
+
"bin": {
|
|
15
|
+
"af": "bin/af.js"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"bin/af.js",
|
|
19
|
+
"README.md"
|
|
20
|
+
],
|
|
21
|
+
"keywords": [
|
|
22
|
+
"android",
|
|
23
|
+
"automation",
|
|
24
|
+
"cli",
|
|
25
|
+
"agent",
|
|
26
|
+
"llm"
|
|
27
|
+
],
|
|
28
|
+
"optionalDependencies": {
|
|
29
|
+
"@memohjs/af-linux-x64-musl": "0.2.0-rc.4",
|
|
30
|
+
"@memohjs/af-linux-arm64-musl": "0.2.0-rc.4",
|
|
31
|
+
"@memohjs/af-darwin-x64": "0.2.0-rc.4",
|
|
32
|
+
"@memohjs/af-darwin-arm64": "0.2.0-rc.4",
|
|
33
|
+
"@memohjs/af-win32-x64-msvc": "0.2.0-rc.4"
|
|
34
|
+
},
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=18"
|
|
37
|
+
}
|
|
38
|
+
}
|