@chaitin-ai/octobus 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/octobus.js +41 -0
- package/package.json +43 -0
package/bin/octobus.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const { spawnSync } = require("node:child_process");
|
|
5
|
+
const path = require("node:path");
|
|
6
|
+
|
|
7
|
+
const platformPackages = {
|
|
8
|
+
"linux-x64": { name: "@chaitin-ai/octobus-linux-x64", binary: "octobus" },
|
|
9
|
+
"linux-arm64": { name: "@chaitin-ai/octobus-linux-arm64", binary: "octobus" },
|
|
10
|
+
"darwin-x64": { name: "@chaitin-ai/octobus-darwin-x64", binary: "octobus" },
|
|
11
|
+
"darwin-arm64": { name: "@chaitin-ai/octobus-darwin-arm64", binary: "octobus" },
|
|
12
|
+
"win32-x64": { name: "@chaitin-ai/octobus-win32-x64", binary: "octobus.exe" },
|
|
13
|
+
"win32-arm64": { name: "@chaitin-ai/octobus-win32-arm64", binary: "octobus.exe" }
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const platformKey = `${process.platform}-${process.arch}`;
|
|
17
|
+
const platformPackage = platformPackages[platformKey];
|
|
18
|
+
|
|
19
|
+
if (!platformPackage) {
|
|
20
|
+
console.error(`OctoBus does not provide an npm binary package for ${platformKey}.`);
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
let packageJSON;
|
|
25
|
+
try {
|
|
26
|
+
packageJSON = require.resolve(`${platformPackage.name}/package.json`);
|
|
27
|
+
} catch (error) {
|
|
28
|
+
console.error(`OctoBus platform package ${platformPackage.name} is not installed.`);
|
|
29
|
+
console.error("Reinstall @chaitin-ai/octobus with optional dependencies enabled.");
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const binary = path.join(path.dirname(packageJSON), "bin", platformPackage.binary);
|
|
34
|
+
const result = spawnSync(binary, process.argv.slice(2), { stdio: "inherit" });
|
|
35
|
+
|
|
36
|
+
if (result.error) {
|
|
37
|
+
console.error(result.error.message);
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
process.exit(result.status === null ? 1 : result.status);
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@chaitin-ai/octobus",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "OctoBus local daemon and CLI.",
|
|
5
|
+
"license": "GPL-3.0",
|
|
6
|
+
"bin": {
|
|
7
|
+
"octobus": "bin/octobus.js"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/chaitin/OctoBus.git",
|
|
12
|
+
"directory": "npm/octobus"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/chaitin/OctoBus#readme",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/chaitin/OctoBus/issues"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"octobus",
|
|
20
|
+
"cli",
|
|
21
|
+
"daemon",
|
|
22
|
+
"grpc",
|
|
23
|
+
"mcp"
|
|
24
|
+
],
|
|
25
|
+
"files": [
|
|
26
|
+
"bin"
|
|
27
|
+
],
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=20"
|
|
30
|
+
},
|
|
31
|
+
"optionalDependencies": {
|
|
32
|
+
"@chaitin-ai/octobus-linux-x64": "0.1.0",
|
|
33
|
+
"@chaitin-ai/octobus-linux-arm64": "0.1.0",
|
|
34
|
+
"@chaitin-ai/octobus-darwin-x64": "0.1.0",
|
|
35
|
+
"@chaitin-ai/octobus-darwin-arm64": "0.1.0",
|
|
36
|
+
"@chaitin-ai/octobus-win32-x64": "0.1.0",
|
|
37
|
+
"@chaitin-ai/octobus-win32-arm64": "0.1.0"
|
|
38
|
+
},
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public",
|
|
41
|
+
"registry": "https://registry.npmjs.org/"
|
|
42
|
+
}
|
|
43
|
+
}
|