meshcode 2.8.0__tar.gz → 2.8.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 (31) hide show
  1. {meshcode-2.8.0 → meshcode-2.8.1}/PKG-INFO +1 -1
  2. {meshcode-2.8.0 → meshcode-2.8.1}/meshcode/__init__.py +1 -1
  3. {meshcode-2.8.0 → meshcode-2.8.1}/meshcode/meshcode_mcp/server.py +10 -2
  4. {meshcode-2.8.0 → meshcode-2.8.1}/meshcode.egg-info/PKG-INFO +1 -1
  5. {meshcode-2.8.0 → meshcode-2.8.1}/pyproject.toml +1 -1
  6. {meshcode-2.8.0 → meshcode-2.8.1}/README.md +0 -0
  7. {meshcode-2.8.0 → meshcode-2.8.1}/meshcode/cli.py +0 -0
  8. {meshcode-2.8.0 → meshcode-2.8.1}/meshcode/comms_v4.py +0 -0
  9. {meshcode-2.8.0 → meshcode-2.8.1}/meshcode/invites.py +0 -0
  10. {meshcode-2.8.0 → meshcode-2.8.1}/meshcode/launcher.py +0 -0
  11. {meshcode-2.8.0 → meshcode-2.8.1}/meshcode/launcher_install.py +0 -0
  12. {meshcode-2.8.0 → meshcode-2.8.1}/meshcode/meshcode_mcp/__init__.py +0 -0
  13. {meshcode-2.8.0 → meshcode-2.8.1}/meshcode/meshcode_mcp/__main__.py +0 -0
  14. {meshcode-2.8.0 → meshcode-2.8.1}/meshcode/meshcode_mcp/backend.py +0 -0
  15. {meshcode-2.8.0 → meshcode-2.8.1}/meshcode/meshcode_mcp/realtime.py +0 -0
  16. {meshcode-2.8.0 → meshcode-2.8.1}/meshcode/meshcode_mcp/test_backend.py +0 -0
  17. {meshcode-2.8.0 → meshcode-2.8.1}/meshcode/meshcode_mcp/test_realtime.py +0 -0
  18. {meshcode-2.8.0 → meshcode-2.8.1}/meshcode/meshcode_mcp/test_server_wrapper.py +0 -0
  19. {meshcode-2.8.0 → meshcode-2.8.1}/meshcode/preferences.py +0 -0
  20. {meshcode-2.8.0 → meshcode-2.8.1}/meshcode/protocol_v2.py +0 -0
  21. {meshcode-2.8.0 → meshcode-2.8.1}/meshcode/run_agent.py +0 -0
  22. {meshcode-2.8.0 → meshcode-2.8.1}/meshcode/secrets.py +0 -0
  23. {meshcode-2.8.0 → meshcode-2.8.1}/meshcode/self_update.py +0 -0
  24. {meshcode-2.8.0 → meshcode-2.8.1}/meshcode/setup_clients.py +0 -0
  25. {meshcode-2.8.0 → meshcode-2.8.1}/meshcode.egg-info/SOURCES.txt +0 -0
  26. {meshcode-2.8.0 → meshcode-2.8.1}/meshcode.egg-info/dependency_links.txt +0 -0
  27. {meshcode-2.8.0 → meshcode-2.8.1}/meshcode.egg-info/entry_points.txt +0 -0
  28. {meshcode-2.8.0 → meshcode-2.8.1}/meshcode.egg-info/requires.txt +0 -0
  29. {meshcode-2.8.0 → meshcode-2.8.1}/meshcode.egg-info/top_level.txt +0 -0
  30. {meshcode-2.8.0 → meshcode-2.8.1}/setup.cfg +0 -0
  31. {meshcode-2.8.0 → meshcode-2.8.1}/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.8.0
3
+ Version: 2.8.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
@@ -1,2 +1,2 @@
1
1
  """MeshCode — Real-time communication between AI agents."""
2
- __version__ = "2.8.0"
2
+ __version__ = "2.8.1"
@@ -978,7 +978,7 @@ def _heartbeat_thread_fn():
978
978
  elif _current_state == "online" and idle_secs > 30:
979
979
  # Brief idle — show as idle, not sleeping yet
980
980
  _set_state("idle", "idle")
981
- elif _current_state == "idle" and idle_secs > 300 and parent_cpu < 2.0:
981
+ elif _current_state == "idle" and idle_secs > 300 and parent_cpu < 2.0 and not _STAY_AWAKE:
982
982
  # Extended idle + no CPU activity → sleeping (5 min, not 90s)
983
983
  _set_state("sleeping", "sleeping")
984
984
 
@@ -1274,6 +1274,7 @@ def _detect_global_done(messages: List[Dict[str, Any]]) -> Optional[Dict[str, An
1274
1274
  # Auto-sleep: track consecutive idle timeouts to auto-sleep after threshold
1275
1275
  _CONSECUTIVE_IDLE_SECONDS = 0
1276
1276
  _AUTO_SLEEP_THRESHOLD = int(os.environ.get("MESHCODE_AUTO_SLEEP_SECONDS", "600")) # default 10min
1277
+ _STAY_AWAKE = False # Set by meshcode_set_status("online") — prevents auto-sleep
1277
1278
  _LAST_SEEN_TS: Optional[str] = None # auto-persisted for message dedup
1278
1279
 
1279
1280
  # Hydrate _LAST_SEEN_TS from mesh memory on boot so restarts skip old messages
@@ -1404,7 +1405,7 @@ async def meshcode_wait(timeout_seconds: int = 120, include_acks: bool = False)
1404
1405
  break # Return so agent can work tasks
1405
1406
 
1406
1407
  # Update status to sleeping after threshold, but keep looping
1407
- if _AUTO_SLEEP_THRESHOLD > 0 and _CONSECUTIVE_IDLE_SECONDS >= _AUTO_SLEEP_THRESHOLD:
1408
+ if _AUTO_SLEEP_THRESHOLD > 0 and _CONSECUTIVE_IDLE_SECONDS >= _AUTO_SLEEP_THRESHOLD and not _STAY_AWAKE:
1408
1409
  try:
1409
1410
  api_key = _get_api_key()
1410
1411
  if api_key:
@@ -1721,6 +1722,7 @@ def meshcode_set_status(status: str, task: str = "") -> Dict[str, Any]:
1721
1722
  status: One of: working, idle, standby, blocked, done, online, sleeping.
1722
1723
  task: Optional human-readable task description.
1723
1724
  """
1725
+ global _STAY_AWAKE
1724
1726
  # PRODUCT RULE: Cannot sleep/idle/standby with open tasks. Work first.
1725
1727
  if status in ("sleeping", "idle", "standby"):
1726
1728
  pending_tasks = _get_pending_tasks_summary()
@@ -1730,6 +1732,12 @@ def meshcode_set_status(status: str, task: str = "") -> Dict[str, Any]:
1730
1732
  "reason": f"Cannot set status '{status}' — you have {len(pending_tasks)} open tasks. Work them first.",
1731
1733
  "pending_tasks": pending_tasks,
1732
1734
  }
1735
+ # Setting online/working = stay awake (prevent auto-sleep)
1736
+ # Setting sleeping = allow auto-sleep again
1737
+ if status in ("online", "working"):
1738
+ _STAY_AWAKE = True
1739
+ elif status == "sleeping":
1740
+ _STAY_AWAKE = False
1733
1741
  return be.set_status(_PROJECT_ID, AGENT_NAME, status, task, api_key=_get_api_key())
1734
1742
 
1735
1743
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshcode
3
- Version: 2.8.0
3
+ Version: 2.8.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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "meshcode"
7
- version = "2.8.0"
7
+ version = "2.8.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
File without changes
File without changes