meshcode 2.10.20__tar.gz → 2.10.22__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.20 → meshcode-2.10.22}/PKG-INFO +1 -1
- {meshcode-2.10.20 → meshcode-2.10.22}/meshcode/__init__.py +1 -1
- {meshcode-2.10.20 → meshcode-2.10.22}/meshcode/meshcode_mcp/server.py +22 -26
- {meshcode-2.10.20 → meshcode-2.10.22}/meshcode.egg-info/PKG-INFO +1 -1
- {meshcode-2.10.20 → meshcode-2.10.22}/pyproject.toml +1 -1
- {meshcode-2.10.20 → meshcode-2.10.22}/README.md +0 -0
- {meshcode-2.10.20 → meshcode-2.10.22}/meshcode/ascii_art.py +0 -0
- {meshcode-2.10.20 → meshcode-2.10.22}/meshcode/cli.py +0 -0
- {meshcode-2.10.20 → meshcode-2.10.22}/meshcode/comms_v4.py +0 -0
- {meshcode-2.10.20 → meshcode-2.10.22}/meshcode/invites.py +0 -0
- {meshcode-2.10.20 → meshcode-2.10.22}/meshcode/launcher.py +0 -0
- {meshcode-2.10.20 → meshcode-2.10.22}/meshcode/launcher_install.py +0 -0
- {meshcode-2.10.20 → meshcode-2.10.22}/meshcode/meshcode_mcp/__init__.py +0 -0
- {meshcode-2.10.20 → meshcode-2.10.22}/meshcode/meshcode_mcp/__main__.py +0 -0
- {meshcode-2.10.20 → meshcode-2.10.22}/meshcode/meshcode_mcp/backend.py +0 -0
- {meshcode-2.10.20 → meshcode-2.10.22}/meshcode/meshcode_mcp/realtime.py +0 -0
- {meshcode-2.10.20 → meshcode-2.10.22}/meshcode/meshcode_mcp/test_backend.py +0 -0
- {meshcode-2.10.20 → meshcode-2.10.22}/meshcode/meshcode_mcp/test_realtime.py +0 -0
- {meshcode-2.10.20 → meshcode-2.10.22}/meshcode/meshcode_mcp/test_server_wrapper.py +0 -0
- {meshcode-2.10.20 → meshcode-2.10.22}/meshcode/preferences.py +0 -0
- {meshcode-2.10.20 → meshcode-2.10.22}/meshcode/protocol_v2.py +0 -0
- {meshcode-2.10.20 → meshcode-2.10.22}/meshcode/run_agent.py +0 -0
- {meshcode-2.10.20 → meshcode-2.10.22}/meshcode/secrets.py +0 -0
- {meshcode-2.10.20 → meshcode-2.10.22}/meshcode/self_update.py +0 -0
- {meshcode-2.10.20 → meshcode-2.10.22}/meshcode/setup_clients.py +0 -0
- {meshcode-2.10.20 → meshcode-2.10.22}/meshcode.egg-info/SOURCES.txt +0 -0
- {meshcode-2.10.20 → meshcode-2.10.22}/meshcode.egg-info/dependency_links.txt +0 -0
- {meshcode-2.10.20 → meshcode-2.10.22}/meshcode.egg-info/entry_points.txt +0 -0
- {meshcode-2.10.20 → meshcode-2.10.22}/meshcode.egg-info/requires.txt +0 -0
- {meshcode-2.10.20 → meshcode-2.10.22}/meshcode.egg-info/top_level.txt +0 -0
- {meshcode-2.10.20 → meshcode-2.10.22}/setup.cfg +0 -0
- {meshcode-2.10.20 → meshcode-2.10.22}/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.22"
|
|
@@ -516,17 +516,16 @@ def _schedule_flip(status: str, task: str = "") -> None:
|
|
|
516
516
|
|
|
517
517
|
|
|
518
518
|
def _set_state(state: str, tool: str = "") -> None:
|
|
519
|
-
"""Update the state machine and broadcast to dashboard.
|
|
519
|
+
"""Update the state machine and broadcast to dashboard."""
|
|
520
520
|
global _current_state, _current_tool, _last_tool_at, _working_timer
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
_last_tool_at = _time.time()
|
|
521
|
+
# Cancel any pending working→online timer
|
|
522
|
+
if _working_timer is not None:
|
|
523
|
+
_working_timer.cancel()
|
|
524
|
+
_working_timer = None
|
|
525
|
+
_current_state = state
|
|
526
|
+
_current_tool = tool
|
|
527
|
+
if state == "working":
|
|
528
|
+
_last_tool_at = _time.time()
|
|
530
529
|
_schedule_flip(state, tool)
|
|
531
530
|
|
|
532
531
|
|
|
@@ -574,16 +573,10 @@ def with_working_status(func):
|
|
|
574
573
|
_record_event_bg("tool_call", {"tool": name, "args_keys": list(kwargs.keys())})
|
|
575
574
|
try:
|
|
576
575
|
return await func(*args, **kwargs)
|
|
577
|
-
except asyncio.CancelledError:
|
|
578
|
-
# Let CancelledError propagate — FastMCP handles it correctly.
|
|
579
|
-
raise
|
|
580
576
|
except Exception as e:
|
|
581
577
|
if not skip:
|
|
582
578
|
_auto_learn_error(name, e, list(kwargs.keys()))
|
|
583
|
-
|
|
584
|
-
import traceback as _tb
|
|
585
|
-
_log_crash_to_db("tool_exception", f"{name}: {type(e).__name__}: {e}\n{_tb.format_exc()[-500:]}")
|
|
586
|
-
return {"error": f"tool {name} failed: {type(e).__name__}: {e}", "_recovered": True}
|
|
579
|
+
raise
|
|
587
580
|
finally:
|
|
588
581
|
if not skip:
|
|
589
582
|
global _last_tool_at
|
|
@@ -604,10 +597,7 @@ def with_working_status(func):
|
|
|
604
597
|
except Exception as e:
|
|
605
598
|
if not skip:
|
|
606
599
|
_auto_learn_error(name, e, list(kwargs.keys()))
|
|
607
|
-
|
|
608
|
-
import traceback as _tb
|
|
609
|
-
_log_crash_to_db("tool_exception", f"{name}: {type(e).__name__}: {e}\n{_tb.format_exc()[-500:]}")
|
|
610
|
-
return {"error": f"tool {name} failed: {type(e).__name__}: {e}", "_recovered": True}
|
|
600
|
+
raise
|
|
611
601
|
finally:
|
|
612
602
|
if not skip:
|
|
613
603
|
global _last_tool_at
|
|
@@ -876,6 +866,12 @@ RULES:
|
|
|
876
866
|
- sensitive=True for secrets/PII.
|
|
877
867
|
|
|
878
868
|
SESSION START (do these IMMEDIATELY — don't wait for user input):
|
|
869
|
+
The moment you see these instructions — whether the user said "boot", "hi",
|
|
870
|
+
nothing at all, or anything else — run the full protocol. Never reply with
|
|
871
|
+
only a memory summary and then idle. If your client defers MCP tool schemas
|
|
872
|
+
(shows tool names without parameters), your FIRST action is to load them:
|
|
873
|
+
ToolSearch(query="select:meshcode_set_status,meshcode_check,meshcode_tasks,meshcode_auto_wake,meshcode_status,meshcode_wait,meshcode_send,meshcode_task_claim,meshcode_task_complete,meshcode_remember,meshcode_recall")
|
|
874
|
+
Then execute:
|
|
879
875
|
1. meshcode_set_status(status="online", task="ready")
|
|
880
876
|
2. meshcode_check() — read NEW messages only (last_seen is auto-restored from mesh memory on boot, old messages are skipped automatically)
|
|
881
877
|
3. meshcode_tasks() — check for assigned/pending tasks and claim any unclaimed ones
|
|
@@ -883,6 +879,7 @@ SESSION START (do these IMMEDIATELY — don't wait for user input):
|
|
|
883
879
|
5. meshcode_status() — see who's online
|
|
884
880
|
6. If other agents are online → meshcode_send them a greeting
|
|
885
881
|
7. meshcode_wait() — enter the loop
|
|
882
|
+
DO NOT ASK THE USER "what do you want to work on" — the mesh tells you via tasks/messages.
|
|
886
883
|
|
|
887
884
|
CRITICAL: You communicate by CALLING TOOLS, not by thinking or writing text.
|
|
888
885
|
To talk to another agent → call meshcode_send(to="agent", message="...")
|
|
@@ -1107,12 +1104,11 @@ def _heartbeat_thread_fn():
|
|
|
1107
1104
|
try:
|
|
1108
1105
|
be.sb_rpc("mc_heartbeat", {"p_project_id": _PROJECT_ID, "p_agent_name": AGENT_NAME, "p_version": _SDK_VERSION})
|
|
1109
1106
|
|
|
1110
|
-
# CPU-based status detection
|
|
1107
|
+
# CPU-based status detection
|
|
1111
1108
|
parent_cpu = _get_parent_cpu()
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
idle_secs = _time.time() - _last_tool_at
|
|
1109
|
+
cur_state = _current_state
|
|
1110
|
+
in_wait = _IN_WAIT
|
|
1111
|
+
idle_secs = _time.time() - _last_tool_at
|
|
1116
1112
|
|
|
1117
1113
|
if in_wait:
|
|
1118
1114
|
# Actually in meshcode_wait right now — listening for messages
|
|
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
|