@leonmw/agw 0.0.0-stage → 1.0.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/agw.js +51 -0
- package/package.json +22 -4
- package/README.md +0 -3
package/bin/agw.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawnSync } = require("node:child_process");
|
|
4
|
+
|
|
5
|
+
const platformPackageMap = {
|
|
6
|
+
"linux-x64": { packageName: "@leonmw/agw-linux-x64", binaryPath: "bin/agw" },
|
|
7
|
+
"darwin-arm64": { packageName: "@leonmw/agw-darwin-arm64", binaryPath: "bin/agw" },
|
|
8
|
+
"win32-x64": { packageName: "@leonmw/agw-win32-x64", binaryPath: "bin/agw.exe" }
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
function getPackageForHost() {
|
|
12
|
+
const key = `${process.platform}-${process.arch}`;
|
|
13
|
+
return platformPackageMap[key] ?? null;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function resolveHostBinaryPath() {
|
|
17
|
+
const match = getPackageForHost();
|
|
18
|
+
if (!match) {
|
|
19
|
+
const supported = Object.keys(platformPackageMap).join(", ");
|
|
20
|
+
throw new Error(`Unsupported platform '${process.platform}-${process.arch}'. Supported: ${supported}.`);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
try {
|
|
24
|
+
return require.resolve(`${match.packageName}/${match.binaryPath}`);
|
|
25
|
+
} catch {
|
|
26
|
+
throw new Error(
|
|
27
|
+
`Missing platform binary package '${match.packageName}'. Reinstall with 'npm i -g @leonmw/agw'.`
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function run() {
|
|
33
|
+
const binaryPath = resolveHostBinaryPath();
|
|
34
|
+
const result = spawnSync(binaryPath, process.argv.slice(2), {
|
|
35
|
+
stdio: "inherit"
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
if (result.error) {
|
|
39
|
+
throw result.error;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
process.exit(result.status ?? 1);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
try {
|
|
46
|
+
run();
|
|
47
|
+
} catch (error) {
|
|
48
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
49
|
+
console.error(`agw launcher error: ${message}`);
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leonmw/agw",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Run Antigravity CLI in Docker with strict isolation, persistent state, and profile management.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"bin": {
|
|
7
|
+
"agw": "bin/agw.js",
|
|
8
|
+
"agy-wrap": "bin/agw.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"bin/"
|
|
12
|
+
],
|
|
13
|
+
"optionalDependencies": {
|
|
14
|
+
"@leonmw/agw-linux-x64": "1.0.0",
|
|
15
|
+
"@leonmw/agw-darwin-arm64": "1.0.0",
|
|
16
|
+
"@leonmw/agw-win32-x64": "1.0.0"
|
|
17
|
+
},
|
|
18
|
+
"engines": {
|
|
19
|
+
"node": ">=18"
|
|
20
|
+
},
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
}
|
|
24
|
+
}
|
package/README.md
DELETED