meshcode 2.10.16__tar.gz → 2.10.17__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.10.16 → meshcode-2.10.17}/PKG-INFO +1 -1
- {meshcode-2.10.16 → meshcode-2.10.17}/meshcode/__init__.py +1 -1
- {meshcode-2.10.16 → meshcode-2.10.17}/meshcode/meshcode_mcp/server.py +29 -29
- {meshcode-2.10.16 → meshcode-2.10.17}/meshcode.egg-info/PKG-INFO +1 -1
- {meshcode-2.10.16 → meshcode-2.10.17}/pyproject.toml +1 -1
- {meshcode-2.10.16 → meshcode-2.10.17}/README.md +0 -0
- {meshcode-2.10.16 → meshcode-2.10.17}/meshcode/ascii_art.py +0 -0
- {meshcode-2.10.16 → meshcode-2.10.17}/meshcode/cli.py +0 -0
- {meshcode-2.10.16 → meshcode-2.10.17}/meshcode/comms_v4.py +0 -0
- {meshcode-2.10.16 → meshcode-2.10.17}/meshcode/invites.py +0 -0
- {meshcode-2.10.16 → meshcode-2.10.17}/meshcode/launcher.py +0 -0
- {meshcode-2.10.16 → meshcode-2.10.17}/meshcode/launcher_install.py +0 -0
- {meshcode-2.10.16 → meshcode-2.10.17}/meshcode/meshcode_mcp/__init__.py +0 -0
- {meshcode-2.10.16 → meshcode-2.10.17}/meshcode/meshcode_mcp/__main__.py +0 -0
- {meshcode-2.10.16 → meshcode-2.10.17}/meshcode/meshcode_mcp/backend.py +0 -0
- {meshcode-2.10.16 → meshcode-2.10.17}/meshcode/meshcode_mcp/realtime.py +0 -0
- {meshcode-2.10.16 → meshcode-2.10.17}/meshcode/meshcode_mcp/test_backend.py +0 -0
- {meshcode-2.10.16 → meshcode-2.10.17}/meshcode/meshcode_mcp/test_realtime.py +0 -0
- {meshcode-2.10.16 → meshcode-2.10.17}/meshcode/meshcode_mcp/test_server_wrapper.py +0 -0
- {meshcode-2.10.16 → meshcode-2.10.17}/meshcode/preferences.py +0 -0
- {meshcode-2.10.16 → meshcode-2.10.17}/meshcode/protocol_v2.py +0 -0
- {meshcode-2.10.16 → meshcode-2.10.17}/meshcode/run_agent.py +0 -0
- {meshcode-2.10.16 → meshcode-2.10.17}/meshcode/secrets.py +0 -0
- {meshcode-2.10.16 → meshcode-2.10.17}/meshcode/self_update.py +0 -0
- {meshcode-2.10.16 → meshcode-2.10.17}/meshcode/setup_clients.py +0 -0
- {meshcode-2.10.16 → meshcode-2.10.17}/meshcode.egg-info/SOURCES.txt +0 -0
- {meshcode-2.10.16 → meshcode-2.10.17}/meshcode.egg-info/dependency_links.txt +0 -0
- {meshcode-2.10.16 → meshcode-2.10.17}/meshcode.egg-info/entry_points.txt +0 -0
- {meshcode-2.10.16 → meshcode-2.10.17}/meshcode.egg-info/requires.txt +0 -0
- {meshcode-2.10.16 → meshcode-2.10.17}/meshcode.egg-info/top_level.txt +0 -0
- {meshcode-2.10.16 → meshcode-2.10.17}/setup.cfg +0 -0
- {meshcode-2.10.16 → meshcode-2.10.17}/tests/test_status_enum_coverage.py +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""MeshCode — Real-time communication between AI agents."""
|
|
2
|
-
__version__ = "2.10.
|
|
2
|
+
__version__ = "2.10.17"
|
|
@@ -85,11 +85,11 @@ def _mc_log(msg: str, level: str = "info") -> None:
|
|
|
85
85
|
c = _agent_color(agent) if agent else "\033[36m"
|
|
86
86
|
prefix = f"{c}{_ANSI_BOLD}[meshcode-mcp]{_ANSI_RESET}"
|
|
87
87
|
if level == "error":
|
|
88
|
-
print(f"{prefix} \033[91mERROR:{_ANSI_RESET} {msg}",
|
|
88
|
+
print(f"{prefix} \033[91mERROR:{_ANSI_RESET} {msg}", "warn")
|
|
89
89
|
elif level == "warn":
|
|
90
|
-
print(f"{prefix} \033[33mWARNING:{_ANSI_RESET} {msg}",
|
|
90
|
+
print(f"{prefix} \033[33mWARNING:{_ANSI_RESET} {msg}", "warn")
|
|
91
91
|
else:
|
|
92
|
-
print(f"{prefix} {c}{msg}{_ANSI_RESET}",
|
|
92
|
+
print(f"{prefix} {c}{msg}{_ANSI_RESET}", "warn")
|
|
93
93
|
|
|
94
94
|
|
|
95
95
|
# ============================================================
|
|
@@ -386,7 +386,7 @@ def _get_api_key() -> str:
|
|
|
386
386
|
_API_KEY_CACHE = kc_val
|
|
387
387
|
return kc_val
|
|
388
388
|
except Exception as e:
|
|
389
|
-
_mc_log(f" keychain lookup failed for profile '{profile}': {e}",
|
|
389
|
+
_mc_log(f" keychain lookup failed for profile '{profile}': {e}", "warn")
|
|
390
390
|
_API_KEY_CACHE = ""
|
|
391
391
|
return ""
|
|
392
392
|
|
|
@@ -411,17 +411,17 @@ if not _PROJECT_ID:
|
|
|
411
411
|
_PROJECT_ID = _r["project_id"]
|
|
412
412
|
break
|
|
413
413
|
elif isinstance(_r, dict) and _r.get("error"):
|
|
414
|
-
_mc_log(f" mc_resolve_project: {_r['error']}",
|
|
414
|
+
_mc_log(f" mc_resolve_project: {_r['error']}", "warn")
|
|
415
415
|
except Exception as _e:
|
|
416
|
-
_mc_log(f" mc_resolve_project failed: {_e}",
|
|
416
|
+
_mc_log(f" mc_resolve_project failed: {_e}", "warn")
|
|
417
417
|
if not _PROJECT_ID:
|
|
418
418
|
_PROJECT_ID = be.get_project_id(PROJECT_NAME)
|
|
419
419
|
if _PROJECT_ID:
|
|
420
420
|
break
|
|
421
421
|
if _boot_attempt < _BOOT_MAX_RETRIES - 1:
|
|
422
422
|
_wait = _BOOT_BACKOFF[_boot_attempt]
|
|
423
|
-
_mc_log(f" project resolution failed (attempt {_boot_attempt+1}/{_BOOT_MAX_RETRIES}), retrying in {_wait}s...",
|
|
424
|
-
|
|
423
|
+
_mc_log(f" project resolution failed (attempt {_boot_attempt+1}/{_BOOT_MAX_RETRIES}), retrying in {_wait}s...", "warn")
|
|
424
|
+
import time; time.sleep(_wait)
|
|
425
425
|
if not _PROJECT_ID:
|
|
426
426
|
_mc_log(f"project '{PROJECT_NAME}' not found after {_BOOT_MAX_RETRIES} attempts (check MESHCODE_KEYCHAIN_PROFILE / MESHCODE_API_KEY)", "error")
|
|
427
427
|
sys.exit(2)
|
|
@@ -437,7 +437,7 @@ except Exception:
|
|
|
437
437
|
|
|
438
438
|
_register_result = be.register_agent(PROJECT_NAME, AGENT_NAME, AGENT_ROLE or "MCP-connected agent", api_key=_get_api_key())
|
|
439
439
|
if isinstance(_register_result, dict) and _register_result.get("error"):
|
|
440
|
-
_mc_log(f" register failed: {_register_result['error']}",
|
|
440
|
+
_mc_log(f" register failed: {_register_result['error']}", "warn")
|
|
441
441
|
|
|
442
442
|
# ── Fetch profile color from dashboard (single source of truth) ──
|
|
443
443
|
try:
|
|
@@ -471,7 +471,7 @@ def _flip_status(status: str, task: str = "") -> bool:
|
|
|
471
471
|
return False
|
|
472
472
|
|
|
473
473
|
if not _flip_status("idle", ""):
|
|
474
|
-
_mc_log(f" could not flip status to idle",
|
|
474
|
+
_mc_log(f" could not flip status to idle", "warn")
|
|
475
475
|
|
|
476
476
|
|
|
477
477
|
# ============================================================
|
|
@@ -636,7 +636,7 @@ def _acquire_lease() -> bool:
|
|
|
636
636
|
})
|
|
637
637
|
except Exception as e:
|
|
638
638
|
# Non-fatal: RPC might not exist on older servers.
|
|
639
|
-
_mc_log(f"stale-lease pre-clean skipped: {e}",
|
|
639
|
+
_mc_log(f"stale-lease pre-clean skipped: {e}", "warn")
|
|
640
640
|
for attempt in range(3):
|
|
641
641
|
try:
|
|
642
642
|
r = be.sb_rpc("mc_acquire_agent_lease", {
|
|
@@ -688,14 +688,14 @@ def _acquire_lease() -> bool:
|
|
|
688
688
|
_mc_log(f"Could not start — agent '{AGENT_NAME}' is running in another window.", "error")
|
|
689
689
|
_mc_log("Close the other window first, or use a different agent name.", "error")
|
|
690
690
|
return False
|
|
691
|
-
_mc_log(f"lease attempt {attempt+1}: {r.get('error')}",
|
|
691
|
+
_mc_log(f"lease attempt {attempt+1}: {r.get('error')}", "warn")
|
|
692
692
|
else:
|
|
693
693
|
return True
|
|
694
694
|
except Exception as e:
|
|
695
|
-
_mc_log(f"lease attempt {attempt+1} failed: {e}",
|
|
695
|
+
_mc_log(f"lease attempt {attempt+1} failed: {e}", "warn")
|
|
696
696
|
if attempt < 2:
|
|
697
697
|
_time.sleep(2)
|
|
698
|
-
_mc_log(f" lease failed after 3 attempts — proceeding anyway",
|
|
698
|
+
_mc_log(f" lease failed after 3 attempts — proceeding anyway", "warn")
|
|
699
699
|
return True
|
|
700
700
|
|
|
701
701
|
if not _acquire_lease():
|
|
@@ -713,7 +713,7 @@ def _boot_diagnostic() -> None:
|
|
|
713
713
|
be.sb_select("mc_projects", f"id=eq.{_PROJECT_ID}", limit=1)
|
|
714
714
|
checks_passed += 1
|
|
715
715
|
except Exception as e:
|
|
716
|
-
print(f"[meshcode] BOOT CHECK FAILED: Supabase API unreachable ({e}). Fix: check network/VPN.",
|
|
716
|
+
print(f"[meshcode] BOOT CHECK FAILED: Supabase API unreachable ({e}). Fix: check network/VPN.", "warn")
|
|
717
717
|
|
|
718
718
|
# Check 2: Lease valid
|
|
719
719
|
try:
|
|
@@ -723,11 +723,11 @@ def _boot_diagnostic() -> None:
|
|
|
723
723
|
if agent.get("instance_id") == _INSTANCE_ID:
|
|
724
724
|
checks_passed += 1
|
|
725
725
|
else:
|
|
726
|
-
print(f"[meshcode] BOOT CHECK FAILED: Lease mismatch — expected {_INSTANCE_ID}, got {agent.get('instance_id')}. Fix: restart agent.",
|
|
726
|
+
print(f"[meshcode] BOOT CHECK FAILED: Lease mismatch — expected {_INSTANCE_ID}, got {agent.get('instance_id')}. Fix: restart agent.", "warn")
|
|
727
727
|
else:
|
|
728
|
-
print(f"[meshcode] BOOT CHECK FAILED: Agent '{AGENT_NAME}' not found in project. Fix: register agent first.",
|
|
728
|
+
print(f"[meshcode] BOOT CHECK FAILED: Agent '{AGENT_NAME}' not found in project. Fix: register agent first.", "warn")
|
|
729
729
|
except Exception as e:
|
|
730
|
-
print(f"[meshcode] BOOT CHECK FAILED: Could not verify lease ({e}).",
|
|
730
|
+
print(f"[meshcode] BOOT CHECK FAILED: Could not verify lease ({e}).", "warn")
|
|
731
731
|
|
|
732
732
|
# Check 3: Heartbeat recent
|
|
733
733
|
try:
|
|
@@ -736,7 +736,7 @@ def _boot_diagnostic() -> None:
|
|
|
736
736
|
if hb:
|
|
737
737
|
checks_passed += 1
|
|
738
738
|
else:
|
|
739
|
-
print(f"[meshcode] BOOT CHECK WARNING: No heartbeat recorded yet.",
|
|
739
|
+
print(f"[meshcode] BOOT CHECK WARNING: No heartbeat recorded yet.", "warn")
|
|
740
740
|
else:
|
|
741
741
|
checks_passed += 1 # skip if no agent data
|
|
742
742
|
except Exception:
|
|
@@ -753,9 +753,9 @@ def _boot_diagnostic() -> None:
|
|
|
753
753
|
checks_passed += 1 # non-critical
|
|
754
754
|
|
|
755
755
|
if checks_passed == checks_total:
|
|
756
|
-
print(f"[meshcode] All boot checks passed ({checks_passed}/{checks_total}).",
|
|
756
|
+
print(f"[meshcode] All boot checks passed ({checks_passed}/{checks_total}).", "warn")
|
|
757
757
|
else:
|
|
758
|
-
print(f"[meshcode] Boot checks: {checks_passed}/{checks_total} passed. Agent starting anyway.",
|
|
758
|
+
print(f"[meshcode] Boot checks: {checks_passed}/{checks_total} passed. Agent starting anyway.", "warn")
|
|
759
759
|
|
|
760
760
|
|
|
761
761
|
_boot_diagnostic()
|
|
@@ -802,7 +802,7 @@ def _log_crash_to_db(reason: str = "unknown", error_detail: str = "") -> None:
|
|
|
802
802
|
f"crashed: {reason[:100]}", api_key=_get_api_key())
|
|
803
803
|
except Exception:
|
|
804
804
|
pass
|
|
805
|
-
_mc_log(f" crash logged: {reason}",
|
|
805
|
+
_mc_log(f" crash logged: {reason}", "warn")
|
|
806
806
|
|
|
807
807
|
|
|
808
808
|
def _on_exit() -> None:
|
|
@@ -1462,9 +1462,9 @@ try:
|
|
|
1462
1462
|
elif isinstance(_ls_val, str):
|
|
1463
1463
|
_LAST_SEEN_TS = _ls_val
|
|
1464
1464
|
if _LAST_SEEN_TS:
|
|
1465
|
-
print(f"[meshcode] Restored last_seen={_LAST_SEEN_TS} from mesh memory.",
|
|
1465
|
+
print(f"[meshcode] Restored last_seen={_LAST_SEEN_TS} from mesh memory.", "warn")
|
|
1466
1466
|
except Exception as _e:
|
|
1467
|
-
print(f"[meshcode] Could not restore last_seen: {_e}",
|
|
1467
|
+
print(f"[meshcode] Could not restore last_seen: {_e}", "warn")
|
|
1468
1468
|
|
|
1469
1469
|
|
|
1470
1470
|
def _get_pending_tasks_summary() -> Optional[List[Dict[str, str]]]:
|
|
@@ -2624,7 +2624,7 @@ def _auto_update() -> None:
|
|
|
2624
2624
|
return
|
|
2625
2625
|
|
|
2626
2626
|
# 3. Install the new version (blocking, 60s timeout)
|
|
2627
|
-
print(f"[meshcode] Updating {current} → {latest}...",
|
|
2627
|
+
print(f"[meshcode] Updating {current} → {latest}...", "warn")
|
|
2628
2628
|
try:
|
|
2629
2629
|
result = subprocess.run(
|
|
2630
2630
|
[sys.executable, "-m", "pip", "install", "--upgrade",
|
|
@@ -2644,11 +2644,11 @@ def _auto_update() -> None:
|
|
|
2644
2644
|
# 4. In MCP mode, NEVER re-exec — it kills the stdio pipe to Claude Code.
|
|
2645
2645
|
# The new version will load on the next clean boot.
|
|
2646
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).",
|
|
2647
|
+
print(f"[meshcode] Updated {current} → {latest}. Will load on next boot (MCP mode — cannot restart).", "warn")
|
|
2648
2648
|
return
|
|
2649
2649
|
|
|
2650
2650
|
# CLI mode: safe to re-exec
|
|
2651
|
-
print(f"[meshcode] Updated to {latest}, restarting...",
|
|
2651
|
+
print(f"[meshcode] Updated to {latest}, restarting...", "warn")
|
|
2652
2652
|
os.environ["MESHCODE_UPDATED"] = "1"
|
|
2653
2653
|
try:
|
|
2654
2654
|
os.execv(sys.executable, [sys.executable] + sys.argv)
|
|
@@ -2683,6 +2683,6 @@ def run_server():
|
|
|
2683
2683
|
import traceback as _tb
|
|
2684
2684
|
tb_str = _tb.format_exc()
|
|
2685
2685
|
_log_crash_to_db("unhandled_exception", f"{type(e).__name__}: {e}\n{tb_str}")
|
|
2686
|
-
print(f"[meshcode-mcp] FATAL: {e}",
|
|
2687
|
-
print(f"[meshcode-mcp] Stack trace logged to mc_agent_crash_logs",
|
|
2686
|
+
print(f"[meshcode-mcp] FATAL: {e}", "warn")
|
|
2687
|
+
print(f"[meshcode-mcp] Stack trace logged to mc_agent_crash_logs", "warn")
|
|
2688
2688
|
sys.exit(1)
|
|
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
|
|
File without changes
|
|
File without changes
|