mesh-context-layer 0.4.1__tar.gz → 0.4.2__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 (34) hide show
  1. {mesh_context_layer-0.4.1 → mesh_context_layer-0.4.2}/PKG-INFO +1 -1
  2. {mesh_context_layer-0.4.1 → mesh_context_layer-0.4.2}/mesh/memory.py +3 -2
  3. {mesh_context_layer-0.4.1 → mesh_context_layer-0.4.2}/mesh/store.py +1 -1
  4. mesh_context_layer-0.4.2/mesh/version.py +38 -0
  5. {mesh_context_layer-0.4.1 → mesh_context_layer-0.4.2}/pyproject.toml +1 -1
  6. mesh_context_layer-0.4.1/mesh/version.py +0 -24
  7. {mesh_context_layer-0.4.1 → mesh_context_layer-0.4.2}/.github/workflows/test.yml +0 -0
  8. {mesh_context_layer-0.4.1 → mesh_context_layer-0.4.2}/.gitignore +0 -0
  9. {mesh_context_layer-0.4.1 → mesh_context_layer-0.4.2}/ARCHITECTURE.md +0 -0
  10. {mesh_context_layer-0.4.1 → mesh_context_layer-0.4.2}/DEVELOPER_GUIDE.md +0 -0
  11. {mesh_context_layer-0.4.1 → mesh_context_layer-0.4.2}/LICENSE +0 -0
  12. {mesh_context_layer-0.4.1 → mesh_context_layer-0.4.2}/MANIFEST.in +0 -0
  13. {mesh_context_layer-0.4.1 → mesh_context_layer-0.4.2}/README.md +0 -0
  14. {mesh_context_layer-0.4.1 → mesh_context_layer-0.4.2}/examples/basic_usage.py +0 -0
  15. {mesh_context_layer-0.4.1 → mesh_context_layer-0.4.2}/examples/two_agents_demo.py +0 -0
  16. {mesh_context_layer-0.4.1 → mesh_context_layer-0.4.2}/examples/v02_demo.py +0 -0
  17. {mesh_context_layer-0.4.1 → mesh_context_layer-0.4.2}/mesh/__init__.py +0 -0
  18. {mesh_context_layer-0.4.1 → mesh_context_layer-0.4.2}/mesh/audit.py +0 -0
  19. {mesh_context_layer-0.4.1 → mesh_context_layer-0.4.2}/mesh/cli.py +0 -0
  20. {mesh_context_layer-0.4.1 → mesh_context_layer-0.4.2}/mesh/context_builder.py +0 -0
  21. {mesh_context_layer-0.4.1 → mesh_context_layer-0.4.2}/mesh/dashboard.py +0 -0
  22. {mesh_context_layer-0.4.1 → mesh_context_layer-0.4.2}/mesh/digest.py +0 -0
  23. {mesh_context_layer-0.4.1 → mesh_context_layer-0.4.2}/mesh/http_server.py +0 -0
  24. {mesh_context_layer-0.4.1 → mesh_context_layer-0.4.2}/mesh/io.py +0 -0
  25. {mesh_context_layer-0.4.1 → mesh_context_layer-0.4.2}/mesh/mcp_server.py +0 -0
  26. {mesh_context_layer-0.4.1 → mesh_context_layer-0.4.2}/mesh/namespaces.py +0 -0
  27. {mesh_context_layer-0.4.1 → mesh_context_layer-0.4.2}/mesh/passive.py +0 -0
  28. {mesh_context_layer-0.4.1 → mesh_context_layer-0.4.2}/pytest.ini +0 -0
  29. {mesh_context_layer-0.4.1 → mesh_context_layer-0.4.2}/test_out.txt +0 -0
  30. {mesh_context_layer-0.4.1 → mesh_context_layer-0.4.2}/test_out_utf8.txt +0 -0
  31. {mesh_context_layer-0.4.1 → mesh_context_layer-0.4.2}/tests/__init__.py +0 -0
  32. {mesh_context_layer-0.4.1 → mesh_context_layer-0.4.2}/tests/test_memory.py +0 -0
  33. {mesh_context_layer-0.4.1 → mesh_context_layer-0.4.2}/tests/test_v03.py +0 -0
  34. {mesh_context_layer-0.4.1 → mesh_context_layer-0.4.2}/tests/test_v04.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mesh-context-layer
3
- Version: 0.4.1
3
+ Version: 0.4.2
4
4
  Summary: Shared memory layer for AI agents — MCP server and Python library
5
5
  Project-URL: Homepage, https://github.com/billighost/mesh
6
6
  Project-URL: Repository, https://github.com/billighost/mesh
@@ -4,7 +4,7 @@ import uuid
4
4
  from datetime import datetime, timedelta
5
5
  from typing import Optional
6
6
 
7
- from sentence_transformers import SentenceTransformer
7
+
8
8
 
9
9
  from .store import MeshStore
10
10
 
@@ -18,9 +18,10 @@ CONTRADICTION_THRESHOLD = 0.82
18
18
  STALE_THRESHOLD = 0.3
19
19
 
20
20
 
21
- def _get_model() -> SentenceTransformer:
21
+ def _get_model() -> "SentenceTransformer":
22
22
  global _model
23
23
  if _model is None:
24
+ from sentence_transformers import SentenceTransformer
24
25
  _model = SentenceTransformer(_MODEL_NAME)
25
26
  return _model
26
27
 
@@ -1,4 +1,3 @@
1
- import chromadb
2
1
  import sqlite3
3
2
  import json
4
3
  from pathlib import Path
@@ -24,6 +23,7 @@ class MeshStore:
24
23
  self.namespace = namespace
25
24
  MESH_DIR.mkdir(parents=True, exist_ok=True)
26
25
 
26
+ import chromadb
27
27
  self.chroma_client = chromadb.PersistentClient(
28
28
  path=str(MESH_DIR / "chroma")
29
29
  )
@@ -0,0 +1,38 @@
1
+ import threading
2
+
3
+ VERSION = "0.4.2"
4
+ PACKAGE_NAME = "mesh-context-layer"
5
+
6
+ def get_latest_version():
7
+ """Check PyPI for the latest version of the package."""
8
+ try:
9
+ import httpx
10
+ url = f"https://pypi.org/pypi/{PACKAGE_NAME}/json"
11
+ response = httpx.get(url, timeout=1.5)
12
+ if response.status_code == 200:
13
+ return response.json()["info"]["version"]
14
+ except Exception:
15
+ pass
16
+ return None
17
+
18
+ def _run_check():
19
+ latest = get_latest_version()
20
+ if not latest:
21
+ return
22
+
23
+ # Simple semver compare (only notify if latest > VERSION)
24
+ try:
25
+ l_parts = [int(p) for p in latest.split(".")]
26
+ v_parts = [int(p) for p in VERSION.split(".")]
27
+ if l_parts > v_parts:
28
+ print(f"\n📢 A new version of Mesh is available: {latest} (you have {VERSION})")
29
+ print(f" Run 'pip install --upgrade {PACKAGE_NAME}' to update.\n")
30
+ except (ValueError, IndexError):
31
+ # Fallback to string compare if semver fails
32
+ if latest != VERSION:
33
+ print(f"\n📢 Version {latest} is available on PyPI (you have {VERSION})\n")
34
+
35
+ def check_for_updates():
36
+ """Check for updates in a background thread to avoid blocking CLI startup."""
37
+ thread = threading.Thread(target=_run_check, daemon=True)
38
+ thread.start()
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "mesh-context-layer"
7
- version = "0.4.1"
7
+ version = "0.4.2"
8
8
  description = "Shared memory layer for AI agents — MCP server and Python library"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -1,24 +0,0 @@
1
- import httpx
2
- import os
3
- from pathlib import Path
4
-
5
- VERSION = "0.4.1"
6
- PACKAGE_NAME = "mesh-context-layer"
7
-
8
- def get_latest_version():
9
- """Check PyPI for the latest version of the package."""
10
- try:
11
- url = f"https://pypi.org/pypi/{PACKAGE_NAME}/json"
12
- response = httpx.get(url, timeout=2.0)
13
- if response.status_code == 200:
14
- return response.json()["info"]["version"]
15
- except Exception:
16
- pass
17
- return None
18
-
19
- def check_for_updates():
20
- """Print a message if a new version is available."""
21
- latest = get_latest_version()
22
- if latest and latest != VERSION:
23
- print(f"\n📢 A new version of Mesh is available: {latest} (you have {VERSION})")
24
- print(f" Run 'pip install --upgrade {PACKAGE_NAME}' to update.\n")