akashcli 4.7.6__tar.gz → 4.7.7__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.6 → akashcli-4.7.7}/PKG-INFO +1 -1
  2. {akashcli-4.7.6 → akashcli-4.7.7}/akashcli/cli.py +41 -7
  3. {akashcli-4.7.6 → akashcli-4.7.7}/akashcli.egg-info/PKG-INFO +1 -1
  4. {akashcli-4.7.6 → akashcli-4.7.7}/pyproject.toml +1 -1
  5. {akashcli-4.7.6 → akashcli-4.7.7}/README.md +0 -0
  6. {akashcli-4.7.6 → akashcli-4.7.7}/akashcli/__init__.py +0 -0
  7. {akashcli-4.7.6 → akashcli-4.7.7}/akashcli/_net.py +0 -0
  8. {akashcli-4.7.6 → akashcli-4.7.7}/akashcli/auth.py +0 -0
  9. {akashcli-4.7.6 → akashcli-4.7.7}/akashcli/client.py +0 -0
  10. {akashcli-4.7.6 → akashcli-4.7.7}/akashcli/config.py +0 -0
  11. {akashcli-4.7.6 → akashcli-4.7.7}/akashcli/crypto.py +0 -0
  12. {akashcli-4.7.6 → akashcli-4.7.7}/akashcli/env_manager.py +0 -0
  13. {akashcli-4.7.6 → akashcli-4.7.7}/akashcli/exceptions.py +0 -0
  14. {akashcli-4.7.6 → akashcli-4.7.7}/akashcli/exec.py +0 -0
  15. {akashcli-4.7.6 → akashcli-4.7.7}/akashcli/integrity.py +0 -0
  16. {akashcli-4.7.6 → akashcli-4.7.7}/akashcli/logger.py +0 -0
  17. {akashcli-4.7.6 → akashcli-4.7.7}/akashcli/models.py +0 -0
  18. {akashcli-4.7.6 → akashcli-4.7.7}/akashcli/p2p.py +0 -0
  19. {akashcli-4.7.6 → akashcli-4.7.7}/akashcli/packages.py +0 -0
  20. {akashcli-4.7.6 → akashcli-4.7.7}/akashcli/relay.py +0 -0
  21. {akashcli-4.7.6 → akashcli-4.7.7}/akashcli/restore.py +0 -0
  22. {akashcli-4.7.6 → akashcli-4.7.7}/akashcli/snapshot_crypto.py +0 -0
  23. {akashcli-4.7.6 → akashcli-4.7.7}/akashcli/storage.py +0 -0
  24. {akashcli-4.7.6 → akashcli-4.7.7}/akashcli/terminal.py +0 -0
  25. {akashcli-4.7.6 → akashcli-4.7.7}/akashcli/updater.py +0 -0
  26. {akashcli-4.7.6 → akashcli-4.7.7}/akashcli/uploader.py +0 -0
  27. {akashcli-4.7.6 → akashcli-4.7.7}/akashcli/utils.py +0 -0
  28. {akashcli-4.7.6 → akashcli-4.7.7}/akashcli.egg-info/SOURCES.txt +0 -0
  29. {akashcli-4.7.6 → akashcli-4.7.7}/akashcli.egg-info/dependency_links.txt +0 -0
  30. {akashcli-4.7.6 → akashcli-4.7.7}/akashcli.egg-info/entry_points.txt +0 -0
  31. {akashcli-4.7.6 → akashcli-4.7.7}/akashcli.egg-info/requires.txt +0 -0
  32. {akashcli-4.7.6 → akashcli-4.7.7}/akashcli.egg-info/top_level.txt +0 -0
  33. {akashcli-4.7.6 → akashcli-4.7.7}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: akashcli
3
- Version: 4.7.6
3
+ Version: 4.7.7
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
@@ -62,6 +62,9 @@ class _Spin:
62
62
 
63
63
  def __enter__(self):
64
64
  if self._disabled:
65
+ pfx = self._prefix + " " if self._prefix else " "
66
+ sys.stdout.write(f"{pfx}{_C}▶{_RS} {_DM}{self._label}…{_RS}\n")
67
+ sys.stdout.flush()
65
68
  return self
66
69
  import threading, time
67
70
  self._active = True
@@ -76,7 +79,7 @@ class _Spin:
76
79
  f = self._FRAMES[self._i % len(self._FRAMES)]
77
80
  now = time.monotonic()
78
81
  dur = now - self._t0
79
- dur_str = f" {_dim(f'({dur:.1f}s)')}" if dur >= 1.0 else ""
82
+ dur_str = f" {_dim(f'({dur:.1f}s)')}" if dur >= 0.8 else ""
80
83
  sys.stdout.write(f"\r\033[2K{pfx}{_C}{f}{_RS} {_DM}{self._label}{_RS}{dur_str} ")
81
84
  sys.stdout.flush()
82
85
  self._i += 1
@@ -93,12 +96,12 @@ class _Spin:
93
96
  if self._disabled:
94
97
  return
95
98
  import time
99
+ self._active = False
100
+ if self._thread:
101
+ self._thread.join(timeout=0.3)
96
102
  elapsed = time.monotonic() - self._t0
97
103
  if elapsed < self._min_seconds:
98
104
  time.sleep(self._min_seconds - elapsed)
99
- self._active = False
100
- if self._thread:
101
- self._thread.join(timeout=0.2)
102
105
  sys.stdout.write("\r\033[2K")
103
106
  sys.stdout.flush()
104
107
 
@@ -3251,6 +3254,18 @@ def _sanitize_agent_command(cmd: str, scopes: str = "*") -> tuple[bool, str]:
3251
3254
  if not cmd or not cmd.strip(): return False, "Empty command."
3252
3255
  clean_cmd = cmd.strip()
3253
3256
 
3257
+ # Guard against interactive commands that hang waiting for human input in automated agents
3258
+ interactive_patterns = (
3259
+ r"^\s*(nano|vi|vim|htop|top|less|more|man)\b",
3260
+ r"\bgit\s+commit\s*$",
3261
+ r"^\s*python[0-9.]*\s*$",
3262
+ r"^\s*node\s*$",
3263
+ r"^\s*cat\s*$"
3264
+ )
3265
+ for pat in interactive_patterns:
3266
+ if re.search(pat, clean_cmd):
3267
+ return False, "Interactive command requiring terminal input is not supported in automated execution."
3268
+
3254
3269
  # Unconditional critical security guard (Always enforced regardless of scopes)
3255
3270
  for pat, reason in CRITICAL_DENY_PATTERNS:
3256
3271
  if re.search(pat, clean_cmd):
@@ -3442,17 +3457,36 @@ def mcp_serve(
3442
3457
  if any(k in cmd for k in ["touch", "mkdir", "mv", "cp", "sed", ">", ">>", "python", "npm", "pip"]):
3443
3458
  _save_undo_checkpoint()
3444
3459
 
3445
- # Instant frame-0 animated spinner with live visibility
3460
+ # Auto-add non-interactive flags if missing
3461
+ exec_cmd = cmd
3462
+ if re.search(r"\bping\s+", exec_cmd) and "-c" not in exec_cmd:
3463
+ exec_cmd += " -c 4"
3464
+ if re.search(r"\bapt(-get)?\s+(install|upgrade|remove)\b", exec_cmd) and "-y" not in exec_cmd:
3465
+ exec_cmd += " -y"
3466
+
3467
+ # Instant frame-0 animated spinner with live visibility and timeout protection
3446
3468
  try:
3447
3469
  with _Spin(f"exec: {disp_cmd}", min_seconds=0.25, prefix=ts_pfx):
3448
- r = subprocess.run(cmd, shell=True, capture_output=True, text=True, timeout=60)
3470
+ r = subprocess.run(
3471
+ exec_cmd,
3472
+ shell=True,
3473
+ capture_output=True,
3474
+ text=True,
3475
+ timeout=60,
3476
+ stdin=subprocess.DEVNULL,
3477
+ errors="replace"
3478
+ )
3449
3479
  elapsed_ms = (time.monotonic() - t0) * 1000
3450
- raw_out = r.stdout + r.stderr
3480
+ raw_out = (r.stdout or "") + (r.stderr or "")
3451
3481
  returncode = r.returncode
3452
3482
  except subprocess.TimeoutExpired:
3453
3483
  elapsed_ms = 60000.0
3454
3484
  raw_out = "⛔ Command timed out after 60 seconds."
3455
3485
  returncode = 124
3486
+ except Exception as cmd_err:
3487
+ elapsed_ms = (time.monotonic() - t0) * 1000
3488
+ raw_out = f"⛔ Command execution error: {cmd_err}"
3489
+ returncode = 1
3456
3490
 
3457
3491
  bounded_out = _smart_truncate_output(raw_out)
3458
3492
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: akashcli
3
- Version: 4.7.6
3
+ Version: 4.7.7
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.6"
3
+ version = "4.7.7"
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