minitap-mobile-use 2.8.0__py3-none-any.whl → 2.8.1__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.

@@ -1,8 +1,10 @@
1
+ import asyncio
1
2
  import base64
2
3
  import json
3
4
  import threading
4
5
  import time
5
6
  from contextlib import asynccontextmanager
7
+ from datetime import UTC, datetime
6
8
 
7
9
  import requests
8
10
  import uvicorn
@@ -16,16 +18,19 @@ from minitap.mobile_use.servers.utils import is_port_in_use
16
18
  DEVICE_HARDWARE_BRIDGE_BASE_URL = server_settings.DEVICE_HARDWARE_BRIDGE_BASE_URL
17
19
  DEVICE_HARDWARE_BRIDGE_API_URL = f"{DEVICE_HARDWARE_BRIDGE_BASE_URL}/api"
18
20
 
21
+ MAX_WAIT_TIME = 1
22
+
19
23
  _latest_screen_data = None
20
24
  _is_streaming_connected = False
21
25
 
22
26
  _data_lock = threading.Lock()
23
27
  _stream_thread = None
24
28
  _stop_event = threading.Event()
29
+ _latest_screen_ts = None
25
30
 
26
31
 
27
32
  def _stream_worker():
28
- global _latest_screen_data, _is_streaming_connected
33
+ global _latest_screen_data, _is_streaming_connected, _latest_screen_ts
29
34
  sse_url = f"{DEVICE_HARDWARE_BRIDGE_API_URL}/device-screen/sse"
30
35
  headers = {"Accept": "text/event-stream"}
31
36
 
@@ -63,6 +68,7 @@ def _stream_worker():
63
68
  "height": height,
64
69
  "platform": platform,
65
70
  }
71
+ _latest_screen_ts = datetime.now(UTC)
66
72
 
67
73
  except Exception as e:
68
74
  print(f"Connection error in stream worker: {e}. Retrying in 2 seconds...")
@@ -122,6 +128,14 @@ def get_latest_data():
122
128
 
123
129
  @app.get("/screen-info")
124
130
  async def get_screen_info():
131
+ now = datetime.now(UTC)
132
+ waited_for_seconds = 0
133
+ while not _latest_screen_ts or _latest_screen_ts < now:
134
+ wait_for_seconds = 0.05
135
+ await asyncio.sleep(wait_for_seconds)
136
+ waited_for_seconds += wait_for_seconds
137
+ if waited_for_seconds >= MAX_WAIT_TIME:
138
+ break
125
139
  data = get_latest_data()
126
140
  return JSONResponse(content=data)
127
141
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: minitap-mobile-use
3
- Version: 2.8.0
3
+ Version: 2.8.1
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
@@ -60,7 +60,7 @@ minitap/mobile_use/sdk/types/task.py,sha256=c7f0b3c59ee980eb63e9836268701069e805
60
60
  minitap/mobile_use/sdk/utils.py,sha256=647f1f4a463c3029c3b0eb3c33f7dd778d5f5fd9d293224f5474595a60e1de6f,967
61
61
  minitap/mobile_use/servers/config.py,sha256=8a4a6bce23e2093d047a91e135e2f88627f76ac12177d071f25a3ca739b3afeb,575
62
62
  minitap/mobile_use/servers/device_hardware_bridge.py,sha256=39c20834812d9929163affaedd0e285ab0b349948b3236156c04a3e0bf094272,7456
63
- minitap/mobile_use/servers/device_screen_api.py,sha256=2e60a5bc32d71ca80ee8dd93ff8b76138ae5d74e67d82bdb16fd15086d4eb33a,5675
63
+ minitap/mobile_use/servers/device_screen_api.py,sha256=fad57f96b4316f9700f77b8312e5fdc4c4c717a9f5b77862142752fb77a50b42,6160
64
64
  minitap/mobile_use/servers/start_servers.py,sha256=2155d744726ac64c38b38e2e589e1cdb32e852bd9d5cc8c669f175d79de0a78b,5078
65
65
  minitap/mobile_use/servers/stop_servers.py,sha256=04a409a17fc0323209301fe28fbb037d71e41e5422eb369640f9f329aae312f5,7064
66
66
  minitap/mobile_use/servers/utils.py,sha256=f3cc85da39f8d60cb840001be418562de7db95462370db9b79e96d884abe5c17,294
@@ -97,7 +97,7 @@ minitap/mobile_use/utils/shell_utils.py,sha256=b35ae7f863379adb86c9ba0f9b3b9d495
97
97
  minitap/mobile_use/utils/test_ui_hierarchy.py,sha256=96c1549c05b4f7254a22d57dbd40aea860756f1e0b9d8cc24319383643448422,5911
98
98
  minitap/mobile_use/utils/time.py,sha256=41bfaabb3751de11443ccb4a3f1f53d5ebacc7744c72e32695fdcc3d23f17d49,160
99
99
  minitap/mobile_use/utils/ui_hierarchy.py,sha256=f3370518035d9daf02c08042a9e28ad564f4fc81a2b268103b9a7f8bc5c61d11,3797
100
- minitap_mobile_use-2.8.0.dist-info/WHEEL,sha256=ab6157bc637547491fb4567cd7ddf26b04d63382916ca16c29a5c8e94c9c9ef7,79
101
- minitap_mobile_use-2.8.0.dist-info/entry_points.txt,sha256=663a29cfd551a4eaa0f27335f0bd7e4a732a4e39c76b68ef5c8dc444d4a285fa,60
102
- minitap_mobile_use-2.8.0.dist-info/METADATA,sha256=d1131fea7bfc7ac26bd51ee3266dae6191ffefffde7e8193043059dd6dd40ee3,11995
103
- minitap_mobile_use-2.8.0.dist-info/RECORD,,
100
+ minitap_mobile_use-2.8.1.dist-info/WHEEL,sha256=ab6157bc637547491fb4567cd7ddf26b04d63382916ca16c29a5c8e94c9c9ef7,79
101
+ minitap_mobile_use-2.8.1.dist-info/entry_points.txt,sha256=663a29cfd551a4eaa0f27335f0bd7e4a732a4e39c76b68ef5c8dc444d4a285fa,60
102
+ minitap_mobile_use-2.8.1.dist-info/METADATA,sha256=252a0f36038ca484e7c9ddd2f7cea8d8c81af9fad8f22e021382e695230bb7cb,11995
103
+ minitap_mobile_use-2.8.1.dist-info/RECORD,,