@agumbe/ctl 0.7.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.
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const path = require("node:path");
|
|
3
|
+
const { spawnSync } = require("node:child_process");
|
|
4
|
+
|
|
5
|
+
const binary = path.join(__dirname, "..", "vendor", "bin", process.platform === "win32" ? "agumbe-ctl.exe" : "agumbe-ctl");
|
|
6
|
+
const result = spawnSync(binary, process.argv.slice(2), { stdio: "inherit" });
|
|
7
|
+
if (result.error) {
|
|
8
|
+
console.error(result.error.message);
|
|
9
|
+
process.exit(1);
|
|
10
|
+
}
|
|
11
|
+
process.exit(result.status === null ? 1 : result.status);
|
package/install.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const fs = require("node:fs");
|
|
2
|
+
const path = require("node:path");
|
|
3
|
+
const { spawnSync } = require("node:child_process");
|
|
4
|
+
|
|
5
|
+
const platform = process.platform;
|
|
6
|
+
const arch = process.arch;
|
|
7
|
+
const supported = {
|
|
8
|
+
"darwin-x64": ["agumbe-ctl-darwin-amd64.tar.gz", "tar"],
|
|
9
|
+
"darwin-arm64": ["agumbe-ctl-darwin-arm64.tar.gz", "tar"],
|
|
10
|
+
"linux-x64": ["agumbe-ctl-linux-amd64.tar.gz", "tar"],
|
|
11
|
+
"win32-x64": ["agumbe-ctl-windows-amd64.zip", "zip"]
|
|
12
|
+
};
|
|
13
|
+
const selected = supported[`${platform}-${arch}`];
|
|
14
|
+
if (!selected) {
|
|
15
|
+
throw new Error(`@agumbe/ctl does not yet support ${platform}-${arch}`);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const root = __dirname;
|
|
19
|
+
const source = path.join(root, "vendor", selected[0]);
|
|
20
|
+
const destination = path.join(root, "vendor", "bin");
|
|
21
|
+
fs.mkdirSync(destination, { recursive: true });
|
|
22
|
+
|
|
23
|
+
let result;
|
|
24
|
+
if (selected[1] === "tar") {
|
|
25
|
+
result = spawnSync("tar", ["-xzf", source, "-C", destination], { stdio: "inherit" });
|
|
26
|
+
} else {
|
|
27
|
+
result = spawnSync("powershell.exe", ["-NoProfile", "-Command", `Expand-Archive -Force '${source}' '${destination}'`], { stdio: "inherit" });
|
|
28
|
+
}
|
|
29
|
+
if (result.error || result.status !== 0) {
|
|
30
|
+
throw result.error || new Error(`failed to extract ${selected[0]}`);
|
|
31
|
+
}
|
|
32
|
+
if (platform !== "win32") {
|
|
33
|
+
fs.chmodSync(path.join(destination, "agumbe-ctl"), 0o755);
|
|
34
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@agumbe/ctl",
|
|
3
|
+
"version": "0.7.1",
|
|
4
|
+
"description": "Agumbe CLI and the xcontext context layer for AI agents",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"bin": {
|
|
7
|
+
"agumbe-ctl": "bin/agumbe-ctl.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"postinstall": "node install.js"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"bin",
|
|
14
|
+
"install.js",
|
|
15
|
+
"vendor"
|
|
16
|
+
],
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=18"
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/agumbe-ai/agumbe-ctl.git"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|