runtime-sdk 0.4.8__tar.gz → 0.4.9__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: runtime-sdk
3
- Version: 0.4.8
3
+ Version: 0.4.9
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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "runtime-sdk"
3
- version = "0.4.8"
3
+ version = "0.4.9"
4
4
  description = "Runtime Python SDK and CLI"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -939,7 +939,7 @@ def handle_create(
939
939
  computer_id = result.get("id") or result.get("slug")
940
940
  if not computer_id:
941
941
  return code
942
- return _enter_computer(config, str(computer_id), announce_created=False)
942
+ return _enter_computer(config, str(computer_id))
943
943
 
944
944
 
945
945
  def handle_list(config: RuntimeConfig) -> int:
@@ -1159,7 +1159,7 @@ def handle_publish(config: RuntimeConfig, computer_id: str | None, port: int | N
1159
1159
  )
1160
1160
 
1161
1161
 
1162
- def _enter_computer(config: RuntimeConfig, computer_id: str, *, announce_created: bool = True) -> int:
1162
+ def _enter_computer(config: RuntimeConfig, computer_id: str) -> int:
1163
1163
  client = RuntimeClient(base_url=config.base_url, api_key=config.api_key)
1164
1164
  ticket_payload = _with_spinner(
1165
1165
  f"preparing console for {computer_id}…",
@@ -1169,10 +1169,7 @@ def _enter_computer(config: RuntimeConfig, computer_id: str, *, announce_created
1169
1169
  if not ws_url:
1170
1170
  return report_error("terminal endpoint did not return a websocket url")
1171
1171
 
1172
- if announce_created:
1173
- _UI.console().print("[cyan]●[/cyan] Connecting to console...")
1174
- else:
1175
- _UI.console().print("[cyan]●[/cyan] Connecting to console...")
1172
+ _UI.console().print("[cyan]●[/cyan] Connecting to console...")
1176
1173
 
1177
1174
  try:
1178
1175
  return _run_terminal_session(ws_url)
@@ -1241,6 +1238,9 @@ def _run_terminal_session(ws_url: str) -> int:
1241
1238
  stop.set()
1242
1239
  return
1243
1240
  except ConnectionClosed:
1241
+ if not stop.is_set() and not result.get("error") and int(result.get("code") or 0) == 0:
1242
+ result["code"] = 1
1243
+ result["error"] = "terminal connection closed unexpectedly"
1244
1244
  stop.set()
1245
1245
  except Exception as exc: # pragma: no cover - defensive for real TTY sessions
1246
1246
  result["code"] = 1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: runtime-sdk
3
- Version: 0.4.8
3
+ Version: 0.4.9
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