@agentnetwork/anet 1.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/anet +36 -0
- package/install.js +21 -0
- package/package.json +26 -0
package/bin/anet
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Shim: resolve the platform-specific binary and exec it
|
|
3
|
+
const { execFileSync } = require("child_process");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const os = require("os");
|
|
6
|
+
|
|
7
|
+
const PLATFORMS = {
|
|
8
|
+
"linux-x64": "@agentnetwork/anet-linux-x64",
|
|
9
|
+
"linux-arm64": "@agentnetwork/anet-linux-arm64",
|
|
10
|
+
"darwin-x64": "@agentnetwork/anet-darwin-x64",
|
|
11
|
+
"darwin-arm64": "@agentnetwork/anet-darwin-arm64",
|
|
12
|
+
"win32-x64": "@agentnetwork/anet-win32-x64",
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const key = `${os.platform()}-${os.arch()}`;
|
|
16
|
+
const pkg = PLATFORMS[key];
|
|
17
|
+
if (!pkg) {
|
|
18
|
+
console.error(`Unsupported platform: ${key}`);
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
let binPath;
|
|
23
|
+
try {
|
|
24
|
+
const pkgDir = path.dirname(require.resolve(`${pkg}/package.json`));
|
|
25
|
+
const binName = os.platform() === "win32" ? "anet.exe" : "anet";
|
|
26
|
+
binPath = path.join(pkgDir, "bin", binName);
|
|
27
|
+
} catch {
|
|
28
|
+
console.error(`Platform package ${pkg} not installed. Try: npm install -g @agentnetwork/anet`);
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
try {
|
|
33
|
+
execFileSync(binPath, process.argv.slice(2), { stdio: "inherit" });
|
|
34
|
+
} catch (e) {
|
|
35
|
+
process.exit(e.status || 1);
|
|
36
|
+
}
|
package/install.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// postinstall: verify the platform binary exists
|
|
2
|
+
const os = require("os");
|
|
3
|
+
const key = `${os.platform()}-${os.arch()}`;
|
|
4
|
+
const PLATFORMS = {
|
|
5
|
+
"linux-x64": "@agentnetwork/anet-linux-x64",
|
|
6
|
+
"linux-arm64": "@agentnetwork/anet-linux-arm64",
|
|
7
|
+
"darwin-x64": "@agentnetwork/anet-darwin-x64",
|
|
8
|
+
"darwin-arm64": "@agentnetwork/anet-darwin-arm64",
|
|
9
|
+
"win32-x64": "@agentnetwork/anet-win32-x64",
|
|
10
|
+
};
|
|
11
|
+
const pkg = PLATFORMS[key];
|
|
12
|
+
if (!pkg) {
|
|
13
|
+
console.warn(`[anet] No binary for ${key}. Use: curl -fsSL https://clawnet.cc/install.sh | sh`);
|
|
14
|
+
process.exit(0);
|
|
15
|
+
}
|
|
16
|
+
try {
|
|
17
|
+
require.resolve(`${pkg}/package.json`);
|
|
18
|
+
console.log(`[anet] Binary installed for ${key}`);
|
|
19
|
+
} catch {
|
|
20
|
+
console.warn(`[anet] Platform package ${pkg} not found. Try reinstalling.`);
|
|
21
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@agentnetwork/anet",
|
|
3
|
+
"version": "1.1.1",
|
|
4
|
+
"description": "AgentNetwork — Decentralized P2P Network for AI Agents",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/ChatChatTech/AgentNetwork"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://clawnet.cc",
|
|
11
|
+
"bin": {
|
|
12
|
+
"anet": "bin/anet"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"postinstall": "node install.js"
|
|
16
|
+
},
|
|
17
|
+
"optionalDependencies": {
|
|
18
|
+
"@agentnetwork/anet-linux-x64": "1.1.1",
|
|
19
|
+
"@agentnetwork/anet-linux-arm64": "1.1.1",
|
|
20
|
+
"@agentnetwork/anet-darwin-x64": "1.1.1",
|
|
21
|
+
"@agentnetwork/anet-darwin-arm64": "1.1.1",
|
|
22
|
+
"@agentnetwork/anet-win32-x64": "1.1.1"
|
|
23
|
+
},
|
|
24
|
+
"keywords": ["agent", "p2p", "decentralized", "ai", "network", "agentnetwork"],
|
|
25
|
+
"files": ["bin", "install.js"]
|
|
26
|
+
}
|