meshcode 2.6.0__tar.gz → 2.6.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.
- {meshcode-2.6.0 → meshcode-2.6.2}/PKG-INFO +1 -1
- {meshcode-2.6.0 → meshcode-2.6.2}/meshcode/__init__.py +1 -1
- {meshcode-2.6.0 → meshcode-2.6.2}/meshcode/meshcode_mcp/server.py +72 -20
- {meshcode-2.6.0 → meshcode-2.6.2}/meshcode.egg-info/PKG-INFO +1 -1
- {meshcode-2.6.0 → meshcode-2.6.2}/pyproject.toml +1 -1
- {meshcode-2.6.0 → meshcode-2.6.2}/README.md +0 -0
- {meshcode-2.6.0 → meshcode-2.6.2}/meshcode/cli.py +0 -0
- {meshcode-2.6.0 → meshcode-2.6.2}/meshcode/comms_v4.py +0 -0
- {meshcode-2.6.0 → meshcode-2.6.2}/meshcode/invites.py +0 -0
- {meshcode-2.6.0 → meshcode-2.6.2}/meshcode/launcher.py +0 -0
- {meshcode-2.6.0 → meshcode-2.6.2}/meshcode/launcher_install.py +0 -0
- {meshcode-2.6.0 → meshcode-2.6.2}/meshcode/meshcode_mcp/__init__.py +0 -0
- {meshcode-2.6.0 → meshcode-2.6.2}/meshcode/meshcode_mcp/__main__.py +0 -0
- {meshcode-2.6.0 → meshcode-2.6.2}/meshcode/meshcode_mcp/backend.py +0 -0
- {meshcode-2.6.0 → meshcode-2.6.2}/meshcode/meshcode_mcp/realtime.py +0 -0
- {meshcode-2.6.0 → meshcode-2.6.2}/meshcode/meshcode_mcp/test_backend.py +0 -0
- {meshcode-2.6.0 → meshcode-2.6.2}/meshcode/meshcode_mcp/test_realtime.py +0 -0
- {meshcode-2.6.0 → meshcode-2.6.2}/meshcode/meshcode_mcp/test_server_wrapper.py +0 -0
- {meshcode-2.6.0 → meshcode-2.6.2}/meshcode/preferences.py +0 -0
- {meshcode-2.6.0 → meshcode-2.6.2}/meshcode/protocol_v2.py +0 -0
- {meshcode-2.6.0 → meshcode-2.6.2}/meshcode/run_agent.py +0 -0
- {meshcode-2.6.0 → meshcode-2.6.2}/meshcode/secrets.py +0 -0
- {meshcode-2.6.0 → meshcode-2.6.2}/meshcode/self_update.py +0 -0
- {meshcode-2.6.0 → meshcode-2.6.2}/meshcode/setup_clients.py +0 -0
- {meshcode-2.6.0 → meshcode-2.6.2}/meshcode.egg-info/SOURCES.txt +0 -0
- {meshcode-2.6.0 → meshcode-2.6.2}/meshcode.egg-info/dependency_links.txt +0 -0
- {meshcode-2.6.0 → meshcode-2.6.2}/meshcode.egg-info/entry_points.txt +0 -0
- {meshcode-2.6.0 → meshcode-2.6.2}/meshcode.egg-info/requires.txt +0 -0
- {meshcode-2.6.0 → meshcode-2.6.2}/meshcode.egg-info/top_level.txt +0 -0
- {meshcode-2.6.0 → meshcode-2.6.2}/setup.cfg +0 -0
- {meshcode-2.6.0 → meshcode-2.6.2}/tests/test_status_enum_coverage.py +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""MeshCode — Real-time communication between AI agents."""
|
|
2
|
-
__version__ = "2.6.
|
|
2
|
+
__version__ = "2.6.2"
|
|
@@ -2182,32 +2182,84 @@ def history_resource() -> str:
|
|
|
2182
2182
|
# ============================================================
|
|
2183
2183
|
|
|
2184
2184
|
def _auto_update() -> None:
|
|
2185
|
-
"""
|
|
2185
|
+
"""Blocking self-update: check PyPI, install if newer, re-exec.
|
|
2186
2186
|
|
|
2187
|
-
|
|
2188
|
-
is
|
|
2187
|
+
Ensures every agent launch always runs the latest meshcode version.
|
|
2188
|
+
The update is blocking (with short timeouts) so the new code is loaded
|
|
2189
|
+
before the MCP server starts — no "two-launch" delay.
|
|
2190
|
+
|
|
2191
|
+
Disable with MESHCODE_AUTO_UPDATE=0 if needed.
|
|
2192
|
+
Re-exec guard: MESHCODE_UPDATED=1 prevents infinite restart loops.
|
|
2189
2193
|
"""
|
|
2190
|
-
if os.environ.get("MESHCODE_AUTO_UPDATE", "
|
|
2191
|
-
log.debug("[meshcode] Auto-update disabled (
|
|
2194
|
+
if os.environ.get("MESHCODE_AUTO_UPDATE", "1").lower() in ("0", "false", "no"):
|
|
2195
|
+
log.debug("[meshcode] Auto-update disabled (MESHCODE_AUTO_UPDATE=0)")
|
|
2196
|
+
return
|
|
2197
|
+
if os.environ.get("MESHCODE_UPDATED") == "1":
|
|
2192
2198
|
return
|
|
2193
2199
|
|
|
2194
|
-
import
|
|
2200
|
+
import subprocess
|
|
2201
|
+
import urllib.request
|
|
2195
2202
|
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2203
|
+
# 1. Fetch latest version from PyPI (fast, 3s timeout)
|
|
2204
|
+
current = "0.0.0"
|
|
2205
|
+
try:
|
|
2206
|
+
from meshcode import __version__
|
|
2207
|
+
current = __version__
|
|
2208
|
+
except Exception:
|
|
2209
|
+
pass
|
|
2210
|
+
|
|
2211
|
+
latest = None
|
|
2212
|
+
try:
|
|
2213
|
+
req = urllib.request.Request(
|
|
2214
|
+
f"https://pypi.org/pypi/meshcode/json",
|
|
2215
|
+
headers={"User-Agent": f"meshcode/{current}"},
|
|
2216
|
+
)
|
|
2217
|
+
with urllib.request.urlopen(req, timeout=3) as resp:
|
|
2218
|
+
data = json.loads(resp.read().decode("utf-8"))
|
|
2219
|
+
latest = data.get("info", {}).get("version")
|
|
2220
|
+
except Exception:
|
|
2221
|
+
log.debug("[meshcode] Auto-update: PyPI check failed (offline?), skipping")
|
|
2222
|
+
return
|
|
2223
|
+
|
|
2224
|
+
if not latest:
|
|
2225
|
+
return
|
|
2226
|
+
|
|
2227
|
+
# 2. Compare versions
|
|
2228
|
+
def _ver(v: str):
|
|
2229
|
+
return tuple(int(x) for x in v.split(".") if x.isdigit())
|
|
2230
|
+
|
|
2231
|
+
try:
|
|
2232
|
+
if _ver(latest) <= _ver(current):
|
|
2233
|
+
log.debug(f"[meshcode] Already at latest version ({current})")
|
|
2234
|
+
return
|
|
2235
|
+
except Exception:
|
|
2236
|
+
return
|
|
2237
|
+
|
|
2238
|
+
# 3. Install the new version (blocking, 60s timeout)
|
|
2239
|
+
print(f"[meshcode] Updating {current} → {latest}...", file=sys.stderr)
|
|
2240
|
+
try:
|
|
2241
|
+
result = subprocess.run(
|
|
2242
|
+
[sys.executable, "-m", "pip", "install", "--upgrade",
|
|
2243
|
+
"--disable-pip-version-check", "--quiet", "meshcode"],
|
|
2244
|
+
capture_output=True, text=True, timeout=60,
|
|
2245
|
+
)
|
|
2246
|
+
if result.returncode != 0:
|
|
2247
|
+
log.debug(f"[meshcode] pip upgrade failed: {result.stderr}")
|
|
2248
|
+
return
|
|
2249
|
+
except subprocess.TimeoutExpired:
|
|
2250
|
+
log.debug("[meshcode] pip upgrade timed out (60s), skipping")
|
|
2251
|
+
return
|
|
2252
|
+
except Exception as e:
|
|
2253
|
+
log.debug(f"[meshcode] Auto-update failed: {e}")
|
|
2254
|
+
return
|
|
2209
2255
|
|
|
2210
|
-
|
|
2256
|
+
# 4. Re-exec to load the new code
|
|
2257
|
+
print(f"[meshcode] Updated to {latest}, restarting...", file=sys.stderr)
|
|
2258
|
+
os.environ["MESHCODE_UPDATED"] = "1"
|
|
2259
|
+
try:
|
|
2260
|
+
os.execv(sys.executable, [sys.executable] + sys.argv)
|
|
2261
|
+
except Exception as e:
|
|
2262
|
+
log.debug(f"[meshcode] Re-exec failed: {e}, continuing with old version")
|
|
2211
2263
|
|
|
2212
2264
|
|
|
2213
2265
|
def run_server():
|
|
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
|
|
File without changes
|