@openpaw-ai/openpaw 0.1.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/openpaw +59 -0
- package/package.json +26 -0
package/bin/openpaw
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawn } = require("child_process");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const fs = require("fs");
|
|
6
|
+
|
|
7
|
+
const PLATFORM_MAP = {
|
|
8
|
+
darwin: { arm64: "darwin-arm64", x64: "darwin-x64" },
|
|
9
|
+
linux: { arm64: "linux-arm64", x64: "linux-x64" },
|
|
10
|
+
win32: { x64: "win32-x64" },
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
function getBinaryPath() {
|
|
14
|
+
const platformPkgs = PLATFORM_MAP[process.platform];
|
|
15
|
+
if (!platformPkgs) {
|
|
16
|
+
console.error(`Unsupported platform: ${process.platform}`);
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const archPkg = platformPkgs[process.arch];
|
|
21
|
+
if (!archPkg) {
|
|
22
|
+
console.error(
|
|
23
|
+
`Unsupported architecture: ${process.arch} on ${process.platform}`
|
|
24
|
+
);
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const pkgName = `@openpaw-ai/${archPkg}`;
|
|
29
|
+
const ext = process.platform === "win32" ? ".exe" : "";
|
|
30
|
+
const binaryName = `openpaw${ext}`;
|
|
31
|
+
|
|
32
|
+
try {
|
|
33
|
+
const pkgDir = path.dirname(require.resolve(`${pkgName}/package.json`));
|
|
34
|
+
const binPath = path.join(pkgDir, binaryName);
|
|
35
|
+
if (fs.existsSync(binPath)) {
|
|
36
|
+
return binPath;
|
|
37
|
+
}
|
|
38
|
+
} catch {
|
|
39
|
+
// Package not installed
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
console.error(
|
|
43
|
+
`Could not find the OpenPaw binary for ${process.platform}-${process.arch}.`
|
|
44
|
+
);
|
|
45
|
+
console.error(`Expected package: ${pkgName}`);
|
|
46
|
+
console.error(`Try reinstalling: npm install -g openpaw`);
|
|
47
|
+
process.exit(1);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const binary = getBinaryPath();
|
|
51
|
+
const child = spawn(binary, process.argv.slice(2), { stdio: "inherit" });
|
|
52
|
+
|
|
53
|
+
for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) {
|
|
54
|
+
process.on(signal, () => child.kill(signal));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
child.on("close", (code) => {
|
|
58
|
+
process.exit(code ?? 1);
|
|
59
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@openpaw-ai/openpaw",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "AI-powered agent management platform",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/WynterJones/OpenPaw"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"bin": {
|
|
11
|
+
"openpaw": "bin/openpaw"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"bin/"
|
|
15
|
+
],
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=18"
|
|
18
|
+
},
|
|
19
|
+
"optionalDependencies": {
|
|
20
|
+
"@openpaw-ai/darwin-arm64": "0.1.1",
|
|
21
|
+
"@openpaw-ai/darwin-x64": "0.1.1",
|
|
22
|
+
"@openpaw-ai/linux-x64": "0.1.1",
|
|
23
|
+
"@openpaw-ai/linux-arm64": "0.1.1",
|
|
24
|
+
"@openpaw-ai/win32-x64": "0.1.1"
|
|
25
|
+
}
|
|
26
|
+
}
|