meshcode 2.5.5__tar.gz → 2.5.6__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.5.5 → meshcode-2.5.6}/PKG-INFO +1 -1
- {meshcode-2.5.5 → meshcode-2.5.6}/meshcode/__init__.py +1 -1
- {meshcode-2.5.5 → meshcode-2.5.6}/meshcode/meshcode_mcp/backend.py +13 -5
- {meshcode-2.5.5 → meshcode-2.5.6}/meshcode/meshcode_mcp/server.py +13 -3
- {meshcode-2.5.5 → meshcode-2.5.6}/meshcode.egg-info/PKG-INFO +1 -1
- {meshcode-2.5.5 → meshcode-2.5.6}/pyproject.toml +1 -1
- {meshcode-2.5.5 → meshcode-2.5.6}/README.md +0 -0
- {meshcode-2.5.5 → meshcode-2.5.6}/meshcode/cli.py +0 -0
- {meshcode-2.5.5 → meshcode-2.5.6}/meshcode/comms_v4.py +0 -0
- {meshcode-2.5.5 → meshcode-2.5.6}/meshcode/invites.py +0 -0
- {meshcode-2.5.5 → meshcode-2.5.6}/meshcode/launcher.py +0 -0
- {meshcode-2.5.5 → meshcode-2.5.6}/meshcode/launcher_install.py +0 -0
- {meshcode-2.5.5 → meshcode-2.5.6}/meshcode/meshcode_mcp/__init__.py +0 -0
- {meshcode-2.5.5 → meshcode-2.5.6}/meshcode/meshcode_mcp/__main__.py +0 -0
- {meshcode-2.5.5 → meshcode-2.5.6}/meshcode/meshcode_mcp/realtime.py +0 -0
- {meshcode-2.5.5 → meshcode-2.5.6}/meshcode/meshcode_mcp/test_backend.py +0 -0
- {meshcode-2.5.5 → meshcode-2.5.6}/meshcode/meshcode_mcp/test_realtime.py +0 -0
- {meshcode-2.5.5 → meshcode-2.5.6}/meshcode/meshcode_mcp/test_server_wrapper.py +0 -0
- {meshcode-2.5.5 → meshcode-2.5.6}/meshcode/preferences.py +0 -0
- {meshcode-2.5.5 → meshcode-2.5.6}/meshcode/protocol_v2.py +0 -0
- {meshcode-2.5.5 → meshcode-2.5.6}/meshcode/run_agent.py +0 -0
- {meshcode-2.5.5 → meshcode-2.5.6}/meshcode/secrets.py +0 -0
- {meshcode-2.5.5 → meshcode-2.5.6}/meshcode/self_update.py +0 -0
- {meshcode-2.5.5 → meshcode-2.5.6}/meshcode/setup_clients.py +0 -0
- {meshcode-2.5.5 → meshcode-2.5.6}/meshcode.egg-info/SOURCES.txt +0 -0
- {meshcode-2.5.5 → meshcode-2.5.6}/meshcode.egg-info/dependency_links.txt +0 -0
- {meshcode-2.5.5 → meshcode-2.5.6}/meshcode.egg-info/entry_points.txt +0 -0
- {meshcode-2.5.5 → meshcode-2.5.6}/meshcode.egg-info/requires.txt +0 -0
- {meshcode-2.5.5 → meshcode-2.5.6}/meshcode.egg-info/top_level.txt +0 -0
- {meshcode-2.5.5 → meshcode-2.5.6}/setup.cfg +0 -0
- {meshcode-2.5.5 → meshcode-2.5.6}/tests/test_status_enum_coverage.py +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""MeshCode — Real-time communication between AI agents."""
|
|
2
|
-
__version__ = "2.5.
|
|
2
|
+
__version__ = "2.5.6"
|
|
@@ -269,12 +269,18 @@ def send_message(project_id: str, from_agent: str, to_agent: str, payload: Any,
|
|
|
269
269
|
if actual_encrypted:
|
|
270
270
|
out["encrypted"] = True
|
|
271
271
|
return out
|
|
272
|
-
# If RPC returned an
|
|
273
|
-
|
|
272
|
+
# If RPC returned an error, propagate it — do NOT fall through to
|
|
273
|
+
# direct insert (RLS blocks anon INSERT since migration 089).
|
|
274
|
+
if isinstance(result, dict) and result.get("error"):
|
|
274
275
|
return {"error": result["error"]}
|
|
275
|
-
#
|
|
276
|
+
# RPC returned unexpected shape but didn't error — treat as success
|
|
277
|
+
if result is not None:
|
|
278
|
+
return {"sent": True}
|
|
276
279
|
|
|
277
|
-
# Fallback: direct insert
|
|
280
|
+
# Fallback: direct insert — ONLY for tests or legacy (no api_key)
|
|
281
|
+
if api_key:
|
|
282
|
+
# api_key was provided but RPC path didn't return — should not happen
|
|
283
|
+
return {"error": "mc_send_message RPC unavailable and direct insert blocked by RLS"}
|
|
278
284
|
msg = {
|
|
279
285
|
"project_id": project_id,
|
|
280
286
|
"from_agent": from_agent,
|
|
@@ -326,7 +332,9 @@ def read_inbox(project_id: str, agent: str, mark_read: bool = True, api_key: Opt
|
|
|
326
332
|
# If RPC succeeded, skip direct update
|
|
327
333
|
if isinstance(result, dict) and result.get("ok"):
|
|
328
334
|
marked = True
|
|
329
|
-
if not marked:
|
|
335
|
+
if not marked and not api_key:
|
|
336
|
+
# Only attempt direct update when no api_key (tests/legacy).
|
|
337
|
+
# With api_key, RLS blocks anon UPDATE since migration 089.
|
|
330
338
|
sb_update("mc_messages", f"id=eq.{m['id']}", {"read": True})
|
|
331
339
|
|
|
332
340
|
# Auto-ACK senders — but ONLY for messages older than 60s. If the
|
|
@@ -1394,8 +1394,14 @@ def meshcode_done(reason: str) -> Dict[str, Any]:
|
|
|
1394
1394
|
|
|
1395
1395
|
@mcp.tool()
|
|
1396
1396
|
@with_working_status
|
|
1397
|
-
def meshcode_check(include_acks: bool = False) -> Dict[str, Any]:
|
|
1398
|
-
"""Peek at inbox (non-destructive). Returns pending count + new messages.
|
|
1397
|
+
def meshcode_check(include_acks: bool = False, since: Optional[str] = None) -> Dict[str, Any]:
|
|
1398
|
+
"""Peek at inbox (non-destructive). Returns pending count + new messages.
|
|
1399
|
+
|
|
1400
|
+
Args:
|
|
1401
|
+
include_acks: Include ack messages in response.
|
|
1402
|
+
since: ISO-8601 timestamp. Only return messages newer than this.
|
|
1403
|
+
Use meshcode_remember("last_seen", ts) to persist across sessions.
|
|
1404
|
+
"""
|
|
1399
1405
|
pending = be.count_pending(_PROJECT_ID, AGENT_NAME)
|
|
1400
1406
|
# Peek at realtime buffer WITHOUT draining — check is non-destructive
|
|
1401
1407
|
realtime_buffered = _REALTIME.peek() if _REALTIME else []
|
|
@@ -1421,11 +1427,15 @@ def meshcode_check(include_acks: bool = False) -> Dict[str, Any]:
|
|
|
1421
1427
|
if _seen_key({"id": m.get("id"), "from": m.get("from_agent"), "payload": m.get("payload", {}), "ts": m.get("created_at")}) not in _SEEN_MSG_IDS
|
|
1422
1428
|
]
|
|
1423
1429
|
|
|
1430
|
+
# Filter by `since` timestamp if provided
|
|
1431
|
+
if since:
|
|
1432
|
+
deduped = [m for m in deduped if m.get("ts") and str(m["ts"]) > since]
|
|
1433
|
+
|
|
1424
1434
|
split = _split_messages(deduped)
|
|
1425
1435
|
if not include_acks:
|
|
1426
1436
|
split["acks"] = []
|
|
1427
1437
|
return {
|
|
1428
|
-
"pending": pending,
|
|
1438
|
+
"pending": pending if not since else len(split.get("messages", [])),
|
|
1429
1439
|
"agent": AGENT_NAME,
|
|
1430
1440
|
"project": PROJECT_NAME,
|
|
1431
1441
|
"realtime_connected": _REALTIME.is_connected if _REALTIME else False,
|
|
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
|