minitap-mobile-use 2.5.0__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:
@@ -26,7 +26,7 @@ class Settings(BaseSettings):
26
26
  MINITAP_API_KEY: SecretStr | None = None
27
27
 
28
28
  OPENAI_BASE_URL: str | None = None
29
- MINITAP_API_BASE_URL: str = "https://platform.minitap.ai"
29
+ MINITAP_BASE_URL: str = "https://platform.minitap.ai"
30
30
 
31
31
  DEVICE_SCREEN_API_BASE_URL: str | None = None
32
32
  DEVICE_HARDWARE_BRIDGE_BASE_URL: str | None = None
@@ -211,6 +211,33 @@ def get_default_llm_config() -> LLMConfig:
211
211
  )
212
212
 
213
213
 
214
+ def get_default_minitap_llm_config() -> LLMConfig | None:
215
+ """
216
+ Returns a default LLM config using the Minitap provider.
217
+ Only returns a config if MINITAP_API_KEY is available.
218
+
219
+ Returns:
220
+ LLMConfig with minitap provider if API key is available, None otherwise
221
+ """
222
+ if not settings.MINITAP_API_KEY:
223
+ return None
224
+
225
+ return LLMConfig(
226
+ planner=LLM(provider="minitap", model="meta-llama/llama-4-scout"),
227
+ orchestrator=LLM(provider="minitap", model="openai/gpt-oss-120b"),
228
+ cortex=LLMWithFallback(
229
+ provider="minitap",
230
+ model="google/gemini-2.5-pro",
231
+ fallback=LLM(provider="minitap", model="openai/gpt-5"),
232
+ ),
233
+ executor=LLM(provider="minitap", model="meta-llama/llama-3.3-70b-instruct"),
234
+ utils=LLMConfigUtils(
235
+ outputter=LLM(provider="minitap", model="openai/gpt-4.1"),
236
+ hopper=LLM(provider="minitap", model="openai/gpt-5-nano"),
237
+ ),
238
+ )
239
+
240
+
214
241
  def deep_merge_llm_config(default: LLMConfig, override: dict) -> LLMConfig:
215
242
  def _deep_merge_dict(base: dict, extra: dict):
216
243
  for key, value in extra.items():
@@ -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
@@ -6,7 +6,7 @@ import copy
6
6
 
7
7
  from langchain_core.callbacks.base import Callbacks
8
8
 
9
- from minitap.mobile_use.config import get_default_llm_config
9
+ from minitap.mobile_use.config import get_default_llm_config, get_default_minitap_llm_config
10
10
  from minitap.mobile_use.context import DevicePlatform
11
11
  from minitap.mobile_use.sdk.constants import (
12
12
  DEFAULT_HW_BRIDGE_BASE_URL,
@@ -187,9 +187,10 @@ class AgentConfigBuilder:
187
187
  if default_profile.name not in self._agent_profiles:
188
188
  self.add_profile(default_profile)
189
189
  elif nb_profiles <= 0:
190
+ llm_config = get_default_minitap_llm_config() or get_default_llm_config()
190
191
  default_profile = AgentProfile(
191
192
  name=DEFAULT_PROFILE_NAME,
192
- llm_config=get_default_llm_config(),
193
+ llm_config=llm_config,
193
194
  )
194
195
  self.add_profile(default_profile)
195
196
  elif nb_profiles == 1:
@@ -31,7 +31,7 @@ async def main() -> None:
31
31
  Main execution function demonstrating manual task creation pattern.
32
32
 
33
33
  Visit https://platform.minitap.ai to get your API key.
34
- Set MINITAP_API_KEY and MINITAP_API_BASE_URL environment variables.
34
+ Set MINITAP_API_KEY and MINITAP_BASE_URL environment variables.
35
35
  """
36
36
  agent = Agent()
37
37
  agent.init()
@@ -28,7 +28,7 @@ async def main() -> None:
28
28
 
29
29
  Visit https://platform.minitap.ai to create a task, customize your profiles,
30
30
  and get your API key.
31
- Set MINITAP_API_KEY and MINITAP_API_BASE_URL environment variables.
31
+ Set MINITAP_API_KEY and MINITAP_BASE_URL environment variables.
32
32
  """
33
33
  agent = Agent()
34
34
  agent.init()
@@ -37,7 +37,7 @@ DEFAULT_PROFILE = "default"
37
37
 
38
38
  class PlatformService:
39
39
  def __init__(self, api_key: str | None = None):
40
- self._base_url = settings.MINITAP_API_BASE_URL
40
+ self._base_url = settings.MINITAP_BASE_URL
41
41
 
42
42
  if api_key:
43
43
  self._api_key = api_key
@@ -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)
@@ -71,10 +71,10 @@ def get_minitap_llm(
71
71
  else:
72
72
  raise ValueError("MINITAP_API_KEY must be provided or set in environment")
73
73
 
74
- if settings.MINITAP_API_BASE_URL is None:
75
- raise ValueError("MINITAP_API_BASE_URL must be set in environment")
74
+ if settings.MINITAP_BASE_URL is None:
75
+ raise ValueError("MINITAP_BASE_URL must be set in environment")
76
76
 
77
- llm_base_url = f"{settings.MINITAP_API_BASE_URL}/api/v1"
77
+ llm_base_url = f"{settings.MINITAP_BASE_URL}/api/v1"
78
78
 
79
79
  if max_retries is None and model.startswith("google/"):
80
80
  max_retries = 2
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: minitap-mobile-use
3
- Version: 2.5.0
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,9 +23,9 @@ 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
- minitap/mobile_use/config.py,sha256=70a9519f0c4732870ee0bb7cdb1a7adc5dca85e380edce9e8cd5d5572709c7d9,10206
28
+ minitap/mobile_use/config.py,sha256=18aa1251ff5eb5a5296c6854a8ce7686615a7eec2b63b2e0a125c1c941b77055,11182
29
29
  minitap/mobile_use/constants.py,sha256=3acd9d6ade5bc772e902b3473f3ba12ddd04e7306963ca2bae49d1132d89ba46,95
30
30
  minitap/mobile_use/context.py,sha256=2e212588a8a7caf58460fead0cae195c6386b7301026bbb2d78fe56c263ce6c3,2131
31
31
  minitap/mobile_use/controllers/__init__.py,sha256=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855,0
@@ -35,19 +35,19 @@ 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
- minitap/mobile_use/sdk/builders/agent_config_builder.py,sha256=c63f452350822daab86d29c44a333909b623fc7ff7bcbf74e5f9104b24630bf5,7582
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
42
42
  minitap/mobile_use/sdk/builders/task_request_builder.py,sha256=9e6cf7afb68af986d6a81487179bb79d28f63047a068725d92996dbcbe753376,6857
43
43
  minitap/mobile_use/sdk/constants.py,sha256=436ba0700c6cf37ac0c9e3995a5f5a0d54ca87af72686eb9667a2c6a96e30f68,292
44
44
  minitap/mobile_use/sdk/examples/README.md,sha256=c92e57d6efc5bce9f3c8668b20d9ce80396aefb7a685636ee84de8c7b9c1403e,3247
45
45
  minitap/mobile_use/sdk/examples/__init__.py,sha256=c23868a2ca7e9b76e80d6835fe93c10e13ea8f2287dd6e785511b8ac30354e9b,46
46
- minitap/mobile_use/sdk/examples/platform_manual_task_example.py,sha256=2c140c040f0389f41ea430f088c40b3f0c211a433fca21ea6e106ddde9699927,1941
47
- minitap/mobile_use/sdk/examples/platform_minimal_example.py,sha256=58e57771362ef606045e238fe96cdf91313f161f233c5167acef71bb05c065ed,1321
46
+ minitap/mobile_use/sdk/examples/platform_manual_task_example.py,sha256=00f54d58fa0abe9a1df20b3593633c239947c5acdf716fe9be1f58f9f56d8caa,1937
47
+ minitap/mobile_use/sdk/examples/platform_minimal_example.py,sha256=bbb6ef341491d10b2ecbf88155ebe7827c6bd892803183c0a9e0f6bdd2212336,1317
48
48
  minitap/mobile_use/sdk/examples/simple_photo_organizer.py,sha256=8ad1cebb5281e3663264560bd15b090add41d2821b1db77e4cbc829860c98df8,2606
49
49
  minitap/mobile_use/sdk/examples/smart_notification_assistant.py,sha256=1d00658dc30c7bce5ef68369f982cd2d1932f53e2e2da6ded70cea13dc669c72,6362
50
- minitap/mobile_use/sdk/services/platform.py,sha256=28636d3d1715b997a44a41e0c4af2756235a04ecd565d011439ae970ac040c88,11973
50
+ minitap/mobile_use/sdk/services/platform.py,sha256=2a1f97efe06577b67c5880ebcfb8a855ba61bf30b5f7d3e1f2600ef60cbd9dce,11969
51
51
  minitap/mobile_use/sdk/types/__init__.py,sha256=433aff6b35f84a985633204edbbdaca9f2f61fb2b822630f9723c481b9bb5c10,1078
52
52
  minitap/mobile_use/sdk/types/agent.py,sha256=390d5c642b3480f4a2203ddd28ec115c785f2576bec81e82e4db3c129399c020,2260
53
53
  minitap/mobile_use/sdk/types/exceptions.py,sha256=684c0049c5af417edf7e46e515be14fd57a0614c81b06ed52f379bc9d0bbebf3,4499
@@ -56,12 +56,12 @@ 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
63
63
  minitap/mobile_use/services/accessibility.py,sha256=42bcbe81b427ee6f6e82bcfe420fc40630db950bda354e3e433c2dda2e159628,3404
64
- minitap/mobile_use/services/llm.py,sha256=e100560940a5d4fc33d2086742369c621e81e6c2fbb98e6d07411856d4df480f,7059
64
+ minitap/mobile_use/services/llm.py,sha256=b76882a8026ae048ffeaeeb3ad056c11d9a757e4a7f2fd12eba40b29ee04a3bf,7047
65
65
  minitap/mobile_use/tools/index.py,sha256=9eab29d43e66ca397fad3206a302a9a4f423448437ab0a6fdb2b9d8bb227513b,2377
66
66
  minitap/mobile_use/tools/mobile/back.py,sha256=8b909e412c8ad382e339b8c89171bf1363398a95a5c96126f79ee2f24e3c2ed1,1816
67
67
  minitap/mobile_use/tools/mobile/clear_text.py,sha256=58e0426f042e39d827d3ff2fe3a79bb23e4146cbefd13da938e1a6f397579c4b,9799
@@ -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.0.dist-info/WHEEL,sha256=ab6157bc637547491fb4567cd7ddf26b04d63382916ca16c29a5c8e94c9c9ef7,79
98
- minitap_mobile_use-2.5.0.dist-info/entry_points.txt,sha256=663a29cfd551a4eaa0f27335f0bd7e4a732a4e39c76b68ef5c8dc444d4a285fa,60
99
- minitap_mobile_use-2.5.0.dist-info/METADATA,sha256=3319e5797aab4b31ed4bc8ad9a499e09fdaa3f685d60ad3f958993bc55a961b0,11995
100
- minitap_mobile_use-2.5.0.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,,