meshcode 2.2.0__tar.gz → 2.3.0__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.2.0 → meshcode-2.3.0}/PKG-INFO +1 -1
- {meshcode-2.2.0 → meshcode-2.3.0}/meshcode/__init__.py +1 -1
- {meshcode-2.2.0 → meshcode-2.3.0}/meshcode/meshcode_mcp/server.py +21 -10
- {meshcode-2.2.0 → meshcode-2.3.0}/meshcode.egg-info/PKG-INFO +1 -1
- {meshcode-2.2.0 → meshcode-2.3.0}/pyproject.toml +1 -1
- {meshcode-2.2.0 → meshcode-2.3.0}/README.md +0 -0
- {meshcode-2.2.0 → meshcode-2.3.0}/meshcode/cli.py +0 -0
- {meshcode-2.2.0 → meshcode-2.3.0}/meshcode/comms_v4.py +0 -0
- {meshcode-2.2.0 → meshcode-2.3.0}/meshcode/invites.py +0 -0
- {meshcode-2.2.0 → meshcode-2.3.0}/meshcode/launcher.py +0 -0
- {meshcode-2.2.0 → meshcode-2.3.0}/meshcode/launcher_install.py +0 -0
- {meshcode-2.2.0 → meshcode-2.3.0}/meshcode/meshcode_mcp/__init__.py +0 -0
- {meshcode-2.2.0 → meshcode-2.3.0}/meshcode/meshcode_mcp/__main__.py +0 -0
- {meshcode-2.2.0 → meshcode-2.3.0}/meshcode/meshcode_mcp/backend.py +0 -0
- {meshcode-2.2.0 → meshcode-2.3.0}/meshcode/meshcode_mcp/realtime.py +0 -0
- {meshcode-2.2.0 → meshcode-2.3.0}/meshcode/meshcode_mcp/test_backend.py +0 -0
- {meshcode-2.2.0 → meshcode-2.3.0}/meshcode/meshcode_mcp/test_realtime.py +0 -0
- {meshcode-2.2.0 → meshcode-2.3.0}/meshcode/meshcode_mcp/test_server_wrapper.py +0 -0
- {meshcode-2.2.0 → meshcode-2.3.0}/meshcode/preferences.py +0 -0
- {meshcode-2.2.0 → meshcode-2.3.0}/meshcode/protocol_v2.py +0 -0
- {meshcode-2.2.0 → meshcode-2.3.0}/meshcode/run_agent.py +0 -0
- {meshcode-2.2.0 → meshcode-2.3.0}/meshcode/secrets.py +0 -0
- {meshcode-2.2.0 → meshcode-2.3.0}/meshcode/self_update.py +0 -0
- {meshcode-2.2.0 → meshcode-2.3.0}/meshcode/setup_clients.py +0 -0
- {meshcode-2.2.0 → meshcode-2.3.0}/meshcode.egg-info/SOURCES.txt +0 -0
- {meshcode-2.2.0 → meshcode-2.3.0}/meshcode.egg-info/dependency_links.txt +0 -0
- {meshcode-2.2.0 → meshcode-2.3.0}/meshcode.egg-info/entry_points.txt +0 -0
- {meshcode-2.2.0 → meshcode-2.3.0}/meshcode.egg-info/requires.txt +0 -0
- {meshcode-2.2.0 → meshcode-2.3.0}/meshcode.egg-info/top_level.txt +0 -0
- {meshcode-2.2.0 → meshcode-2.3.0}/setup.cfg +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""MeshCode — Real-time communication between AI agents."""
|
|
2
|
-
__version__ = "2.
|
|
2
|
+
__version__ = "2.3.0"
|
|
@@ -589,12 +589,18 @@ RULES:
|
|
|
589
589
|
- Threading: pass in_reply_to.
|
|
590
590
|
- sensitive=True for secrets/PII.
|
|
591
591
|
|
|
592
|
-
SESSION START:
|
|
593
|
-
1. meshcode_set_status(status="online", task="ready")
|
|
594
|
-
2. meshcode_check() — read
|
|
592
|
+
SESSION START (do these IMMEDIATELY — don't wait for user input):
|
|
593
|
+
1. meshcode_set_status(status="online", task="ready")
|
|
594
|
+
2. meshcode_check() — read pending messages
|
|
595
595
|
3. meshcode_status() — see who's online
|
|
596
|
-
4.
|
|
597
|
-
(
|
|
596
|
+
4. If other agents are online → meshcode_send them a greeting
|
|
597
|
+
5. meshcode_wait() — enter the loop
|
|
598
|
+
|
|
599
|
+
CRITICAL: You communicate by CALLING TOOLS, not by thinking or writing text.
|
|
600
|
+
To talk to another agent → call meshcode_send(to="agent", message="...")
|
|
601
|
+
To check who's online → call meshcode_status()
|
|
602
|
+
To wait for messages → call meshcode_wait()
|
|
603
|
+
NEVER just describe what you would do. DO IT by calling the tool.
|
|
598
604
|
|
|
599
605
|
CROSS-MESH: meshcode_send(to="agent@meshwork") routes via active link.
|
|
600
606
|
meshcode_link(target) creates pending link, target accepts. Expand with
|
|
@@ -726,8 +732,10 @@ def _heartbeat_thread_fn():
|
|
|
726
732
|
parent_cpu = _get_parent_cpu()
|
|
727
733
|
idle_secs = _time.time() - _last_tool_at
|
|
728
734
|
|
|
729
|
-
if
|
|
730
|
-
|
|
735
|
+
if _IN_WAIT:
|
|
736
|
+
# Actually in meshcode_wait right now — listening for messages
|
|
737
|
+
if _current_state != "waiting":
|
|
738
|
+
_set_state("waiting", "listening for messages")
|
|
731
739
|
elif parent_cpu > 5.0:
|
|
732
740
|
# LLM is actively generating tokens
|
|
733
741
|
if _current_state != "working":
|
|
@@ -735,7 +743,7 @@ def _heartbeat_thread_fn():
|
|
|
735
743
|
elif _current_state == "working":
|
|
736
744
|
# LLM just stopped — brief online before sleeping
|
|
737
745
|
_set_state("online", "")
|
|
738
|
-
elif _current_state in ("online", "idle") and idle_secs >
|
|
746
|
+
elif _current_state in ("online", "idle") and idle_secs > 10:
|
|
739
747
|
# Not in loop, not thinking → sleeping
|
|
740
748
|
_set_state("sleeping", "sleeping")
|
|
741
749
|
|
|
@@ -1052,6 +1060,8 @@ def meshcode_done(reason: str) -> Dict[str, Any]:
|
|
|
1052
1060
|
except Exception as e:
|
|
1053
1061
|
log.warning(f"meshcode_done: failed to notify {name}: {e}")
|
|
1054
1062
|
log.info(f"global done broadcast from {AGENT_NAME}: reason={reason!r} notified={sent}")
|
|
1063
|
+
# Immediately set sleeping — we're done, not listening anymore
|
|
1064
|
+
_set_state("sleeping", "sleeping")
|
|
1055
1065
|
return {"ok": True, "global_done": True, "agents_notified": sent, "reason": reason}
|
|
1056
1066
|
|
|
1057
1067
|
|
|
@@ -1377,6 +1387,7 @@ def meshcode_scratchpad_set(key: str, value: Any) -> Dict[str, Any]:
|
|
|
1377
1387
|
"p_api_key": api_key,
|
|
1378
1388
|
"p_key": key,
|
|
1379
1389
|
"p_value": json_value,
|
|
1390
|
+
"p_project_name": PROJECT_NAME,
|
|
1380
1391
|
})
|
|
1381
1392
|
|
|
1382
1393
|
|
|
@@ -1390,9 +1401,9 @@ def meshcode_scratchpad_get(key: Optional[str] = None) -> Dict[str, Any]:
|
|
|
1390
1401
|
"""
|
|
1391
1402
|
api_key = _get_api_key()
|
|
1392
1403
|
if key:
|
|
1393
|
-
return be.sb_rpc("mc_scratchpad_get", {"p_api_key": api_key, "p_key": key})
|
|
1404
|
+
return be.sb_rpc("mc_scratchpad_get", {"p_api_key": api_key, "p_key": key, "p_project_name": PROJECT_NAME})
|
|
1394
1405
|
else:
|
|
1395
|
-
return be.sb_rpc("mc_scratchpad_list", {"p_api_key": api_key})
|
|
1406
|
+
return be.sb_rpc("mc_scratchpad_list", {"p_api_key": api_key, "p_project_name": PROJECT_NAME})
|
|
1396
1407
|
|
|
1397
1408
|
|
|
1398
1409
|
# ----------------- OBSIDIAN SYNC HELPER -----------------
|
|
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
|