thronglets 0.2.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/README.md +63 -0
- package/bin/thronglets.js +19 -0
- package/package.json +37 -0
- package/scripts/install.js +79 -0
package/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Thronglets
|
|
2
|
+
|
|
3
|
+
P2P shared memory substrate for AI agents — stigmergic knowledge network via libp2p.
|
|
4
|
+
|
|
5
|
+
AI agents leave execution traces on a decentralized network. Traces propagate via gossipsub and aggregate into collective intelligence that any agent can query.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g thronglets
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## MCP Setup
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Claude Code
|
|
17
|
+
claude mcp add thronglets -- npx thronglets mcp
|
|
18
|
+
|
|
19
|
+
# With P2P network
|
|
20
|
+
claude mcp add thronglets -- npx thronglets mcp --port 0 --bootstrap /ip4/47.93.32.88/tcp/4001
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Claude Desktop
|
|
24
|
+
|
|
25
|
+
Add to `claude_desktop_config.json`:
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"mcpServers": {
|
|
30
|
+
"thronglets": {
|
|
31
|
+
"command": "npx",
|
|
32
|
+
"args": ["thronglets", "mcp"]
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## MCP Tools
|
|
39
|
+
|
|
40
|
+
| Tool | Description |
|
|
41
|
+
|------|-------------|
|
|
42
|
+
| `trace_record` | Record an execution trace (capability, outcome, latency, context, model) |
|
|
43
|
+
| `substrate_query` | Query with intent: `resolve` / `evaluate` / `explore` |
|
|
44
|
+
|
|
45
|
+
## Also available via
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# Rust
|
|
49
|
+
cargo install thronglets
|
|
50
|
+
|
|
51
|
+
# Python
|
|
52
|
+
pip install thronglets
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Links
|
|
56
|
+
|
|
57
|
+
- [GitHub](https://github.com/Shangri-la-0428/Thronglets)
|
|
58
|
+
- [crates.io](https://crates.io/crates/thronglets)
|
|
59
|
+
- [MCP Registry](https://registry.modelcontextprotocol.io/)
|
|
60
|
+
|
|
61
|
+
## License
|
|
62
|
+
|
|
63
|
+
MIT
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const { execFileSync } = require("child_process");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const fs = require("fs");
|
|
7
|
+
|
|
8
|
+
const binPath = path.join(__dirname, "thronglets-bin");
|
|
9
|
+
|
|
10
|
+
if (!fs.existsSync(binPath)) {
|
|
11
|
+
console.error("Thronglets binary not found. Run: npm rebuild thronglets");
|
|
12
|
+
process.exit(1);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
try {
|
|
16
|
+
execFileSync(binPath, process.argv.slice(2), { stdio: "inherit" });
|
|
17
|
+
} catch (err) {
|
|
18
|
+
process.exit(err.status || 1);
|
|
19
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "thronglets",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "P2P shared memory substrate for AI agents — stigmergic knowledge network via libp2p",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"mcp",
|
|
7
|
+
"mcp-server",
|
|
8
|
+
"model-context-protocol",
|
|
9
|
+
"ai-agents",
|
|
10
|
+
"p2p",
|
|
11
|
+
"libp2p",
|
|
12
|
+
"stigmergy",
|
|
13
|
+
"collective-intelligence",
|
|
14
|
+
"simhash",
|
|
15
|
+
"decentralized"
|
|
16
|
+
],
|
|
17
|
+
"homepage": "https://github.com/Shangri-la-0428/Thronglets",
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "https://github.com/Shangri-la-0428/Thronglets.git"
|
|
21
|
+
},
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"bin": {
|
|
24
|
+
"thronglets": "bin/thronglets.js"
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"postinstall": "node scripts/install.js"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"bin/",
|
|
31
|
+
"scripts/",
|
|
32
|
+
"README.md"
|
|
33
|
+
],
|
|
34
|
+
"os": ["darwin", "linux"],
|
|
35
|
+
"cpu": ["arm64", "x64"],
|
|
36
|
+
"mcpName": "io.github.Shangri-la-0428/thronglets"
|
|
37
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const { execSync } = require("child_process");
|
|
5
|
+
const fs = require("fs");
|
|
6
|
+
const path = require("path");
|
|
7
|
+
const https = require("https");
|
|
8
|
+
const http = require("http");
|
|
9
|
+
|
|
10
|
+
const VERSION = "0.2.0";
|
|
11
|
+
const REPO = "Shangri-la-0428/Thronglets";
|
|
12
|
+
|
|
13
|
+
const PLATFORMS = {
|
|
14
|
+
"darwin-arm64": {
|
|
15
|
+
asset: `thronglets-mcp-darwin-arm64`,
|
|
16
|
+
sha256: "7b0546e9381b8dc9180036afc1cbcd504068b4ac13d92f497a44945fc3faad5e",
|
|
17
|
+
},
|
|
18
|
+
"linux-x64": {
|
|
19
|
+
asset: `thronglets-mcp-linux-amd64`,
|
|
20
|
+
sha256: "d02883a6eecb861de8c1328ee9f264d4eb2d17635eb8db069bdf66ea7e9f33e6",
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const platform = `${process.platform}-${process.arch}`;
|
|
25
|
+
const target = PLATFORMS[platform];
|
|
26
|
+
|
|
27
|
+
if (!target) {
|
|
28
|
+
console.error(`Unsupported platform: ${platform}`);
|
|
29
|
+
console.error(`Supported: ${Object.keys(PLATFORMS).join(", ")}`);
|
|
30
|
+
console.error("You can install from source: cargo install thronglets");
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const binDir = path.join(__dirname, "..", "bin");
|
|
35
|
+
const binPath = path.join(binDir, "thronglets-bin");
|
|
36
|
+
const url = `https://github.com/${REPO}/releases/download/v${VERSION}/${target.asset}`;
|
|
37
|
+
|
|
38
|
+
function download(url, dest) {
|
|
39
|
+
return new Promise((resolve, reject) => {
|
|
40
|
+
const follow = (url) => {
|
|
41
|
+
const client = url.startsWith("https") ? https : http;
|
|
42
|
+
client.get(url, (res) => {
|
|
43
|
+
if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
|
|
44
|
+
follow(res.headers.location);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (res.statusCode !== 200) {
|
|
48
|
+
reject(new Error(`Download failed: HTTP ${res.statusCode}`));
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const file = fs.createWriteStream(dest);
|
|
52
|
+
res.pipe(file);
|
|
53
|
+
file.on("finish", () => {
|
|
54
|
+
file.close();
|
|
55
|
+
resolve();
|
|
56
|
+
});
|
|
57
|
+
}).on("error", reject);
|
|
58
|
+
};
|
|
59
|
+
follow(url);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async function main() {
|
|
64
|
+
console.log(`Downloading thronglets v${VERSION} for ${platform}...`);
|
|
65
|
+
|
|
66
|
+
fs.mkdirSync(binDir, { recursive: true });
|
|
67
|
+
|
|
68
|
+
try {
|
|
69
|
+
await download(url, binPath);
|
|
70
|
+
fs.chmodSync(binPath, 0o755);
|
|
71
|
+
console.log("Thronglets installed successfully.");
|
|
72
|
+
} catch (err) {
|
|
73
|
+
console.error(`Failed to download: ${err.message}`);
|
|
74
|
+
console.error("You can install from source: cargo install thronglets");
|
|
75
|
+
process.exit(1);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
main();
|