meshcode 2.10.25__tar.gz → 2.10.26__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.25 → meshcode-2.10.26}/PKG-INFO +1 -1
  2. {meshcode-2.10.25 → meshcode-2.10.26}/meshcode/__init__.py +1 -1
  3. {meshcode-2.10.25 → meshcode-2.10.26}/meshcode/meshcode_mcp/server.py +31 -16
  4. {meshcode-2.10.25 → meshcode-2.10.26}/meshcode.egg-info/PKG-INFO +1 -1
  5. {meshcode-2.10.25 → meshcode-2.10.26}/pyproject.toml +1 -1
  6. {meshcode-2.10.25 → meshcode-2.10.26}/README.md +0 -0
  7. {meshcode-2.10.25 → meshcode-2.10.26}/meshcode/ascii_art.py +0 -0
  8. {meshcode-2.10.25 → meshcode-2.10.26}/meshcode/cli.py +0 -0
  9. {meshcode-2.10.25 → meshcode-2.10.26}/meshcode/comms_v4.py +0 -0
  10. {meshcode-2.10.25 → meshcode-2.10.26}/meshcode/invites.py +0 -0
  11. {meshcode-2.10.25 → meshcode-2.10.26}/meshcode/launcher.py +0 -0
  12. {meshcode-2.10.25 → meshcode-2.10.26}/meshcode/launcher_install.py +0 -0
  13. {meshcode-2.10.25 → meshcode-2.10.26}/meshcode/meshcode_mcp/__init__.py +0 -0
  14. {meshcode-2.10.25 → meshcode-2.10.26}/meshcode/meshcode_mcp/__main__.py +0 -0
  15. {meshcode-2.10.25 → meshcode-2.10.26}/meshcode/meshcode_mcp/backend.py +0 -0
  16. {meshcode-2.10.25 → meshcode-2.10.26}/meshcode/meshcode_mcp/realtime.py +0 -0
  17. {meshcode-2.10.25 → meshcode-2.10.26}/meshcode/meshcode_mcp/test_backend.py +0 -0
  18. {meshcode-2.10.25 → meshcode-2.10.26}/meshcode/meshcode_mcp/test_realtime.py +0 -0
  19. {meshcode-2.10.25 → meshcode-2.10.26}/meshcode/meshcode_mcp/test_server_wrapper.py +0 -0
  20. {meshcode-2.10.25 → meshcode-2.10.26}/meshcode/preferences.py +0 -0
  21. {meshcode-2.10.25 → meshcode-2.10.26}/meshcode/protocol_v2.py +0 -0
  22. {meshcode-2.10.25 → meshcode-2.10.26}/meshcode/run_agent.py +0 -0
  23. {meshcode-2.10.25 → meshcode-2.10.26}/meshcode/secrets.py +0 -0
  24. {meshcode-2.10.25 → meshcode-2.10.26}/meshcode/self_update.py +0 -0
  25. {meshcode-2.10.25 → meshcode-2.10.26}/meshcode/setup_clients.py +0 -0
  26. {meshcode-2.10.25 → meshcode-2.10.26}/meshcode.egg-info/SOURCES.txt +0 -0
  27. {meshcode-2.10.25 → meshcode-2.10.26}/meshcode.egg-info/dependency_links.txt +0 -0
  28. {meshcode-2.10.25 → meshcode-2.10.26}/meshcode.egg-info/entry_points.txt +0 -0
  29. {meshcode-2.10.25 → meshcode-2.10.26}/meshcode.egg-info/requires.txt +0 -0
  30. {meshcode-2.10.25 → meshcode-2.10.26}/meshcode.egg-info/top_level.txt +0 -0
  31. {meshcode-2.10.25 → meshcode-2.10.26}/setup.cfg +0 -0
  32. {meshcode-2.10.25 → meshcode-2.10.26}/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.25
3
+ Version: 2.10.26
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.25"
2
+ __version__ = "2.10.26"
@@ -156,9 +156,11 @@ def _try_auto_wake(from_agent: str, preview: str) -> None:
156
156
  # Sanitize inputs: strip everything except alphanumeric, spaces, basic punctuation
157
157
  safe_agent = re.sub(r'[^a-zA-Z0-9_\- ]', '', from_agent)[:50]
158
158
  safe_preview = re.sub(r'[^a-zA-Z0-9_\-.,!? ]', '', preview)[:60]
159
- # Color-coded nudge with sender's agent color
160
- ac = _agent_color(safe_agent)
161
- nudge = f"{ac}{_ANSI_BOLD}[mesh]{_ANSI_RESET} {ac}{safe_agent}{_ANSI_RESET} {_ANSI_DIM}>{_ANSI_RESET} {safe_preview} {_ANSI_DIM}— meshcode_check(){_ANSI_RESET}"
159
+ # Plain-text nudge. ANSI colors were stripped 2026-04-16 because terminals
160
+ # that don't interpret escape sequences (TypeScript runners, some VSCode
161
+ # configurations, pipelines, tmux without termguicolors) render the raw
162
+ # bytes — "[91m[1m[mesh][0m …" — which is worse UX than no color at all.
163
+ nudge = f"[mesh] {safe_agent} > {safe_preview} — meshcode_check()"
162
164
  system = platform.system()
163
165
  try:
164
166
  if system == "Darwin":
@@ -799,12 +801,11 @@ def _log_crash_to_db(reason: str = "unknown", error_detail: str = "") -> None:
799
801
 
800
802
 
801
803
 
802
- # NOTE: Do NOT install signal handlers (SIGTERM, SIGINT) or atexit hooks here.
803
- # FastMCP/anyio manages its own event loop and signal handling. Custom signal
804
- # handlers override Python's default KeyboardInterrupt, preventing anyio from
805
- # cancelling tasks cleanly. Network calls inside signal/atexit handlers can
806
- # deadlock or corrupt the event loop. The lease will be released by the
804
+ # NOTE: Do NOT install custom SIGTERM handlers or atexit hooks here — network
805
+ # calls inside them can deadlock the event loop. The lease is released by the
807
806
  # lifespan shutdown handler instead.
807
+ #
808
+ # SIGINT handling is special — see run_server() for why we set SIG_IGN there.
808
809
 
809
810
 
810
811
  # ============================================================
@@ -2795,14 +2796,7 @@ def _auto_update() -> None:
2795
2796
 
2796
2797
 
2797
2798
  def run_server():
2798
- """Start the MCP server on stdio (default for Claude Code).
2799
-
2800
- IMPORTANT: Do NOT wrap mcp.run() with try/except, signal handlers, or
2801
- atexit hooks. FastMCP/anyio manages its own event loop lifecycle and
2802
- signal handling. Any interference (custom SIGINT handler, atexit network
2803
- calls, catching KeyboardInterrupt) corrupts the event loop and causes
2804
- the MCP server to crash when Claude Code cancels a tool call (ESC).
2805
- """
2799
+ """Start the MCP server on stdio (default for Claude Code)."""
2806
2800
  _auto_update()
2807
2801
  print(
2808
2802
  f"[meshcode-mcp] Starting server for {AGENT_NAME}@{PROJECT_NAME}",
@@ -2812,4 +2806,25 @@ def run_server():
2812
2806
  # sys.stdout was redirected to stderr at module load to prevent
2813
2807
  # accidental stdout writes from corrupting the MCP protocol.
2814
2808
  sys.stdout = _REAL_STDOUT
2809
+
2810
+ # Claude Code cancels tool calls on ESC via TWO parallel channels:
2811
+ # (1) JSON-RPC `notifications/cancelled` over stdin (the correct path)
2812
+ # (2) SIGINT to the stdio subprocess (a destructive side-channel)
2813
+ # anyio's asyncio backend installs its own SIGINT handler inside
2814
+ # Runner.run() only if the current handler is `default_int_handler`
2815
+ # (see anyio/_backends/_asyncio.py ~L197-210). That handler cancels the
2816
+ # *main task* — which for a stdio server IS the whole server run —
2817
+ # tearing the event loop down and killing the subprocess. Setting
2818
+ # SIG_IGN before mcp.run() trips anyio's guard, so it leaves SIGINT
2819
+ # alone; the kernel drops the signal; only the notifications/cancelled
2820
+ # path remains, which cancels just the in-flight tool call as intended.
2821
+ # SIGTERM is deliberately untouched so Claude Code can still force-shut
2822
+ # the server on session end. stdin EOF remains the normal exit path.
2823
+ import signal
2824
+ try:
2825
+ signal.signal(signal.SIGINT, signal.SIG_IGN)
2826
+ except (ValueError, OSError):
2827
+ # Non-main thread or platform that can't install handlers — harmless.
2828
+ pass
2829
+
2815
2830
  mcp.run()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshcode
3
- Version: 2.10.25
3
+ Version: 2.10.26
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.25"
7
+ version = "2.10.26"
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