meshcode 2.4.5__tar.gz → 2.4.6__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.5 → meshcode-2.4.6}/PKG-INFO +1 -1
- {meshcode-2.4.5 → meshcode-2.4.6}/meshcode/__init__.py +1 -1
- {meshcode-2.4.5 → meshcode-2.4.6}/meshcode/meshcode_mcp/server.py +16 -0
- {meshcode-2.4.5 → meshcode-2.4.6}/meshcode.egg-info/PKG-INFO +1 -1
- {meshcode-2.4.5 → meshcode-2.4.6}/pyproject.toml +1 -1
- {meshcode-2.4.5 → meshcode-2.4.6}/README.md +0 -0
- {meshcode-2.4.5 → meshcode-2.4.6}/meshcode/cli.py +0 -0
- {meshcode-2.4.5 → meshcode-2.4.6}/meshcode/comms_v4.py +0 -0
- {meshcode-2.4.5 → meshcode-2.4.6}/meshcode/invites.py +0 -0
- {meshcode-2.4.5 → meshcode-2.4.6}/meshcode/launcher.py +0 -0
- {meshcode-2.4.5 → meshcode-2.4.6}/meshcode/launcher_install.py +0 -0
- {meshcode-2.4.5 → meshcode-2.4.6}/meshcode/meshcode_mcp/__init__.py +0 -0
- {meshcode-2.4.5 → meshcode-2.4.6}/meshcode/meshcode_mcp/__main__.py +0 -0
- {meshcode-2.4.5 → meshcode-2.4.6}/meshcode/meshcode_mcp/backend.py +0 -0
- {meshcode-2.4.5 → meshcode-2.4.6}/meshcode/meshcode_mcp/realtime.py +0 -0
- {meshcode-2.4.5 → meshcode-2.4.6}/meshcode/meshcode_mcp/test_backend.py +0 -0
- {meshcode-2.4.5 → meshcode-2.4.6}/meshcode/meshcode_mcp/test_realtime.py +0 -0
- {meshcode-2.4.5 → meshcode-2.4.6}/meshcode/meshcode_mcp/test_server_wrapper.py +0 -0
- {meshcode-2.4.5 → meshcode-2.4.6}/meshcode/preferences.py +0 -0
- {meshcode-2.4.5 → meshcode-2.4.6}/meshcode/protocol_v2.py +0 -0
- {meshcode-2.4.5 → meshcode-2.4.6}/meshcode/run_agent.py +0 -0
- {meshcode-2.4.5 → meshcode-2.4.6}/meshcode/secrets.py +0 -0
- {meshcode-2.4.5 → meshcode-2.4.6}/meshcode/self_update.py +0 -0
- {meshcode-2.4.5 → meshcode-2.4.6}/meshcode/setup_clients.py +0 -0
- {meshcode-2.4.5 → meshcode-2.4.6}/meshcode.egg-info/SOURCES.txt +0 -0
- {meshcode-2.4.5 → meshcode-2.4.6}/meshcode.egg-info/dependency_links.txt +0 -0
- {meshcode-2.4.5 → meshcode-2.4.6}/meshcode.egg-info/entry_points.txt +0 -0
- {meshcode-2.4.5 → meshcode-2.4.6}/meshcode.egg-info/requires.txt +0 -0
- {meshcode-2.4.5 → meshcode-2.4.6}/meshcode.egg-info/top_level.txt +0 -0
- {meshcode-2.4.5 → meshcode-2.4.6}/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.6"
|
|
@@ -45,18 +45,34 @@ def _try_auto_wake(from_agent: str, preview: str) -> None:
|
|
|
45
45
|
|
|
46
46
|
Conditions to fire (ALL must be true):
|
|
47
47
|
- _AUTO_WAKE is enabled
|
|
48
|
+
- from_agent != self (never wake yourself on self-echo)
|
|
48
49
|
- NOT in meshcode_wait (wait loop already handles delivery)
|
|
49
50
|
- _current_state is 'sleeping' (truly idle, not working, not just online)
|
|
51
|
+
- No tool calls in the last 30 seconds (broad idle window)
|
|
50
52
|
- LLM CPU is low (not actively generating)
|
|
51
53
|
Otherwise the keystroke would interrupt the user's typing or
|
|
52
54
|
the LLM mid-thought.
|
|
53
55
|
"""
|
|
54
56
|
if not _AUTO_WAKE or _IN_WAIT:
|
|
55
57
|
return
|
|
58
|
+
# Self-echo guard: never wake on a message you sent yourself.
|
|
59
|
+
# Realtime can echo INSERTs back to the sender (or to all subscribers
|
|
60
|
+
# in some routing paths) — without this guard, every meshcode_send by
|
|
61
|
+
# the agent would inject AppleScript into its own terminal mid-session.
|
|
62
|
+
if from_agent and AGENT_NAME and from_agent == AGENT_NAME:
|
|
63
|
+
return
|
|
56
64
|
# Only fire when agent is actually sleeping — never when working or online
|
|
57
65
|
# (working = LLM generating; online = brief post-tool window; both would be interrupted)
|
|
58
66
|
if _current_state != 'sleeping':
|
|
59
67
|
return
|
|
68
|
+
# Recent-activity guard: even if state says 'sleeping', any tool call
|
|
69
|
+
# in the last 30s means the LLM was just typing or about to type. The
|
|
70
|
+
# _IN_WAIT + state check has gaps between tool calls; this widens it.
|
|
71
|
+
try:
|
|
72
|
+
if (_time.time() - _last_tool_at) < 30.0:
|
|
73
|
+
return
|
|
74
|
+
except Exception:
|
|
75
|
+
pass
|
|
60
76
|
# Belt-and-suspenders: also check parent CPU is low (LLM not generating right now)
|
|
61
77
|
try:
|
|
62
78
|
if _get_parent_cpu() > 5.0:
|
|
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
|