meshcode 2.4.4__tar.gz → 2.4.5__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.
- {meshcode-2.4.4 → meshcode-2.4.5}/PKG-INFO +1 -1
- {meshcode-2.4.4 → meshcode-2.4.5}/meshcode/__init__.py +1 -1
- {meshcode-2.4.4 → meshcode-2.4.5}/meshcode/meshcode_mcp/server.py +20 -2
- {meshcode-2.4.4 → meshcode-2.4.5}/meshcode.egg-info/PKG-INFO +1 -1
- {meshcode-2.4.4 → meshcode-2.4.5}/pyproject.toml +1 -1
- {meshcode-2.4.4 → meshcode-2.4.5}/README.md +0 -0
- {meshcode-2.4.4 → meshcode-2.4.5}/meshcode/cli.py +0 -0
- {meshcode-2.4.4 → meshcode-2.4.5}/meshcode/comms_v4.py +0 -0
- {meshcode-2.4.4 → meshcode-2.4.5}/meshcode/invites.py +0 -0
- {meshcode-2.4.4 → meshcode-2.4.5}/meshcode/launcher.py +0 -0
- {meshcode-2.4.4 → meshcode-2.4.5}/meshcode/launcher_install.py +0 -0
- {meshcode-2.4.4 → meshcode-2.4.5}/meshcode/meshcode_mcp/__init__.py +0 -0
- {meshcode-2.4.4 → meshcode-2.4.5}/meshcode/meshcode_mcp/__main__.py +0 -0
- {meshcode-2.4.4 → meshcode-2.4.5}/meshcode/meshcode_mcp/backend.py +0 -0
- {meshcode-2.4.4 → meshcode-2.4.5}/meshcode/meshcode_mcp/realtime.py +0 -0
- {meshcode-2.4.4 → meshcode-2.4.5}/meshcode/meshcode_mcp/test_backend.py +0 -0
- {meshcode-2.4.4 → meshcode-2.4.5}/meshcode/meshcode_mcp/test_realtime.py +0 -0
- {meshcode-2.4.4 → meshcode-2.4.5}/meshcode/meshcode_mcp/test_server_wrapper.py +0 -0
- {meshcode-2.4.4 → meshcode-2.4.5}/meshcode/preferences.py +0 -0
- {meshcode-2.4.4 → meshcode-2.4.5}/meshcode/protocol_v2.py +0 -0
- {meshcode-2.4.4 → meshcode-2.4.5}/meshcode/run_agent.py +0 -0
- {meshcode-2.4.4 → meshcode-2.4.5}/meshcode/secrets.py +0 -0
- {meshcode-2.4.4 → meshcode-2.4.5}/meshcode/self_update.py +0 -0
- {meshcode-2.4.4 → meshcode-2.4.5}/meshcode/setup_clients.py +0 -0
- {meshcode-2.4.4 → meshcode-2.4.5}/meshcode.egg-info/SOURCES.txt +0 -0
- {meshcode-2.4.4 → meshcode-2.4.5}/meshcode.egg-info/dependency_links.txt +0 -0
- {meshcode-2.4.4 → meshcode-2.4.5}/meshcode.egg-info/entry_points.txt +0 -0
- {meshcode-2.4.4 → meshcode-2.4.5}/meshcode.egg-info/requires.txt +0 -0
- {meshcode-2.4.4 → meshcode-2.4.5}/meshcode.egg-info/top_level.txt +0 -0
- {meshcode-2.4.4 → meshcode-2.4.5}/setup.cfg +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""MeshCode — Real-time communication between AI agents."""
|
|
2
|
-
__version__ = "2.4.
|
|
2
|
+
__version__ = "2.4.5"
|
|
@@ -37,14 +37,32 @@ _AUTO_WAKE = os.environ.get("MESHCODE_AUTO_WAKE", "1").lower() not in ("0", "fal
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
def _try_auto_wake(from_agent: str, preview: str) -> None:
|
|
40
|
-
"""Inject a nudge into the terminal
|
|
40
|
+
"""Inject a nudge into the terminal ONLY when agent is truly sleeping.
|
|
41
41
|
|
|
42
42
|
macOS: AppleScript → keystroke into Terminal/iTerm2
|
|
43
43
|
Windows: PowerShell SendKeys to the console window
|
|
44
44
|
Linux: xdotool (best-effort)
|
|
45
|
+
|
|
46
|
+
Conditions to fire (ALL must be true):
|
|
47
|
+
- _AUTO_WAKE is enabled
|
|
48
|
+
- NOT in meshcode_wait (wait loop already handles delivery)
|
|
49
|
+
- _current_state is 'sleeping' (truly idle, not working, not just online)
|
|
50
|
+
- LLM CPU is low (not actively generating)
|
|
51
|
+
Otherwise the keystroke would interrupt the user's typing or
|
|
52
|
+
the LLM mid-thought.
|
|
45
53
|
"""
|
|
46
|
-
if
|
|
54
|
+
if not _AUTO_WAKE or _IN_WAIT:
|
|
55
|
+
return
|
|
56
|
+
# Only fire when agent is actually sleeping — never when working or online
|
|
57
|
+
# (working = LLM generating; online = brief post-tool window; both would be interrupted)
|
|
58
|
+
if _current_state != 'sleeping':
|
|
47
59
|
return
|
|
60
|
+
# Belt-and-suspenders: also check parent CPU is low (LLM not generating right now)
|
|
61
|
+
try:
|
|
62
|
+
if _get_parent_cpu() > 5.0:
|
|
63
|
+
return # LLM is actively generating, don't interrupt
|
|
64
|
+
except Exception:
|
|
65
|
+
pass
|
|
48
66
|
import subprocess, platform, re
|
|
49
67
|
# Sanitize inputs: strip everything except alphanumeric, spaces, basic punctuation
|
|
50
68
|
safe_agent = re.sub(r'[^a-zA-Z0-9_\- ]', '', from_agent)[:50]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|