akashcli 4.5.6__tar.gz → 4.5.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.
- {akashcli-4.5.6 → akashcli-4.5.7}/PKG-INFO +1 -1
- {akashcli-4.5.6 → akashcli-4.5.7}/akashcli/relay.py +38 -4
- {akashcli-4.5.6 → akashcli-4.5.7}/akashcli.egg-info/PKG-INFO +1 -1
- {akashcli-4.5.6 → akashcli-4.5.7}/pyproject.toml +1 -1
- {akashcli-4.5.6 → akashcli-4.5.7}/README.md +0 -0
- {akashcli-4.5.6 → akashcli-4.5.7}/akashcli/__init__.py +0 -0
- {akashcli-4.5.6 → akashcli-4.5.7}/akashcli/_net.py +0 -0
- {akashcli-4.5.6 → akashcli-4.5.7}/akashcli/auth.py +0 -0
- {akashcli-4.5.6 → akashcli-4.5.7}/akashcli/cli.py +0 -0
- {akashcli-4.5.6 → akashcli-4.5.7}/akashcli/client.py +0 -0
- {akashcli-4.5.6 → akashcli-4.5.7}/akashcli/config.py +0 -0
- {akashcli-4.5.6 → akashcli-4.5.7}/akashcli/crypto.py +0 -0
- {akashcli-4.5.6 → akashcli-4.5.7}/akashcli/env_manager.py +0 -0
- {akashcli-4.5.6 → akashcli-4.5.7}/akashcli/exceptions.py +0 -0
- {akashcli-4.5.6 → akashcli-4.5.7}/akashcli/exec.py +0 -0
- {akashcli-4.5.6 → akashcli-4.5.7}/akashcli/integrity.py +0 -0
- {akashcli-4.5.6 → akashcli-4.5.7}/akashcli/logger.py +0 -0
- {akashcli-4.5.6 → akashcli-4.5.7}/akashcli/models.py +0 -0
- {akashcli-4.5.6 → akashcli-4.5.7}/akashcli/p2p.py +0 -0
- {akashcli-4.5.6 → akashcli-4.5.7}/akashcli/packages.py +0 -0
- {akashcli-4.5.6 → akashcli-4.5.7}/akashcli/restore.py +0 -0
- {akashcli-4.5.6 → akashcli-4.5.7}/akashcli/snapshot_crypto.py +0 -0
- {akashcli-4.5.6 → akashcli-4.5.7}/akashcli/storage.py +0 -0
- {akashcli-4.5.6 → akashcli-4.5.7}/akashcli/terminal.py +0 -0
- {akashcli-4.5.6 → akashcli-4.5.7}/akashcli/uploader.py +0 -0
- {akashcli-4.5.6 → akashcli-4.5.7}/akashcli/utils.py +0 -0
- {akashcli-4.5.6 → akashcli-4.5.7}/akashcli.egg-info/SOURCES.txt +0 -0
- {akashcli-4.5.6 → akashcli-4.5.7}/akashcli.egg-info/dependency_links.txt +0 -0
- {akashcli-4.5.6 → akashcli-4.5.7}/akashcli.egg-info/entry_points.txt +0 -0
- {akashcli-4.5.6 → akashcli-4.5.7}/akashcli.egg-info/requires.txt +0 -0
- {akashcli-4.5.6 → akashcli-4.5.7}/akashcli.egg-info/top_level.txt +0 -0
- {akashcli-4.5.6 → akashcli-4.5.7}/setup.cfg +0 -0
|
@@ -221,6 +221,20 @@ def _handle_pty(ws, frame: dict) -> None:
|
|
|
221
221
|
|
|
222
222
|
import subprocess as _sp
|
|
223
223
|
shell = command or os.environ.get("SHELL", "/bin/bash")
|
|
224
|
+
|
|
225
|
+
# DevOS-style PS1 injected into every relay shell session.
|
|
226
|
+
# Uses only bash builtins + git (optional). No external deps.
|
|
227
|
+
_AKASH_PS1 = (
|
|
228
|
+
r'__akash_ps1() { '
|
|
229
|
+
r' local b; b=$(git branch --show-current 2>/dev/null); '
|
|
230
|
+
r' [ -n "$b" ] && echo -e " \033[90m(\033[1;35m$b\033[90m)\033[0m"; '
|
|
231
|
+
r'}; '
|
|
232
|
+
r'PS1="\n\033[1;36m╭─\033[0m \033[1;32m\u\033[90m@\033[1;32m\h\033[0m'
|
|
233
|
+
r' \033[1;34m\w\033[0m\$(__akash_ps1)\n'
|
|
234
|
+
r'\033[1;36m╰─❯\033[0m "; '
|
|
235
|
+
r'export PS1'
|
|
236
|
+
)
|
|
237
|
+
|
|
224
238
|
# Run the shell directly (not wrapped in bash -c) so it IS the login shell
|
|
225
239
|
# and gets a proper controlling terminal from slave_fd.
|
|
226
240
|
try:
|
|
@@ -243,6 +257,15 @@ def _handle_pty(ws, frame: dict) -> None:
|
|
|
243
257
|
return
|
|
244
258
|
|
|
245
259
|
os.close(slave_fd)
|
|
260
|
+
|
|
261
|
+
# Give bash ~120 ms to finish sourcing .bashrc, then inject our PS1.
|
|
262
|
+
import time as _time
|
|
263
|
+
_time.sleep(0.12)
|
|
264
|
+
try:
|
|
265
|
+
os.write(master_fd, (_AKASH_PS1 + "\n").encode())
|
|
266
|
+
except Exception:
|
|
267
|
+
pass
|
|
268
|
+
|
|
246
269
|
stop = threading.Event()
|
|
247
270
|
|
|
248
271
|
# Thread: master fd → WebSocket (drain as fast as possible)
|
|
@@ -737,11 +760,10 @@ def guest_connect_shell(base_url: str, code: str) -> int:
|
|
|
737
760
|
if ftype == "waiting_approval":
|
|
738
761
|
fp = first.get("fingerprint", "")
|
|
739
762
|
_restore() # restore terminal so we can print cleanly
|
|
740
|
-
print(f" {
|
|
763
|
+
print(f"\n {_C}◈{_RS} {_DM}waiting for host to approve…{_RS}")
|
|
741
764
|
if fp:
|
|
742
|
-
print(f" {_DM}
|
|
743
|
-
print(f" {_DM}
|
|
744
|
-
print()
|
|
765
|
+
print(f" {_DM}fingerprint {_C}{fp}{_RS}")
|
|
766
|
+
print(f" {_DM}host has 30 s to respond{_RS}\n")
|
|
745
767
|
# Wait for next frame: connected or denied
|
|
746
768
|
try:
|
|
747
769
|
second = json.loads(ws.recv(timeout=35))
|
|
@@ -763,6 +785,18 @@ def guest_connect_shell(base_url: str, code: str) -> int:
|
|
|
763
785
|
_restore()
|
|
764
786
|
raise RuntimeError(first.get("message", "unexpected server response"))
|
|
765
787
|
|
|
788
|
+
# Print a clean DevOS-style session header before entering raw mode
|
|
789
|
+
_restore()
|
|
790
|
+
print(f"\n {_G}◉{_RS} {_C}akash shell{_RS} {_DM}· code {code} · Ctrl-C to disconnect{_RS}\n")
|
|
791
|
+
# Re-enter raw mode
|
|
792
|
+
try:
|
|
793
|
+
import tty as _tty3, termios as _term3
|
|
794
|
+
_old_settings = _term3.tcgetattr(_stdin_fd)
|
|
795
|
+
_tty3.setraw(_stdin_fd)
|
|
796
|
+
_raw_ok = True
|
|
797
|
+
except Exception:
|
|
798
|
+
pass
|
|
799
|
+
|
|
766
800
|
ws.send(json.dumps({
|
|
767
801
|
"type": "pty_run",
|
|
768
802
|
"command": os.environ.get("SHELL", "/bin/bash"),
|
|
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
|
|
File without changes
|