meshcode 2.2.1__tar.gz → 2.4.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.1 → meshcode-2.4.0}/PKG-INFO +1 -1
- {meshcode-2.2.1 → meshcode-2.4.0}/meshcode/__init__.py +1 -1
- {meshcode-2.2.1 → meshcode-2.4.0}/meshcode/meshcode_mcp/server.py +18 -5
- {meshcode-2.2.1 → meshcode-2.4.0}/meshcode.egg-info/PKG-INFO +1 -1
- {meshcode-2.2.1 → meshcode-2.4.0}/pyproject.toml +1 -1
- {meshcode-2.2.1 → meshcode-2.4.0}/README.md +0 -0
- {meshcode-2.2.1 → meshcode-2.4.0}/meshcode/cli.py +0 -0
- {meshcode-2.2.1 → meshcode-2.4.0}/meshcode/comms_v4.py +0 -0
- {meshcode-2.2.1 → meshcode-2.4.0}/meshcode/invites.py +0 -0
- {meshcode-2.2.1 → meshcode-2.4.0}/meshcode/launcher.py +0 -0
- {meshcode-2.2.1 → meshcode-2.4.0}/meshcode/launcher_install.py +0 -0
- {meshcode-2.2.1 → meshcode-2.4.0}/meshcode/meshcode_mcp/__init__.py +0 -0
- {meshcode-2.2.1 → meshcode-2.4.0}/meshcode/meshcode_mcp/__main__.py +0 -0
- {meshcode-2.2.1 → meshcode-2.4.0}/meshcode/meshcode_mcp/backend.py +0 -0
- {meshcode-2.2.1 → meshcode-2.4.0}/meshcode/meshcode_mcp/realtime.py +0 -0
- {meshcode-2.2.1 → meshcode-2.4.0}/meshcode/meshcode_mcp/test_backend.py +0 -0
- {meshcode-2.2.1 → meshcode-2.4.0}/meshcode/meshcode_mcp/test_realtime.py +0 -0
- {meshcode-2.2.1 → meshcode-2.4.0}/meshcode/meshcode_mcp/test_server_wrapper.py +0 -0
- {meshcode-2.2.1 → meshcode-2.4.0}/meshcode/preferences.py +0 -0
- {meshcode-2.2.1 → meshcode-2.4.0}/meshcode/protocol_v2.py +0 -0
- {meshcode-2.2.1 → meshcode-2.4.0}/meshcode/run_agent.py +0 -0
- {meshcode-2.2.1 → meshcode-2.4.0}/meshcode/secrets.py +0 -0
- {meshcode-2.2.1 → meshcode-2.4.0}/meshcode/self_update.py +0 -0
- {meshcode-2.2.1 → meshcode-2.4.0}/meshcode/setup_clients.py +0 -0
- {meshcode-2.2.1 → meshcode-2.4.0}/meshcode.egg-info/SOURCES.txt +0 -0
- {meshcode-2.2.1 → meshcode-2.4.0}/meshcode.egg-info/dependency_links.txt +0 -0
- {meshcode-2.2.1 → meshcode-2.4.0}/meshcode.egg-info/entry_points.txt +0 -0
- {meshcode-2.2.1 → meshcode-2.4.0}/meshcode.egg-info/requires.txt +0 -0
- {meshcode-2.2.1 → meshcode-2.4.0}/meshcode.egg-info/top_level.txt +0 -0
- {meshcode-2.2.1 → meshcode-2.4.0}/setup.cfg +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""MeshCode — Real-time communication between AI agents."""
|
|
2
|
-
__version__ = "2.
|
|
2
|
+
__version__ = "2.4.0"
|
|
@@ -647,6 +647,7 @@ try:
|
|
|
647
647
|
_memories = be.sb_rpc("mc_memory_list", {
|
|
648
648
|
"p_api_key": _get_api_key(),
|
|
649
649
|
"p_agent_name": AGENT_NAME,
|
|
650
|
+
"p_project_name": PROJECT_NAME,
|
|
650
651
|
})
|
|
651
652
|
if isinstance(_memories, dict) and _memories.get("ok") and _memories.get("memories"):
|
|
652
653
|
_mem_lines = []
|
|
@@ -732,8 +733,10 @@ def _heartbeat_thread_fn():
|
|
|
732
733
|
parent_cpu = _get_parent_cpu()
|
|
733
734
|
idle_secs = _time.time() - _last_tool_at
|
|
734
735
|
|
|
735
|
-
if
|
|
736
|
-
|
|
736
|
+
if _IN_WAIT:
|
|
737
|
+
# Actually in meshcode_wait right now — listening for messages
|
|
738
|
+
if _current_state != "waiting":
|
|
739
|
+
_set_state("waiting", "listening for messages")
|
|
737
740
|
elif parent_cpu > 5.0:
|
|
738
741
|
# LLM is actively generating tokens
|
|
739
742
|
if _current_state != "working":
|
|
@@ -741,7 +744,7 @@ def _heartbeat_thread_fn():
|
|
|
741
744
|
elif _current_state == "working":
|
|
742
745
|
# LLM just stopped — brief online before sleeping
|
|
743
746
|
_set_state("online", "")
|
|
744
|
-
elif _current_state in ("online", "idle") and idle_secs >
|
|
747
|
+
elif _current_state in ("online", "idle") and idle_secs > 10:
|
|
745
748
|
# Not in loop, not thinking → sleeping
|
|
746
749
|
_set_state("sleeping", "sleeping")
|
|
747
750
|
|
|
@@ -1058,6 +1061,8 @@ def meshcode_done(reason: str) -> Dict[str, Any]:
|
|
|
1058
1061
|
except Exception as e:
|
|
1059
1062
|
log.warning(f"meshcode_done: failed to notify {name}: {e}")
|
|
1060
1063
|
log.info(f"global done broadcast from {AGENT_NAME}: reason={reason!r} notified={sent}")
|
|
1064
|
+
# Immediately set sleeping — we're done, not listening anymore
|
|
1065
|
+
_set_state("sleeping", "sleeping")
|
|
1061
1066
|
return {"ok": True, "global_done": True, "agents_notified": sent, "reason": reason}
|
|
1062
1067
|
|
|
1063
1068
|
|
|
@@ -1268,6 +1273,7 @@ def meshcode_accept_link(link_id: str) -> Dict[str, Any]:
|
|
|
1268
1273
|
return be.sb_rpc("mc_accept_mesh_link", {
|
|
1269
1274
|
"p_api_key": api_key,
|
|
1270
1275
|
"p_link_id": link_id,
|
|
1276
|
+
"p_project_name": PROJECT_NAME,
|
|
1271
1277
|
})
|
|
1272
1278
|
|
|
1273
1279
|
|
|
@@ -1293,6 +1299,7 @@ def meshcode_expand_link(link_id: str, agents: str) -> Dict[str, Any]:
|
|
|
1293
1299
|
"p_link_id": link_id,
|
|
1294
1300
|
"p_src": agent_list,
|
|
1295
1301
|
"p_tgt": agent_list,
|
|
1302
|
+
"p_project_name": PROJECT_NAME,
|
|
1296
1303
|
})
|
|
1297
1304
|
|
|
1298
1305
|
|
|
@@ -1363,6 +1370,7 @@ def meshcode_edit_memory(agent_name: str, key: str, value: Any) -> Dict[str, Any
|
|
|
1363
1370
|
"p_agent_name": agent_name,
|
|
1364
1371
|
"p_key": key,
|
|
1365
1372
|
"p_value": json_value,
|
|
1373
|
+
"p_project_name": PROJECT_NAME,
|
|
1366
1374
|
}) or {"error": "failed to edit memory"}
|
|
1367
1375
|
|
|
1368
1376
|
|
|
@@ -1383,6 +1391,7 @@ def meshcode_scratchpad_set(key: str, value: Any) -> Dict[str, Any]:
|
|
|
1383
1391
|
"p_api_key": api_key,
|
|
1384
1392
|
"p_key": key,
|
|
1385
1393
|
"p_value": json_value,
|
|
1394
|
+
"p_project_name": PROJECT_NAME,
|
|
1386
1395
|
})
|
|
1387
1396
|
|
|
1388
1397
|
|
|
@@ -1396,9 +1405,9 @@ def meshcode_scratchpad_get(key: Optional[str] = None) -> Dict[str, Any]:
|
|
|
1396
1405
|
"""
|
|
1397
1406
|
api_key = _get_api_key()
|
|
1398
1407
|
if key:
|
|
1399
|
-
return be.sb_rpc("mc_scratchpad_get", {"p_api_key": api_key, "p_key": key})
|
|
1408
|
+
return be.sb_rpc("mc_scratchpad_get", {"p_api_key": api_key, "p_key": key, "p_project_name": PROJECT_NAME})
|
|
1400
1409
|
else:
|
|
1401
|
-
return be.sb_rpc("mc_scratchpad_list", {"p_api_key": api_key})
|
|
1410
|
+
return be.sb_rpc("mc_scratchpad_list", {"p_api_key": api_key, "p_project_name": PROJECT_NAME})
|
|
1402
1411
|
|
|
1403
1412
|
|
|
1404
1413
|
# ----------------- OBSIDIAN SYNC HELPER -----------------
|
|
@@ -1480,6 +1489,7 @@ def meshcode_remember(key: str, value: Any) -> Dict[str, Any]:
|
|
|
1480
1489
|
"p_agent_name": AGENT_NAME,
|
|
1481
1490
|
"p_key": key,
|
|
1482
1491
|
"p_value": json_value,
|
|
1492
|
+
"p_project_name": PROJECT_NAME,
|
|
1483
1493
|
})
|
|
1484
1494
|
# Best-effort sync to Obsidian vault (if configured)
|
|
1485
1495
|
if isinstance(result, dict) and result.get("ok"):
|
|
@@ -1504,11 +1514,13 @@ def meshcode_recall(key: Optional[str] = None) -> Dict[str, Any]:
|
|
|
1504
1514
|
"p_api_key": api_key,
|
|
1505
1515
|
"p_agent_name": AGENT_NAME,
|
|
1506
1516
|
"p_key": key,
|
|
1517
|
+
"p_project_name": PROJECT_NAME,
|
|
1507
1518
|
})
|
|
1508
1519
|
else:
|
|
1509
1520
|
return be.sb_rpc("mc_memory_list", {
|
|
1510
1521
|
"p_api_key": api_key,
|
|
1511
1522
|
"p_agent_name": AGENT_NAME,
|
|
1523
|
+
"p_project_name": PROJECT_NAME,
|
|
1512
1524
|
})
|
|
1513
1525
|
|
|
1514
1526
|
|
|
@@ -1525,6 +1537,7 @@ def meshcode_forget(key: str) -> Dict[str, Any]:
|
|
|
1525
1537
|
"p_api_key": api_key,
|
|
1526
1538
|
"p_agent_name": AGENT_NAME,
|
|
1527
1539
|
"p_key": key,
|
|
1540
|
+
"p_project_name": PROJECT_NAME,
|
|
1528
1541
|
})
|
|
1529
1542
|
|
|
1530
1543
|
|
|
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
|