meshcode 1.2.0__tar.gz → 1.2.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-1.2.0 → meshcode-1.2.2}/PKG-INFO +1 -1
- {meshcode-1.2.0 → meshcode-1.2.2}/meshcode/__init__.py +1 -1
- {meshcode-1.2.0 → meshcode-1.2.2}/meshcode/comms_v4.py +40 -19
- {meshcode-1.2.0 → meshcode-1.2.2}/meshcode/meshcode_mcp/backend.py +25 -8
- {meshcode-1.2.0 → meshcode-1.2.2}/meshcode/setup_clients.py +4 -3
- {meshcode-1.2.0 → meshcode-1.2.2}/meshcode.egg-info/PKG-INFO +1 -1
- {meshcode-1.2.0 → meshcode-1.2.2}/pyproject.toml +1 -1
- {meshcode-1.2.0 → meshcode-1.2.2}/README.md +0 -0
- {meshcode-1.2.0 → meshcode-1.2.2}/meshcode/cli.py +0 -0
- {meshcode-1.2.0 → meshcode-1.2.2}/meshcode/launcher.py +0 -0
- {meshcode-1.2.0 → meshcode-1.2.2}/meshcode/launcher_install.py +0 -0
- {meshcode-1.2.0 → meshcode-1.2.2}/meshcode/meshcode_mcp/__init__.py +0 -0
- {meshcode-1.2.0 → meshcode-1.2.2}/meshcode/meshcode_mcp/__main__.py +0 -0
- {meshcode-1.2.0 → meshcode-1.2.2}/meshcode/meshcode_mcp/realtime.py +0 -0
- {meshcode-1.2.0 → meshcode-1.2.2}/meshcode/meshcode_mcp/server.py +0 -0
- {meshcode-1.2.0 → meshcode-1.2.2}/meshcode/meshcode_mcp/test_backend.py +0 -0
- {meshcode-1.2.0 → meshcode-1.2.2}/meshcode/meshcode_mcp/test_realtime.py +0 -0
- {meshcode-1.2.0 → meshcode-1.2.2}/meshcode/protocol_v2.py +0 -0
- {meshcode-1.2.0 → meshcode-1.2.2}/meshcode.egg-info/SOURCES.txt +0 -0
- {meshcode-1.2.0 → meshcode-1.2.2}/meshcode.egg-info/dependency_links.txt +0 -0
- {meshcode-1.2.0 → meshcode-1.2.2}/meshcode.egg-info/entry_points.txt +0 -0
- {meshcode-1.2.0 → meshcode-1.2.2}/meshcode.egg-info/requires.txt +0 -0
- {meshcode-1.2.0 → meshcode-1.2.2}/meshcode.egg-info/top_level.txt +0 -0
- {meshcode-1.2.0 → meshcode-1.2.2}/setup.cfg +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""MeshCode — Real-time communication between AI agents."""
|
|
2
|
-
__version__ = "1.
|
|
2
|
+
__version__ = "1.2.2"
|
|
@@ -36,24 +36,34 @@ from urllib.parse import quote
|
|
|
36
36
|
# ============================================================
|
|
37
37
|
# CONFIG — Supabase connection
|
|
38
38
|
# ============================================================
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
# Production defaults baked in. The publishable key is the anon/public key
|
|
40
|
+
# (RLS-protected, safe to ship — same one the frontend at meshcode.io uses
|
|
41
|
+
# in the browser). Override via env vars or ~/.meshcode/env if you self-host.
|
|
42
|
+
_DEFAULT_SUPABASE_URL = "https://wwgzzmydrwrjgaebspdo.supabase.co"
|
|
43
|
+
_DEFAULT_SUPABASE_KEY = "sb_publishable_0qf0U1GURopPIxLR8Vu7eQ_5grflPP4"
|
|
44
|
+
|
|
45
|
+
def _load_env_file():
|
|
46
|
+
"""Read SUPABASE_URL/KEY from ~/.meshcode/env if present (overrides defaults)."""
|
|
47
|
+
env_path = Path.home() / ".meshcode" / "env"
|
|
48
|
+
if not env_path.exists():
|
|
49
|
+
return {}
|
|
50
|
+
out = {}
|
|
51
|
+
try:
|
|
52
|
+
for line in env_path.read_text().splitlines():
|
|
53
|
+
line = line.strip()
|
|
54
|
+
if line.startswith("export "):
|
|
55
|
+
line = line[7:]
|
|
56
|
+
if "=" in line and not line.startswith("#"):
|
|
57
|
+
k, v = line.split("=", 1)
|
|
58
|
+
out[k.strip()] = v.strip().strip('"').strip("'")
|
|
59
|
+
except Exception:
|
|
60
|
+
pass
|
|
61
|
+
return out
|
|
42
62
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
or sys.argv[1] in ("help", "--help", "-h")
|
|
48
|
-
or (len(sys.argv) >= 3 and sys.argv[2] in ("--help", "-h", "help"))
|
|
49
|
-
)
|
|
50
|
-
if not _is_help:
|
|
51
|
-
sys.stderr.write(
|
|
52
|
-
"[meshcode] ERROR: SUPABASE_URL and SUPABASE_KEY env vars are required.\n"
|
|
53
|
-
"[meshcode] Set them in your shell, in a .env file, or via `meshcode login <api_key>`.\n"
|
|
54
|
-
"[meshcode] See .env.example for the full list.\n"
|
|
55
|
-
)
|
|
56
|
-
sys.exit(2)
|
|
63
|
+
_env_file = _load_env_file()
|
|
64
|
+
SUPABASE_URL = os.environ.get("SUPABASE_URL") or _env_file.get("SUPABASE_URL") or _DEFAULT_SUPABASE_URL
|
|
65
|
+
SUPABASE_KEY = os.environ.get("SUPABASE_KEY") or _env_file.get("SUPABASE_KEY") or _DEFAULT_SUPABASE_KEY
|
|
66
|
+
SCHEMA = "meshcode"
|
|
57
67
|
|
|
58
68
|
# Local paths for session/TTY tracking (still needed for nudge)
|
|
59
69
|
COMMS_DIR = Path(__file__).parent
|
|
@@ -1405,7 +1415,8 @@ def connect(project, name, hook_target="claude", role=""):
|
|
|
1405
1415
|
if hook_target == "claude":
|
|
1406
1416
|
# Delegate to the universal setup_clients writer. `meshcode connect` is
|
|
1407
1417
|
# now a backwards-compat alias for `meshcode setup claude-code`.
|
|
1408
|
-
|
|
1418
|
+
import importlib
|
|
1419
|
+
_setup_client = importlib.import_module("meshcode.setup_clients").setup
|
|
1409
1420
|
_setup_client("claude-code", project, name, actual_role)
|
|
1410
1421
|
|
|
1411
1422
|
elif hook_target == "codex":
|
|
@@ -1653,6 +1664,15 @@ if __name__ == "__main__":
|
|
|
1653
1664
|
|
|
1654
1665
|
cmd = sys.argv[1].lower()
|
|
1655
1666
|
|
|
1667
|
+
if cmd in ("--version", "-V", "version"):
|
|
1668
|
+
try:
|
|
1669
|
+
import importlib
|
|
1670
|
+
_v = importlib.import_module("meshcode").__version__
|
|
1671
|
+
except Exception:
|
|
1672
|
+
_v = "unknown"
|
|
1673
|
+
print(f"meshcode {_v}")
|
|
1674
|
+
sys.exit(0)
|
|
1675
|
+
|
|
1656
1676
|
# Per-subcommand help: meshcode <cmd> --help / -h / help
|
|
1657
1677
|
if len(sys.argv) >= 3 and sys.argv[2] in ("--help", "-h", "help"):
|
|
1658
1678
|
show_subcommand_help(cmd)
|
|
@@ -1876,7 +1896,8 @@ if __name__ == "__main__":
|
|
|
1876
1896
|
project = sys.argv[3]
|
|
1877
1897
|
agent = sys.argv[4]
|
|
1878
1898
|
role = sys.argv[5] if len(sys.argv) > 5 else ""
|
|
1879
|
-
|
|
1899
|
+
import importlib
|
|
1900
|
+
_setup_client = importlib.import_module("meshcode.setup_clients").setup
|
|
1880
1901
|
sys.exit(_setup_client(client, project, agent, role))
|
|
1881
1902
|
|
|
1882
1903
|
elif cmd == "login":
|
|
@@ -6,20 +6,37 @@ Zero deps beyond stdlib (urllib).
|
|
|
6
6
|
import json
|
|
7
7
|
import os
|
|
8
8
|
from datetime import datetime
|
|
9
|
+
from pathlib import Path
|
|
9
10
|
from typing import Any, Dict, List, Optional
|
|
10
11
|
from urllib.error import HTTPError, URLError
|
|
11
12
|
from urllib.parse import quote
|
|
12
13
|
from urllib.request import Request, urlopen
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
# Bake in production defaults — RLS-protected publishable key, safe to ship.
|
|
16
|
+
_DEFAULT_SUPABASE_URL = "https://wwgzzmydrwrjgaebspdo.supabase.co"
|
|
17
|
+
_DEFAULT_SUPABASE_KEY = "sb_publishable_0qf0U1GURopPIxLR8Vu7eQ_5grflPP4"
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
def _load_env_file() -> Dict[str, str]:
|
|
20
|
+
env_path = Path.home() / ".meshcode" / "env"
|
|
21
|
+
if not env_path.exists():
|
|
22
|
+
return {}
|
|
23
|
+
out: Dict[str, str] = {}
|
|
24
|
+
try:
|
|
25
|
+
for line in env_path.read_text().splitlines():
|
|
26
|
+
line = line.strip()
|
|
27
|
+
if line.startswith("export "):
|
|
28
|
+
line = line[7:]
|
|
29
|
+
if "=" in line and not line.startswith("#"):
|
|
30
|
+
k, v = line.split("=", 1)
|
|
31
|
+
out[k.strip()] = v.strip().strip('"').strip("'")
|
|
32
|
+
except Exception:
|
|
33
|
+
pass
|
|
34
|
+
return out
|
|
35
|
+
|
|
36
|
+
_env_file = _load_env_file()
|
|
37
|
+
SUPABASE_URL = os.environ.get("SUPABASE_URL") or _env_file.get("SUPABASE_URL") or _DEFAULT_SUPABASE_URL
|
|
38
|
+
SUPABASE_KEY = os.environ.get("SUPABASE_KEY") or _env_file.get("SUPABASE_KEY") or _DEFAULT_SUPABASE_KEY
|
|
39
|
+
SCHEMA = "meshcode"
|
|
23
40
|
|
|
24
41
|
|
|
25
42
|
def _now_iso() -> str:
|
|
@@ -43,9 +43,10 @@ def _load_supabase_env() -> Dict[str, str]:
|
|
|
43
43
|
url = v
|
|
44
44
|
elif k == "SUPABASE_KEY" and not key:
|
|
45
45
|
key = v
|
|
46
|
-
if not url
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
if not url:
|
|
47
|
+
url = "https://wwgzzmydrwrjgaebspdo.supabase.co"
|
|
48
|
+
if not key:
|
|
49
|
+
key = "sb_publishable_0qf0U1GURopPIxLR8Vu7eQ_5grflPP4"
|
|
49
50
|
return {"SUPABASE_URL": url, "SUPABASE_KEY": key}
|
|
50
51
|
|
|
51
52
|
|
|
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
|