droidrun 0.3.0__py3-none-any.whl → 0.3.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.
droidrun/tools/ios.py CHANGED
@@ -53,7 +53,7 @@ class IOSTools(Tools):
53
53
  self.bundle_identifiers = bundle_identifiers
54
54
  logger.info(f"iOS device URL: {url}")
55
55
 
56
- async def get_clickables(
56
+ async def get_state(
57
57
  self, serial: Optional[str] = None
58
58
  ) -> List[Dict[str, Any]]:
59
59
  """
@@ -80,7 +80,9 @@ class IOSTools(Tools):
80
80
  # Cache the elements for tap_by_index usage
81
81
  self.clickable_elements_cache = elements
82
82
 
83
- return self.clickable_elements_cache
83
+ return {
84
+ "a11y_tree":self.clickable_elements_cache
85
+ }
84
86
  else:
85
87
  logger.error(
86
88
  f"Failed to get accessibility data: HTTP {response.status}"
droidrun/tools/tools.py CHANGED
@@ -9,7 +9,7 @@ logger = logging.getLogger(__name__)
9
9
 
10
10
  class Tools(ABC):
11
11
  @abstractmethod
12
- async def get_clickables(self) -> str:
12
+ async def get_state(self) -> Dict[str, Any]:
13
13
  pass
14
14
 
15
15
  @abstractmethod
@@ -46,10 +46,6 @@ class Tools(ABC):
46
46
  async def take_screenshot(self) -> Tuple[str, bytes]:
47
47
  pass
48
48
 
49
- @abstractmethod
50
- async def get_phone_state(self) -> Dict[str, Any]:
51
- pass
52
-
53
49
  @abstractmethod
54
50
  async def list_packages(self, include_system_apps: bool = False) -> List[str]:
55
51
  pass
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: droidrun
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary: A framework for controlling Android devices through LLM agents
5
5
  Project-URL: Homepage, https://github.com/droidrun/droidrun
6
6
  Project-URL: Bug Tracker, https://github.com/droidrun/droidrun/issues
@@ -34,9 +34,10 @@ Requires-Dist: llama-index
34
34
  Requires-Dist: llama-index-callbacks-arize-phoenix
35
35
  Requires-Dist: llama-index-llms-anthropic
36
36
  Requires-Dist: llama-index-llms-deepseek
37
- Requires-Dist: llama-index-llms-gemini
37
+ Requires-Dist: llama-index-llms-google-genai
38
38
  Requires-Dist: llama-index-llms-ollama
39
39
  Requires-Dist: llama-index-llms-openai
40
+ Requires-Dist: llama-index-llms-openai-like
40
41
  Requires-Dist: openai>=1.0.0
41
42
  Requires-Dist: pillow>=10.0.0
42
43
  Requires-Dist: pydantic>=2.0.0
@@ -1,13 +1,12 @@
1
1
  droidrun/__init__.py,sha256=ERliGcmgGJpyTs7SukYD28tgRccxn6hPG8JPsH0ezZA,840
2
2
  droidrun/__main__.py,sha256=78o1Wr_Z-NrZy9yLWmEfNfRRhAiJGBr4Xi3lmbgkx3w,105
3
- droidrun/run.py,sha256=79xRUb5OgAezXBiI1a4PLvdimfRiowcrhMF1eC9vcC0,3341
4
3
  droidrun/adb/__init__.py,sha256=kh-iT9Sv6RZ2dFSDu1beK_GgtAq8wlMvZQ7puR8JWsI,257
5
4
  droidrun/adb/device.py,sha256=fAKXR5Qmqzz7q3KD2VCcW6dG3NsDLfG9zd56B5kswL4,11004
6
5
  droidrun/adb/manager.py,sha256=g7TuEOCnMTavHzCMtr3u6TPBhmZwE98CW9vBwdhdyyg,2728
7
6
  droidrun/adb/wrapper.py,sha256=Yz3_JSIidq-5bf-t0UfawTutMaLrINS_1Y15m_Uss4g,7093
8
7
  droidrun/agent/__init__.py,sha256=4SqTJeGDvr_wT8rtN9J8hnN6P-pae663mkYr-JmzH4w,208
9
8
  droidrun/agent/codeact/__init__.py,sha256=ZLDGT_lTTzyNm7pcBzdyRIGHJ2ZgbInJdhXZRbJLhSQ,278
10
- droidrun/agent/codeact/codeact_agent.py,sha256=NOOmyRaMn_AOeMSMNK6p86dStslTX5s9rn-bQWJ0Fh0,15647
9
+ droidrun/agent/codeact/codeact_agent.py,sha256=z0c10d1vk2PBciYbHLwnYlEopvwZzJhXkXqjJuUI0v4,16045
11
10
  droidrun/agent/codeact/events.py,sha256=skCfZ-5SR0YhhzZVxx8_VkUjfILk8rCv47k9pHNYhdc,634
12
11
  droidrun/agent/codeact/prompts.py,sha256=28HflWMNkC1ky0hGCzAxhJftjU2IIU1ZRUfya3S7M6I,1006
13
12
  droidrun/agent/common/default.py,sha256=P07el-PrHsoqQMYsYxSSln6mFl-QY75vzwp1Dll_XmY,259
@@ -18,35 +17,34 @@ droidrun/agent/context/context_injection_manager.py,sha256=sA33q2KPtX_4Yap8wM11T
18
17
  droidrun/agent/context/episodic_memory.py,sha256=1ImeR3jAWOpKwkQt3bMlXVOBiQbIli5fBIlBq2waREQ,394
19
18
  droidrun/agent/context/reflection.py,sha256=0hJluOz0hTlHHhReKpIJ9HU5aJbaJsvrjMfraQ84D-M,652
20
19
  droidrun/agent/context/task_manager.py,sha256=ESLs4kR6VNYiYQsc4V7WAeoSLwbaZPSWBXpveOfOv8c,4343
21
- droidrun/agent/context/todo.txt,sha256=pwcH0z4Ofic3fhZ2fekRMfjrxPIB8IybO4eqvSWWjgA,163
22
20
  droidrun/agent/context/personas/__init__.py,sha256=tUDIM_9Kim3ki6ZXpwcvPHPSa2cCHNMLdNW4lyJr4gM,231
23
21
  droidrun/agent/context/personas/app_starter.py,sha256=dHeknznxGEPJ7S6VPyEG_MB-HvAvQwUOnRWaShaV8Xo,1585
24
- droidrun/agent/context/personas/default.py,sha256=8pWC34gdbySyTaRFVE3dFdwpOMW63G1EOjjcYP0BLGo,5023
22
+ droidrun/agent/context/personas/default.py,sha256=Xm07YCWoKjvlHAbQRtzE3vn7BVcz6wYcSVeg4FiojJQ,5060
25
23
  droidrun/agent/context/personas/extractor.py,sha256=S7Qgh3-Kz_OowQJFJGQUlr8OUVktX5UHVdf5qkAj3GQ,1907
26
24
  droidrun/agent/context/personas/ui_expert.py,sha256=P2dAnkKiR3O4bN4ZUuWHmuu4Qo8WRiH1mU6EEOr3yJA,4710
27
25
  droidrun/agent/droid/__init__.py,sha256=3BfUVZiUQ8ATAJ_JmqQZQx53WoERRpQ4AyHW5WOgbRI,297
28
- droidrun/agent/droid/droid_agent.py,sha256=M08l7WOu1NdTOPNErs0lNVUZC4UDNdS-FK0W5vJ1RqU,13222
26
+ droidrun/agent/droid/droid_agent.py,sha256=ELPQOpRYQcnB64rLOoVPk12GHuQ_EFs7fMH-7t0LeQM,13365
29
27
  droidrun/agent/droid/events.py,sha256=bpUhJnbaIH86r8hfUsbHub465v-xYOsIyHWNN8g4TCs,576
30
28
  droidrun/agent/oneflows/reflector.py,sha256=I_tE0PBjvwWbS6SA8Qd41etxJglFgn8oScuKUxc9LEE,11621
31
29
  droidrun/agent/planner/__init__.py,sha256=Fu0Ewtd-dIRLgHIL1DB_9EEKvQS_f1vjB8jgO5TbJXg,364
32
30
  droidrun/agent/planner/events.py,sha256=oyt2FNrA2uVyUeVT65-N0AC6sWBFxSnwNEqWtnRYoFM,390
33
- droidrun/agent/planner/planner_agent.py,sha256=MuCDer3ZfEXTpid-sCd5L4i1C3yHrWsSa8sRLwqq7IA,10050
31
+ droidrun/agent/planner/planner_agent.py,sha256=vcZx8tawMss0F2nt-4QEtdF7kSaikUq3rdWPdTNicjk,10494
34
32
  droidrun/agent/planner/prompts.py,sha256=Ci7Oeu3J4TAhx-tKGPZ9l6Wb3a81FSqC8cWW4jW73HI,6046
35
33
  droidrun/agent/utils/__init__.py,sha256=JK6ygRjw7gzcQSG0HBEYLoVGH54QQAxJJ7HpIS5mgyc,44
36
34
  droidrun/agent/utils/async_utils.py,sha256=IQBcWPwevm89B7R_UdMXk0unWeNCBA232b5kQGqoxNI,336
37
- droidrun/agent/utils/chat_utils.py,sha256=aZihuOE_sdkzniRHBF9QNZ1RF9IFOj06uyd6sglPumY,13241
35
+ droidrun/agent/utils/chat_utils.py,sha256=5oqP2nmKs8sHWP1H_TK82yaxrxWf7FdEbFKASKpR60g,13000
38
36
  droidrun/agent/utils/executer.py,sha256=lQbk2TbPyl_F0k2FqEVimq8cQRcWM_KCO_I7fnkkxqA,4587
39
37
  droidrun/agent/utils/llm_picker.py,sha256=adktsU2-GhYzZ0djOhO_TyFhUE8aGirzJy36A_EvnXU,5919
40
38
  droidrun/agent/utils/trajectory.py,sha256=OmO8TvNO0LVtPXg2qTCv8o9ePaMeDyf-MRWN_YObXho,6845
41
39
  droidrun/cli/__init__.py,sha256=DuwSRtZ8WILPd-nf-fZ7BaBsRgtofoInOF3JtJ9wag0,167
42
40
  droidrun/cli/logs.py,sha256=PsT_VbnOa_sOLXK4KkEJk4AsYCpscqrVoryMmLVwPG0,9714
43
- droidrun/cli/main.py,sha256=bNwlhTdZcsqM-Q-SnFTqY4BzNTp_fGhGel67r_fbMHM,14344
41
+ droidrun/cli/main.py,sha256=3VP5cZ0a7bKcNnqwMQ8mBvaprPcjgM7394WBRdkKDKU,15059
44
42
  droidrun/tools/__init__.py,sha256=9ReauavtSKDQG9ya9_Fr9O0TQnDFixgOPaP5n82_iEk,271
45
- droidrun/tools/adb.py,sha256=YSStSGYa7SFCzmrZAb_hn5pOtpXzErnrP5HJyOCm5Ss,33984
46
- droidrun/tools/ios.py,sha256=JMsBLAykeXsSvwHXvHmGinM9luPW63SpsI_u1IDPCx8,22822
47
- droidrun/tools/tools.py,sha256=L9EKBk2_QxPZmmDVXfjmHwqkauwCawNnQuz9X29N8UE,2468
48
- droidrun-0.3.0.dist-info/METADATA,sha256=QIbmadNT3BUyfINHZmtlOUZvtOPLthl-q9CfqkVgBJ4,6294
49
- droidrun-0.3.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
50
- droidrun-0.3.0.dist-info/entry_points.txt,sha256=o259U66js8TIybQ7zs814Oe_LQ_GpZsp6a9Cr-xm5zE,51
51
- droidrun-0.3.0.dist-info/licenses/LICENSE,sha256=s-uxn9qChu-kFdRXUp6v_0HhsaJ_5OANmfNOFVm2zdk,1069
52
- droidrun-0.3.0.dist-info/RECORD,,
43
+ droidrun/tools/adb.py,sha256=1Nv8tkmgqGlOZJYe39W5SGwdqnEjrxN7szsLQ_BkWqo,30137
44
+ droidrun/tools/ios.py,sha256=-fq4VNJFVTkR4xtUW9IVyUXwqnhsJWda_fik3II2EGg,22885
45
+ droidrun/tools/tools.py,sha256=EH3hzrVUHEkTUT-PF2s9NHyNntV9xoNXskmNBcZwLm4,2385
46
+ droidrun-0.3.1.dist-info/METADATA,sha256=8lZqTnD2aoQOcpRKn6TL7rC0IdshMhAUAnyY9QWCKmQ,6344
47
+ droidrun-0.3.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
48
+ droidrun-0.3.1.dist-info/entry_points.txt,sha256=o259U66js8TIybQ7zs814Oe_LQ_GpZsp6a9Cr-xm5zE,51
49
+ droidrun-0.3.1.dist-info/licenses/LICENSE,sha256=s-uxn9qChu-kFdRXUp6v_0HhsaJ_5OANmfNOFVm2zdk,1069
50
+ droidrun-0.3.1.dist-info/RECORD,,
@@ -1,4 +0,0 @@
1
- Task 1: Precondition: None. Goal: Open the notification shade to find the settings button.
2
- Status: pending
3
- Agent: Default
4
- ----------------------------------------
droidrun/run.py DELETED
@@ -1,105 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- Minimal script to create and run a DroidAgent
4
- """
5
-
6
- import asyncio
7
- import os
8
- import sys
9
-
10
- # Add the current directory to Python path so we can import droidrun
11
- sys.path.insert(0, '/home/sleyn/projects/droidrun')
12
-
13
- async def main():
14
- try:
15
- # Import required modules
16
- from droidrun.agent.droid import DroidAgent
17
- from droidrun.agent.utils.llm_picker import load_llm
18
- from droidrun.tools.adb import DeviceManager, AdbTools
19
- from droidrun.agent.context.personas import DEFAULT, APP_STARTER_EXPERT
20
-
21
- # Configuration
22
- goal = """Open the notes app and create a new note"""
23
- provider = "Gemini" # Change this to your preferred provider
24
- model = "models/gemini-2.5-flash-preview-05-20"
25
-
26
- # Check for API key
27
- api_key = os.getenv("GEMINI_API_KEY") #os.getenv("GEMINI_API_KEY")
28
- if not api_key:
29
- print("❌ Please set GEMINI_API_KEY environment variable")
30
- print(" Example: export GEMINI_API_KEY='your-api-key-here'")
31
- return
32
-
33
- print(f"🎯 Goal: {goal}")
34
- print(f"🤖 Using {provider} with model {model}")
35
-
36
- # Find a connected device
37
- device_manager = DeviceManager()
38
- devices = await device_manager.list_devices()
39
-
40
- #if not devices:
41
- # print("❌ No Android devices found. Please connect a device via ADB.")
42
- # print(" Try: adb devices")
43
- # return
44
-
45
- device_serial = devices[0].serial
46
- #"http://localhost:6643"using the CLI and
47
- #device_serial = "http://192.168.100.91:6643"
48
- print(f"📱 Using device: {device_serial}")
49
-
50
- # Initialize LLM
51
- print("🧠 Initializing LLM...")
52
- llm = load_llm(
53
- provider_name=provider,
54
- model=model,
55
- api_key=api_key,
56
- temperature=0.2
57
- )
58
-
59
- tools = AdbTools(serial=device_serial)
60
-
61
-
62
-
63
- # Create DroidAgent
64
- print("🤖 Creating DroidAgent...")
65
- agent = DroidAgent(
66
- goal=goal,
67
- llm=llm,
68
- tools=tools,
69
- max_steps=100,
70
- timeout=3000,
71
- reasoning=False,
72
- debug=True,
73
- save_trajectories=True,
74
- enable_tracing=False
75
- )
76
-
77
- # Run the agent
78
- print("🚀 Running agent...")
79
- handler = agent.run()
80
- async for nested_ev in handler.stream_events():
81
- print(f"EXTERNAL EVENT: {nested_ev.__class__.__name__}")
82
-
83
- result = await handler
84
-
85
- # Print results
86
- if result.get("success"):
87
- print(f"✅ Success: {result.get('reason', 'Goal completed')}")
88
- else:
89
- print(f"❌ Failed: {result.get('reason', 'Unknown error')}")
90
-
91
- print(f"📊 Steps taken: {result.get('steps', 0)}")
92
-
93
- if result.get("trajectory"):
94
- print(f"📝 Trajectory has {len(result['trajectory'])} steps")
95
-
96
- except ImportError as e:
97
- print(f"❌ Import error: {e}")
98
- print(" Make sure you're in the droidrun project directory")
99
- except Exception as e:
100
- print(f"❌ Error: {e}")
101
- import traceback
102
- traceback.print_exc()
103
-
104
- if __name__ == "__main__":
105
- asyncio.run(main())