965 Commits
Author SHA1 Message Date
johnmalek312 fe71359e73 feat: ephemeral 2-state injection via deepcopy for all agents
Stop mutating message_history with stale device state and screenshots.
Instead, deepcopy the history before each LLM call and inject current
+ previous device state and screenshot into the disposable copy.

- FastAgent/CodeActAgent: add state rotation, deepcopy, and 2-state
  injection matching the manager's pattern
- ManagerAgent: rename previous state tag to <previous_device_state>
2026-02-27 17:49:23 +11:00
johnmalek312 23a29d12b0 feat: preserve thinking tokens 2026-02-27 17:27:50 +11:00
johnmalek312 0fa696abdd chore: bump version to 0.5.0.dev6 v0.5.0.dev6 2026-02-20 23:22:58 +11:00
johnmalek312 89df59aa18 feat: decouple screenshot streaming from trajectory persistence
Add DROIDRUN_STREAM_SCREENSHOTS env var (disabled by default) to enable
ScreenshotEvent emission without trajectory disk I/O. Screenshots can
now be streamed via the event system independently of TrajectoryWriter
serialization, PNG writes, and GIF generation.
2026-02-20 23:22:17 +11:00
johnmalek312 e1eb4f7103 chore: bump version to 0.5.0.dev5 v0.5.0.dev5 2026-02-20 20:05:07 +11:00
johnmalek312 e7ec67e38f Merge pull request #271 from droidrun/error_handling
feat: graceful device disconnect handling with DeviceDisconnectedError
2026-02-20 18:59:29 +11:00
johnmalek312 634bb403d0 fix: reuse _call() for screenshot response.read() instead of inline catch 2026-02-20 18:58:27 +11:00
johnmalek312 c205ec49f4 fix: cover screenshot response.read() disconnect and crash on get_date failure
- Wrap response.read() in screenshot() to catch SDK disconnect errors
  that occur after the initial request succeeds but during body read
- Remove try/except around get_date() in start_handler — if the device
  can't respond at startup, fail immediately instead of silently degrading
2026-02-20 18:45:55 +11:00
johnmalek312 edb55c99c3 feat: graceful device disconnect handling with DeviceDisconnectedError
Add DeviceDisconnectedError to the driver layer so cloud device
disconnects (409/timeout/connection errors) propagate cleanly instead
of crashing the workflow or being silently swallowed.

- CloudDriver: add max_retries=4 (~7.5s backoff), wrap all SDK calls
  via _call() helper that translates ConflictError/APIConnectionError/
  APITimeoutError into DeviceDisconnectedError, remove 7 silent
  try/except blocks that returned fake values on failure
- StateProvider: let DeviceDisconnectedError bypass retry loop; fix
  pre-existing bug where `from last_error` used str instead of exception
- DroidAgent: catch DeviceDisconnectedError in run_manager and
  execute_task, finalize with success=False and clear reason
- FastAgent/CodeActAgent: re-raise DeviceDisconnectedError from
  screenshot and get_state try/except blocks
- ManagerAgent/StatelessManagerAgent: re-raise DeviceDisconnectedError
  from screenshot; use shared_state.device_date (fetched once at
  startup) instead of calling get_date() every step
2026-02-20 18:22:35 +11:00
sleynsol 5bf65650ea docs: updated logo 2026-02-19 12:03:24 +01:00
johnmalek312 0cd2e3a692 feat: add ui_cls parameter to AndroidStateProvider
Allow custom UIState subclasses to be injected via ui_cls param,
enabling external stealth implementations without subclassing
the provider. Bump version to 0.5.0.dev4.
v0.5.0.dev4
2026-02-17 17:55:56 +11:00
johnmalek312 6047db18bb chore: increment project version to 0.5.0.dev3 v0.5.0.dev3 2026-02-17 15:53:21 +11:00
johnmalek312 639df43d51 feat: emit ToolExecutionEvent from ToolRegistry on every tool call
Replaces the old per-action event classes (TapActionEvent, SwipeActionEvent,
etc.) with a single generic ToolExecutionEvent streamed via llama-index
workflow Context after each tool execution.
2026-02-17 15:52:25 +11:00
johnmalek312 6dc24a15ae chore: increment project version to 0.5.0.dev2 v0.5.0.dev2 2026-02-17 15:27:46 +11:00
johnmalek312 341dee63ad refactor: move driver param from StateProvider.get_state() to __init__ 2026-02-17 15:27:19 +11:00
johnmalek312 12238d8750 Merge branch 'fast_agent' v0.5.0.dev1 2026-02-17 00:56:20 +11:00
johnmalek312 e11aa6a58a chore: increment project version to 0.5.0.dev1 2026-02-17 00:55:30 +11:00
johnmalek312 a0946738e5 chore: update vulnerable warning packages 2026-02-17 00:54:36 +11:00
johnmalek312 e9c5f71dc7 chore: update project version to 0.5.0.dev v0.5.0.dev 2026-02-17 00:51:34 +11:00
johnmalek312 b3c7b3654d chore: fix deps 2026-02-17 00:51:00 +11:00
johnmalek312 d034347c0a Merge pull request #270 from droidrun/fast_agent
Fast agent
2026-02-17 00:46:51 +11:00
johnmalek312 b6012c77ba chore: black formatter 2026-02-17 00:46:36 +11:00
johnmalek312 caa81a613b chore: cleanup trajectory saving logic 2026-02-17 00:45:57 +11:00
johnmalek312 63ae3b2838 feat: add dependency management for tools in ToolRegistry 2026-02-16 22:09:09 +11:00
johnmalek312 92d72175be fix: dont parse num as string 2026-02-16 21:52:57 +11:00
johnmalek312 869d84fc30 docs: update docs to match v5 2026-02-16 18:26:17 +11:00
johnmalek312 cc10667a69 chore: formatter 2026-02-16 17:59:35 +11:00
johnmalek312 6f3147e58e feat: enhance LangfuseSpanProcessor to support additional agents and input data 2026-02-16 17:57:41 +11:00
johnmalek312 09820429db style: format stealth files with black 2026-02-16 17:48:04 +11:00
johnmalek312 660c8f66f5 refactor: migrate StealthAdbTools to new driver/provider architecture
- Add StealthDriver (curved Bezier swipes via motionevent, word-by-word typing)
- Add StealthUIState (randomized tap coords within element safe zone)
- Add stealth flag to AndroidStateProvider and ToolsConfig
- Wire stealth mode in DroidAgent.start_handler
- Delete old StealthAdbTools (depended on deleted AdbTools base class)
2026-02-16 17:47:39 +11:00
johnmalek312 b1192f3cd4 style: format cloud.py with black 2026-02-16 17:34:05 +11:00
johnmalek312 03ef39e7a3 chore: make mobilerun-sdk a core dependency and cap Python at <3.14
- Move mobilerun-sdk from optional extra to core dependencies
- Move `from mobilerun import AsyncMobilerun` to top of cloud.py
- Export CloudDriver from driver __init__
- Set requires-python to >=3.11,<3.14
2026-02-16 17:33:48 +11:00
johnmalek312 479b8c88bf chore: delete old IOSTools (replaced by IOSDriver) 2026-02-16 17:27:50 +11:00
johnmalek312 767e40d4b3 feat: migrate IOSTools to new driver/provider architecture
- Add IOSDriver (httpx-based async HTTP REST driver)
- Add IOSStateProvider (parses iOS a11y tree into UIState)
- Branch DroidAgent.start_handler on config.device.platform
- Update exports in driver/, ui/, and ios/ __init__ files

Known TODOs (pre-existing iOS limitations, not regressions):
- input_text clear param ignored
- press_key only maps HOME (no BACK/ENTER on iOS)
- get_date not available
- drag not implemented
- Screen dimensions inferred from element bounds
- bundle_identifiers not configurable from config yet
2026-02-16 17:27:09 +11:00
johnmalek312 13487ef460 refactor: remove cloud tools module 2026-02-16 17:14:55 +11:00
johnmalek312 80d7ae720a chore: update cloud tools 2026-02-16 17:11:02 +11:00
johnmalek312 90de45f64f docs: default to v4 2026-02-16 17:10:31 +11:00
johnmalek312 f0c7c53992 fix: move inline imports to top of file and fix Manager custom tools filtering
- Move imports to top of file in droid_agent, tools_agent, manager_agent,
  state, app_starter_workflow
- Fix Manager agent to exclude standard atomic actions from custom_tools_descriptions
  (was redundantly listing click, swipe, etc. alongside actual custom tools)
- Fix focused_text undefined reference in both manager agents
- Fix unused variable in codeact_agent
- Add circular import guard comment in android driver
2026-02-16 15:17:39 +11:00
johnmalek312 c093dc1e54 fix: resolve bugs found during post-refactor testing
- Fix undefined `focused_text` variable in both manager agents (should be
  `self.shared_state.focused_text`)
- Remove unused `goal` variable in CodeActAgent
- Reject whitespace-only strings in `DroidAgentState.remember()`
- Fix `raise` without `from` in AndroidStateProvider
- Clean up import sorting and unused import
2026-02-16 14:17:47 +11:00
johnmalek312 467e9e966f chore: restore StealthAdbTools and IOSTools (broken, pending migration) 2026-02-16 13:29:35 +11:00
johnmalek312 8d0f32e367 refactor: delete old tools layer and MacroEvent system
Remove Tools/AdbTools/StealthAdbTools/IOSTools classes, MacroEvent
hierarchy, and legacy helper functions now replaced by DeviceDriver,
ToolRegistry, and RecordingDriver. Macro data flows from
RecordingDriver.log through trajectory writer as plain dicts.
2026-02-16 13:28:45 +11:00
johnmalek312 24e3dedb85 refactor: replace AdbTools with DeviceDriver/ToolRegistry/ActionContext architecture
Phases 1-3 of the tooling refactor:
- Add DeviceDriver, AndroidDriver, RecordingDriver for clean device I/O
- Add UIState, StateProvider for element resolution and state fetching
- Add ActionContext, ActionResult, ToolRegistry for tool dispatch
- Refactor all action functions to use ctx: ActionContext
- Update DroidAgent start_handler to create driver/registry/action_ctx
- Update executor, FastAgent, CodeActAgent to use registry.execute()
- Update manager agents to use action_ctx/state_provider
- Rename DroidAgentState fields: memory→manager_memory, manager_answer→answer
- Add fast_memory, finished, success fields to DroidAgentState
2026-02-16 13:00:11 +11:00
johnmalek312 0f7f541728 refactor: update action functions to return detailed error messages and results 2026-02-16 08:06:26 +11:00
johnmalek312 7566773f0a docs: fix event field names, custom tools format, and add missing config options in v5 docs 2026-02-13 21:17:00 +11:00
johnmalek312 842cf3a2f9 feat: add parallel_tools config, streamline FastAgent prompt, fix complete() param handling 2026-02-13 19:26:02 +11:00
johnmalek312 5d7085c08b feat: add batch_tools config, streamline FastAgent prompt, fix complete() param handling 2026-02-13 19:22:17 +11:00
johnmalek312 ef0b14934e docs: add v5 docs with version switcher, replace CodeAct with FastAgent
- Delete legacy v1 and v2 docs
- Create v5 docs as new latest version
- Configure Mintlify navigation.versions for v3/v4/v5 switcher
- Replace all CodeAct references with FastAgent (XML tool-calling)
- Update internal event types to match FastAgent implementation
- Fix all cross-references to point to /v5/
- Remove v3→v4 migration guide from v5
- Update SKILL.md and gen-docs-sdk-ref.sh to target v5
2026-02-13 14:40:37 +11:00
johnmalek312 ffa87c4dd0 refactor: reorganize FastAgent event handling for improved clarity and maintainability 2026-02-13 14:28:29 +11:00
johnmalek312 0864d94ccd refactor: streamline tool call handling in FastAgent, removing unused event classes and improving XML extraction 2026-02-13 04:56:28 +11:00
johnmalek312 74664c33c9 refactor: rename 'reason' parameter to 'message' in complete() function and update related documentation 2026-02-13 04:25:18 +11:00