495 Commits

Author SHA1 Message Date
Michał Pierzchała e248c87634 test: lock find click JSON response to exact deterministic key set (#183)
Add strict key-set assertions to find click handler tests to prevent
accidental schema drift in the machine-consumed JSON response.

Closes #182

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 20:28:10 +01:00
Michał Pierzchała 22deb54ddb feat: add --shutdown option to close command for iOS simulator teardown (#176)
* feat: add --shutdown option to close command for iOS simulator teardown (#172)

When --shutdown is passed, close ends the session then runs xcrun simctl
shutdown on the associated simulator. Shutdown result (success, exitCode,
stdout, stderr) is included in the JSON response data.

The option is silently ignored for non-simulator targets (physical iOS
devices, Android). A shutdownSimulator override is injected into
handleSessionCommands for testability.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs: document close --shutdown option for iOS simulator teardown

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: keep close --shutdown successful when simulator shutdown fails

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 20:00:10 +01:00
Michał Pierzchała bb06bafc65 feat: add ensure-simulator command for scoped iOS device sets (#179)
* feat: add ensure-simulator command for scoped iOS device sets (#169)

Adds a new first-class `ensure-simulator` command that ensures an iOS
simulator exists (and optionally boots it) inside a scoped device set,
without requiring custom simctl scripting outside agent-device.

Usage:
  agent-device ensure-simulator --device "iPhone 16" [--runtime <id>] [--boot] [--ios-simulator-device-set <path>]

JSON output includes udid, device, runtime, ios_simulator_device_set,
and whether the simulator was created vs reused.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs: document ensure-simulator in commands reference and skill

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 19:39:52 +01:00
Michał Pierzchała 427093d0b0 fix: return deterministic matched-target metadata for find click responses (#178)
* fix: return deterministic matched-target metadata for find click responses (#170)

On success, build the response from the matched snapshot node rather than
passing through whatever the underlying click/press handler returns.
Response now includes: ref, locator, query, and x/y derived from the
matched element's rect — all stable across runs.

Also makes `dispatch` injectable in `handleFindCommands` (matching the
pattern in `handleInteractionCommands`) and adds tests that assert the
deterministic shape and verify that non-deterministic platform runner
data does not bleed into the response.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs: document find click response shape in selectors and skill references

Add response shape documentation for `find "<query>" click --json` to:
- website/docs/docs/selectors.md (new "Response shape (click)" section)
- skills/agent-device/SKILL.md (guardrail note)
- skills/agent-device/references/snapshot-refs.md (new "find click response" section)

Follows the fix in #178 that made the response deterministic.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 19:39:31 +01:00
Michał Pierzchała 8d4c9149a6 fix: retry alert accept/dismiss on transient 'alert not found' errors (#177)
* fix: retry alert accept/dismiss on transient 'alert not found' errors

Adds a 2 s internal retry window for `alert accept` and `alert dismiss`
when the runner returns "alert not found" or "no alert". Errors from
other causes break the loop immediately and are re-thrown unchanged.
Also injects `runnerCommand` as an optional param to enable unit testing
without spawning a real runner.

Closes #171

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs: document alert accept/dismiss retry behaviour in skill and permissions reference

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 19:39:22 +01:00
Michał Pierzchała 43cb8cdb5d fix: enrich DEVICE_NOT_FOUND error for empty scoped iOS simulator sets (#175)
* fix: enrich DEVICE_NOT_FOUND error for empty scoped iOS simulator sets (#168)

When selectDevice finds no candidates and a simulatorSetPath context is
provided for iOS, throw a detailed error including the set path and a
suggested xcrun simctl --set ... create command to provision the first
simulator.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs: note enriched DEVICE_NOT_FOUND guidance for empty scoped iOS simulator sets

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 19:37:58 +01:00
Michał Pierzchała a51f8193f2 feat: include device_udid and ios_simulator_device_set in iOS JSON payloads (#180)
Add device identity fields to open, appstate, and session_list responses
for iOS targets, enabling isolation verification in concurrent multi-session
runs without extra simctl calls.

Closes #173

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 19:36:01 +01:00
Michał Pierzchała 5f941c13f6 refactor: split app-log backend into process/stream/platform modules (#161) (#174)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 18:46:22 +01:00
Michał Pierzchała 5628693aa3 fix: stabilize iOS simulator screenshot capture (#167)
* fix: stabilize iOS simulator screenshot capture

* refactor: extract iOS screenshot module

* fix: fallback to runner for flaky iOS simulator screenshots

* chore: harden simulator runner screenshot path resolution

* refactor: simplify simulator screenshot fallback flow
2026-03-03 18:15:49 +01:00
Michał Pierzchała d269da37e3 refactor: split dispatch into command-family modules (#157) (#164)
Extract resolveTargetDevice, series/jitter helpers, and push payload
parsing into dedicated modules to reduce dispatch.ts from ~706 to ~564 LOC.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 18:11:14 +01:00
Michał Pierzchała c6910823df fix: harden daemon startup retries (#166) 2026-03-03 17:21:43 +01:00
Michał Pierzchała d38ddc6bb0 refactor: split iOS runner-client into focused modules (#163)
Break the 1129-LOC runner-client.ts into cohesive modules:
- runner-errors.ts: error classification, hints, error builders
- runner-xctestrun.ts: xctestrun discovery, build, preparation, build settings
- runner-transport.ts: HTTP transport, endpoint resolution, connection waiting
- runner-session.ts: session lifecycle, process management, device validation
- runner-client.ts: thin orchestration + re-exports (preserves all public API)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 14:44:11 +01:00
Michał Pierzchała b6b7c6228a refactor: split session replay helpers into focused modules (#153) 2026-03-03 14:41:35 +01:00
Michał Pierzchała 1a3ae62510 refactor: split Android platform module into focused submodules (#162)
Break down the monolithic `src/platforms/android/index.ts` (~1533 LOC) into
focused submodules to improve maintainability and targeted code review.

New submodules:
- `adb.ts` (21 LOC) — shared helpers: adbArgs, ensureAdb, sleep, isClipboardShellUnsupported
- `app-lifecycle.ts` (507 LOC) — app resolve/list/open/close/install/reinstall/appstate + bundletool
- `input-actions.ts` (378 LOC) — press/swipe/longPress/type/fill/scroll/scrollIntoView
- `device-input-state.ts` (184 LOC) — keyboard state/dismiss + clipboard read/write
- `settings.ts` (314 LOC) — appearance/permission/fingerprint/wifi/airplane/location
- `notifications.ts` (61 LOC) — push notification broadcast
- `snapshot.ts` (98 LOC) — snapshot + screenshot + UI hierarchy dump
- `index.ts` (43 LOC) — thin re-export layer preserving all public exports

Closes #154

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 14:41:10 +01:00
Michał Pierzchała 674a221865 0.7.6 v0.7.6 2026-03-03 14:14:47 +01:00
Michał Pierzchała 9b0a3dee6e feat: add install command with ipa/aab support (#151)
* feat: add install command for in-place app deployment

* chore: document install vs reinstall in quick start and skill

* docs: clarify install format support and limits

* feat: support ipa and aab app installation

* feat: improve install flexibility for ipa and aab

* fix: retry iOS simulator screenshot surface timeouts

* refactor: simplify install resolution and boot handling
2026-03-03 14:14:23 +01:00
Michał Pierzchała 6c78472420 fix: harden iOS relaunch/close lifecycle to reduce simulator flakes (#152)
* fix: harden iOS relaunch and close runner lifecycle

* refactor: dedupe iOS relaunch close flow and tighten tests
2026-03-03 14:00:14 +01:00
Michał Pierzchała 83b757d883 fix: quote dogfood skill YAML description 2026-03-02 09:36:55 +01:00
Michał Pierzchała e44eeab976 0.7.5 v0.7.5 2026-02-28 14:15:07 +01:00
Michał Pierzchała 8c30032ae4 perf: speed up iOS runner build-for-testing (#150)
* perf: speed up runner build-for-testing

* chore: drop redundant active-arch runner override

* test: run iOS simulator integration on CI by default
2026-02-28 14:13:39 +01:00
Michał Pierzchała 9b443c526f refactor: split RunnerTests into focused files (#149)
* refactor: split RunnerTests into focused files

* chore: remove dead interaction label helper
2026-02-28 13:38:59 +01:00
Michał Pierzchała 97f59254bb fix: make snapshot --raw use target app tree on physical iOS (#148)
* fix: use snapshots for raw iOS tree traversal

Fixes #147

* refactor: unify snapshot hittable computation across modes

* refactor: account for cousin occlusion in hittable

* refactor: tighten snapshot occlusion heuristic
2026-02-28 12:55:41 +01:00
Michał Pierzchała 33d918d0f3 chore: cleanup old bundleIDs 2026-02-26 16:48:16 +01:00
Michał Pierzchała e248bf38c0 0.7.4 v0.7.4 2026-02-26 16:40:51 +01:00
Michał Pierzchała 14de55c9b7 fix: support configurable iOS runner bundle IDs (#146) 2026-02-26 16:40:24 +01:00
Michał Pierzchała ed5dd7bc28 0.7.3 v0.7.3 2026-02-26 11:48:55 +01:00
Michał Pierzchała b3ad24f527 feat: add Android keyboard status and dismiss command (#144) 2026-02-26 11:47:46 +01:00
Michał Pierzchała 3c6be3c715 0.7.2 v0.7.2 2026-02-26 10:44:55 +01:00
Michał Pierzchała 890ceefe90 feat: add trigger-app-event aliases and routing (#134)
* feat: add trigger app event aliases and routing

* chore: remove redundant trigger normalization in session handler

* chore: remove trigger command aliases
2026-02-26 10:44:46 +01:00
Michał Pierzchała 4a38bb0b74 feat: add simulator-set and Android allowlist isolation (#143)
* feat: add simulator-set and Android allowlist isolation

* chore: document isolation scopes in agent-device skills
2026-02-26 10:38:23 +01:00
Michał Pierzchała 0c4b1251c6 fix: prevent Android fill/type truncation with + and @ (#142)
* fix: encode Android shell text input for special ASCII

* fix: harden android fill fallback strategy

* chore: simplify android fill fallback flow
2026-02-26 10:37:31 +01:00
Michał Pierzchała 2a86f52b05 fix: harden press @ref bounds recovery (#141) 2026-02-26 10:23:14 +01:00
Michał Pierzchała 74eee5a32e Fix Android boot completion and emulator launch modes (#138)
* Fix Android boot completion and headless emulator launch

* Refactor Android boot fast lookup for testability

* Avoid extra target probes in Android boot fast lookup

* Simplify Android boot path in session handler

* fix: enforce boot target and headless validation
2026-02-26 10:20:51 +01:00
Michał Pierzchała cfc56e8b63 docs: add agent skill guidance for remote tenant leases (#137) 2026-02-25 18:34:36 +01:00
Michał Pierzchała 2e0f5da4b9 0.7.1 v0.7.1 2026-02-25 18:25:35 +01:00
Michał Pierzchała b685a0b259 Add remote HTTP daemon mode with lease admission controls (#136)
* fix: add daemon remote HTTP server mode with isolation controls

* feat: add tenant lease lifecycle and admission control

* refactor: simplify lease scope and rpc method routing

* fix: correct smoke expectations for close without session
2026-02-25 18:25:15 +01:00
Michał Pierzchała 803ba256d4 Add Touch ID and Android fingerprint simulation for settings (#135)
* fix: add touchid/fingerprint settings simulation and harden error handling

* chore: tighten agent docs and simplify iOS biometric settings flow
2026-02-25 17:38:43 +01:00
Michał Pierzchała 18364bd04a 0.7.0 v0.7.0 2026-02-25 16:28:38 +01:00
Michał Pierzchała e8e92dc7b8 feat: port dogfood skill to agent-device (#133)
* feat: add agent-device dogfood skill package

* Apply suggestion from @thymikee
2026-02-25 16:27:25 +01:00
Michał Pierzchała f512b7d69c feat: add network dump command for session app traffic (#120)
* feat: add network dump command for session app traffic

* fix: restore cli branch block after rebase conflict
2026-02-25 16:17:08 +01:00
Nick Dima 43aae1d30a fix(ios): correctly implement runner fallback for physical device screenshots (#132)
* fix(ios): use XCTest runner for screenshots on physical devices

`xcrun devicectl device screenshot` was removed in Xcode 26.x, causing
`agent-device screenshot` to fail on physical iOS devices with exit code 64.

This fix routes physical device screenshots through the AgentDeviceRunner
XCTest runner (already used for snapshot/interaction commands) instead:

- Add `screenshot` command to the Swift runner's `CommandType` enum
- Implement the handler using `XCUIScreen.main.screenshot()`, writing a
  timestamped PNG to the app's temp directory (returned as `tmp/<file>`)
- If `appBundleId` is provided, activate the target app before capturing
  so the screenshot shows the app under test rather than the runner itself
- In `screenshotIos()`, pass `appBundleId` to the runner command then pull
  the file back to the host via `xcrun devicectl device copy from` (same
  mechanism used by the recording feature)
- Thread `appBundleId` through `Interactor.screenshot()` → `dispatch.ts`
  → `screenshotIos()` so the active session's app is always captured
- Extract `IOS_RUNNER_CONTAINER_BUNDLE_IDS` to `runner-client.ts` so it
  can be shared between `apps.ts` and `record-trace.ts`

Fixes: screenshots failing with "Failed to capture iOS screenshot" on
devices using Xcode 26.x / devicectl 506.6+

* fix: clean up iOS screenshot fallback follow-ups

---------

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
2026-02-25 16:11:01 +01:00
Michał Pierzchała 8123117e6d fix: fallback iOS/tvOS screenshot to runner when devicectl screenshot is unavailable (#130) 2026-02-25 15:34:14 +01:00
Michał Pierzchała ef20dea6bc feat: add AndroidTV and tvOS target support (#125)
* feat: add AndroidTV and tvOS target support

* feat: enable tvOS runner interactions

* refactor: unify apple target handling and tvOS capability gates

* refactor: remove hardcoded tvOS app-switcher sleep

* fix: align tvOS capabilities and docs for simulator-only helpers

* feat: improve AppleTV and AndroidTV physical device detection

* refactor: simplify tv target detection helpers
2026-02-25 14:55:54 +01:00
Michał Pierzchała 996d1fca2f feat: add session perf metrics command (#121)
* feat: add session perf metrics command

* refactor: simplify open perf result shaping

* docs: improve perf guidance in docs and skill

* docs: split perf guidance into skill reference
2026-02-25 13:49:59 +01:00
Michał Pierzchała ab338263ed feat: add clipboard read and write commands (#122) 2026-02-25 13:01:33 +01:00
Michał Pierzchała 13b2e2c83b chore: resolve merge marker in agent-device skill 2026-02-24 17:56:02 +01:00
Michał Pierzchała 0b9ab86fc5 0.6.3 v0.6.3 2026-02-24 17:35:08 +01:00
Michał Pierzchała 66b0bdba31 fix: expose push notification simulation (#109)
* fix: expose push notification simulation across iOS and Android

* refactor: share push JSON detection and clean extras validation

* fix: harden push payload path handling in session

* refactor: consolidate push payload source resolution
2026-02-24 17:34:28 +01:00
Nils Fischer 8660b0433f feat: add settings appearance command (#119)
* feat: add settings appearance command

- add appearance light|dark|toggle support to settings command

- implement iOS simulator and Android night mode handlers

- cover parser/handler/platform behavior with unit tests

- update README, docs, and agent-device skill guidance

* test: align settings usage assertions

- expect split settings usage lines for wifi/location and appearance

* fix: harden settings appearance parsing and dedupe usage contract

---------

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
2026-02-24 17:25:56 +01:00
Michał Pierzchała ea7d60a0a4 0.6.2 v0.6.2 2026-02-24 16:57:15 +01:00