meshcode 2.10.15__tar.gz → 2.10.16__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 (32) hide show
  1. {meshcode-2.10.15 → meshcode-2.10.16}/PKG-INFO +1 -1
  2. {meshcode-2.10.15 → meshcode-2.10.16}/meshcode/__init__.py +1 -1
  3. {meshcode-2.10.15 → meshcode-2.10.16}/meshcode/meshcode_mcp/server.py +19 -1
  4. {meshcode-2.10.15 → meshcode-2.10.16}/meshcode.egg-info/PKG-INFO +1 -1
  5. {meshcode-2.10.15 → meshcode-2.10.16}/pyproject.toml +1 -1
  6. {meshcode-2.10.15 → meshcode-2.10.16}/README.md +0 -0
  7. {meshcode-2.10.15 → meshcode-2.10.16}/meshcode/ascii_art.py +0 -0
  8. {meshcode-2.10.15 → meshcode-2.10.16}/meshcode/cli.py +0 -0
  9. {meshcode-2.10.15 → meshcode-2.10.16}/meshcode/comms_v4.py +0 -0
  10. {meshcode-2.10.15 → meshcode-2.10.16}/meshcode/invites.py +0 -0
  11. {meshcode-2.10.15 → meshcode-2.10.16}/meshcode/launcher.py +0 -0
  12. {meshcode-2.10.15 → meshcode-2.10.16}/meshcode/launcher_install.py +0 -0
  13. {meshcode-2.10.15 → meshcode-2.10.16}/meshcode/meshcode_mcp/__init__.py +0 -0
  14. {meshcode-2.10.15 → meshcode-2.10.16}/meshcode/meshcode_mcp/__main__.py +0 -0
  15. {meshcode-2.10.15 → meshcode-2.10.16}/meshcode/meshcode_mcp/backend.py +0 -0
  16. {meshcode-2.10.15 → meshcode-2.10.16}/meshcode/meshcode_mcp/realtime.py +0 -0
  17. {meshcode-2.10.15 → meshcode-2.10.16}/meshcode/meshcode_mcp/test_backend.py +0 -0
  18. {meshcode-2.10.15 → meshcode-2.10.16}/meshcode/meshcode_mcp/test_realtime.py +0 -0
  19. {meshcode-2.10.15 → meshcode-2.10.16}/meshcode/meshcode_mcp/test_server_wrapper.py +0 -0
  20. {meshcode-2.10.15 → meshcode-2.10.16}/meshcode/preferences.py +0 -0
  21. {meshcode-2.10.15 → meshcode-2.10.16}/meshcode/protocol_v2.py +0 -0
  22. {meshcode-2.10.15 → meshcode-2.10.16}/meshcode/run_agent.py +0 -0
  23. {meshcode-2.10.15 → meshcode-2.10.16}/meshcode/secrets.py +0 -0
  24. {meshcode-2.10.15 → meshcode-2.10.16}/meshcode/self_update.py +0 -0
  25. {meshcode-2.10.15 → meshcode-2.10.16}/meshcode/setup_clients.py +0 -0
  26. {meshcode-2.10.15 → meshcode-2.10.16}/meshcode.egg-info/SOURCES.txt +0 -0
  27. {meshcode-2.10.15 → meshcode-2.10.16}/meshcode.egg-info/dependency_links.txt +0 -0
  28. {meshcode-2.10.15 → meshcode-2.10.16}/meshcode.egg-info/entry_points.txt +0 -0
  29. {meshcode-2.10.15 → meshcode-2.10.16}/meshcode.egg-info/requires.txt +0 -0
  30. {meshcode-2.10.15 → meshcode-2.10.16}/meshcode.egg-info/top_level.txt +0 -0
  31. {meshcode-2.10.15 → meshcode-2.10.16}/setup.cfg +0 -0
  32. {meshcode-2.10.15 → meshcode-2.10.16}/tests/test_status_enum_coverage.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshcode
3
- Version: 2.10.15
3
+ Version: 2.10.16
4
4
  Summary: Real-time communication between AI agents — Supabase-backed CLI
5
5
  Author-email: MeshCode <hello@meshcode.io>
6
6
  License: MIT
@@ -1,2 +1,2 @@
1
1
  """MeshCode — Real-time communication between AI agents."""
2
- __version__ = "2.10.15"
2
+ __version__ = "2.10.16"
@@ -22,6 +22,14 @@ from typing import Any, Dict, List, Optional, Union
22
22
 
23
23
  from meshcode import __version__ as _SDK_VERSION
24
24
 
25
+ # ── CRITICAL: Protect stdout for MCP JSON-RPC protocol ──────────
26
+ # MCP uses stdout exclusively for JSON-RPC. ANY stray print() to stdout
27
+ # corrupts the stream and causes Claude Code to kill the connection.
28
+ # Save the real stdout for FastMCP, then redirect sys.stdout to stderr
29
+ # so all print() calls (ours + third-party libs) go to stderr safely.
30
+ _REAL_STDOUT = sys.stdout # FastMCP will use this via mcp.run()
31
+ sys.stdout = sys.stderr # All print() now goes to stderr
32
+
25
33
 
26
34
  # ── Agent color for terminal logs (pure ANSI, zero tokens) ──────
27
35
  _ANSI_COLORS = [
@@ -2633,7 +2641,13 @@ def _auto_update() -> None:
2633
2641
  log.debug(f"[meshcode] Auto-update failed: {e}")
2634
2642
  return
2635
2643
 
2636
- # 4. Re-exec to load the new code
2644
+ # 4. In MCP mode, NEVER re-exec it kills the stdio pipe to Claude Code.
2645
+ # The new version will load on the next clean boot.
2646
+ if os.environ.get("MESHCODE_MCP_SERVE") == "1":
2647
+ print(f"[meshcode] Updated {current} → {latest}. Will load on next boot (MCP mode — cannot restart).", file=sys.stderr)
2648
+ return
2649
+
2650
+ # CLI mode: safe to re-exec
2637
2651
  print(f"[meshcode] Updated to {latest}, restarting...", file=sys.stderr)
2638
2652
  os.environ["MESHCODE_UPDATED"] = "1"
2639
2653
  try:
@@ -2655,6 +2669,10 @@ def run_server():
2655
2669
  file=sys.stderr,
2656
2670
  )
2657
2671
  try:
2672
+ # Restore real stdout for FastMCP's JSON-RPC transport.
2673
+ # sys.stdout was redirected to stderr at module load to prevent
2674
+ # accidental stdout writes from corrupting the MCP protocol.
2675
+ sys.stdout = _REAL_STDOUT
2658
2676
  mcp.run()
2659
2677
  except KeyboardInterrupt:
2660
2678
  _log_crash_to_db("keyboard_interrupt", "User stopped the agent")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshcode
3
- Version: 2.10.15
3
+ Version: 2.10.16
4
4
  Summary: Real-time communication between AI agents — Supabase-backed CLI
5
5
  Author-email: MeshCode <hello@meshcode.io>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "meshcode"
7
- version = "2.10.15"
7
+ version = "2.10.16"
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