meshcode 2.10.9__tar.gz → 2.10.11__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.10.9 → meshcode-2.10.11}/PKG-INFO +1 -1
- {meshcode-2.10.9 → meshcode-2.10.11}/meshcode/__init__.py +1 -1
- {meshcode-2.10.9 → meshcode-2.10.11}/meshcode/invites.py +51 -32
- {meshcode-2.10.9 → meshcode-2.10.11}/meshcode.egg-info/PKG-INFO +1 -1
- {meshcode-2.10.9 → meshcode-2.10.11}/pyproject.toml +1 -1
- {meshcode-2.10.9 → meshcode-2.10.11}/README.md +0 -0
- {meshcode-2.10.9 → meshcode-2.10.11}/meshcode/ascii_art.py +0 -0
- {meshcode-2.10.9 → meshcode-2.10.11}/meshcode/cli.py +0 -0
- {meshcode-2.10.9 → meshcode-2.10.11}/meshcode/comms_v4.py +0 -0
- {meshcode-2.10.9 → meshcode-2.10.11}/meshcode/launcher.py +0 -0
- {meshcode-2.10.9 → meshcode-2.10.11}/meshcode/launcher_install.py +0 -0
- {meshcode-2.10.9 → meshcode-2.10.11}/meshcode/meshcode_mcp/__init__.py +0 -0
- {meshcode-2.10.9 → meshcode-2.10.11}/meshcode/meshcode_mcp/__main__.py +0 -0
- {meshcode-2.10.9 → meshcode-2.10.11}/meshcode/meshcode_mcp/backend.py +0 -0
- {meshcode-2.10.9 → meshcode-2.10.11}/meshcode/meshcode_mcp/realtime.py +0 -0
- {meshcode-2.10.9 → meshcode-2.10.11}/meshcode/meshcode_mcp/server.py +0 -0
- {meshcode-2.10.9 → meshcode-2.10.11}/meshcode/meshcode_mcp/test_backend.py +0 -0
- {meshcode-2.10.9 → meshcode-2.10.11}/meshcode/meshcode_mcp/test_realtime.py +0 -0
- {meshcode-2.10.9 → meshcode-2.10.11}/meshcode/meshcode_mcp/test_server_wrapper.py +0 -0
- {meshcode-2.10.9 → meshcode-2.10.11}/meshcode/preferences.py +0 -0
- {meshcode-2.10.9 → meshcode-2.10.11}/meshcode/protocol_v2.py +0 -0
- {meshcode-2.10.9 → meshcode-2.10.11}/meshcode/run_agent.py +0 -0
- {meshcode-2.10.9 → meshcode-2.10.11}/meshcode/secrets.py +0 -0
- {meshcode-2.10.9 → meshcode-2.10.11}/meshcode/self_update.py +0 -0
- {meshcode-2.10.9 → meshcode-2.10.11}/meshcode/setup_clients.py +0 -0
- {meshcode-2.10.9 → meshcode-2.10.11}/meshcode.egg-info/SOURCES.txt +0 -0
- {meshcode-2.10.9 → meshcode-2.10.11}/meshcode.egg-info/dependency_links.txt +0 -0
- {meshcode-2.10.9 → meshcode-2.10.11}/meshcode.egg-info/entry_points.txt +0 -0
- {meshcode-2.10.9 → meshcode-2.10.11}/meshcode.egg-info/requires.txt +0 -0
- {meshcode-2.10.9 → meshcode-2.10.11}/meshcode.egg-info/top_level.txt +0 -0
- {meshcode-2.10.9 → meshcode-2.10.11}/setup.cfg +0 -0
- {meshcode-2.10.9 → meshcode-2.10.11}/tests/test_status_enum_coverage.py +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""MeshCode — Real-time communication between AI agents."""
|
|
2
|
-
__version__ = "2.10.
|
|
2
|
+
__version__ = "2.10.11"
|
|
@@ -188,35 +188,54 @@ def cmd_join(token: str, display_name: Optional[str] = None) -> int:
|
|
|
188
188
|
# Backend returns varying field names depending on RPC version
|
|
189
189
|
project = redeem.get("project_name") or redeem.get("meshwork_name") or redeem.get("meshwork")
|
|
190
190
|
agent = redeem.get("agent_name")
|
|
191
|
-
if not scoped_key or not project or not agent:
|
|
192
|
-
missing = []
|
|
193
|
-
if not scoped_key: missing.append("api_key")
|
|
194
|
-
if not project: missing.append("project_name/meshwork")
|
|
195
|
-
if not agent: missing.append("agent_name")
|
|
196
|
-
print(f"[meshcode] ERROR: redeem succeeded but response missing fields: {', '.join(missing)}", file=sys.stderr)
|
|
197
|
-
print(f"[meshcode] got keys: {sorted(redeem.keys())}", file=sys.stderr)
|
|
198
|
-
return 1
|
|
199
191
|
|
|
200
|
-
#
|
|
201
|
-
|
|
192
|
+
# Store API key IMMEDIATELY — before any validation. If we crash later,
|
|
193
|
+
# the key is safe in keychain and `meshcode setup` can recover.
|
|
202
194
|
try:
|
|
203
195
|
import importlib
|
|
204
196
|
secrets_mod = importlib.import_module("meshcode.secrets")
|
|
205
197
|
except Exception as e:
|
|
206
198
|
print(f"[meshcode] ERROR: cannot load secrets module: {e}", file=sys.stderr)
|
|
199
|
+
print(f"[meshcode] IMPORTANT: your invite was redeemed. API key: {scoped_key}", file=sys.stderr)
|
|
200
|
+
print(f"[meshcode] Save this key! Run: meshcode setup {project or '<project>'} {agent or '<agent>'}", file=sys.stderr)
|
|
207
201
|
return 1
|
|
208
202
|
|
|
209
|
-
if
|
|
210
|
-
"
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
203
|
+
if scoped_key and project and agent:
|
|
204
|
+
profile_name = f"mesh:{project}:{agent}"
|
|
205
|
+
if not secrets_mod.set_api_key(scoped_key, profile=profile_name, meta={
|
|
206
|
+
"type": "scoped",
|
|
207
|
+
"meshwork": project,
|
|
208
|
+
"agent": agent,
|
|
209
|
+
"role": redeem.get("role") or "",
|
|
210
|
+
"expires_at": redeem.get("expires_at"),
|
|
211
|
+
"display_name": redeem.get("display_name"),
|
|
212
|
+
"guest_user_id": redeem.get("guest_user_id"),
|
|
213
|
+
}):
|
|
214
|
+
print(f"[meshcode] WARNING: could not store key in keychain, but invite redeemed", file=sys.stderr)
|
|
215
|
+
print(f"[meshcode] API key: {scoped_key}", file=sys.stderr)
|
|
216
|
+
|
|
217
|
+
if not scoped_key or not project or not agent:
|
|
218
|
+
missing = []
|
|
219
|
+
if not scoped_key: missing.append("api_key")
|
|
220
|
+
if not project: missing.append("project_name/meshwork")
|
|
221
|
+
if not agent: missing.append("agent_name")
|
|
222
|
+
print(f"[meshcode] WARNING: redeem succeeded but response missing fields: {', '.join(missing)}", file=sys.stderr)
|
|
223
|
+
print(f"[meshcode] got keys: {sorted(redeem.keys())}", file=sys.stderr)
|
|
224
|
+
if scoped_key:
|
|
225
|
+
# Try to recover with what we have from the inspect call
|
|
226
|
+
project = project or inspect.get("meshwork") or inspect.get("project_name")
|
|
227
|
+
agent = agent or inspect.get("agent_name")
|
|
228
|
+
if project and agent:
|
|
229
|
+
print(f"[meshcode] Recovered from inspect data. Continuing setup...", file=sys.stderr)
|
|
230
|
+
profile_name = f"mesh:{project}:{agent}"
|
|
231
|
+
secrets_mod.set_api_key(scoped_key, profile=profile_name, meta={
|
|
232
|
+
"type": "scoped", "meshwork": project, "agent": agent,
|
|
233
|
+
})
|
|
234
|
+
else:
|
|
235
|
+
print(f"[meshcode] Run: meshcode setup {project or '<project>'} {agent or '<agent>'}", file=sys.stderr)
|
|
236
|
+
return 1
|
|
237
|
+
else:
|
|
238
|
+
return 1
|
|
220
239
|
|
|
221
240
|
# 4. Create the workspace dir with this profile baked in
|
|
222
241
|
try:
|
|
@@ -233,18 +252,18 @@ def cmd_join(token: str, display_name: Optional[str] = None) -> int:
|
|
|
233
252
|
|
|
234
253
|
print()
|
|
235
254
|
print(f"[meshcode] 🎉 You've joined '{project}' as '{agent}'")
|
|
236
|
-
print(f"[meshcode]")
|
|
237
|
-
print(f"[meshcode] To launch your agent now:")
|
|
238
|
-
print(f"[meshcode] meshcode run {agent}")
|
|
239
|
-
print(f"[meshcode]")
|
|
240
|
-
print(f"[meshcode] Your scoped api key is in the OS keychain under profile:")
|
|
241
|
-
print(f"[meshcode] {profile_name}")
|
|
242
|
-
print(f"[meshcode]")
|
|
243
|
-
print(f"[meshcode] This key only works for the '{agent}' agent in '{project}'.")
|
|
244
|
-
print(f"[meshcode] It cannot create new meshworks, see other agents' messages,")
|
|
245
|
-
print(f"[meshcode] or affect the inviter's billing.")
|
|
255
|
+
print(f"[meshcode] Scoped key saved in OS keychain: {profile_name}")
|
|
246
256
|
print()
|
|
247
|
-
|
|
257
|
+
|
|
258
|
+
# Auto-launch: go straight into the agent — no second command needed
|
|
259
|
+
print(f"[meshcode] Launching agent...")
|
|
260
|
+
try:
|
|
261
|
+
from .run_agent import run
|
|
262
|
+
return run(agent, project=project)
|
|
263
|
+
except Exception as e:
|
|
264
|
+
print(f"[meshcode] WARNING: auto-launch failed ({e})", file=sys.stderr)
|
|
265
|
+
print(f"[meshcode] Run manually: meshcode run {agent}", file=sys.stderr)
|
|
266
|
+
return 0
|
|
248
267
|
|
|
249
268
|
|
|
250
269
|
# ============================================================
|
|
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
|
|
File without changes
|