meshcode 1.2.0__tar.gz → 1.2.1__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.1}/PKG-INFO +1 -1
  2. {meshcode-1.2.0 → meshcode-1.2.1}/meshcode/__init__.py +1 -1
  3. {meshcode-1.2.0 → meshcode-1.2.1}/meshcode/comms_v4.py +36 -17
  4. {meshcode-1.2.0 → meshcode-1.2.1}/meshcode/meshcode_mcp/backend.py +25 -8
  5. {meshcode-1.2.0 → meshcode-1.2.1}/meshcode/setup_clients.py +4 -3
  6. {meshcode-1.2.0 → meshcode-1.2.1}/meshcode.egg-info/PKG-INFO +1 -1
  7. {meshcode-1.2.0 → meshcode-1.2.1}/pyproject.toml +1 -1
  8. {meshcode-1.2.0 → meshcode-1.2.1}/README.md +0 -0
  9. {meshcode-1.2.0 → meshcode-1.2.1}/meshcode/cli.py +0 -0
  10. {meshcode-1.2.0 → meshcode-1.2.1}/meshcode/launcher.py +0 -0
  11. {meshcode-1.2.0 → meshcode-1.2.1}/meshcode/launcher_install.py +0 -0
  12. {meshcode-1.2.0 → meshcode-1.2.1}/meshcode/meshcode_mcp/__init__.py +0 -0
  13. {meshcode-1.2.0 → meshcode-1.2.1}/meshcode/meshcode_mcp/__main__.py +0 -0
  14. {meshcode-1.2.0 → meshcode-1.2.1}/meshcode/meshcode_mcp/realtime.py +0 -0
  15. {meshcode-1.2.0 → meshcode-1.2.1}/meshcode/meshcode_mcp/server.py +0 -0
  16. {meshcode-1.2.0 → meshcode-1.2.1}/meshcode/meshcode_mcp/test_backend.py +0 -0
  17. {meshcode-1.2.0 → meshcode-1.2.1}/meshcode/meshcode_mcp/test_realtime.py +0 -0
  18. {meshcode-1.2.0 → meshcode-1.2.1}/meshcode/protocol_v2.py +0 -0
  19. {meshcode-1.2.0 → meshcode-1.2.1}/meshcode.egg-info/SOURCES.txt +0 -0
  20. {meshcode-1.2.0 → meshcode-1.2.1}/meshcode.egg-info/dependency_links.txt +0 -0
  21. {meshcode-1.2.0 → meshcode-1.2.1}/meshcode.egg-info/entry_points.txt +0 -0
  22. {meshcode-1.2.0 → meshcode-1.2.1}/meshcode.egg-info/requires.txt +0 -0
  23. {meshcode-1.2.0 → meshcode-1.2.1}/meshcode.egg-info/top_level.txt +0 -0
  24. {meshcode-1.2.0 → meshcode-1.2.1}/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.1
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.1"
@@ -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
@@ -1653,6 +1663,15 @@ if __name__ == "__main__":
1653
1663
 
1654
1664
  cmd = sys.argv[1].lower()
1655
1665
 
1666
+ if cmd in ("--version", "-V", "version"):
1667
+ try:
1668
+ import importlib
1669
+ _v = importlib.import_module("meshcode").__version__
1670
+ except Exception:
1671
+ _v = "unknown"
1672
+ print(f"meshcode {_v}")
1673
+ sys.exit(0)
1674
+
1656
1675
  # Per-subcommand help: meshcode <cmd> --help / -h / help
1657
1676
  if len(sys.argv) >= 3 and sys.argv[2] in ("--help", "-h", "help"):
1658
1677
  show_subcommand_help(cmd)
@@ -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.1
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.1"
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