thronglets 0.2.0__py3-none-any.whl

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.
thronglets/__init__.py ADDED
@@ -0,0 +1,63 @@
1
+ """Thronglets — P2P shared memory substrate for AI agents."""
2
+
3
+ import os
4
+ import platform
5
+ import stat
6
+ import subprocess
7
+ import sys
8
+ import urllib.request
9
+ from pathlib import Path
10
+
11
+ __version__ = "0.2.0"
12
+
13
+ VERSION = "0.2.0"
14
+ REPO = "Shangri-la-0428/Thronglets"
15
+
16
+ PLATFORMS = {
17
+ ("Darwin", "arm64"): "thronglets-mcp-darwin-arm64",
18
+ ("Linux", "x86_64"): "thronglets-mcp-linux-amd64",
19
+ }
20
+
21
+
22
+ def _bin_dir() -> Path:
23
+ return Path(__file__).parent / "bin"
24
+
25
+
26
+ def _bin_path() -> Path:
27
+ return _bin_dir() / "thronglets-bin"
28
+
29
+
30
+ def _download_binary() -> Path:
31
+ system = platform.system()
32
+ machine = platform.machine()
33
+ key = (system, machine)
34
+
35
+ asset = PLATFORMS.get(key)
36
+ if not asset:
37
+ print(f"Unsupported platform: {system}-{machine}", file=sys.stderr)
38
+ print("Install from source: cargo install thronglets", file=sys.stderr)
39
+ sys.exit(1)
40
+
41
+ url = f"https://github.com/{REPO}/releases/download/v{VERSION}/{asset}"
42
+ dest = _bin_path()
43
+ dest.parent.mkdir(parents=True, exist_ok=True)
44
+
45
+ print(f"Downloading thronglets v{VERSION} for {system}-{machine}...")
46
+ urllib.request.urlretrieve(url, dest)
47
+ dest.chmod(dest.stat().st_mode | stat.S_IEXEC | stat.S_IXGRP | stat.S_IXOTH)
48
+ print("Thronglets installed successfully.")
49
+ return dest
50
+
51
+
52
+ def _ensure_binary() -> Path:
53
+ bin_path = _bin_path()
54
+ if not bin_path.exists():
55
+ _download_binary()
56
+ return bin_path
57
+
58
+
59
+ def main():
60
+ """Entry point for the thronglets CLI."""
61
+ binary = _ensure_binary()
62
+ result = subprocess.run([str(binary)] + sys.argv[1:])
63
+ sys.exit(result.returncode)
@@ -0,0 +1,82 @@
1
+ Metadata-Version: 2.4
2
+ Name: thronglets
3
+ Version: 0.2.0
4
+ Summary: P2P shared memory substrate for AI agents — stigmergic knowledge network via libp2p
5
+ Project-URL: Homepage, https://github.com/Shangri-la-0428/Thronglets
6
+ Project-URL: Repository, https://github.com/Shangri-la-0428/Thronglets
7
+ Project-URL: Issues, https://github.com/Shangri-la-0428/Thronglets/issues
8
+ Author-email: Shangri-la-0428 <ptc0428@qq.com>
9
+ License-Expression: MIT
10
+ Keywords: ai-agents,collective-intelligence,libp2p,mcp,mcp-server,p2p,stigmergy
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
16
+ Classifier: Topic :: System :: Networking
17
+ Requires-Python: >=3.8
18
+ Description-Content-Type: text/markdown
19
+
20
+ # Thronglets
21
+
22
+ P2P shared memory substrate for AI agents — stigmergic knowledge network via libp2p.
23
+
24
+ <!-- mcp-name: io.github.Shangri-la-0428/thronglets -->
25
+
26
+ AI agents leave execution traces on a decentralized network. Traces propagate via gossipsub and aggregate into collective intelligence that any agent can query.
27
+
28
+ ## Install
29
+
30
+ ```bash
31
+ pip install thronglets
32
+ ```
33
+
34
+ ## MCP Setup
35
+
36
+ ```bash
37
+ # Claude Code
38
+ claude mcp add thronglets -- thronglets mcp
39
+
40
+ # With P2P network
41
+ claude mcp add thronglets -- thronglets mcp --port 0 --bootstrap /ip4/47.93.32.88/tcp/4001
42
+ ```
43
+
44
+ ### Claude Desktop
45
+
46
+ ```json
47
+ {
48
+ "mcpServers": {
49
+ "thronglets": {
50
+ "command": "thronglets",
51
+ "args": ["mcp"]
52
+ }
53
+ }
54
+ }
55
+ ```
56
+
57
+ ## MCP Tools
58
+
59
+ | Tool | Description |
60
+ |------|-------------|
61
+ | `trace_record` | Record an execution trace (capability, outcome, latency, context, model) |
62
+ | `substrate_query` | Query with intent: `resolve` (find capabilities), `evaluate` (get stats), `explore` (discover) |
63
+
64
+ ## Also available via
65
+
66
+ ```bash
67
+ # Rust
68
+ cargo install thronglets
69
+
70
+ # Node.js
71
+ npm install -g thronglets
72
+ ```
73
+
74
+ ## Links
75
+
76
+ - [GitHub](https://github.com/Shangri-la-0428/Thronglets)
77
+ - [crates.io](https://crates.io/crates/thronglets)
78
+ - [MCP Registry](https://registry.modelcontextprotocol.io/)
79
+
80
+ ## License
81
+
82
+ MIT
@@ -0,0 +1,5 @@
1
+ thronglets/__init__.py,sha256=I4jQgbDKEE4WvZpX5BDGQhjxYu1qbjscv0i8PWvF3oQ,1601
2
+ thronglets-0.2.0.dist-info/METADATA,sha256=Hy9ONRjraAJMUSqExVNpy3xcUUcF4Fhd-JnM5uXHXPM,2155
3
+ thronglets-0.2.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
4
+ thronglets-0.2.0.dist-info/entry_points.txt,sha256=9GwABegk4camVuthE5rY4lTTGUOyM21duAod5oRiLSc,47
5
+ thronglets-0.2.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.27.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ thronglets = thronglets:main