akashcli 4.7.4__tar.gz → 4.7.5__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 (33) hide show
  1. {akashcli-4.7.4 → akashcli-4.7.5}/PKG-INFO +1 -1
  2. {akashcli-4.7.4 → akashcli-4.7.5}/akashcli/cli.py +29 -8
  3. {akashcli-4.7.4 → akashcli-4.7.5}/akashcli.egg-info/PKG-INFO +1 -1
  4. {akashcli-4.7.4 → akashcli-4.7.5}/pyproject.toml +1 -1
  5. {akashcli-4.7.4 → akashcli-4.7.5}/README.md +0 -0
  6. {akashcli-4.7.4 → akashcli-4.7.5}/akashcli/__init__.py +0 -0
  7. {akashcli-4.7.4 → akashcli-4.7.5}/akashcli/_net.py +0 -0
  8. {akashcli-4.7.4 → akashcli-4.7.5}/akashcli/auth.py +0 -0
  9. {akashcli-4.7.4 → akashcli-4.7.5}/akashcli/client.py +0 -0
  10. {akashcli-4.7.4 → akashcli-4.7.5}/akashcli/config.py +0 -0
  11. {akashcli-4.7.4 → akashcli-4.7.5}/akashcli/crypto.py +0 -0
  12. {akashcli-4.7.4 → akashcli-4.7.5}/akashcli/env_manager.py +0 -0
  13. {akashcli-4.7.4 → akashcli-4.7.5}/akashcli/exceptions.py +0 -0
  14. {akashcli-4.7.4 → akashcli-4.7.5}/akashcli/exec.py +0 -0
  15. {akashcli-4.7.4 → akashcli-4.7.5}/akashcli/integrity.py +0 -0
  16. {akashcli-4.7.4 → akashcli-4.7.5}/akashcli/logger.py +0 -0
  17. {akashcli-4.7.4 → akashcli-4.7.5}/akashcli/models.py +0 -0
  18. {akashcli-4.7.4 → akashcli-4.7.5}/akashcli/p2p.py +0 -0
  19. {akashcli-4.7.4 → akashcli-4.7.5}/akashcli/packages.py +0 -0
  20. {akashcli-4.7.4 → akashcli-4.7.5}/akashcli/relay.py +0 -0
  21. {akashcli-4.7.4 → akashcli-4.7.5}/akashcli/restore.py +0 -0
  22. {akashcli-4.7.4 → akashcli-4.7.5}/akashcli/snapshot_crypto.py +0 -0
  23. {akashcli-4.7.4 → akashcli-4.7.5}/akashcli/storage.py +0 -0
  24. {akashcli-4.7.4 → akashcli-4.7.5}/akashcli/terminal.py +0 -0
  25. {akashcli-4.7.4 → akashcli-4.7.5}/akashcli/updater.py +0 -0
  26. {akashcli-4.7.4 → akashcli-4.7.5}/akashcli/uploader.py +0 -0
  27. {akashcli-4.7.4 → akashcli-4.7.5}/akashcli/utils.py +0 -0
  28. {akashcli-4.7.4 → akashcli-4.7.5}/akashcli.egg-info/SOURCES.txt +0 -0
  29. {akashcli-4.7.4 → akashcli-4.7.5}/akashcli.egg-info/dependency_links.txt +0 -0
  30. {akashcli-4.7.4 → akashcli-4.7.5}/akashcli.egg-info/entry_points.txt +0 -0
  31. {akashcli-4.7.4 → akashcli-4.7.5}/akashcli.egg-info/requires.txt +0 -0
  32. {akashcli-4.7.4 → akashcli-4.7.5}/akashcli.egg-info/top_level.txt +0 -0
  33. {akashcli-4.7.4 → akashcli-4.7.5}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: akashcli
3
- Version: 4.7.4
3
+ Version: 4.7.5
4
4
  Summary: Akash CLI — secure remote shell relay, file vault, and device management
5
5
  License-Expression: MIT
6
6
  Keywords: akash,cli,relay,remote-shell,vault
@@ -2792,7 +2792,7 @@ def agent_list(raw: bool = typer.Option(False, "--json", help="Raw JSON output")
2792
2792
 
2793
2793
 
2794
2794
  def _resolve_agent_id(target_id: str) -> tuple[str, str, str]:
2795
- """Resolves short Profile ID (e.g. fbf6) or Client ID into (profile_id, client_id, agent_name)."""
2795
+ """Resolves short Profile ID (e.g. aa23), Client ID, suffix, or name into (profile_id, client_id, agent_name)."""
2796
2796
  import json
2797
2797
  from pathlib import Path
2798
2798
  agents_file = Path.home() / ".akash" / "agents.json"
@@ -2801,15 +2801,32 @@ def _resolve_agent_id(target_id: str) -> tuple[str, str, str]:
2801
2801
  try: agents = json.loads(agents_file.read_text())
2802
2802
  except Exception: pass
2803
2803
 
2804
- # 1. Match by Profile ID (fbf6)
2804
+ if not target_id:
2805
+ if agents:
2806
+ first_pid = next(reversed(list(agents.keys())))
2807
+ return first_pid, agents[first_pid]["client_id"], agents[first_pid].get("name", "Agent")
2808
+ return "", "", "Agent"
2809
+
2810
+ # 1. Match by Profile ID (e.g. aa23)
2805
2811
  if target_id in agents:
2806
2812
  return target_id, agents[target_id]["client_id"], agents[target_id].get("name", "Agent")
2807
2813
 
2808
- # 2. Match by Client ID (akash_client_...)
2814
+ # 2. Match by exact Client ID
2809
2815
  for pid, d in agents.items():
2810
2816
  if d.get("client_id") == target_id:
2811
2817
  return pid, target_id, d.get("name", "Agent")
2812
2818
 
2819
+ # 3. Match by Client ID suffix (e.g. d06f) or prefix
2820
+ for pid, d in agents.items():
2821
+ cid = d.get("client_id", "")
2822
+ if cid.endswith(target_id) or cid.startswith(target_id) or (len(target_id) >= 4 and target_id in cid):
2823
+ return pid, cid, d.get("name", "Agent")
2824
+
2825
+ # 4. Match by Name (case-insensitive)
2826
+ for pid, d in agents.items():
2827
+ if d.get("name", "").lower() == target_id.lower():
2828
+ return pid, d.get("client_id", ""), d.get("name", "Agent")
2829
+
2813
2830
  return target_id, target_id, "Agent"
2814
2831
 
2815
2832
 
@@ -3310,15 +3327,19 @@ def mcp_serve(
3310
3327
  except Exception: agents = {}
3311
3328
 
3312
3329
  if not profile_id and not client_id and agents:
3313
- profile_id = "af4f" if "af4f" in agents else next(iter(agents.keys()))
3330
+ profile_id = next(reversed(list(agents.keys())))
3314
3331
 
3315
- cached = agents.get(profile_id or "", {})
3316
- cid = client_id or cached.get("client_id") or os.getenv("AKASH_CLIENT_ID")
3332
+ resolved_pid, resolved_cid, pname = _resolve_agent_id(profile_id or client_id or "")
3333
+ cached = agents.get(resolved_pid, {})
3334
+ cid = client_id or resolved_cid or cached.get("client_id") or os.getenv("AKASH_CLIENT_ID")
3317
3335
  csec = client_secret or cached.get("client_secret") or os.getenv("AKASH_CLIENT_SECRET")
3318
- pname = cached.get("name", "AI Agent")
3336
+ pname = cached.get("name", pname)
3337
+ profile_id = resolved_pid or profile_id
3319
3338
 
3320
3339
  if not cid or not csec:
3321
- _err("Missing credentials. Provide --id <ID> or create one: akash agent create")
3340
+ avail = ", ".join([f"{k} ({v.get('name', 'Agent')})" for k, v in agents.items()]) if agents else "none"
3341
+ _err(f"Missing credentials for '{profile_id or client_id or 'default'}'. Available profiles: {avail}")
3342
+ _err("Provide a valid --id <ID> or create one: akash mcp create -n Dev -r @coder")
3322
3343
  raise typer.Exit(1)
3323
3344
 
3324
3345
  _, base = _resolve_client(url or cached.get("url"), require_key=False, silent=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: akashcli
3
- Version: 4.7.4
3
+ Version: 4.7.5
4
4
  Summary: Akash CLI — secure remote shell relay, file vault, and device management
5
5
  License-Expression: MIT
6
6
  Keywords: akash,cli,relay,remote-shell,vault
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "akashcli"
3
- version = "4.7.4"
3
+ version = "4.7.5"
4
4
  description = "Akash CLI — secure remote shell relay, file vault, and device management"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.9"
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