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.
Files changed (24) hide show
  1. {meshcode-1.2.0 → meshcode-1.2.2}/PKG-INFO +1 -1
  2. {meshcode-1.2.0 → meshcode-1.2.2}/meshcode/__init__.py +1 -1
  3. {meshcode-1.2.0 → meshcode-1.2.2}/meshcode/comms_v4.py +40 -19
  4. {meshcode-1.2.0 → meshcode-1.2.2}/meshcode/meshcode_mcp/backend.py +25 -8
  5. {meshcode-1.2.0 → meshcode-1.2.2}/meshcode/setup_clients.py +4 -3
  6. {meshcode-1.2.0 → meshcode-1.2.2}/meshcode.egg-info/PKG-INFO +1 -1
  7. {meshcode-1.2.0 → meshcode-1.2.2}/pyproject.toml +1 -1
  8. {meshcode-1.2.0 → meshcode-1.2.2}/README.md +0 -0
  9. {meshcode-1.2.0 → meshcode-1.2.2}/meshcode/cli.py +0 -0
  10. {meshcode-1.2.0 → meshcode-1.2.2}/meshcode/launcher.py +0 -0
  11. {meshcode-1.2.0 → meshcode-1.2.2}/meshcode/launcher_install.py +0 -0
  12. {meshcode-1.2.0 → meshcode-1.2.2}/meshcode/meshcode_mcp/__init__.py +0 -0
  13. {meshcode-1.2.0 → meshcode-1.2.2}/meshcode/meshcode_mcp/__main__.py +0 -0
  14. {meshcode-1.2.0 → meshcode-1.2.2}/meshcode/meshcode_mcp/realtime.py +0 -0
  15. {meshcode-1.2.0 → meshcode-1.2.2}/meshcode/meshcode_mcp/server.py +0 -0
  16. {meshcode-1.2.0 → meshcode-1.2.2}/meshcode/meshcode_mcp/test_backend.py +0 -0
  17. {meshcode-1.2.0 → meshcode-1.2.2}/meshcode/meshcode_mcp/test_realtime.py +0 -0
  18. {meshcode-1.2.0 → meshcode-1.2.2}/meshcode/protocol_v2.py +0 -0
  19. {meshcode-1.2.0 → meshcode-1.2.2}/meshcode.egg-info/SOURCES.txt +0 -0
  20. {meshcode-1.2.0 → meshcode-1.2.2}/meshcode.egg-info/dependency_links.txt +0 -0
  21. {meshcode-1.2.0 → meshcode-1.2.2}/meshcode.egg-info/entry_points.txt +0 -0
  22. {meshcode-1.2.0 → meshcode-1.2.2}/meshcode.egg-info/requires.txt +0 -0
  23. {meshcode-1.2.0 → meshcode-1.2.2}/meshcode.egg-info/top_level.txt +0 -0
  24. {meshcode-1.2.0 → meshcode-1.2.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshcode
3
- Version: 1.2.0
3
+ Version: 1.2.2
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__ = "1.0.0"
2
+ __version__ = "1.2.2"
@@ -36,24 +36,34 @@ from urllib.parse import quote
36
36
  # ============================================================
37
37
  # CONFIG — Supabase connection
38
38
  # ============================================================
39
- SUPABASE_URL = os.environ.get("SUPABASE_URL", "")
40
- SUPABASE_KEY = os.environ.get("SUPABASE_KEY", "")
41
- SCHEMA = "meshcode"
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
- if not SUPABASE_URL or not SUPABASE_KEY:
44
- # Allow `--help` and the help command to run without credentials
45
- _is_help = (
46
- len(sys.argv) <= 1
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
- from .setup_clients import setup as _setup_client
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
- from .setup_clients import setup as _setup_client
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
- SUPABASE_URL = os.environ.get("SUPABASE_URL", "")
15
- SUPABASE_KEY = os.environ.get("SUPABASE_KEY", "")
16
- SCHEMA = "meshcode"
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
- if not SUPABASE_URL or not SUPABASE_KEY:
19
- raise RuntimeError(
20
- "SUPABASE_URL and SUPABASE_KEY env vars are required. "
21
- "Set them in your shell or .env file. See .env.example."
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 or not key:
47
- print("[meshcode] ERROR: SUPABASE_URL / SUPABASE_KEY not set in env or ~/.meshcode/env", file=sys.stderr)
48
- sys.exit(2)
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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshcode
3
- Version: 1.2.0
3
+ Version: 1.2.2
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 = "1.2.0"
7
+ version = "1.2.2"
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