akashcli 4.7.9__tar.gz → 4.8.0__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.9 → akashcli-4.8.0}/PKG-INFO +1 -1
  2. {akashcli-4.7.9 → akashcli-4.8.0}/akashcli/cli.py +36 -5
  3. {akashcli-4.7.9 → akashcli-4.8.0}/akashcli.egg-info/PKG-INFO +1 -1
  4. {akashcli-4.7.9 → akashcli-4.8.0}/pyproject.toml +1 -1
  5. {akashcli-4.7.9 → akashcli-4.8.0}/README.md +0 -0
  6. {akashcli-4.7.9 → akashcli-4.8.0}/akashcli/__init__.py +0 -0
  7. {akashcli-4.7.9 → akashcli-4.8.0}/akashcli/_net.py +0 -0
  8. {akashcli-4.7.9 → akashcli-4.8.0}/akashcli/auth.py +0 -0
  9. {akashcli-4.7.9 → akashcli-4.8.0}/akashcli/client.py +0 -0
  10. {akashcli-4.7.9 → akashcli-4.8.0}/akashcli/config.py +0 -0
  11. {akashcli-4.7.9 → akashcli-4.8.0}/akashcli/crypto.py +0 -0
  12. {akashcli-4.7.9 → akashcli-4.8.0}/akashcli/env_manager.py +0 -0
  13. {akashcli-4.7.9 → akashcli-4.8.0}/akashcli/exceptions.py +0 -0
  14. {akashcli-4.7.9 → akashcli-4.8.0}/akashcli/exec.py +0 -0
  15. {akashcli-4.7.9 → akashcli-4.8.0}/akashcli/integrity.py +0 -0
  16. {akashcli-4.7.9 → akashcli-4.8.0}/akashcli/logger.py +0 -0
  17. {akashcli-4.7.9 → akashcli-4.8.0}/akashcli/models.py +0 -0
  18. {akashcli-4.7.9 → akashcli-4.8.0}/akashcli/p2p.py +0 -0
  19. {akashcli-4.7.9 → akashcli-4.8.0}/akashcli/packages.py +0 -0
  20. {akashcli-4.7.9 → akashcli-4.8.0}/akashcli/relay.py +0 -0
  21. {akashcli-4.7.9 → akashcli-4.8.0}/akashcli/restore.py +0 -0
  22. {akashcli-4.7.9 → akashcli-4.8.0}/akashcli/snapshot_crypto.py +0 -0
  23. {akashcli-4.7.9 → akashcli-4.8.0}/akashcli/storage.py +0 -0
  24. {akashcli-4.7.9 → akashcli-4.8.0}/akashcli/terminal.py +0 -0
  25. {akashcli-4.7.9 → akashcli-4.8.0}/akashcli/updater.py +0 -0
  26. {akashcli-4.7.9 → akashcli-4.8.0}/akashcli/uploader.py +0 -0
  27. {akashcli-4.7.9 → akashcli-4.8.0}/akashcli/utils.py +0 -0
  28. {akashcli-4.7.9 → akashcli-4.8.0}/akashcli.egg-info/SOURCES.txt +0 -0
  29. {akashcli-4.7.9 → akashcli-4.8.0}/akashcli.egg-info/dependency_links.txt +0 -0
  30. {akashcli-4.7.9 → akashcli-4.8.0}/akashcli.egg-info/entry_points.txt +0 -0
  31. {akashcli-4.7.9 → akashcli-4.8.0}/akashcli.egg-info/requires.txt +0 -0
  32. {akashcli-4.7.9 → akashcli-4.8.0}/akashcli.egg-info/top_level.txt +0 -0
  33. {akashcli-4.7.9 → akashcli-4.8.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: akashcli
3
- Version: 4.7.9
3
+ Version: 4.8.0
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
@@ -3220,18 +3220,39 @@ _LAST_UNDO_DIR = Path.home() / ".akash" / "undo_vault"
3220
3220
  def _save_undo_checkpoint():
3221
3221
  try:
3222
3222
  import tarfile
3223
+ cwd = Path.cwd().resolve()
3224
+ home = Path.home().resolve()
3225
+ # Never archive the full home directory or system root!
3226
+ if cwd == home or cwd == Path("/") or str(cwd).startswith(("/proc", "/sys", "/dev")):
3227
+ return
3223
3228
  _LAST_UNDO_DIR.mkdir(parents=True, exist_ok=True)
3224
3229
  undo_tar = _LAST_UNDO_DIR / "workspace_last.tar.gz"
3230
+ excluded = {".git", "venv", "__pycache__", ".akash", "storage", ".termux", "node_modules", ".cache", "build", "dist"}
3225
3231
  with tarfile.open(undo_tar, "w:gz") as tar:
3232
+ count = 0
3226
3233
  for item in os.listdir("."):
3227
- if item in (".git", "venv", "__pycache__", ".akash"):
3234
+ if item in excluded or item.startswith(".") or os.path.islink(item):
3235
+ continue
3236
+ p = Path(item)
3237
+ if not p.exists() or p.is_symlink():
3228
3238
  continue
3229
- if os.path.exists(item):
3230
- tar.add(item)
3239
+ try:
3240
+ if p.is_file() and p.stat().st_size > 5 * 1024 * 1024:
3241
+ continue
3242
+ except Exception:
3243
+ continue
3244
+ tar.add(item, recursive=True, filter=lambda ti: None if (ti.name in excluded or ti.issym()) else ti)
3245
+ count += 1
3246
+ if count > 100:
3247
+ break
3231
3248
  except Exception:
3232
3249
  pass
3233
3250
 
3234
3251
  def _restore_undo_checkpoint() -> tuple[bool, str]:
3252
+ cwd = Path.cwd().resolve()
3253
+ home = Path.home().resolve()
3254
+ if cwd == home or cwd == Path("/"):
3255
+ return False, "Undo snapshot is disabled when running in root or home directory for safety."
3235
3256
  undo_tar = _LAST_UNDO_DIR / "workspace_last.tar.gz"
3236
3257
  if not undo_tar.exists():
3237
3258
  return False, "No undo checkpoint available for this session."
@@ -3466,7 +3487,10 @@ def mcp_serve(
3466
3487
  ws.send(json.dumps({
3467
3488
  "type": "tool_response",
3468
3489
  "id": call_id,
3469
- "result": {"content": [{"type": "text", "text": f"⛔ {sec_reason}"}], "isError": True}
3490
+ "result": {
3491
+ "content": [{"type": "text", "text": f"⛔ Security Policy Block: {sec_reason}\nCommand: {cmd}"}],
3492
+ "isError": True
3493
+ }
3470
3494
  }))
3471
3495
  else:
3472
3496
  if any(k in cmd for k in ["touch", "mkdir", "mv", "cp", "sed", ">", ">>", "python", "npm", "pip"]):
@@ -3526,10 +3550,17 @@ def mcp_serve(
3526
3550
  ec_icon = f"{_G}✓{_RS}" if returncode == 0 else f"{_R}✗{_RS}"
3527
3551
  print(f"{ts_pfx} {ec_icon} {ec_color}exec:{_RS} {disp_cmd} {ec_color}[{returncode}]{_RS} {_dim(f'{elapsed_ms:.1f}ms')}")
3528
3552
 
3553
+ if returncode != 0:
3554
+ res_content = bounded_out or f"Command exited with status code {returncode} (no output)"
3555
+ if not res_content.startswith("⛔"):
3556
+ res_content = f"⛔ Command execution failed (exit code {returncode}):\n{res_content}"
3557
+ else:
3558
+ res_content = bounded_out or "(command completed successfully with no output)"
3559
+
3529
3560
  ws.send(json.dumps({
3530
3561
  "type": "tool_response",
3531
3562
  "id": call_id,
3532
- "result": {"content": [{"type": "text", "text": bounded_out or "(no output)"}], "isError": returncode != 0}
3563
+ "result": {"content": [{"type": "text", "text": res_content}], "isError": returncode != 0}
3533
3564
  }))
3534
3565
  elif t_name == "akash_undo":
3535
3566
  with _Spin("undo: reverting workspace to checkpoint", min_seconds=0.25, prefix=ts_pfx):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: akashcli
3
- Version: 4.7.9
3
+ Version: 4.8.0
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.9"
3
+ version = "4.8.0"
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