a2ald 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/a2ald +16 -0
- package/index.js +38 -0
- package/package.json +35 -0
package/bin/a2ald
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const { getBinaryPath } = require("..");
|
|
5
|
+
const { spawnSync } = require("child_process");
|
|
6
|
+
|
|
7
|
+
let bin;
|
|
8
|
+
try {
|
|
9
|
+
bin = getBinaryPath();
|
|
10
|
+
} catch (e) {
|
|
11
|
+
process.stderr.write(e.message + "\n");
|
|
12
|
+
process.exit(1);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const result = spawnSync(bin, process.argv.slice(2), { stdio: "inherit" });
|
|
16
|
+
process.exit(result.status != null ? result.status : 1);
|
package/index.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const os = require("os");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
|
|
6
|
+
const PLATFORM_PACKAGES = {
|
|
7
|
+
"linux-x64": "@a2al/a2ald-linux-x64",
|
|
8
|
+
"linux-arm64": "@a2al/a2ald-linux-arm64",
|
|
9
|
+
"darwin-x64": "@a2al/a2ald-darwin-x64",
|
|
10
|
+
"darwin-arm64": "@a2al/a2ald-darwin-arm64",
|
|
11
|
+
"win32-x64": "@a2al/a2ald-win32-x64",
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Returns the absolute path to the a2ald binary for the current platform.
|
|
16
|
+
* @throws {Error} if the platform is unsupported or the platform package is not installed.
|
|
17
|
+
*/
|
|
18
|
+
function getBinaryPath() {
|
|
19
|
+
const key = `${os.platform()}-${os.arch()}`;
|
|
20
|
+
const pkg = PLATFORM_PACKAGES[key];
|
|
21
|
+
if (!pkg) {
|
|
22
|
+
throw new Error(
|
|
23
|
+
`a2ald: unsupported platform ${key}. ` +
|
|
24
|
+
`Supported: ${Object.keys(PLATFORM_PACKAGES).join(", ")}`
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
const exe = os.platform() === "win32" ? "a2ald.exe" : "a2ald";
|
|
28
|
+
try {
|
|
29
|
+
return require.resolve(`${pkg}/bin/${exe}`);
|
|
30
|
+
} catch {
|
|
31
|
+
throw new Error(
|
|
32
|
+
`a2ald: platform package ${pkg} is not installed. ` +
|
|
33
|
+
`Try: npm install ${pkg}`
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
module.exports = { getBinaryPath };
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "a2ald",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "A2AL daemon — decentralized agent networking for AI agents",
|
|
5
|
+
"license": "MPL-2.0",
|
|
6
|
+
"homepage": "https://github.com/a2al/a2al",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/a2al/a2al.git",
|
|
10
|
+
"directory": "npm/a2ald"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"a2al",
|
|
14
|
+
"agent",
|
|
15
|
+
"mcp",
|
|
16
|
+
"p2p",
|
|
17
|
+
"decentralized",
|
|
18
|
+
"ai"
|
|
19
|
+
],
|
|
20
|
+
"bin": {
|
|
21
|
+
"a2ald": "bin/a2ald"
|
|
22
|
+
},
|
|
23
|
+
"main": "index.js",
|
|
24
|
+
"files": [
|
|
25
|
+
"bin",
|
|
26
|
+
"index.js"
|
|
27
|
+
],
|
|
28
|
+
"optionalDependencies": {
|
|
29
|
+
"@a2al/a2ald-linux-x64": "0.1.1",
|
|
30
|
+
"@a2al/a2ald-linux-arm64": "0.1.1",
|
|
31
|
+
"@a2al/a2ald-darwin-x64": "0.1.1",
|
|
32
|
+
"@a2al/a2ald-darwin-arm64": "0.1.1",
|
|
33
|
+
"@a2al/a2ald-win32-x64": "0.1.1"
|
|
34
|
+
}
|
|
35
|
+
}
|