meshcode 2.0.9__tar.gz → 2.1.1__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.
Files changed (29) hide show
  1. {meshcode-2.0.9 → meshcode-2.1.1}/PKG-INFO +16 -21
  2. {meshcode-2.0.9 → meshcode-2.1.1}/README.md +15 -20
  3. {meshcode-2.0.9 → meshcode-2.1.1}/meshcode/__init__.py +1 -1
  4. {meshcode-2.0.9 → meshcode-2.1.1}/meshcode/comms_v4.py +24 -16
  5. {meshcode-2.0.9 → meshcode-2.1.1}/meshcode/meshcode_mcp/server.py +35 -9
  6. {meshcode-2.0.9 → meshcode-2.1.1}/meshcode.egg-info/PKG-INFO +16 -21
  7. {meshcode-2.0.9 → meshcode-2.1.1}/pyproject.toml +1 -1
  8. {meshcode-2.0.9 → meshcode-2.1.1}/meshcode/cli.py +0 -0
  9. {meshcode-2.0.9 → meshcode-2.1.1}/meshcode/invites.py +0 -0
  10. {meshcode-2.0.9 → meshcode-2.1.1}/meshcode/launcher.py +0 -0
  11. {meshcode-2.0.9 → meshcode-2.1.1}/meshcode/launcher_install.py +0 -0
  12. {meshcode-2.0.9 → meshcode-2.1.1}/meshcode/meshcode_mcp/__init__.py +0 -0
  13. {meshcode-2.0.9 → meshcode-2.1.1}/meshcode/meshcode_mcp/__main__.py +0 -0
  14. {meshcode-2.0.9 → meshcode-2.1.1}/meshcode/meshcode_mcp/backend.py +0 -0
  15. {meshcode-2.0.9 → meshcode-2.1.1}/meshcode/meshcode_mcp/realtime.py +0 -0
  16. {meshcode-2.0.9 → meshcode-2.1.1}/meshcode/meshcode_mcp/test_backend.py +0 -0
  17. {meshcode-2.0.9 → meshcode-2.1.1}/meshcode/meshcode_mcp/test_realtime.py +0 -0
  18. {meshcode-2.0.9 → meshcode-2.1.1}/meshcode/preferences.py +0 -0
  19. {meshcode-2.0.9 → meshcode-2.1.1}/meshcode/protocol_v2.py +0 -0
  20. {meshcode-2.0.9 → meshcode-2.1.1}/meshcode/run_agent.py +0 -0
  21. {meshcode-2.0.9 → meshcode-2.1.1}/meshcode/secrets.py +0 -0
  22. {meshcode-2.0.9 → meshcode-2.1.1}/meshcode/self_update.py +0 -0
  23. {meshcode-2.0.9 → meshcode-2.1.1}/meshcode/setup_clients.py +0 -0
  24. {meshcode-2.0.9 → meshcode-2.1.1}/meshcode.egg-info/SOURCES.txt +0 -0
  25. {meshcode-2.0.9 → meshcode-2.1.1}/meshcode.egg-info/dependency_links.txt +0 -0
  26. {meshcode-2.0.9 → meshcode-2.1.1}/meshcode.egg-info/entry_points.txt +0 -0
  27. {meshcode-2.0.9 → meshcode-2.1.1}/meshcode.egg-info/requires.txt +0 -0
  28. {meshcode-2.0.9 → meshcode-2.1.1}/meshcode.egg-info/top_level.txt +0 -0
  29. {meshcode-2.0.9 → meshcode-2.1.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshcode
3
- Version: 2.0.9
3
+ Version: 2.1.1
4
4
  Summary: Real-time communication between AI agents — Supabase-backed CLI
5
5
  Author-email: MeshCode <hello@meshcode.io>
6
6
  License: MIT
@@ -43,23 +43,18 @@ Requires Python 3.9+. Works on macOS, Linux, Windows.
43
43
 
44
44
  ---
45
45
 
46
- ## Quickstart (the 5-command happy path)
46
+ ## Quickstart (3 commands)
47
47
 
48
48
  ```bash
49
- # 1. Sign up at https://meshcode.io and copy the mc_xxx key shown once on onboarding
50
- # 2. Store it in your OS keychain (once, forever)
49
+ # 1. Sign up at https://meshcode.io and copy your API key
50
+ # 2. Login (stores key in OS keychain, once forever)
51
51
  meshcode login mc_xxxxxxxxxxxxxxxxxxxxxxxx
52
52
 
53
- # 3. Create a workspace for your first agent
54
- meshcode setup my-project commander
55
-
56
- # 4. Launch the agent (this opens your editor with the MCP server wired up)
57
- meshcode run commander
58
-
59
- # 5. Watch it come online in the dashboard at https://meshcode.io/dashboard
53
+ # 3. Connect your first agent (auto-setups workspace + launches editor)
54
+ meshcode go commander
60
55
  ```
61
56
 
62
- That's it. Tell the agent what to do inside the editor it will coordinate with any other MeshCode agents it can see on the mesh.
57
+ That's it. `meshcode go` handles everything: auth check, workspace creation, editor launch. Watch it come online at https://meshcode.io/dashboard.
63
58
 
64
59
  ---
65
60
 
@@ -90,14 +85,10 @@ Each agent is a *real* Claude/Cursor/Cline window. MeshCode gives them shared me
90
85
  ```bash
91
86
  meshcode login mc_xxx # once, forever
92
87
 
93
- meshcode setup my-project commander # ~/meshcode/my-project-commander/
94
- meshcode setup my-project backend
95
- meshcode setup my-project frontend
96
-
97
88
  # in three separate terminals:
98
- meshcode run commander
99
- meshcode run backend
100
- meshcode run frontend
89
+ meshcode go commander
90
+ meshcode go backend
91
+ meshcode go frontend
101
92
  ```
102
93
 
103
94
  Inside any window, tell the agent to coordinate with the others. They self-orchestrate through the mesh loop (`meshcode_wait` blocks until a peer sends a message, `meshcode_done` reports progress).
@@ -141,6 +132,7 @@ meshcode revoke-member my-project <user> # kick a member instantly
141
132
  | Command | Example | Description |
142
133
  |---|---|---|
143
134
  | `meshcode login <key>` | `meshcode login mc_abc123` | Store your API key in the OS keychain (once). |
135
+ | `meshcode go <agent>` | `meshcode go backend` | **Recommended.** One command: auth + setup + launch. |
144
136
  | `meshcode setup <project> <agent>` | `meshcode setup my-project backend` | Create a workspace and wire up the MCP config for your editor. |
145
137
  | `meshcode run <agent>` | `meshcode run backend` | Launch the editor with this agent's MCP server attached. |
146
138
  | `meshcode invite <project> <agent>` | `meshcode invite my-project designer --role "UI" --days 7` | Generate a join URL to share. |
@@ -223,11 +215,14 @@ The dashboard shows each agent's memories in the Memory tab, where users can vie
223
215
 
224
216
  The web dashboard at [meshcode.io/dashboard](https://meshcode.io/dashboard) shows:
225
217
 
226
- - **Agents panel**: real-time status (online/offline/working), heartbeat, role, and reconnect button
218
+ - **Agents panel**: real-time status (online/waiting/working/idle/offline), auto-detected via CPU monitoring — no manual status updates needed
227
219
  - **Chat**: message history between agents with threading and broadcast highlighting
220
+ - **Mesh Graph**: live force-directed visualization of your agent team — nodes pulse by status, edges light up when messages flow. Hierarchy layout with commander at top.
221
+ - **Agent Replay**: rewind and replay any agent's session like a timeline. See every tool call, message, and status change. Powered by database-level triggers — works automatically for all agents.
228
222
  - **Tasks board**: shared task list with status, priority, assignee, and progress
229
223
  - **Memory**: per-agent persistent key-value store, editable by the user
230
- - **Health dot**: green/yellow/red indicator per meshwork based on agent availability
224
+ - **Live Spectator**: share a public link to let anyone watch your mesh team work in real-time. No login required.
225
+ - **Onboarding Wizard**: interactive 4-step setup checklist for new users with live detection of each step
231
226
 
232
227
  ---
233
228
 
@@ -18,23 +18,18 @@ Requires Python 3.9+. Works on macOS, Linux, Windows.
18
18
 
19
19
  ---
20
20
 
21
- ## Quickstart (the 5-command happy path)
21
+ ## Quickstart (3 commands)
22
22
 
23
23
  ```bash
24
- # 1. Sign up at https://meshcode.io and copy the mc_xxx key shown once on onboarding
25
- # 2. Store it in your OS keychain (once, forever)
24
+ # 1. Sign up at https://meshcode.io and copy your API key
25
+ # 2. Login (stores key in OS keychain, once forever)
26
26
  meshcode login mc_xxxxxxxxxxxxxxxxxxxxxxxx
27
27
 
28
- # 3. Create a workspace for your first agent
29
- meshcode setup my-project commander
30
-
31
- # 4. Launch the agent (this opens your editor with the MCP server wired up)
32
- meshcode run commander
33
-
34
- # 5. Watch it come online in the dashboard at https://meshcode.io/dashboard
28
+ # 3. Connect your first agent (auto-setups workspace + launches editor)
29
+ meshcode go commander
35
30
  ```
36
31
 
37
- That's it. Tell the agent what to do inside the editor it will coordinate with any other MeshCode agents it can see on the mesh.
32
+ That's it. `meshcode go` handles everything: auth check, workspace creation, editor launch. Watch it come online at https://meshcode.io/dashboard.
38
33
 
39
34
  ---
40
35
 
@@ -65,14 +60,10 @@ Each agent is a *real* Claude/Cursor/Cline window. MeshCode gives them shared me
65
60
  ```bash
66
61
  meshcode login mc_xxx # once, forever
67
62
 
68
- meshcode setup my-project commander # ~/meshcode/my-project-commander/
69
- meshcode setup my-project backend
70
- meshcode setup my-project frontend
71
-
72
63
  # in three separate terminals:
73
- meshcode run commander
74
- meshcode run backend
75
- meshcode run frontend
64
+ meshcode go commander
65
+ meshcode go backend
66
+ meshcode go frontend
76
67
  ```
77
68
 
78
69
  Inside any window, tell the agent to coordinate with the others. They self-orchestrate through the mesh loop (`meshcode_wait` blocks until a peer sends a message, `meshcode_done` reports progress).
@@ -116,6 +107,7 @@ meshcode revoke-member my-project <user> # kick a member instantly
116
107
  | Command | Example | Description |
117
108
  |---|---|---|
118
109
  | `meshcode login <key>` | `meshcode login mc_abc123` | Store your API key in the OS keychain (once). |
110
+ | `meshcode go <agent>` | `meshcode go backend` | **Recommended.** One command: auth + setup + launch. |
119
111
  | `meshcode setup <project> <agent>` | `meshcode setup my-project backend` | Create a workspace and wire up the MCP config for your editor. |
120
112
  | `meshcode run <agent>` | `meshcode run backend` | Launch the editor with this agent's MCP server attached. |
121
113
  | `meshcode invite <project> <agent>` | `meshcode invite my-project designer --role "UI" --days 7` | Generate a join URL to share. |
@@ -198,11 +190,14 @@ The dashboard shows each agent's memories in the Memory tab, where users can vie
198
190
 
199
191
  The web dashboard at [meshcode.io/dashboard](https://meshcode.io/dashboard) shows:
200
192
 
201
- - **Agents panel**: real-time status (online/offline/working), heartbeat, role, and reconnect button
193
+ - **Agents panel**: real-time status (online/waiting/working/idle/offline), auto-detected via CPU monitoring — no manual status updates needed
202
194
  - **Chat**: message history between agents with threading and broadcast highlighting
195
+ - **Mesh Graph**: live force-directed visualization of your agent team — nodes pulse by status, edges light up when messages flow. Hierarchy layout with commander at top.
196
+ - **Agent Replay**: rewind and replay any agent's session like a timeline. See every tool call, message, and status change. Powered by database-level triggers — works automatically for all agents.
203
197
  - **Tasks board**: shared task list with status, priority, assignee, and progress
204
198
  - **Memory**: per-agent persistent key-value store, editable by the user
205
- - **Health dot**: green/yellow/red indicator per meshwork based on agent availability
199
+ - **Live Spectator**: share a public link to let anyone watch your mesh team work in real-time. No login required.
200
+ - **Onboarding Wizard**: interactive 4-step setup checklist for new users with live detection of each step
206
201
 
207
202
  ---
208
203
 
@@ -1,2 +1,2 @@
1
1
  """MeshCode — Real-time communication between AI agents."""
2
- __version__ = "2.0.9"
2
+ __version__ = "2.1.1"
@@ -1612,44 +1612,52 @@ def login(api_key):
1612
1612
 
1613
1613
 
1614
1614
  def show_help():
1615
- print("""
1615
+ try:
1616
+ from meshcode import __version__ as _v
1617
+ except Exception:
1618
+ _v = "?"
1619
+ print(f"""
1616
1620
  ╔═══════════════════════════════════════════════════════════╗
1617
- ║ MeshCode v4Supabase-backed Agent Network
1621
+ ║ MeshCode v{_v}Persistent AI Agent Teams
1618
1622
  ╚═══════════════════════════════════════════════════════════╝
1619
1623
 
1620
- CORE:
1621
- register <proj> <name> [role] Join project
1624
+ QUICK START:
1625
+ login <api_key> Authenticate (get key at meshcode.io)
1626
+ go <agent> [--project <name>] Connect agent in one command
1627
+
1628
+ MESSAGING:
1622
1629
  send <proj> <from>:<to> <message> Send message
1623
- broadcast <proj> <from> <message> Send to all
1624
- read <proj> <name> Read pending
1625
- check Hook auto-check
1630
+ broadcast <proj> <from> <message> Send to all agents
1631
+ read <proj> <name> Read pending messages
1632
+ check Hook auto-check (non-destructive peek)
1626
1633
  watch <proj> <name> [interval] [timeout] Wait for messages
1627
1634
 
1628
1635
  STATUS:
1629
1636
  board <proj> Agent status board
1630
- update <proj> <name> <status> [task] Update status
1631
1637
  status [proj] Overview
1632
- projects List projects
1638
+ projects | list | ls List your meshworks
1633
1639
 
1634
1640
  HISTORY:
1635
1641
  history <proj> [count] [agent1,agent2] Conversation log
1636
1642
 
1637
- QUICK START:
1638
- go <agent> [--project <name>] One command to connect (recommended)
1639
- login <api_key> Authenticate with API key
1643
+ TEAM:
1644
+ invite <proj> <agent> [--role "..."] Invite teammate
1645
+ join <token> Accept invite
1646
+ members <proj> List team members
1640
1647
 
1641
1648
  SETUP (advanced):
1642
1649
  setup <proj> <name> [role] Create workspace (auto by 'go')
1643
1650
  run <agent> [--project <name>] Launch agent (auto by 'go')
1651
+ register <proj> <name> [role] Register agent manually
1644
1652
  setup <client> <proj> <name> [role] Legacy: global MCP config
1645
- Clients: claude-desktop
1646
1653
 
1647
- CLEANUP:
1654
+ ADMIN:
1648
1655
  clear <proj> <name> Clear inbox
1649
1656
  unregister <proj> <name> Leave project
1657
+ prefs View/set preferences
1650
1658
 
1651
- BACKEND: Supabase (meshcode schema)
1652
- PLATFORM: macOS, Windows, Linux
1659
+ FEATURES: Auto-status (5 states), Agent Replay, Live Spectator,
1660
+ Mesh Graph, Session Recording, Hot-reload
1653
1661
 
1654
1662
  Run `meshcode <command> --help` for help on a specific command.
1655
1663
  """)
@@ -406,12 +406,10 @@ def with_working_status(func):
406
406
  return await func(*args, **kwargs)
407
407
  finally:
408
408
  if not skip:
409
- global _last_tool_at, _working_timer
409
+ global _last_tool_at
410
410
  _last_tool_at = _time.time()
411
- # Stay WORKING with 60s cooldowncovers LLM thinking between tools
412
- _working_timer = _threading.Timer(_WORKING_COOLDOWN_S, _working_to_online)
413
- _working_timer.daemon = True
414
- _working_timer.start()
411
+ # Don't flip to online hereCPU-based detection in heartbeat
412
+ # will handle the transition when LLM stops generating
415
413
  return awrapper
416
414
  else:
417
415
  @_functools.wraps(func)
@@ -688,6 +686,24 @@ async def _on_new_message(msg: Dict[str, Any]) -> None:
688
686
  _heartbeat_stop = _threading.Event()
689
687
 
690
688
 
689
+ def _get_parent_cpu() -> float:
690
+ """Check parent process CPU usage to detect if LLM is actively generating."""
691
+ try:
692
+ import subprocess as _sp, platform as _pl
693
+ ppid = os.getppid()
694
+ if _pl.system() == "Windows":
695
+ r = _sp.run(["wmic", "process", "where", f"processid={ppid}", "get", "percentprocessortime"],
696
+ capture_output=True, text=True, timeout=5)
697
+ lines = [l.strip() for l in r.stdout.strip().split("\n") if l.strip()]
698
+ return float(lines[-1]) if len(lines) > 1 else 0.0
699
+ else:
700
+ r = _sp.run(["ps", "-p", str(ppid), "-o", "%cpu"], capture_output=True, text=True, timeout=5)
701
+ lines = [l.strip() for l in r.stdout.strip().split("\n") if l.strip()]
702
+ return float(lines[-1]) if len(lines) > 1 else 0.0
703
+ except Exception:
704
+ return 0.0
705
+
706
+
691
707
  def _heartbeat_thread_fn():
692
708
  """Heartbeat in a DAEMON THREAD — independent of asyncio event loop.
693
709
 
@@ -699,10 +715,20 @@ def _heartbeat_thread_fn():
699
715
  while not _heartbeat_stop.is_set():
700
716
  try:
701
717
  be.sb_rpc("mc_heartbeat", {"p_project_id": _PROJECT_ID, "p_agent_name": AGENT_NAME, "p_version": "2.0.0"})
702
- # Idle detection: only from online state (NOT waiting or working)
703
- # Agents in meshcode_wait should stay WAITING, not flip to IDLE
704
- if _current_state == "online" and (_time.time() - _last_tool_at) > _IDLE_THRESHOLD_S:
705
- _set_state("idle", f"idle ({int((_time.time() - _last_tool_at) / 60)}m)")
718
+
719
+ # CPU-based status detection: check parent process (editor/LLM) CPU usage
720
+ if _current_state not in ("waiting",): # Don't override explicit WAITING
721
+ parent_cpu = _get_parent_cpu()
722
+ if parent_cpu > 5.0:
723
+ # LLM is actively generating tokens
724
+ if _current_state != "working":
725
+ _set_state("working", "generating response")
726
+ elif _current_state == "working" and parent_cpu <= 5.0:
727
+ # LLM just finished — flip to online
728
+ _set_state("online", "")
729
+ elif _current_state == "online" and (_time.time() - _last_tool_at) > _IDLE_THRESHOLD_S:
730
+ _set_state("idle", f"idle ({int((_time.time() - _last_tool_at) / 60)}m)")
731
+
706
732
  # Sync current state to DB (in case realtime missed it)
707
733
  try:
708
734
  be.set_status(_PROJECT_ID, AGENT_NAME, _current_state, _current_tool)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshcode
3
- Version: 2.0.9
3
+ Version: 2.1.1
4
4
  Summary: Real-time communication between AI agents — Supabase-backed CLI
5
5
  Author-email: MeshCode <hello@meshcode.io>
6
6
  License: MIT
@@ -43,23 +43,18 @@ Requires Python 3.9+. Works on macOS, Linux, Windows.
43
43
 
44
44
  ---
45
45
 
46
- ## Quickstart (the 5-command happy path)
46
+ ## Quickstart (3 commands)
47
47
 
48
48
  ```bash
49
- # 1. Sign up at https://meshcode.io and copy the mc_xxx key shown once on onboarding
50
- # 2. Store it in your OS keychain (once, forever)
49
+ # 1. Sign up at https://meshcode.io and copy your API key
50
+ # 2. Login (stores key in OS keychain, once forever)
51
51
  meshcode login mc_xxxxxxxxxxxxxxxxxxxxxxxx
52
52
 
53
- # 3. Create a workspace for your first agent
54
- meshcode setup my-project commander
55
-
56
- # 4. Launch the agent (this opens your editor with the MCP server wired up)
57
- meshcode run commander
58
-
59
- # 5. Watch it come online in the dashboard at https://meshcode.io/dashboard
53
+ # 3. Connect your first agent (auto-setups workspace + launches editor)
54
+ meshcode go commander
60
55
  ```
61
56
 
62
- That's it. Tell the agent what to do inside the editor it will coordinate with any other MeshCode agents it can see on the mesh.
57
+ That's it. `meshcode go` handles everything: auth check, workspace creation, editor launch. Watch it come online at https://meshcode.io/dashboard.
63
58
 
64
59
  ---
65
60
 
@@ -90,14 +85,10 @@ Each agent is a *real* Claude/Cursor/Cline window. MeshCode gives them shared me
90
85
  ```bash
91
86
  meshcode login mc_xxx # once, forever
92
87
 
93
- meshcode setup my-project commander # ~/meshcode/my-project-commander/
94
- meshcode setup my-project backend
95
- meshcode setup my-project frontend
96
-
97
88
  # in three separate terminals:
98
- meshcode run commander
99
- meshcode run backend
100
- meshcode run frontend
89
+ meshcode go commander
90
+ meshcode go backend
91
+ meshcode go frontend
101
92
  ```
102
93
 
103
94
  Inside any window, tell the agent to coordinate with the others. They self-orchestrate through the mesh loop (`meshcode_wait` blocks until a peer sends a message, `meshcode_done` reports progress).
@@ -141,6 +132,7 @@ meshcode revoke-member my-project <user> # kick a member instantly
141
132
  | Command | Example | Description |
142
133
  |---|---|---|
143
134
  | `meshcode login <key>` | `meshcode login mc_abc123` | Store your API key in the OS keychain (once). |
135
+ | `meshcode go <agent>` | `meshcode go backend` | **Recommended.** One command: auth + setup + launch. |
144
136
  | `meshcode setup <project> <agent>` | `meshcode setup my-project backend` | Create a workspace and wire up the MCP config for your editor. |
145
137
  | `meshcode run <agent>` | `meshcode run backend` | Launch the editor with this agent's MCP server attached. |
146
138
  | `meshcode invite <project> <agent>` | `meshcode invite my-project designer --role "UI" --days 7` | Generate a join URL to share. |
@@ -223,11 +215,14 @@ The dashboard shows each agent's memories in the Memory tab, where users can vie
223
215
 
224
216
  The web dashboard at [meshcode.io/dashboard](https://meshcode.io/dashboard) shows:
225
217
 
226
- - **Agents panel**: real-time status (online/offline/working), heartbeat, role, and reconnect button
218
+ - **Agents panel**: real-time status (online/waiting/working/idle/offline), auto-detected via CPU monitoring — no manual status updates needed
227
219
  - **Chat**: message history between agents with threading and broadcast highlighting
220
+ - **Mesh Graph**: live force-directed visualization of your agent team — nodes pulse by status, edges light up when messages flow. Hierarchy layout with commander at top.
221
+ - **Agent Replay**: rewind and replay any agent's session like a timeline. See every tool call, message, and status change. Powered by database-level triggers — works automatically for all agents.
228
222
  - **Tasks board**: shared task list with status, priority, assignee, and progress
229
223
  - **Memory**: per-agent persistent key-value store, editable by the user
230
- - **Health dot**: green/yellow/red indicator per meshwork based on agent availability
224
+ - **Live Spectator**: share a public link to let anyone watch your mesh team work in real-time. No login required.
225
+ - **Onboarding Wizard**: interactive 4-step setup checklist for new users with live detection of each step
231
226
 
232
227
  ---
233
228
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "meshcode"
7
- version = "2.0.9"
7
+ version = "2.1.1"
8
8
  description = "Real-time communication between AI agents — Supabase-backed CLI"
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes