runtime-sdk 0.4.2__tar.gz → 0.4.4__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.
- {runtime_sdk-0.4.2 → runtime_sdk-0.4.4}/PKG-INFO +1 -1
- {runtime_sdk-0.4.2 → runtime_sdk-0.4.4}/pyproject.toml +1 -1
- {runtime_sdk-0.4.2 → runtime_sdk-0.4.4}/scripts/runtime_sdk/cli.py +46 -3
- {runtime_sdk-0.4.2 → runtime_sdk-0.4.4}/scripts/runtime_sdk.egg-info/PKG-INFO +1 -1
- {runtime_sdk-0.4.2 → runtime_sdk-0.4.4}/README.md +0 -0
- {runtime_sdk-0.4.2 → runtime_sdk-0.4.4}/scripts/runtime_sdk/__init__.py +0 -0
- {runtime_sdk-0.4.2 → runtime_sdk-0.4.4}/scripts/runtime_sdk/client.py +0 -0
- {runtime_sdk-0.4.2 → runtime_sdk-0.4.4}/scripts/runtime_sdk/config.py +0 -0
- {runtime_sdk-0.4.2 → runtime_sdk-0.4.4}/scripts/runtime_sdk.egg-info/SOURCES.txt +0 -0
- {runtime_sdk-0.4.2 → runtime_sdk-0.4.4}/scripts/runtime_sdk.egg-info/dependency_links.txt +0 -0
- {runtime_sdk-0.4.2 → runtime_sdk-0.4.4}/scripts/runtime_sdk.egg-info/entry_points.txt +0 -0
- {runtime_sdk-0.4.2 → runtime_sdk-0.4.4}/scripts/runtime_sdk.egg-info/requires.txt +0 -0
- {runtime_sdk-0.4.2 → runtime_sdk-0.4.4}/scripts/runtime_sdk.egg-info/top_level.txt +0 -0
- {runtime_sdk-0.4.2 → runtime_sdk-0.4.4}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: runtime-sdk
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.4
|
|
4
4
|
Summary: Runtime Python SDK and CLI
|
|
5
5
|
Project-URL: Repository, https://github.com/The-Money-Company-Limited/runtimevm
|
|
6
6
|
Project-URL: Issues, https://github.com/The-Money-Company-Limited/runtimevm/issues
|
|
@@ -910,13 +910,14 @@ def handle_delete(config: RuntimeConfig, computer_id: str | None) -> int:
|
|
|
910
910
|
return 0
|
|
911
911
|
|
|
912
912
|
client = RuntimeClient(base_url=config.base_url, api_key=config.api_key)
|
|
913
|
+
display_ref = computer_id
|
|
913
914
|
computer_id = _resolve_computer_ref(client, computer_id)
|
|
914
915
|
client.delete_computer(computer_id)
|
|
915
916
|
|
|
916
917
|
def render(_: dict[str, Any]) -> None:
|
|
917
|
-
_UI.console().print(f"[green]✓[/green] deleted [bold]{
|
|
918
|
+
_UI.console().print(f"[green]✓[/green] deleted [bold]{display_ref}[/bold]")
|
|
918
919
|
|
|
919
|
-
return report_success({"message": f"computer {
|
|
920
|
+
return report_success({"message": f"computer {display_ref} deleted"}, render)
|
|
920
921
|
|
|
921
922
|
|
|
922
923
|
def handle_run(
|
|
@@ -1063,6 +1064,7 @@ def _run_terminal_session(ws_url: str) -> int:
|
|
|
1063
1064
|
old_settings = termios.tcgetattr(fd)
|
|
1064
1065
|
stop = threading.Event()
|
|
1065
1066
|
result: dict[str, Any] = {"code": 0, "error": None}
|
|
1067
|
+
output_state: dict[str, Any] = {"buffer": "", "suppressing_preamble": True}
|
|
1066
1068
|
|
|
1067
1069
|
with websocket_connect(ws_url, open_timeout=DEFAULT_WARMUP_TIMEOUT, close_timeout=1) as ws:
|
|
1068
1070
|
_send_terminal_resize(ws)
|
|
@@ -1080,7 +1082,7 @@ def _run_terminal_session(ws_url: str) -> int:
|
|
|
1080
1082
|
if event_type == "ready":
|
|
1081
1083
|
continue
|
|
1082
1084
|
if event_type == "output":
|
|
1083
|
-
data = str(event.get("data") or "")
|
|
1085
|
+
data = _filter_terminal_output(str(event.get("data") or ""), output_state)
|
|
1084
1086
|
if data:
|
|
1085
1087
|
sys.stdout.write(data)
|
|
1086
1088
|
sys.stdout.flush()
|
|
@@ -1133,11 +1135,52 @@ def _run_terminal_session(ws_url: str) -> int:
|
|
|
1133
1135
|
|
|
1134
1136
|
sys.stdout.write("\n")
|
|
1135
1137
|
sys.stdout.flush()
|
|
1138
|
+
tail = _flush_terminal_output(output_state)
|
|
1139
|
+
if tail:
|
|
1140
|
+
sys.stdout.write(tail)
|
|
1141
|
+
sys.stdout.flush()
|
|
1136
1142
|
if result.get("error"):
|
|
1137
1143
|
_UI.err().print(f"[bold red]✗[/bold red] {result['error']}")
|
|
1138
1144
|
return int(result.get("code") or 0)
|
|
1139
1145
|
|
|
1140
1146
|
|
|
1147
|
+
def _filter_terminal_output(chunk: str, state: dict[str, Any]) -> str:
|
|
1148
|
+
if not chunk:
|
|
1149
|
+
return ""
|
|
1150
|
+
if not state.get("suppressing_preamble", False):
|
|
1151
|
+
return _strip_terminal_noise(chunk)
|
|
1152
|
+
|
|
1153
|
+
buffer = str(state.get("buffer") or "") + chunk
|
|
1154
|
+
marker = "\x1b[1;34mruntime@"
|
|
1155
|
+
idx = buffer.find(marker)
|
|
1156
|
+
if idx != -1:
|
|
1157
|
+
state["suppressing_preamble"] = False
|
|
1158
|
+
state["buffer"] = ""
|
|
1159
|
+
return _strip_terminal_noise(buffer[idx:])
|
|
1160
|
+
|
|
1161
|
+
if len(buffer) > 8192:
|
|
1162
|
+
buffer = buffer[-4096:]
|
|
1163
|
+
state["buffer"] = buffer
|
|
1164
|
+
return ""
|
|
1165
|
+
|
|
1166
|
+
|
|
1167
|
+
def _flush_terminal_output(state: dict[str, Any]) -> str:
|
|
1168
|
+
buffer = str(state.get("buffer") or "")
|
|
1169
|
+
state["buffer"] = ""
|
|
1170
|
+
if state.get("suppressing_preamble", False):
|
|
1171
|
+
return ""
|
|
1172
|
+
return _strip_terminal_noise(buffer)
|
|
1173
|
+
|
|
1174
|
+
|
|
1175
|
+
def _strip_terminal_noise(text: str) -> str:
|
|
1176
|
+
if not text:
|
|
1177
|
+
return ""
|
|
1178
|
+
cleaned = text
|
|
1179
|
+
cleaned = cleaned.replace("Running bootstrap command: export PS1='\\[\\033[1;34m\\]runtime@\\h\\[\\033[0m\\]:\\w\\$ '\n", "")
|
|
1180
|
+
cleaned = cleaned.replace("Connected! Press Ctrl+] to exit.\n", "")
|
|
1181
|
+
return cleaned
|
|
1182
|
+
|
|
1183
|
+
|
|
1141
1184
|
def _send_terminal_resize(ws: Any) -> None:
|
|
1142
1185
|
size = shutil.get_terminal_size((100, 24))
|
|
1143
1186
|
ws.send(json.dumps({"type": "resize", "cols": size.columns, "rows": size.lines}))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: runtime-sdk
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.4
|
|
4
4
|
Summary: Runtime Python SDK and CLI
|
|
5
5
|
Project-URL: Repository, https://github.com/The-Money-Company-Limited/runtimevm
|
|
6
6
|
Project-URL: Issues, https://github.com/The-Money-Company-Limited/runtimevm/issues
|
|
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
|