droidrun 0.3.4__tar.gz → 0.3.5__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.
- {droidrun-0.3.4 → droidrun-0.3.5}/PKG-INFO +1 -1
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/agent/context/task_manager.py +10 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/agent/planner/planner_agent.py +3 -2
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/agent/utils/chat_utils.py +24 -22
- {droidrun-0.3.4 → droidrun-0.3.5}/pyproject.toml +1 -1
- {droidrun-0.3.4 → droidrun-0.3.5}/.github/workflows/bounty.yml +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/.github/workflows/publish.yml +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/.gitignore +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/CHANGELOG.md +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/CONTRIBUTING.md +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/LICENSE +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/MANIFEST.in +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/README.md +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/docs/.generated-files.txt +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/docs/docs.json +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/docs/favicon.png +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/docs/logo/dark.svg +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/docs/logo/light.svg +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/docs/v1/concepts/agent.mdx +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/docs/v1/concepts/android-control.mdx +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/docs/v1/concepts/portal-app.mdx +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/docs/v1/overview.mdx +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/docs/v1/quickstart.mdx +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/docs/v2/concepts/agent.mdx +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/docs/v2/concepts/android-control.mdx +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/docs/v2/concepts/planning.mdx +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/docs/v2/concepts/portal-app.mdx +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/docs/v2/concepts/tracing.mdx +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/docs/v2/overview.mdx +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/docs/v2/quickstart.mdx +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/docs/v3/concepts/agent.mdx +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/docs/v3/concepts/android-tools.mdx +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/docs/v3/concepts/models.mdx +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/docs/v3/concepts/portal-app.mdx +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/docs/v3/guides/cli.mdx +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/docs/v3/guides/gemini.mdx +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/docs/v3/guides/ollama.mdx +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/docs/v3/guides/openailike.mdx +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/docs/v3/guides/overview.mdx +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/docs/v3/guides/telemetry.mdx +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/docs/v3/images/portal_apk.png +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/docs/v3/overview.mdx +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/docs/v3/quickstart.mdx +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/docs/v3/sdk/adb-tools.mdx +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/docs/v3/sdk/base-tools.mdx +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/docs/v3/sdk/droid-agent.mdx +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/docs/v3/sdk/ios-tools.mdx +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/__init__.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/__main__.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/agent/__init__.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/agent/codeact/__init__.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/agent/codeact/codeact_agent.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/agent/codeact/events.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/agent/codeact/prompts.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/agent/common/default.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/agent/common/events.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/agent/context/__init__.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/agent/context/agent_persona.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/agent/context/context_injection_manager.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/agent/context/episodic_memory.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/agent/context/personas/__init__.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/agent/context/personas/app_starter.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/agent/context/personas/big_agent.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/agent/context/personas/default.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/agent/context/personas/ui_expert.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/agent/context/reflection.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/agent/droid/__init__.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/agent/droid/droid_agent.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/agent/droid/events.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/agent/oneflows/reflector.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/agent/planner/__init__.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/agent/planner/events.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/agent/planner/prompts.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/agent/utils/__init__.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/agent/utils/async_utils.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/agent/utils/executer.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/agent/utils/llm_picker.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/agent/utils/trajectory.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/cli/__init__.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/cli/logs.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/cli/main.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/macro/__init__.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/macro/__main__.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/macro/cli.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/macro/replay.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/portal.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/telemetry/__init__.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/telemetry/events.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/telemetry/tracker.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/tools/__init__.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/tools/adb.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/tools/ios.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/droidrun/tools/tools.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/gen-docs-sdk-ref.sh +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/setup.py +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/static/droidrun-dark.png +0 -0
- {droidrun-0.3.4 → droidrun-0.3.5}/static/droidrun.png +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: droidrun
|
3
|
-
Version: 0.3.
|
3
|
+
Version: 0.3.5
|
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
|
@@ -43,6 +43,13 @@ class TaskManager:
|
|
43
43
|
def get_task_history(self):
|
44
44
|
return self.task_history
|
45
45
|
|
46
|
+
def get_current_task(self) -> Optional[Task]:
|
47
|
+
"""Return the first task with status "pending" from the task list."""
|
48
|
+
for task in self.tasks:
|
49
|
+
if task.status == self.STATUS_PENDING:
|
50
|
+
return task
|
51
|
+
return None
|
52
|
+
|
46
53
|
def complete_task(self, task: Task, message: Optional[str] = None):
|
47
54
|
task = copy.deepcopy(task)
|
48
55
|
task.status = self.STATUS_COMPLETED
|
@@ -60,6 +67,9 @@ class TaskManager:
|
|
60
67
|
|
61
68
|
def get_failed_tasks(self) -> list[dict]:
|
62
69
|
return [task for task in self.task_history if task.status == self.STATUS_FAILED]
|
70
|
+
|
71
|
+
def get_task_history(self) -> list[dict]:
|
72
|
+
return self.task_history
|
63
73
|
|
64
74
|
|
65
75
|
def save_to_file(self):
|
@@ -259,8 +259,9 @@ wrap your code inside this:
|
|
259
259
|
|
260
260
|
|
261
261
|
chat_history = await chat_utils.add_task_history_block(
|
262
|
-
self.task_manager.get_completed_tasks(),
|
263
|
-
self.task_manager.get_failed_tasks(),
|
262
|
+
#self.task_manager.get_completed_tasks(),
|
263
|
+
#self.task_manager.get_failed_tasks(),
|
264
|
+
self.task_manager.get_task_history(),
|
264
265
|
chat_history,
|
265
266
|
)
|
266
267
|
|
@@ -120,7 +120,7 @@ async def add_ui_text_block(ui_state: str, chat_history: List[ChatMessage], copy
|
|
120
120
|
|
121
121
|
async def add_screenshot_image_block(screenshot, chat_history: List[ChatMessage], copy = True) -> None:
|
122
122
|
if screenshot:
|
123
|
-
image_block = ImageBlock(image=
|
123
|
+
image_block = ImageBlock(image=screenshot)
|
124
124
|
if copy:
|
125
125
|
chat_history = chat_history.copy() # Create a copy of chat history to avoid modifying the original
|
126
126
|
chat_history[-1] = message_copy(chat_history[-1])
|
@@ -201,29 +201,31 @@ async def get_reflection_block(reflections: List[Reflection]) -> ChatMessage:
|
|
201
201
|
|
202
202
|
return ChatMessage(role="user", content=reflection_block)
|
203
203
|
|
204
|
-
async def add_task_history_block(
|
205
|
-
|
204
|
+
async def add_task_history_block(all_tasks: list[dict], chat_history: List[ChatMessage]) -> List[ChatMessage]:
|
205
|
+
"""Experimental task history with all previous tasks."""
|
206
|
+
if not all_tasks:
|
207
|
+
return chat_history
|
208
|
+
|
209
|
+
lines = ["### Task Execution History (chronological):"]
|
210
|
+
for index, task in enumerate(all_tasks, 1):
|
211
|
+
description: str
|
212
|
+
status_value: str
|
213
|
+
|
214
|
+
if hasattr(task, "description") and hasattr(task, "status"):
|
215
|
+
description = getattr(task, "description")
|
216
|
+
status_value = getattr(task, "status") or "unknown"
|
217
|
+
elif isinstance(task, dict):
|
218
|
+
description = str(task.get("description", task))
|
219
|
+
status_value = str(task.get("status", "unknown"))
|
220
|
+
else:
|
221
|
+
description = str(task)
|
222
|
+
status_value = "unknown"
|
206
223
|
|
207
|
-
|
208
|
-
all_tasks = completed_tasks + failed_tasks
|
209
|
-
|
210
|
-
if all_tasks:
|
211
|
-
task_history += "### Task Execution History (chronological):\n"
|
212
|
-
for i, task in enumerate(all_tasks, 1):
|
213
|
-
if hasattr(task, 'description'):
|
214
|
-
status_indicator = "[success]" if hasattr(task, 'status') and task.status == "completed" else "[failed]"
|
215
|
-
task_history += f"{i}. {status_indicator} {task.description}\n"
|
216
|
-
elif isinstance(task, dict):
|
217
|
-
# For backward compatibility with dict format
|
218
|
-
task_description = task.get('description', str(task))
|
219
|
-
status_indicator = "[success]" if task in completed_tasks else "[failed]"
|
220
|
-
task_history += f"{i}. {status_indicator} {task_description}\n"
|
221
|
-
else:
|
222
|
-
status_indicator = "[success]" if task in completed_tasks else "[failed]"
|
223
|
-
task_history += f"{i}. {status_indicator} {task}\n"
|
224
|
+
indicator = f"[{status_value}]"
|
224
225
|
|
225
|
-
|
226
|
-
|
226
|
+
lines.append(f"{index}. {indicator} {description}")
|
227
|
+
|
228
|
+
task_block = TextBlock(text="\n".join(lines))
|
227
229
|
|
228
230
|
chat_history = chat_history.copy()
|
229
231
|
chat_history[-1] = message_copy(chat_history[-1])
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|