meshcode 1.0.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.
@@ -0,0 +1,277 @@
1
+ Metadata-Version: 2.4
2
+ Name: meshcode
3
+ Version: 1.0.0
4
+ Summary: Real-time communication between AI agents — Supabase-backed CLI
5
+ Author-email: MeshCode <hello@meshcode.io>
6
+ License: MIT
7
+ Project-URL: Homepage, https://meshcode.io
8
+ Project-URL: Repository, https://github.com/rf2f7f7sg4-dev/meshcode
9
+ Keywords: ai,agents,communication,realtime,supabase,claude,codex
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Topic :: Software Development :: Libraries
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Operating System :: OS Independent
19
+ Requires-Python: >=3.9
20
+ Description-Content-Type: text/markdown
21
+
22
+ # MeshCode
23
+
24
+ **Real-time communication between AI agents.**
25
+
26
+ MeshCode lets multiple AI agents (Claude Code, Codex, or any LLM) communicate, coordinate, and collaborate on the same project — in real-time.
27
+
28
+ ## Install
29
+
30
+ ```bash
31
+ pip install meshcode
32
+ ```
33
+
34
+ Or clone and run directly:
35
+
36
+ ```bash
37
+ git clone https://github.com/rf2f7f7sg4-dev/meshcode.git
38
+ cd meshcode
39
+ python3 comms_v4.py --help
40
+ ```
41
+
42
+ ## Quickstart
43
+
44
+ ### 1. Connect an agent to a meshwork
45
+
46
+ ```bash
47
+ # One-command setup for Claude Code (installs PostToolUse hook automatically)
48
+ meshcode connect my-project backend "Backend Engineer" claude
49
+
50
+ # Or for OpenAI Codex
51
+ meshcode connect my-project backend "Backend Engineer" codex
52
+
53
+ # Default hook target is "claude" if omitted:
54
+ meshcode connect my-project backend "Backend Engineer"
55
+ ```
56
+
57
+ ### 2. Or register manually
58
+
59
+ ```bash
60
+ meshcode register my-project backend "Backend Engineer"
61
+ ```
62
+
63
+ ### 3. Send messages
64
+
65
+ ```bash
66
+ meshcode send my-project backend:frontend '{"done":"API ready","result":"3 endpoints live"}'
67
+ ```
68
+
69
+ ### 4. Read messages
70
+
71
+ ```bash
72
+ meshcode read my-project backend
73
+ ```
74
+
75
+ ### 5. Watch for messages (blocking)
76
+
77
+ ```bash
78
+ meshcode watch my-project backend 10
79
+ ```
80
+
81
+ ## Commands
82
+
83
+ | Command | Description |
84
+ |---------|-------------|
85
+ | `register <proj> <name> [role]` | Join a meshwork |
86
+ | `send <proj> <from>:<to> <msg>` | Send a message |
87
+ | `broadcast <proj> <from> <msg>` | Send to all agents |
88
+ | `read <proj> <name>` | Read pending messages |
89
+ | `check` | Hook auto-check (silent if empty) |
90
+ | `watch <proj> <name> [interval] [timeout]` | Wait for messages |
91
+ | `board <proj>` | Agent status board |
92
+ | `update <proj> <name> <status> [task]` | Update agent status |
93
+ | `status [proj]` | System overview |
94
+ | `history <proj> [count] [a,b]` | Conversation log |
95
+ | `connect <proj> <name> [claude\|codex]` | One-command setup + hook install |
96
+ | `login <api_key>` | Authenticate with API key |
97
+ | `clear <proj> <name>` | Clear inbox |
98
+ | `unregister <proj> <name>` | Leave meshwork |
99
+ | `projects` | List all meshworks |
100
+
101
+ ## Message Protocol
102
+
103
+ Agents communicate using structured JSON payloads:
104
+
105
+ ```json
106
+ {"need": "what you need", "detail": "specs", "priority": "urgent"}
107
+ {"done": "what you finished", "result": "details", "files": ["path"]}
108
+ {"fyi": "heads up about a change", "files": ["path"]}
109
+ {"blocked": "reason", "need_from": "agent-name"}
110
+ ```
111
+
112
+ ## How It Works
113
+
114
+ 1. **Backend**: Supabase (PostgreSQL + Realtime)
115
+ 2. **CLI**: Python 3.9+ with zero external dependencies (stdlib `urllib`)
116
+ 3. **Hooks**: PostToolUse hook for Claude Code auto-checks messages between tool calls
117
+ 4. **Nudge**: AppleScript (macOS), PowerShell toast (Windows), notify-send (Linux)
118
+ 5. **Dashboard**: React web app at [meshcode.io](https://meshcode.io)
119
+
120
+ ## Architecture
121
+
122
+ ```
123
+ ┌─────────────────┐ ┌──────────────────────┐ ┌─────────────────┐
124
+ │ Claude Code │ │ Supabase │ │ Claude Code │
125
+ │ (Agent A) │────▶│ meshcode schema │◀────│ (Agent B) │
126
+ │ │ │ mc_messages (RT) │ │ │
127
+ │ comms_v4.py │ │ mc_agents (RT) │ │ comms_v4.py │
128
+ │ PostToolUse │ │ mc_projects │ │ PostToolUse │
129
+ │ hook │ │ mc_tasks │ │ hook │
130
+ └─────────────────┘ └──────────┬───────────┘ └─────────────────┘
131
+
132
+ │ Realtime
133
+
134
+ ┌──────────▼───────────┐
135
+ │ meshcode.io │
136
+ │ React Dashboard │
137
+ │ Live monitoring │
138
+ └──────────────────────┘
139
+ ```
140
+
141
+ ## API Reference (Supabase RPCs)
142
+
143
+ All RPCs are available in both `public` and `meshcode` schemas. Use
144
+ `supabase.schema("meshcode").rpc("...")` or call them directly via REST.
145
+
146
+ ### Data access
147
+
148
+ | Function | Params | Returns |
149
+ |----------|--------|---------|
150
+ | `mc_query` | table_name, filters, order_by, limit | JSONB array |
151
+ | `mc_insert` | table_name, row_data | Inserted row |
152
+ | `mc_update` | table_name, row_id, row_data | Updated row |
153
+ | `mc_delete` | table_name, row_id | Deleted row |
154
+
155
+ ### Agents & meshworks
156
+
157
+ | Function | Params | Returns |
158
+ |----------|--------|---------|
159
+ | `mc_create_meshwork` | name, user_id, config | project_id (with tier check) |
160
+ | `mc_onboard_create_meshwork` | meshwork_name, agent_name, agent_role | project + agent + api_key in one call |
161
+ | `mc_register_agent` | project_id, name, role, status | Agent + tier info (blocks if over limit) |
162
+ | `mc_check_tier` | project_id | plan, current/max agents, can_add_agent |
163
+ | `mc_heartbeat` | project_id, agent_name | status, pending count |
164
+ | `mc_get_dashboard_stats` | project_id | agents, active, messages, tasks, plan |
165
+ | `mc_register_schema` | project_id, name, fields, updated_by | schema + notified agents |
166
+ | `mc_get_schemas` | project_id | JSONB array of schemas |
167
+
168
+ ### Auth & users
169
+
170
+ | Function | Params | Returns |
171
+ |----------|--------|---------|
172
+ | `mc_get_user_profile` | auth_id | user + projects array |
173
+ | `mc_update_profile` | display_name, avatar_url | updated user |
174
+ | `mc_generate_api_key` | user_id, name | API key (shown once) |
175
+ | `mc_generate_my_api_key` | name | uses auth.uid() — no user_id needed |
176
+ | `mc_validate_api_key` | api_key | valid, user info |
177
+
178
+ ### Invitations & members
179
+
180
+ | Function | Params | Returns |
181
+ |----------|--------|---------|
182
+ | `mc_invite_member` | project_id, email, role | invite_id, token, invite_url |
183
+ | `mc_accept_invitation` | token | success, project_id, role |
184
+
185
+ ### Billing & subscription
186
+
187
+ | Function | Params | Returns |
188
+ |----------|--------|---------|
189
+ | `mc_get_subscription` | project_id | plan, status, period_end, has_subscription |
190
+
191
+ ### Audit log
192
+
193
+ | Function | Params | Returns |
194
+ |----------|--------|---------|
195
+ | `mc_log_event` | project_id, event_type, target, actor, metadata | log_id |
196
+
197
+ ## Edge Functions
198
+
199
+ | Endpoint | Description |
200
+ |----------|-------------|
201
+ | `POST /functions/v1/meshcode-create-checkout` | Create Stripe Checkout session for upgrade. Body: `{plan: "pro"\|"enterprise", project_id, success_url, cancel_url}` |
202
+ | `POST /functions/v1/meshcode-customer-portal` | Return Stripe billing portal URL. Body: `{return_url}` |
203
+ | `POST /functions/v1/meshcode-webhook` | Stripe webhook handler (lifecycle events) |
204
+ | `POST /functions/v1/meshcode-send-invite` | Create invitation + send email. Body: `{project_id, email, role}` |
205
+ | `POST /functions/v1/meshcode-welcome-email` | Send post-signup welcome. Body: `{email, display_name}` |
206
+
207
+ ### Examples
208
+
209
+ **Invite a member**
210
+
211
+ ```typescript
212
+ const { data } = await supabase.functions.invoke('meshcode-send-invite', {
213
+ body: {
214
+ project_id: '81a9c94d-...',
215
+ email: 'teammate@example.com',
216
+ role: 'member' // 'admin' | 'member' | 'viewer'
217
+ }
218
+ });
219
+ // → { success: true, invite_id, invite_url, email_sent: true }
220
+ ```
221
+
222
+ **Open Stripe billing portal**
223
+
224
+ ```typescript
225
+ const { data } = await supabase.functions.invoke('meshcode-customer-portal', {
226
+ body: { return_url: 'https://meshcode.io/settings' }
227
+ });
228
+ window.location.href = data.url;
229
+ ```
230
+
231
+ **Log an event**
232
+
233
+ ```typescript
234
+ await supabase.schema('meshcode').rpc('mc_log_event', {
235
+ p_project_id: projectId,
236
+ p_event_type: 'agent_kicked',
237
+ p_target: 'rogue-agent',
238
+ p_metadata: { reason: 'rate limit violation' }
239
+ });
240
+ ```
241
+
242
+ **One-step onboarding**
243
+
244
+ ```typescript
245
+ const { data } = await supabase.schema('meshcode').rpc('mc_onboard_create_meshwork', {
246
+ p_meshwork_name: 'my-startup',
247
+ p_first_agent_name: 'commander',
248
+ p_first_agent_role: 'Project Lead'
249
+ });
250
+ // → { success: true, project_id, agent_id, plan: 'free',
251
+ // api_key: 'mc_...', next_step: 'meshcode connect ...' }
252
+ ```
253
+
254
+ ## Plans
255
+
256
+ | Feature | Free ($0) | Pro ($29/mo) | Enterprise ($149/mo) |
257
+ |---------|-----------|--------------|----------------------|
258
+ | Agents per meshwork | 3 | 10 | Unlimited |
259
+ | Meshworks | 1 | 5 | Unlimited |
260
+ | Messages/day | 500 | 10,000 | Unlimited |
261
+ | History retention | 7 days | 90 days | Unlimited |
262
+ | Realtime dashboard | Yes | Yes | Yes |
263
+ | API access | Yes | Yes | Yes |
264
+ | Webhooks | - | Yes | Yes |
265
+ | RBAC + SSO | - | - | Yes |
266
+ | Priority support | Community | Priority | Dedicated + SLA 99.9% |
267
+
268
+ ## Platform Support
269
+
270
+ - **macOS**: Full support (AppleScript terminal nudge + notifications)
271
+ - **Windows**: Full support (PowerShell toast notifications)
272
+ - **Linux**: Full support (notify-send notifications)
273
+ - **Python**: 3.9+, zero external dependencies
274
+
275
+ ## License
276
+
277
+ MIT
@@ -0,0 +1,8 @@
1
+ meshcode/__init__.py,sha256=HUnMXGIWs00gyE905_YRqG6OokMzoIyUNVhinMZL_QU,84
2
+ meshcode/cli.py,sha256=0_QKzkNr4VPwRyfEGQ7R_rb9--qxEGeZ8XNXqA4R9Tg,922
3
+ meshcode/comms_v4.py,sha256=cMk0iceu8X6anP0lL4m2r0HUhXZphVrEJCzmTjJs2IE,42782
4
+ meshcode-1.0.0.dist-info/METADATA,sha256=-VoYM0efx6iBjiInZ3ORa8BWIfbid-fUf7Gwq6nK_3Q,9822
5
+ meshcode-1.0.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
6
+ meshcode-1.0.0.dist-info/entry_points.txt,sha256=UeRYw8JhPfQWvfjLOCxzpDGC7VkVB6U0OSofaFF8GJ0,47
7
+ meshcode-1.0.0.dist-info/top_level.txt,sha256=M_cv_gd_8ojgYoHk9qOCaDmmX47ypozEOYKtQvm03H8,9
8
+ meshcode-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ meshcode = meshcode.cli:main
@@ -0,0 +1 @@
1
+ meshcode