meshclaw 0.1.0__tar.gz

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.
meshclaw-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 MeshPOP
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,234 @@
1
+ Metadata-Version: 2.4
2
+ Name: meshclaw
3
+ Version: 0.1.0
4
+ Summary: Distributed AI agent orchestration across mesh networks
5
+ Author-email: MeshPOP <mpop@mpop.dev>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/meshpop/meshclaw
8
+ Project-URL: Repository, https://github.com/meshpop/meshclaw
9
+ Project-URL: Issues, https://github.com/meshpop/meshclaw/issues
10
+ Keywords: ai,agent,distributed,mesh,orchestration,mcp
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Topic :: System :: Distributed Computing
16
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
17
+ Requires-Python: >=3.9
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Provides-Extra: meshpop
21
+ Requires-Dist: meshpop; extra == "meshpop"
22
+ Requires-Dist: vssh; extra == "meshpop"
23
+ Requires-Dist: meshpop-wire; extra == "meshpop"
24
+ Dynamic: license-file
25
+
26
+ # MeshClaw
27
+
28
+ Distributed AI agent orchestration across mesh networks.
29
+
30
+ While existing agent frameworks (OpenClaw, etc.) run on a single machine, MeshClaw distributes AI agents across your entire server infrastructure. Build on d1, test on d2, deploy on v1 — all orchestrated by AI.
31
+
32
+ **Works on a single PC too** — MeshClaw treats local containers (Docker, LXC, rtlinux) as mesh nodes, giving you distributed agent power on one machine.
33
+
34
+ ## What MeshClaw Does That Others Can't
35
+
36
+ | Feature | OpenClaw | MeshClaw |
37
+ |---------|----------|----------|
38
+ | Single-machine agent | Yes | Yes |
39
+ | Multi-server execution | No | **Yes** |
40
+ | Agent migration between servers | No | **Yes** |
41
+ | Parallel tasks across servers | No | **Yes** |
42
+ | Sequential pipelines across servers | No | **Yes** |
43
+ | Collaborative multi-agent with signals | No | **Yes** |
44
+ | Map-Reduce across infrastructure | No | **Yes** |
45
+ | Container-as-node on single machine | No | **Yes** |
46
+ | MeshPOP infrastructure integration | No | **Yes** |
47
+
48
+ ## Install
49
+
50
+ ```bash
51
+ pip install meshclaw
52
+ ```
53
+
54
+ With MeshPOP integration:
55
+ ```bash
56
+ pip install meshclaw[meshpop]
57
+ ```
58
+
59
+ ## Quick Start
60
+
61
+ ### CLI
62
+
63
+ ```bash
64
+ # Discover mesh nodes
65
+ meshclaw discover
66
+
67
+ # Execute on a specific server
68
+ meshclaw exec "uptime" -s d1
69
+
70
+ # Broadcast to all servers
71
+ meshclaw broadcast "df -h"
72
+
73
+ # Parallel tasks on different servers
74
+ meshclaw parallel d1:"make build" d2:"make test" v1:"./deploy.sh"
75
+
76
+ # Sequential pipeline
77
+ meshclaw pipeline d1:"make build" d2:"make test" v1:"./deploy.sh"
78
+ ```
79
+
80
+ ### Python API
81
+
82
+ ```python
83
+ from meshclaw import Orchestrator, Task
84
+ from meshclaw.scenario import ParallelScenario, SequentialScenario, CollaborativeScenario
85
+
86
+ # Auto-discover mesh
87
+ with Orchestrator() as orch:
88
+ orch.discover()
89
+
90
+ # Parallel: different tasks on different servers
91
+ result = orch.parallel("build-and-test", [
92
+ Task("build", command="make build", server="d1"),
93
+ Task("test", command="make test", server="d2"),
94
+ Task("lint", command="make lint", server="g1"),
95
+ ])
96
+
97
+ # Sequential pipeline: output chains
98
+ result = orch.pipeline("deploy", [
99
+ {"server": "d1", "command": "make build"},
100
+ {"server": "d2", "command": "make test"},
101
+ {"server": "v1", "command": "./deploy.sh"},
102
+ ])
103
+
104
+ # Broadcast: same command on all servers
105
+ result = orch.broadcast("health", "uptime")
106
+ ```
107
+
108
+ ### Collaborative Workflow
109
+
110
+ ```python
111
+ from meshclaw import Orchestrator
112
+ from meshclaw.scenario import CollaborativeScenario
113
+
114
+ with Orchestrator() as orch:
115
+ orch.discover()
116
+
117
+ collab = CollaborativeScenario("data-pipeline")
118
+ collab.add_agent_task("scraper", server="d1",
119
+ command="curl -s https://api.example.com/data > /tmp/data.json",
120
+ publishes=["data_ready"])
121
+ collab.add_agent_task("processor", server="g1",
122
+ command="python3 /opt/process.py /tmp/data.json",
123
+ waits_for=["data_ready"],
124
+ publishes=["processed"])
125
+ collab.add_agent_task("server", server="v1",
126
+ command="cp /tmp/output.json /var/www/api/",
127
+ waits_for=["processed"])
128
+
129
+ result = orch.run(collab)
130
+ ```
131
+
132
+ ### Agent Migration
133
+
134
+ ```python
135
+ from meshclaw import Agent
136
+
137
+ agent = Agent("worker", server="d1")
138
+ agent.start()
139
+ agent.execute("heavy-computation.sh")
140
+
141
+ # Server d1 is overloaded? Move to d2
142
+ agent.migrate("d2")
143
+ agent.execute("continue-work.sh") # Now runs on d2
144
+ ```
145
+
146
+ ### Map-Reduce
147
+
148
+ ```python
149
+ from meshclaw import Orchestrator
150
+ from meshclaw.scenario import MapReduceScenario
151
+
152
+ with Orchestrator() as orch:
153
+ orch.discover()
154
+
155
+ scenario = MapReduceScenario(
156
+ "error-count",
157
+ map_command="grep -c ERROR /var/log/syslog",
158
+ map_servers=["d1", "d2", "g1", "v1"],
159
+ reduce_command="python3 -c 'import sys; print(sum(int(l) for l in sys.stdin))'",
160
+ reduce_server="m1"
161
+ )
162
+ result = orch.run(scenario)
163
+ print(f"Total errors: {result.results[-1].output}")
164
+ ```
165
+
166
+ ## MCP Server
167
+
168
+ MeshClaw includes an MCP server for AI assistant integration:
169
+
170
+ ```json
171
+ {
172
+ "mcpServers": {
173
+ "meshclaw": {
174
+ "command": "python3",
175
+ "args": ["/path/to/meshclaw-mcp-server.py"]
176
+ }
177
+ }
178
+ }
179
+ ```
180
+
181
+ ### MCP Tools
182
+
183
+ | Tool | Description |
184
+ |------|-------------|
185
+ | `meshclaw_discover` | Find mesh nodes |
186
+ | `meshclaw_exec` | Execute on specific server |
187
+ | `meshclaw_broadcast` | Run on all servers |
188
+ | `meshclaw_parallel` | Different tasks, different servers, simultaneously |
189
+ | `meshclaw_pipeline` | Sequential cross-server pipeline |
190
+ | `meshclaw_collab` | Collaborative multi-agent with signals |
191
+ | `meshclaw_mapreduce` | Map-Reduce across mesh |
192
+ | `meshclaw_status` | Orchestrator status |
193
+ | `meshclaw_migrate` | Move agent between servers |
194
+
195
+ ## Single-Machine Mode
196
+
197
+ No mesh network? No problem. MeshClaw works with local containers:
198
+
199
+ ```python
200
+ # Auto-detects Docker/LXC/rtlinux containers
201
+ orch = Orchestrator(mode="local")
202
+ orch.discover() # Finds containers as nodes
203
+
204
+ # Same powerful API, one machine
205
+ result = orch.parallel("local-work", [
206
+ Task("build", command="make", server="container-1"),
207
+ Task("test", command="pytest", server="container-2"),
208
+ ])
209
+ ```
210
+
211
+ ## Architecture
212
+
213
+ ```
214
+ Orchestrator
215
+ / | \
216
+ Agent-d1 Agent-d2 Agent-v1
217
+ (build) (test) (deploy)
218
+ | | |
219
+ [vssh/ssh] [vssh/ssh] [vssh/ssh]
220
+ | | |
221
+ Server-d1 Server-d2 Server-v1
222
+ ```
223
+
224
+ Built on MeshPOP: mpop (management), vssh (execution), wire (networking), meshdb (state), vault (secrets).
225
+
226
+ ## License
227
+
228
+ MIT
229
+
230
+ ## Links
231
+
232
+ - [MeshPOP](https://github.com/meshpop)
233
+ - [mpop.dev](https://mpop.dev)
234
+ - [PyPI](https://pypi.org/project/meshclaw/)
@@ -0,0 +1,209 @@
1
+ # MeshClaw
2
+
3
+ Distributed AI agent orchestration across mesh networks.
4
+
5
+ While existing agent frameworks (OpenClaw, etc.) run on a single machine, MeshClaw distributes AI agents across your entire server infrastructure. Build on d1, test on d2, deploy on v1 — all orchestrated by AI.
6
+
7
+ **Works on a single PC too** — MeshClaw treats local containers (Docker, LXC, rtlinux) as mesh nodes, giving you distributed agent power on one machine.
8
+
9
+ ## What MeshClaw Does That Others Can't
10
+
11
+ | Feature | OpenClaw | MeshClaw |
12
+ |---------|----------|----------|
13
+ | Single-machine agent | Yes | Yes |
14
+ | Multi-server execution | No | **Yes** |
15
+ | Agent migration between servers | No | **Yes** |
16
+ | Parallel tasks across servers | No | **Yes** |
17
+ | Sequential pipelines across servers | No | **Yes** |
18
+ | Collaborative multi-agent with signals | No | **Yes** |
19
+ | Map-Reduce across infrastructure | No | **Yes** |
20
+ | Container-as-node on single machine | No | **Yes** |
21
+ | MeshPOP infrastructure integration | No | **Yes** |
22
+
23
+ ## Install
24
+
25
+ ```bash
26
+ pip install meshclaw
27
+ ```
28
+
29
+ With MeshPOP integration:
30
+ ```bash
31
+ pip install meshclaw[meshpop]
32
+ ```
33
+
34
+ ## Quick Start
35
+
36
+ ### CLI
37
+
38
+ ```bash
39
+ # Discover mesh nodes
40
+ meshclaw discover
41
+
42
+ # Execute on a specific server
43
+ meshclaw exec "uptime" -s d1
44
+
45
+ # Broadcast to all servers
46
+ meshclaw broadcast "df -h"
47
+
48
+ # Parallel tasks on different servers
49
+ meshclaw parallel d1:"make build" d2:"make test" v1:"./deploy.sh"
50
+
51
+ # Sequential pipeline
52
+ meshclaw pipeline d1:"make build" d2:"make test" v1:"./deploy.sh"
53
+ ```
54
+
55
+ ### Python API
56
+
57
+ ```python
58
+ from meshclaw import Orchestrator, Task
59
+ from meshclaw.scenario import ParallelScenario, SequentialScenario, CollaborativeScenario
60
+
61
+ # Auto-discover mesh
62
+ with Orchestrator() as orch:
63
+ orch.discover()
64
+
65
+ # Parallel: different tasks on different servers
66
+ result = orch.parallel("build-and-test", [
67
+ Task("build", command="make build", server="d1"),
68
+ Task("test", command="make test", server="d2"),
69
+ Task("lint", command="make lint", server="g1"),
70
+ ])
71
+
72
+ # Sequential pipeline: output chains
73
+ result = orch.pipeline("deploy", [
74
+ {"server": "d1", "command": "make build"},
75
+ {"server": "d2", "command": "make test"},
76
+ {"server": "v1", "command": "./deploy.sh"},
77
+ ])
78
+
79
+ # Broadcast: same command on all servers
80
+ result = orch.broadcast("health", "uptime")
81
+ ```
82
+
83
+ ### Collaborative Workflow
84
+
85
+ ```python
86
+ from meshclaw import Orchestrator
87
+ from meshclaw.scenario import CollaborativeScenario
88
+
89
+ with Orchestrator() as orch:
90
+ orch.discover()
91
+
92
+ collab = CollaborativeScenario("data-pipeline")
93
+ collab.add_agent_task("scraper", server="d1",
94
+ command="curl -s https://api.example.com/data > /tmp/data.json",
95
+ publishes=["data_ready"])
96
+ collab.add_agent_task("processor", server="g1",
97
+ command="python3 /opt/process.py /tmp/data.json",
98
+ waits_for=["data_ready"],
99
+ publishes=["processed"])
100
+ collab.add_agent_task("server", server="v1",
101
+ command="cp /tmp/output.json /var/www/api/",
102
+ waits_for=["processed"])
103
+
104
+ result = orch.run(collab)
105
+ ```
106
+
107
+ ### Agent Migration
108
+
109
+ ```python
110
+ from meshclaw import Agent
111
+
112
+ agent = Agent("worker", server="d1")
113
+ agent.start()
114
+ agent.execute("heavy-computation.sh")
115
+
116
+ # Server d1 is overloaded? Move to d2
117
+ agent.migrate("d2")
118
+ agent.execute("continue-work.sh") # Now runs on d2
119
+ ```
120
+
121
+ ### Map-Reduce
122
+
123
+ ```python
124
+ from meshclaw import Orchestrator
125
+ from meshclaw.scenario import MapReduceScenario
126
+
127
+ with Orchestrator() as orch:
128
+ orch.discover()
129
+
130
+ scenario = MapReduceScenario(
131
+ "error-count",
132
+ map_command="grep -c ERROR /var/log/syslog",
133
+ map_servers=["d1", "d2", "g1", "v1"],
134
+ reduce_command="python3 -c 'import sys; print(sum(int(l) for l in sys.stdin))'",
135
+ reduce_server="m1"
136
+ )
137
+ result = orch.run(scenario)
138
+ print(f"Total errors: {result.results[-1].output}")
139
+ ```
140
+
141
+ ## MCP Server
142
+
143
+ MeshClaw includes an MCP server for AI assistant integration:
144
+
145
+ ```json
146
+ {
147
+ "mcpServers": {
148
+ "meshclaw": {
149
+ "command": "python3",
150
+ "args": ["/path/to/meshclaw-mcp-server.py"]
151
+ }
152
+ }
153
+ }
154
+ ```
155
+
156
+ ### MCP Tools
157
+
158
+ | Tool | Description |
159
+ |------|-------------|
160
+ | `meshclaw_discover` | Find mesh nodes |
161
+ | `meshclaw_exec` | Execute on specific server |
162
+ | `meshclaw_broadcast` | Run on all servers |
163
+ | `meshclaw_parallel` | Different tasks, different servers, simultaneously |
164
+ | `meshclaw_pipeline` | Sequential cross-server pipeline |
165
+ | `meshclaw_collab` | Collaborative multi-agent with signals |
166
+ | `meshclaw_mapreduce` | Map-Reduce across mesh |
167
+ | `meshclaw_status` | Orchestrator status |
168
+ | `meshclaw_migrate` | Move agent between servers |
169
+
170
+ ## Single-Machine Mode
171
+
172
+ No mesh network? No problem. MeshClaw works with local containers:
173
+
174
+ ```python
175
+ # Auto-detects Docker/LXC/rtlinux containers
176
+ orch = Orchestrator(mode="local")
177
+ orch.discover() # Finds containers as nodes
178
+
179
+ # Same powerful API, one machine
180
+ result = orch.parallel("local-work", [
181
+ Task("build", command="make", server="container-1"),
182
+ Task("test", command="pytest", server="container-2"),
183
+ ])
184
+ ```
185
+
186
+ ## Architecture
187
+
188
+ ```
189
+ Orchestrator
190
+ / | \
191
+ Agent-d1 Agent-d2 Agent-v1
192
+ (build) (test) (deploy)
193
+ | | |
194
+ [vssh/ssh] [vssh/ssh] [vssh/ssh]
195
+ | | |
196
+ Server-d1 Server-d2 Server-v1
197
+ ```
198
+
199
+ Built on MeshPOP: mpop (management), vssh (execution), wire (networking), meshdb (state), vault (secrets).
200
+
201
+ ## License
202
+
203
+ MIT
204
+
205
+ ## Links
206
+
207
+ - [MeshPOP](https://github.com/meshpop)
208
+ - [mpop.dev](https://mpop.dev)
209
+ - [PyPI](https://pypi.org/project/meshclaw/)
@@ -0,0 +1,38 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "meshclaw"
7
+ version = "0.1.0"
8
+ description = "Distributed AI agent orchestration across mesh networks"
9
+ readme = "README.md"
10
+ license = {text = "MIT"}
11
+ requires-python = ">=3.9"
12
+ authors = [
13
+ {name = "MeshPOP", email = "mpop@mpop.dev"}
14
+ ]
15
+ keywords = ["ai", "agent", "distributed", "mesh", "orchestration", "mcp"]
16
+ classifiers = [
17
+ "Development Status :: 3 - Alpha",
18
+ "Intended Audience :: Developers",
19
+ "License :: OSI Approved :: MIT License",
20
+ "Programming Language :: Python :: 3",
21
+ "Topic :: System :: Distributed Computing",
22
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
23
+ ]
24
+ dependencies = []
25
+
26
+ [project.optional-dependencies]
27
+ meshpop = ["meshpop", "vssh", "meshpop-wire"]
28
+
29
+ [project.scripts]
30
+ meshclaw = "meshclaw.cli:main"
31
+
32
+ [project.urls]
33
+ Homepage = "https://github.com/meshpop/meshclaw"
34
+ Repository = "https://github.com/meshpop/meshclaw"
35
+ Issues = "https://github.com/meshpop/meshclaw/issues"
36
+
37
+ [tool.setuptools.packages.find]
38
+ where = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,22 @@
1
+ """MeshClaw - Distributed AI Agent Orchestration across Mesh Networks.
2
+
3
+ Unlike single-machine agent frameworks, MeshClaw distributes AI agents
4
+ across multiple servers in a mesh network, enabling parallel execution,
5
+ sequential pipelines, and collaborative multi-agent workflows.
6
+
7
+ Built on top of MeshPOP infrastructure (mpop/vssh/wire/meshdb/vault).
8
+ """
9
+
10
+ __version__ = "0.1.0"
11
+
12
+ from meshclaw.agent import Agent, AgentState
13
+ from meshclaw.task import Task, TaskResult, TaskState
14
+ from meshclaw.orchestrator import Orchestrator
15
+ from meshclaw.scenario import Scenario, ParallelScenario, SequentialScenario, CollaborativeScenario
16
+
17
+ __all__ = [
18
+ "Agent", "AgentState",
19
+ "Task", "TaskResult", "TaskState",
20
+ "Orchestrator",
21
+ "Scenario", "ParallelScenario", "SequentialScenario", "CollaborativeScenario",
22
+ ]
@@ -0,0 +1,3 @@
1
+ """Allow running meshclaw as python -m meshclaw."""
2
+ from meshclaw.cli import main
3
+ main()