meshcode 2.8.1__tar.gz → 2.8.3__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.
Files changed (31) hide show
  1. {meshcode-2.8.1 → meshcode-2.8.3}/PKG-INFO +1 -1
  2. {meshcode-2.8.1 → meshcode-2.8.3}/meshcode/__init__.py +1 -1
  3. {meshcode-2.8.1 → meshcode-2.8.3}/meshcode/meshcode_mcp/backend.py +6 -3
  4. {meshcode-2.8.1 → meshcode-2.8.3}/meshcode/meshcode_mcp/server.py +46 -9
  5. {meshcode-2.8.1 → meshcode-2.8.3}/meshcode.egg-info/PKG-INFO +1 -1
  6. {meshcode-2.8.1 → meshcode-2.8.3}/pyproject.toml +1 -1
  7. {meshcode-2.8.1 → meshcode-2.8.3}/README.md +0 -0
  8. {meshcode-2.8.1 → meshcode-2.8.3}/meshcode/cli.py +0 -0
  9. {meshcode-2.8.1 → meshcode-2.8.3}/meshcode/comms_v4.py +0 -0
  10. {meshcode-2.8.1 → meshcode-2.8.3}/meshcode/invites.py +0 -0
  11. {meshcode-2.8.1 → meshcode-2.8.3}/meshcode/launcher.py +0 -0
  12. {meshcode-2.8.1 → meshcode-2.8.3}/meshcode/launcher_install.py +0 -0
  13. {meshcode-2.8.1 → meshcode-2.8.3}/meshcode/meshcode_mcp/__init__.py +0 -0
  14. {meshcode-2.8.1 → meshcode-2.8.3}/meshcode/meshcode_mcp/__main__.py +0 -0
  15. {meshcode-2.8.1 → meshcode-2.8.3}/meshcode/meshcode_mcp/realtime.py +0 -0
  16. {meshcode-2.8.1 → meshcode-2.8.3}/meshcode/meshcode_mcp/test_backend.py +0 -0
  17. {meshcode-2.8.1 → meshcode-2.8.3}/meshcode/meshcode_mcp/test_realtime.py +0 -0
  18. {meshcode-2.8.1 → meshcode-2.8.3}/meshcode/meshcode_mcp/test_server_wrapper.py +0 -0
  19. {meshcode-2.8.1 → meshcode-2.8.3}/meshcode/preferences.py +0 -0
  20. {meshcode-2.8.1 → meshcode-2.8.3}/meshcode/protocol_v2.py +0 -0
  21. {meshcode-2.8.1 → meshcode-2.8.3}/meshcode/run_agent.py +0 -0
  22. {meshcode-2.8.1 → meshcode-2.8.3}/meshcode/secrets.py +0 -0
  23. {meshcode-2.8.1 → meshcode-2.8.3}/meshcode/self_update.py +0 -0
  24. {meshcode-2.8.1 → meshcode-2.8.3}/meshcode/setup_clients.py +0 -0
  25. {meshcode-2.8.1 → meshcode-2.8.3}/meshcode.egg-info/SOURCES.txt +0 -0
  26. {meshcode-2.8.1 → meshcode-2.8.3}/meshcode.egg-info/dependency_links.txt +0 -0
  27. {meshcode-2.8.1 → meshcode-2.8.3}/meshcode.egg-info/entry_points.txt +0 -0
  28. {meshcode-2.8.1 → meshcode-2.8.3}/meshcode.egg-info/requires.txt +0 -0
  29. {meshcode-2.8.1 → meshcode-2.8.3}/meshcode.egg-info/top_level.txt +0 -0
  30. {meshcode-2.8.1 → meshcode-2.8.3}/setup.cfg +0 -0
  31. {meshcode-2.8.1 → meshcode-2.8.3}/tests/test_status_enum_coverage.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshcode
3
- Version: 2.8.1
3
+ Version: 2.8.3
4
4
  Summary: Real-time communication between AI agents — Supabase-backed CLI
5
5
  Author-email: MeshCode <hello@meshcode.io>
6
6
  License: MIT
@@ -1,2 +1,2 @@
1
1
  """MeshCode — Real-time communication between AI agents."""
2
- __version__ = "2.8.1"
2
+ __version__ = "2.8.3"
@@ -209,7 +209,7 @@ def get_project_id(project_name: str) -> Optional[str]:
209
209
  return None
210
210
 
211
211
 
212
- def register_agent(project: str, name: str, role: str = "") -> Dict:
212
+ def register_agent(project: str, name: str, role: str = "", api_key: Optional[str] = None) -> Dict:
213
213
  project_id = get_project_id(project)
214
214
  if not project_id:
215
215
  # Fallback: many spawn paths (setup_clients.py) bake the project
@@ -221,12 +221,15 @@ def register_agent(project: str, name: str, role: str = "") -> Dict:
221
221
  if not project_id:
222
222
  return {"error": f"Project '{project}' not found"}
223
223
 
224
- result = sb_rpc("mc_register_agent", {
224
+ params = {
225
225
  "p_project_id": project_id,
226
226
  "p_name": name,
227
227
  "p_role": role,
228
228
  "p_status": "online",
229
- })
229
+ }
230
+ if api_key:
231
+ params["p_api_key"] = api_key
232
+ result = sb_rpc("mc_register_agent", params)
230
233
 
231
234
  if not result or (isinstance(result, dict) and result.get("error")):
232
235
  return result or {"error": "Failed to register agent"}
@@ -348,7 +348,7 @@ try:
348
348
  except Exception:
349
349
  pass # default to free
350
350
 
351
- _register_result = be.register_agent(PROJECT_NAME, AGENT_NAME, AGENT_ROLE or "MCP-connected agent")
351
+ _register_result = be.register_agent(PROJECT_NAME, AGENT_NAME, AGENT_ROLE or "MCP-connected agent", api_key=_get_api_key())
352
352
  if isinstance(_register_result, dict) and _register_result.get("error"):
353
353
  print(f"[meshcode-mcp] WARNING: register failed: {_register_result['error']}", file=sys.stderr)
354
354
 
@@ -1283,7 +1283,6 @@ try:
1283
1283
  "p_api_key": _get_api_key(),
1284
1284
  "p_agent_name": AGENT_NAME,
1285
1285
  "p_key": "last_seen",
1286
- "p_project_name": PROJECT_NAME,
1287
1286
  })
1288
1287
  if isinstance(_ls_result, dict) and _ls_result.get("ok"):
1289
1288
  _ls_val = _ls_result.get("value")
@@ -1439,6 +1438,7 @@ async def meshcode_wait(timeout_seconds: int = 120, include_acks: bool = False)
1439
1438
  "p_agent_name": AGENT_NAME,
1440
1439
  "p_key": "last_seen",
1441
1440
  "p_value": {"_raw": latest_ts},
1441
+ "p_tier": "critical",
1442
1442
  "p_project_name": PROJECT_NAME,
1443
1443
  })
1444
1444
  except Exception:
@@ -1711,7 +1711,7 @@ def meshcode_status() -> Dict[str, Any]:
1711
1711
  @with_working_status
1712
1712
  def meshcode_register(role: str = "") -> Dict[str, Any]:
1713
1713
  """Re-register agent (update role)."""
1714
- return be.register_agent(PROJECT_NAME, AGENT_NAME, role or AGENT_ROLE)
1714
+ return be.register_agent(PROJECT_NAME, AGENT_NAME, role or AGENT_ROLE, api_key=_get_api_key())
1715
1715
 
1716
1716
 
1717
1717
  @mcp.tool()
@@ -1753,7 +1753,7 @@ def meshcode_init(project: str, agent: str, role: str = "") -> Dict[str, Any]:
1753
1753
  if not pid:
1754
1754
  return {"error": f"project '{project}' not found"}
1755
1755
  _PROJECT_ID = pid
1756
- result = be.register_agent(project, agent, role or "MCP-connected agent")
1756
+ result = be.register_agent(project, agent, role or "MCP-connected agent", api_key=_get_api_key())
1757
1757
  return {"ok": True, "project": project, "agent": agent, "register": result}
1758
1758
 
1759
1759
 
@@ -1806,9 +1806,29 @@ def meshcode_task_claim(task_id: str) -> Dict[str, Any]:
1806
1806
  @mcp.tool()
1807
1807
  @with_working_status
1808
1808
  def meshcode_task_complete(task_id: str, summary: str = "") -> Dict[str, Any]:
1809
- """Complete a claimed task with summary."""
1809
+ """Complete a claimed task with summary. Auto-remembers the task summary."""
1810
1810
  api_key = _get_api_key()
1811
- return be.task_complete(api_key, _PROJECT_ID, task_id, AGENT_NAME, summary=summary)
1811
+ result = be.task_complete(api_key, _PROJECT_ID, task_id, AGENT_NAME, summary=summary)
1812
+ # Auto-remember task completion for future context
1813
+ if isinstance(result, dict) and result.get("ok") and summary:
1814
+ try:
1815
+ import threading
1816
+ def _auto_remember():
1817
+ try:
1818
+ be.sb_rpc("mc_memory_set", {
1819
+ "p_api_key": api_key,
1820
+ "p_agent_name": AGENT_NAME,
1821
+ "p_key": f"task_{task_id[:8]}",
1822
+ "p_value": {"title": result.get("title", ""), "summary": summary, "completed": True},
1823
+ "p_tier": "episodic",
1824
+ "p_project_name": PROJECT_NAME,
1825
+ })
1826
+ except Exception:
1827
+ pass
1828
+ threading.Thread(target=_auto_remember, daemon=True).start()
1829
+ except Exception:
1830
+ pass
1831
+ return result
1812
1832
 
1813
1833
 
1814
1834
  @mcp.tool()
@@ -2006,7 +2026,7 @@ def meshcode_add_agent(name: str, role: str = "") -> Dict[str, Any]:
2006
2026
  name: Agent name.
2007
2027
  role: Agent role description.
2008
2028
  """
2009
- result = be.register_agent(PROJECT_NAME, name, role or "MCP-connected agent")
2029
+ result = be.register_agent(PROJECT_NAME, name, role or "MCP-connected agent", api_key=_get_api_key())
2010
2030
  if isinstance(result, dict) and not result.get("error"):
2011
2031
  return {"ok": True, "agent": name, "next_step": f"Run: meshcode setup {PROJECT_NAME} {name} && meshcode run {name}"}
2012
2032
  return result or {"error": "failed to add agent"}
@@ -2168,6 +2188,7 @@ def meshcode_remember(key: str, value: Any) -> Dict[str, Any]:
2168
2188
  "p_agent_name": AGENT_NAME,
2169
2189
  "p_key": key,
2170
2190
  "p_value": json_value,
2191
+ "p_tier": "reference",
2171
2192
  "p_project_name": PROJECT_NAME,
2172
2193
  })
2173
2194
  # Best-effort sync to Obsidian vault (if configured)
@@ -2193,16 +2214,33 @@ def meshcode_recall(key: Optional[str] = None) -> Dict[str, Any]:
2193
2214
  "p_api_key": api_key,
2194
2215
  "p_agent_name": AGENT_NAME,
2195
2216
  "p_key": key,
2196
- "p_project_name": PROJECT_NAME,
2197
2217
  })
2198
2218
  else:
2199
2219
  return be.sb_rpc("mc_memory_list", {
2200
2220
  "p_api_key": api_key,
2201
2221
  "p_agent_name": AGENT_NAME,
2222
+ "p_tier": "critical",
2202
2223
  "p_project_name": PROJECT_NAME,
2203
2224
  })
2204
2225
 
2205
2226
 
2227
+ @mcp.tool()
2228
+ @with_working_status
2229
+ def meshcode_recall_keys() -> Dict[str, Any]:
2230
+ """List memory keys only (no values). Cheap token cost for deciding what to recall."""
2231
+ api_key = _get_api_key()
2232
+ result = be.sb_rpc("mc_memory_list", {
2233
+ "p_api_key": api_key,
2234
+ "p_agent_name": AGENT_NAME,
2235
+ "p_tier": "reference",
2236
+ "p_project_name": PROJECT_NAME,
2237
+ })
2238
+ if isinstance(result, dict) and result.get("ok"):
2239
+ keys = [m.get("key") for m in result.get("memories", []) if m.get("key")]
2240
+ return {"ok": True, "keys": keys, "count": len(keys)}
2241
+ return result
2242
+
2243
+
2206
2244
  @mcp.tool()
2207
2245
  @with_working_status
2208
2246
  def meshcode_forget(key: str) -> Dict[str, Any]:
@@ -2216,7 +2254,6 @@ def meshcode_forget(key: str) -> Dict[str, Any]:
2216
2254
  "p_api_key": api_key,
2217
2255
  "p_agent_name": AGENT_NAME,
2218
2256
  "p_key": key,
2219
- "p_project_name": PROJECT_NAME,
2220
2257
  })
2221
2258
 
2222
2259
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshcode
3
- Version: 2.8.1
3
+ Version: 2.8.3
4
4
  Summary: Real-time communication between AI agents — Supabase-backed CLI
5
5
  Author-email: MeshCode <hello@meshcode.io>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "meshcode"
7
- version = "2.8.1"
7
+ version = "2.8.3"
8
8
  description = "Real-time communication between AI agents — Supabase-backed CLI"
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes