minitap-mobile-use 2.5.1__py3-none-any.whl → 2.5.2__py3-none-any.whl

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.

Potentially problematic release.


This version of minitap-mobile-use might be problematic. Click here for more details.

@@ -14,7 +14,7 @@ def get_ios_devices() -> tuple[bool, list[str], str]:
14
14
  - list[str]: A list of iOS device UDIDs.
15
15
  - str: An error message if any.
16
16
  """
17
- if platform.system() != "Linux":
17
+ if platform.system() != "Darwin":
18
18
  return False, [], "xcrun is only available on macOS."
19
19
 
20
20
  try:
@@ -409,6 +409,21 @@ class Agent:
409
409
  self._finalize_tracing(task=task, context=context)
410
410
  return output
411
411
 
412
+ def is_healthy(self):
413
+ """
414
+ Check if the agent is healthy by verifying the streaming connection status.
415
+ Uses the configured Screen API base URL instead of hardcoding localhost.
416
+ """
417
+ try:
418
+ response = self._screen_api_client.get_with_retry("/streaming-status", timeout=2)
419
+ if response.status_code == 200:
420
+ data = response.json()
421
+ is_connected = data.get("is_streaming_connected", False)
422
+ return is_connected
423
+ return False
424
+ except Exception:
425
+ return False
426
+
412
427
  def clean(self, force: bool = False):
413
428
  if not self._initialized and not force:
414
429
  return
@@ -8,21 +8,24 @@ import requests
8
8
  import uvicorn
9
9
  from fastapi import FastAPI, HTTPException
10
10
  from fastapi.responses import JSONResponse
11
+ from sseclient import SSEClient
12
+
11
13
  from minitap.mobile_use.servers.config import server_settings
12
14
  from minitap.mobile_use.servers.utils import is_port_in_use
13
- from sseclient import SSEClient
14
15
 
15
16
  DEVICE_HARDWARE_BRIDGE_BASE_URL = server_settings.DEVICE_HARDWARE_BRIDGE_BASE_URL
16
17
  DEVICE_HARDWARE_BRIDGE_API_URL = f"{DEVICE_HARDWARE_BRIDGE_BASE_URL}/api"
17
18
 
18
19
  _latest_screen_data = None
20
+ _is_streaming_connected = False
21
+
19
22
  _data_lock = threading.Lock()
20
23
  _stream_thread = None
21
24
  _stop_event = threading.Event()
22
25
 
23
26
 
24
27
  def _stream_worker():
25
- global _latest_screen_data
28
+ global _latest_screen_data, _is_streaming_connected
26
29
  sse_url = f"{DEVICE_HARDWARE_BRIDGE_API_URL}/device-screen/sse"
27
30
  headers = {"Accept": "text/event-stream"}
28
31
 
@@ -31,6 +34,8 @@ def _stream_worker():
31
34
  with requests.get(sse_url, stream=True, headers=headers) as response:
32
35
  response.raise_for_status()
33
36
  print("--- Stream connected, listening for events... ---")
37
+ with _data_lock:
38
+ _is_streaming_connected = True
34
39
  event_source = (chunk for chunk in response.iter_content())
35
40
  client = SSEClient(event_source)
36
41
  for event in client.events():
@@ -59,10 +64,12 @@ def _stream_worker():
59
64
  "platform": platform,
60
65
  }
61
66
 
62
- except requests.exceptions.RequestException as e:
67
+ except Exception as e:
63
68
  print(f"Connection error in stream worker: {e}. Retrying in 2 seconds...")
64
69
  with _data_lock:
70
+ _is_streaming_connected = False
65
71
  _latest_screen_data = None
72
+
66
73
  time.sleep(2)
67
74
 
68
75
 
@@ -76,9 +83,11 @@ def start_stream():
76
83
 
77
84
 
78
85
  def stop_stream():
79
- global _stream_thread
86
+ global _stream_thread, _is_streaming_connected
80
87
  if _stream_thread and _stream_thread.is_alive():
81
88
  _stop_event.set()
89
+ with _data_lock:
90
+ _is_streaming_connected = False
82
91
  _stream_thread.join(timeout=2)
83
92
  print("--- Background screen streaming stopped ---")
84
93
 
@@ -135,6 +144,18 @@ async def health_check():
135
144
  raise HTTPException(status_code=503, detail=f"Maestro Studio not available: {e}")
136
145
 
137
146
 
147
+ @app.get("/streaming-status")
148
+ async def streaming_status():
149
+ """Check if the SSE streaming connection is active."""
150
+ with _data_lock:
151
+ return JSONResponse(
152
+ content={
153
+ "is_streaming_connected": _is_streaming_connected,
154
+ "has_screen_data": _latest_screen_data is not None,
155
+ }
156
+ )
157
+
158
+
138
159
  def start():
139
160
  if not is_port_in_use(server_settings.DEVICE_SCREEN_API_PORT):
140
161
  uvicorn.run(app, host="0.0.0.0", port=server_settings.DEVICE_SCREEN_API_PORT)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: minitap-mobile-use
3
- Version: 2.5.1
3
+ Version: 2.5.2
4
4
  Summary: AI-powered multi-agent system that automates real Android and iOS devices through low-level control using LangGraph.
5
5
  Author: Pierre-Louis Favreau, Jean-Pierre Lo, Nicolas Dehandschoewercker
6
6
  License: MIT License
@@ -23,7 +23,7 @@ minitap/mobile_use/agents/planner/types.py,sha256=e8acf3c2d1505286a138b6f7c3ef36
23
23
  minitap/mobile_use/agents/planner/utils.py,sha256=88b4b039e09cea254615ff3d0bc8951c3717a68702742e913a0176ecfbcaf495,2315
24
24
  minitap/mobile_use/agents/summarizer/summarizer.py,sha256=56c2c7d5d48f4ba045b1401538db78b2ddbd43280389ed4cbc58ecd1da0c7610,1083
25
25
  minitap/mobile_use/clients/device_hardware_client.py,sha256=9593380a7a3df32f02aa22717678c25e91367df26b1743abde9e57aec5dc2474,857
26
- minitap/mobile_use/clients/ios_client.py,sha256=332bf47ac01bbd5bf6178a59eea7c7a30fed944f30907caea5388178f312d36b,1452
26
+ minitap/mobile_use/clients/ios_client.py,sha256=46a8c3f3c7d19d20b605502f5eeba90af2e3897483566b53e3f0141dcf7b0570,1453
27
27
  minitap/mobile_use/clients/screen_api_client.py,sha256=3615dc65d25c38b4d8dc5512f9adb3bcf69dca7a0298a472a6812f604a275c47,2019
28
28
  minitap/mobile_use/config.py,sha256=18aa1251ff5eb5a5296c6854a8ce7686615a7eec2b63b2e0a125c1c941b77055,11182
29
29
  minitap/mobile_use/constants.py,sha256=3acd9d6ade5bc772e902b3473f3ba12ddd04e7306963ca2bae49d1132d89ba46,95
@@ -35,7 +35,7 @@ minitap/mobile_use/graph/graph.py,sha256=c7b412e725b096eca8f212d704c3faf91d77eea
35
35
  minitap/mobile_use/graph/state.py,sha256=8efeef0f4bb10c933e54fdf17882ae63907ca557e4f1ae56bced8b5ac0f9ed17,3503
36
36
  minitap/mobile_use/main.py,sha256=7ac4dc592e3ce72bff602d67ba2f25b9b5e45e07a316e548d7c8e73735abf43d,3725
37
37
  minitap/mobile_use/sdk/__init__.py,sha256=4e5555c0597242b9523827194a2500b9c6d7e5c04b1ccd2056c9b1f4d42a31cd,318
38
- minitap/mobile_use/sdk/agent.py,sha256=ad30436d2de47804bd13c54e40c3c8709ff17765bbd2703e332e0959f885c4d3,27825
38
+ minitap/mobile_use/sdk/agent.py,sha256=b1b98ce26ee08690d7b1c33bf98a29452d2d76906f77f5a0300bfa2331e41151,28416
39
39
  minitap/mobile_use/sdk/builders/__init__.py,sha256=d6c96d39b80900a114698ef205ab5061a541f33bfa99c456d9345e5adb8ff6ff,424
40
40
  minitap/mobile_use/sdk/builders/agent_config_builder.py,sha256=542d7d06c677059c8f8e0bc27d95f2dce282b1cfe0320fa6f902bc2f9d08140d,7686
41
41
  minitap/mobile_use/sdk/builders/index.py,sha256=64336ac3b3dea4673a48e95b8c5ac4196ecd5d2196380377d102593d0a1dc138,442
@@ -56,7 +56,7 @@ minitap/mobile_use/sdk/types/task.py,sha256=264e77bce958ee398252c7346dfa7ae896ea
56
56
  minitap/mobile_use/sdk/utils.py,sha256=647f1f4a463c3029c3b0eb3c33f7dd778d5f5fd9d293224f5474595a60e1de6f,967
57
57
  minitap/mobile_use/servers/config.py,sha256=8a4a6bce23e2093d047a91e135e2f88627f76ac12177d071f25a3ca739b3afeb,575
58
58
  minitap/mobile_use/servers/device_hardware_bridge.py,sha256=db5f55ba66bfebf70ea1a655d921d4070ca6c458b1e7e5e08ed58b3bea100d63,7227
59
- minitap/mobile_use/servers/device_screen_api.py,sha256=63bf866f17cde4ab97631b710080866b8427225d3857b2351ab83db38a9c5107,5064
59
+ minitap/mobile_use/servers/device_screen_api.py,sha256=2e60a5bc32d71ca80ee8dd93ff8b76138ae5d74e67d82bdb16fd15086d4eb33a,5675
60
60
  minitap/mobile_use/servers/start_servers.py,sha256=1e86dc0fcbdf6e6570ae68c7097145e754f3c3448ca813d415b3e5ebb74db828,5037
61
61
  minitap/mobile_use/servers/stop_servers.py,sha256=04a409a17fc0323209301fe28fbb037d71e41e5422eb369640f9f329aae312f5,7064
62
62
  minitap/mobile_use/servers/utils.py,sha256=f3cc85da39f8d60cb840001be418562de7db95462370db9b79e96d884abe5c17,294
@@ -94,7 +94,7 @@ minitap/mobile_use/utils/shell_utils.py,sha256=b35ae7f863379adb86c9ba0f9b3b9d495
94
94
  minitap/mobile_use/utils/test_ui_hierarchy.py,sha256=96c1549c05b4f7254a22d57dbd40aea860756f1e0b9d8cc24319383643448422,5911
95
95
  minitap/mobile_use/utils/time.py,sha256=41bfaabb3751de11443ccb4a3f1f53d5ebacc7744c72e32695fdcc3d23f17d49,160
96
96
  minitap/mobile_use/utils/ui_hierarchy.py,sha256=f3370518035d9daf02c08042a9e28ad564f4fc81a2b268103b9a7f8bc5c61d11,3797
97
- minitap_mobile_use-2.5.1.dist-info/WHEEL,sha256=ab6157bc637547491fb4567cd7ddf26b04d63382916ca16c29a5c8e94c9c9ef7,79
98
- minitap_mobile_use-2.5.1.dist-info/entry_points.txt,sha256=663a29cfd551a4eaa0f27335f0bd7e4a732a4e39c76b68ef5c8dc444d4a285fa,60
99
- minitap_mobile_use-2.5.1.dist-info/METADATA,sha256=dd72cb0af27ce8bc4ab3b3077fd39cfd37a9e5a1bee6792bf21a3ae71635ebdb,11995
100
- minitap_mobile_use-2.5.1.dist-info/RECORD,,
97
+ minitap_mobile_use-2.5.2.dist-info/WHEEL,sha256=ab6157bc637547491fb4567cd7ddf26b04d63382916ca16c29a5c8e94c9c9ef7,79
98
+ minitap_mobile_use-2.5.2.dist-info/entry_points.txt,sha256=663a29cfd551a4eaa0f27335f0bd7e4a732a4e39c76b68ef5c8dc444d4a285fa,60
99
+ minitap_mobile_use-2.5.2.dist-info/METADATA,sha256=45d6d254c735004e21ead5f86e7d8b551b21d85dde6d3dd777b118e46d033873,11995
100
+ minitap_mobile_use-2.5.2.dist-info/RECORD,,