agent-device 0.21.18 → 0.21.20

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.
Files changed (205) hide show
  1. package/android/ime-helper/dist/{agent-device-android-ime-helper-0.21.18.apk → agent-device-android-ime-helper-0.21.20.apk} +0 -0
  2. package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.20.apk.sha256 +1 -0
  3. package/android/ime-helper/dist/{agent-device-android-ime-helper-0.21.18.manifest.json → agent-device-android-ime-helper-0.21.20.manifest.json} +4 -4
  4. package/android/snapshot-helper/dist/{agent-device-android-snapshot-helper-0.21.18.apk → agent-device-android-snapshot-helper-0.21.20.apk} +0 -0
  5. package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.20.apk.sha256 +1 -0
  6. package/android/snapshot-helper/dist/{agent-device-android-snapshot-helper-0.21.18.manifest.json → agent-device-android-snapshot-helper-0.21.20.manifest.json} +6 -6
  7. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunner/AgentDeviceRunnerApp.m +12 -0
  8. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandJournal.swift +1 -14
  9. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Interaction.swift +14 -16
  10. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Models.swift +40 -14
  11. package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotModels.swift +20 -5
  12. package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotPresentationProjection.swift +2 -15
  13. package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotVisibilityFold.swift +10 -25
  14. package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotVisibilityFoldProjection.swift +1 -18
  15. package/dist/src/adapter.js +1 -1
  16. package/dist/src/adb-executor.js +2 -2
  17. package/dist/src/adb-failure.js +2 -1
  18. package/dist/src/agent-browser-lifecycle.js +1 -1
  19. package/dist/src/agent-browser-process-record.js +1 -1
  20. package/dist/src/agent-browser-provider.js +1 -1
  21. package/dist/src/agent-browser-tool.js +1 -1
  22. package/dist/src/agent-device-client.js +2 -2
  23. package/dist/src/ai-sdk.js +1 -1
  24. package/dist/src/alert-runtime.js +1 -1
  25. package/dist/src/alert.js +1 -0
  26. package/dist/src/android-input-ownership.js +1 -1
  27. package/dist/src/android.js +1 -1
  28. package/dist/src/app-launch.js +2 -2
  29. package/dist/src/app-lifecycle.js +1 -1
  30. package/dist/src/app-log-runtime2.js +1 -1
  31. package/dist/src/app-resolution.js +2 -2
  32. package/dist/src/apple-runner-platform.js +1 -1
  33. package/dist/src/archive.js +2 -2
  34. package/dist/src/browser-launch.js +1 -1
  35. package/dist/src/cache.js +1 -1
  36. package/dist/src/catalog.js +1 -1
  37. package/dist/src/cli-config.js +1 -1
  38. package/dist/src/cli-help.js +287 -301
  39. package/dist/src/cli-runner.js +1 -1
  40. package/dist/src/cli.js +4 -4
  41. package/dist/src/client-metro-companion.js +1 -1
  42. package/dist/src/client-metro.js +1 -1
  43. package/dist/src/client-types.d.ts +25 -6
  44. package/dist/src/{scroll-command.d.ts → cloud-artifacts.d.ts} +242 -238
  45. package/dist/src/command-metadata.js +1 -1
  46. package/dist/src/command-schema.js +3 -3
  47. package/dist/src/command-tools.js +2 -2
  48. package/dist/src/command.js +1 -1
  49. package/dist/src/config.js +1 -1
  50. package/dist/src/connection-runtime.js +1 -1
  51. package/dist/src/contracts.js +1 -1
  52. package/dist/src/daemon-client-lease-beat.js +1 -1
  53. package/dist/src/daemon-client-lifecycle.js +1 -1
  54. package/dist/src/daemon-client-transport.js +1 -1
  55. package/dist/src/daemon-policy-file.js +1 -1
  56. package/dist/src/daemon-registration.js +1 -1
  57. package/dist/src/debug-symbols-facade.js +3 -3
  58. package/dist/src/device-claim-inspection.js +1 -1
  59. package/dist/src/device-claim-rule.js +1 -1
  60. package/dist/src/device-inventory-context.js +1 -1
  61. package/dist/src/device-rotation.js +1 -1
  62. package/dist/src/device-session.js +1 -1
  63. package/dist/src/devicectl.js +1 -1
  64. package/dist/src/diagnostics.js +1 -1
  65. package/dist/src/diagnostics2.js +1 -1
  66. package/dist/src/display-inventory.js +1 -1
  67. package/dist/src/durable-resource.js +1 -1
  68. package/dist/src/engine-eval-script.js +1 -1
  69. package/dist/src/error.js +1 -1
  70. package/dist/src/exec.js +1 -1
  71. package/dist/src/find.js +1 -1
  72. package/dist/src/finders.js +1 -1
  73. package/dist/src/generic-settle.js +1 -1
  74. package/dist/src/gesture-runtime.js +1 -1
  75. package/dist/src/hdc.js +1 -1
  76. package/dist/src/helper.js +2 -2
  77. package/dist/src/host.js +1 -1
  78. package/dist/src/index.d.ts +3 -3
  79. package/dist/src/index.js +1 -1
  80. package/dist/src/input-actions2.js +2 -2
  81. package/dist/src/install-source-network-transport.js +1 -1
  82. package/dist/src/interaction-positionals.js +1 -1
  83. package/dist/src/interaction-ref-policy.js +1 -1
  84. package/dist/src/interaction.js +1 -1
  85. package/dist/src/interaction2.js +1 -1
  86. package/dist/src/interactor.js +5 -5
  87. package/dist/src/interactor2.js +1 -1
  88. package/dist/src/internal/bin.js +1 -1
  89. package/dist/src/internal/daemon.js +2 -2
  90. package/dist/src/internal/png-worker.js +1 -1
  91. package/dist/src/ios-snapshot-acquisition.js +1 -1
  92. package/dist/src/ios-snapshot-engine.js +1 -1
  93. package/dist/src/launch-confirmation.js +1 -0
  94. package/dist/src/lease.js +1 -1
  95. package/dist/src/limrun-runtime-dependencies.js +1 -1
  96. package/dist/src/limrun.d.ts +50 -42
  97. package/dist/src/local-interactor-operation-set.js +1 -1
  98. package/dist/src/mechanics.js +16 -17
  99. package/dist/src/mobile-snapshot-semantics.js +1 -1
  100. package/dist/src/observe-until.js +1 -0
  101. package/dist/src/overlay.js +2 -2
  102. package/dist/src/owner-identity.js +1 -1
  103. package/dist/src/parameterized-recorded-fill.js +1 -1
  104. package/dist/src/perf-facade.js +1 -1
  105. package/dist/src/perf-runtime-operation-builder.js +1 -1
  106. package/dist/src/perf-runtime-plan.js +1 -1
  107. package/dist/src/perf-target.js +1 -1
  108. package/dist/src/physical-device-control.js +1 -1
  109. package/dist/src/platform-request-scope.js +1 -1
  110. package/dist/src/platform-runtime-android-adb-host.js +1 -1
  111. package/dist/src/platform-runtime-app-log-process.js +1 -1
  112. package/dist/src/platform-runtime-host.js +1 -1
  113. package/dist/src/platform-runtime-managed-owner.js +1 -1
  114. package/dist/src/platform-runtime-operation-host.js +2 -2
  115. package/dist/src/platform-runtime-runtime-hints.js +1 -1
  116. package/dist/src/platform-runtime-screen-recording-apple-simulator-host.js +1 -1
  117. package/dist/src/platform-runtime-screen-recording-finalizer-host.js +1 -1
  118. package/dist/src/platform-runtime-screen-recording-process-host.js +1 -1
  119. package/dist/src/platform-runtime.js +1 -1
  120. package/dist/src/platform-runtime2.js +1 -1
  121. package/dist/src/png-worker-client.js +1 -1
  122. package/dist/src/provider-device-admission.js +1 -0
  123. package/dist/src/provider-session-ownership.js +1 -1
  124. package/dist/src/provider-webdriver.js +1 -1
  125. package/dist/src/proxy.js +1 -1
  126. package/dist/src/react-native.js +1 -1
  127. package/dist/src/record-runtime.js +1 -1
  128. package/dist/src/registry.js +52 -36
  129. package/dist/src/replay-divergence.js +1 -1
  130. package/dist/src/replay.js +1 -1
  131. package/dist/src/request-admission.js +1 -1
  132. package/dist/src/request-runtime-binding.js +1 -1
  133. package/dist/src/result-serialization.js +1 -1
  134. package/dist/src/runner-cache-metadata.js +3 -3
  135. package/dist/src/runner-client.js +1 -1
  136. package/dist/src/runner-dev-tools-security.js +1 -1
  137. package/dist/src/runner-device-readiness.js +1 -1
  138. package/dist/src/runner-disposal.js +1 -1
  139. package/dist/src/runner-error-classification.js +3 -3
  140. package/dist/src/runner-exchange.js +1 -1
  141. package/dist/src/runner-operations-facade.js +1 -1
  142. package/dist/src/runner-session-types.js +1 -1
  143. package/dist/src/runner-start-budget.js +1 -1
  144. package/dist/src/runner-startup-transport.js +1 -1
  145. package/dist/src/runner-xctestrun.js +1 -1
  146. package/dist/src/runner.js +1 -1
  147. package/dist/src/runtime-admission.js +1 -0
  148. package/dist/src/runtime.js +1 -1
  149. package/dist/src/runtime10.js +2 -2
  150. package/dist/src/runtime2.js +2 -2
  151. package/dist/src/runtime3.js +1 -1
  152. package/dist/src/runtime4.js +5 -5
  153. package/dist/src/runtime5.js +1 -1
  154. package/dist/src/runtime6.js +1 -1
  155. package/dist/src/runtime7.js +1 -1
  156. package/dist/src/runtime8.js +1 -1
  157. package/dist/src/runtime9.js +1 -1
  158. package/dist/src/screen-recording-resource-recovery.js +1 -1
  159. package/dist/src/screenshot-result.js +1 -1
  160. package/dist/src/screenshot-runtime.js +1 -1
  161. package/dist/src/screenshot3.js +1 -1
  162. package/dist/src/script.js +1 -1
  163. package/dist/src/scroll-gesture.js +1 -1
  164. package/dist/src/sdk-batch-runner.js +2 -2
  165. package/dist/src/sdk-batch.js +1 -1
  166. package/dist/src/sdk-contracts.d.ts +18 -2
  167. package/dist/src/sdk-contracts.js +2 -2
  168. package/dist/src/sdk-finders.js +1 -1
  169. package/dist/src/sdk-selectors.d.ts +13 -4
  170. package/dist/src/sdk-selectors.js +1 -1
  171. package/dist/src/selection.js +0 -0
  172. package/dist/src/selector-pipeline-policy.js +1 -0
  173. package/dist/src/selector-runtime.js +1 -1
  174. package/dist/src/selectors.js +1 -1
  175. package/dist/src/server.js +1 -1
  176. package/dist/src/session-runtime-admission.js +1 -1
  177. package/dist/src/session-snapshot.js +1 -1
  178. package/dist/src/session-store.js +3 -3
  179. package/dist/src/session2.js +5 -5
  180. package/dist/src/simulator-boot.js +1 -1
  181. package/dist/src/simulator.js +1 -1
  182. package/dist/src/snapshot-desktop-projection.js +1 -1
  183. package/dist/src/snapshot-runtime-binding.js +1 -1
  184. package/dist/src/snapshot-runtime.js +1 -1
  185. package/dist/src/snapshot-state.js +1 -1
  186. package/dist/src/snapshot4.js +1 -1
  187. package/dist/src/src.js +1 -1
  188. package/dist/src/src7.js +1 -1
  189. package/dist/src/target-evidence.js +1 -1
  190. package/dist/src/text-entry-focus.js +1 -1
  191. package/dist/src/tool-provider.js +3 -3
  192. package/dist/src/tool-provider2.js +1 -1
  193. package/dist/src/tool-provider3.js +1 -1
  194. package/dist/src/toolchain-probe.js +1 -1
  195. package/dist/src/touch-runtime.js +1 -1
  196. package/dist/src/touch-runtime2.js +1 -0
  197. package/dist/src/tree.js +1 -1
  198. package/dist/src/type-text-runtime.js +1 -1
  199. package/dist/src/update-check.js +1 -1
  200. package/dist/src/video.js +1 -1
  201. package/package.json +1 -1
  202. package/server.json +2 -2
  203. package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.18.apk.sha256 +0 -1
  204. package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.18.apk.sha256 +0 -1
  205. package/dist/src/runner-command-traits.js +0 -1
@@ -1,5 +1,273 @@
1
- import{r as e}from"./rolldown-runtime.js";import{_r as t}from"./sdk-batch.js";import{i as n}from"./catalog.js";import{r}from"./back-mode.js";import{C as i,N as a,S as o}from"./registry.js";import{a as s}from"./version.js";import{n as c,r as l}from"./command-schema.js";import{n as u}from"./cli-command-aliases.js";const d=[`Flows: launchApp (with clearState, permissions, and Apple-only launch arguments; permissions apply after state clearing but before launch, and a launchApp without permissions touches nothing — there is no silent all: allow default); setPermissions (mid-flow permission grants, denials, and resets; all resolves in the backend — one simctl call on iOS, the declared permissions on Android — with specific entries overriding after it); runFlow file/inline with platform, visibility, and limited boolean conditions; onFlowStart/onFlowComplete; repeat.times and retry.`,`Interactions: tapOn, doubleTapOn, longPressOn, inputText on the focused element, eraseText, openLink, hideKeyboard, basic pressKey, and back; selector targets poll until available and support recursive index, childOf, above, below, leftOf, rightOf, containsChild, containsDescendants, points, and optional; outer command labels are metadata, not target selectors.`,'Assertions and navigation: assertVisible, assertNotVisible, assertTrue (literal values and ${VAR} lookups only; "", "false", "0", "null", and "undefined" are falsy, everything else is truthy), extendedWaitUntil, scroll, scrollUntilVisible, absolute/percentage/target swipe, takeScreenshot, waitForAnimationToEnd, clearState, and stopApp.',`Scripts: ordered runScript file/env scripts with http.post, json, and output variables; evalScript inline expressions run flow-scoped JavaScript and write output.* leaves for later steps.`],f=[`Permissions: every entry is one settings permission call, applied in order with all first; the step stops at the first entry the selected platform refuses, earlier entries stay applied, and the error names what landed. Android’s only allow level is while-in-use, so location: inuse and location: never mean allow and deny there, while location: always and photos: limited are Apple-only and fail. On iOS, which service a runtime changes is simctl privacy’s own verdict: current runtimes refuse a targeted notifications change and leave notifications untouched under all.`,`Runtime: iOS and Android only; launchApp.clearState and standalone clearState support Android and iOS simulators, launch arguments are Apple-only, and other standalone device utility/state commands are unsupported.`,"Expressions: evalScript is the only command whose payload is evaluated as JavaScript (flow env and prior output leaves are string-typed); with that exception, fields stay literal or ${VAR} lookup-only — assertTrue supports literals and bare lookups, repeat.while is unsupported, and other expression-shaped payloads fail loud.",`Environment: flow env is the default, AD_VAR_* overrides it, and CLI -e KEY=VALUE wins over both.`,`Failure diagnostics: resolved targets and runFlow paths are rendered, while inputText payloads remain hidden; do not place secrets in diagnostic identifiers.`,`Trust: runScript and evalScript execute flow scripts in-process via node:vm, which is not a security sandbox; runScript may make http.post network requests and its output keys cannot contain a dot. evalScript is refused outright for a flow accepted over the daemon’s remote HTTP surface, since that context can escape to the host.`,`Errors and tracking: unsupported commands and fields fail with source context when available; open a focused issue only when implementation work is planned.`];function p(){return[`Supported subset:`,...d.map(e=>` - ${e}`),``,`Boundaries:`,...f.map(e=>` - ${e}`)].join(`
2
- `)}function m(e){let t=e.endsWith(`?`),n=t?e.slice(0,-1):e;return t?`[${n}]`:`<${n}>`}function h(e){return r().filter(t=>t.key===e)}function g(e){if(!e.usageHidden)return e.usageLabel??e.names[0]}function _(e){return(e??[]).flatMap(e=>h(e).map(g).filter(e=>e!==void 0).map(e=>`[${e}]`))}function v(e,t){return[t.usageOverride??[e,...(t.positionalArgs??[]).map(m)].join(` `),..._(t.usageFlags??t.allowedFlags)].join(` `)}function y(){return`agent-device <command> [args] [--json]
1
+ import{r as e}from"./rolldown-runtime.js";import{vr as t}from"./sdk-batch.js";import{i as n}from"./catalog.js";import{r}from"./back-mode.js";import{C as i,P as a,c as o,w as s}from"./registry.js";import{a as c}from"./version.js";import{n as l,r as u}from"./command-schema.js";import{n as d}from"./cli-command-aliases.js";const f=[`Flows: launchApp (with clearState, permissions, and Apple-only launch arguments; permissions apply after state clearing but before launch, and a launchApp without permissions touches nothing — there is no silent all: allow default); setPermissions (mid-flow permission grants, denials, and resets; all resolves in the backend — one simctl call on iOS, the declared permissions on Android — with specific entries overriding after it); runFlow file/inline with platform, visibility, and limited boolean conditions; onFlowStart/onFlowComplete; repeat.times and retry.`,`Interactions: tapOn, doubleTapOn, longPressOn, inputText on the focused element, eraseText, openLink, hideKeyboard, basic pressKey, and back; selector targets poll until available and support recursive index, childOf, above, below, leftOf, rightOf, containsChild, containsDescendants, points, and optional; outer command labels are metadata, not target selectors.`,'Assertions and navigation: assertVisible, assertNotVisible, assertTrue (literal values and ${VAR} lookups only; "", "false", "0", "null", and "undefined" are falsy, everything else is truthy), extendedWaitUntil, scroll, scrollUntilVisible, absolute/percentage/target swipe, takeScreenshot, waitForAnimationToEnd, clearState, and stopApp.',`Scripts: ordered runScript file/env scripts with http.post, json, and output variables; evalScript inline expressions run flow-scoped JavaScript and write output.* leaves for later steps.`],p=[`Permissions: every entry is one settings permission call, applied in order with all first; the step stops at the first entry the selected platform refuses, earlier entries stay applied, and the error names what landed. Android’s only allow level is while-in-use, so location: inuse and location: never mean allow and deny there, while location: always and photos: limited are Apple-only and fail. On iOS, which service a runtime changes is simctl privacy’s own verdict: current runtimes refuse a targeted notifications change and leave notifications untouched under all.`,`Runtime: iOS and Android only; launchApp.clearState and standalone clearState support Android and iOS simulators, launch arguments are Apple-only, and other standalone device utility/state commands are unsupported.`,"Expressions: evalScript is the only command whose payload is evaluated as JavaScript (flow env and prior output leaves are string-typed); with that exception, fields stay literal or ${VAR} lookup-only — assertTrue supports literals and bare lookups, repeat.while is unsupported, and other expression-shaped payloads fail loud.",`Environment: flow env is the default, AD_VAR_* overrides it, and CLI -e KEY=VALUE wins over both.`,`Failure diagnostics: resolved targets and runFlow paths are rendered, while inputText payloads remain hidden; do not place secrets in diagnostic identifiers.`,`Trust: runScript and evalScript execute flow scripts in-process via node:vm, which is not a security sandbox; runScript may make http.post network requests and its output keys cannot contain a dot. evalScript is refused outright for a flow accepted over the daemon’s remote HTTP surface, since that context can escape to the host.`,`Errors and tracking: unsupported commands and fields fail with source context when available; open a focused issue only when implementation work is planned.`];function m(){return[`Supported subset:`,...f.map(e=>` - ${e}`),``,`Boundaries:`,...p.map(e=>` - ${e}`)].join(`
2
+ `)}function h(e){let t=e.endsWith(`?`),n=t?e.slice(0,-1):e;return t?`[${n}]`:`<${n}>`}function g(e){return r().filter(t=>t.key===e)}function _(e){if(!e.usageHidden)return e.usageLabel??e.names[0]}function v(e){return(e??[]).flatMap(e=>g(e).map(_).filter(e=>e!==void 0).map(e=>`[${e}]`))}function y(e,t){return[t.usageOverride??[e,...(t.positionalArgs??[]).map(h)].join(` `),...v(t.usageFlags??t.allowedFlags)].join(` `)}const b=`Wait failure contract:
3
+ Read --json error.details.reason.
4
+ wait_target_absent: readable capture, no match.
5
+ wait_target_present: absence timeout; details.matches/firstMatch.
6
+ predicate_failed: no valid absence capture; observation/diagnostic kept.
7
+ wait_capture_stalled: no readable capture by deadline -- retriable.
8
+ wait_deadline_exceeded: later capture exhausted budget after a readable one.
9
+ wait_readiness_exhausted: readiness deadline; details.readinessPhase -- retriable.
10
+ wait_runner_restart_exhausted: restart deadline -- retriable.
11
+ wait_landmark_identity_mismatch: replay guard: selector matched, recorded identity differed.
12
+ wait_stable_timeout: no stable UI -- not absence.
13
+ `,x={"manual-qa":{summary:`Follow manual test scripts with exact interactions and verification`,body:`agent-device help manual-qa
14
+
15
+ Use this when asked to follow a manual QA script, test case, checklist, acceptance flow, or user-provided instructions.
16
+
17
+ Contract:
18
+ Execute the script. Do not explore unrelated screens, read app source, invent missing requirements, or broaden scope.
19
+ Stop and report ambiguity when a required target or expected result is not visible after the documented recovery steps.
20
+
21
+ Loop:
22
+ 1. Open the requested app; use --relaunch only when the script needs fresh state.
23
+ 2. Run snapshot -i to get current refs for the next step.
24
+ 3. Run press/fill/click/longpress <ref-or-selector> --settle for each mutating step.
25
+ 4. Treat a settled:true diff as the next observation. Do not add wait stable or another snapshot when the diff already shows the next target or expected result.
26
+ 5. If --settle prints not settled, follow its hint before the next ref-based action.
27
+ 6. Verify named expectations with wait text/selector/absent, get, is, find, or the settled diff. A bare screenshot/snapshot is not verification for a named expectation.
28
+ 7. Close the session when the script ends.
29
+
30
+ Command shapes:
31
+ agent-device open com.example.app --relaunch
32
+ agent-device open https://example.com/deep-link
33
+ agent-device snapshot -i
34
+ agent-device press @e12 --settle
35
+ agent-device press 'label="Follow"' --settle
36
+ agent-device fill @e13 "qa@example.com" --settle
37
+ agent-device wait text "Order placed" 3000
38
+ agent-device wait absent 'label="Loading..."' 3000
39
+ agent-device close
40
+ --relaunch forces fresh app state; a deep link/URL open does not need it. Labels with an apostrophe or quote (label="Don't leave") are shell-quoting hazards: prefer the @ref from the latest snapshot/settle output over quoting the literal label.
41
+
42
+ Targets:
43
+ Prefer refs from the latest snapshot -i or settled diff. Use durable selectors when the label/id is known: label="Search", id="submit", role=button label="Follow". If label text matches both a field and its caption, target the field with label="Email" editable=true.
44
+ For text fields, use fill <target> <text> --settle to replace the field value; use type only to append to an already-focused field.
45
+ Do not use placeholders such as @ref, @eN, <button>, or <selector> in a final command plan. If the ref is unknown, first run snapshot -i.
46
+ Coordinates are fallback-only after refs/selectors fail or accessibility omits the target; use screenshot or snapshot -i --json to choose a visible center point.
47
+
48
+ Recovery:
49
+ Network/typeahead result missing: wait text "Expected result" or wait <selector>.
50
+ A target that should be gone/disappear: use wait absent <selector>; wait exists ... is rejected in favor of the plain selector wait.
51
+ Keyboard visible over the next target: an element whose center sits behind the keyboard is refused with tap_keyboard_occludes_target, because the touch would activate a key instead of the target. End editing first -- the app's own Done/Cancel control, or keyboard enter when submission is wanted -- then retry. A target whose center stays above the keys still presses; a raw coordinate behind the keyboard taps anyway and reports the reason in warning.
52
+ Sparse or recovered accessibility snapshot: use screenshot as visual truth, leave the bad screen if needed, then retry snapshot -i.
53
+ Non-hittable success hint: verify with the settled diff or snapshot; retarget by a better ref/selector if the UI did not change.
54
+
55
+ ${b}`}},S={debugging:{summary:`Targeted failure evidence without dumping stale context`,body:`agent-device help debugging
56
+
57
+ Use this when behavior fails, hangs, times out, throws alerts, or needs runtime evidence.
58
+
59
+ Logs:
60
+ Keep log windows small. Prefer clear, mark, reproduce, then path.
61
+ agent-device logs clear --restart
62
+ agent-device logs mark "before diagnostics retry"
63
+ agent-device press 'id="load-diagnostics"'
64
+ agent-device logs path
65
+ Do not cat a full stale log into agent context. Open or grep only the relevant window when needed.
66
+ logs clear --restart is the compact command to clear old logs and start a fresh capture; do not split it into logs stop, logs clear, logs start.
67
+ On iOS simulators, logs scope by bundle id and resolved app executable, so use this instead of raw simctl log stream predicates.
68
+ On iOS physical devices, logs clear --restart relaunches the session app through devicectl process launch --console so stdout/stderr can be captured.
69
+ For iOS simulator launch-time stdout/stderr, use --launch-console on the direct app launch:
70
+ agent-device open MyApp --platform ios --relaunch --launch-console ./artifacts/app.console.log
71
+ --launch-console is only for direct iOS simulator app launches, not URL opens.
72
+
73
+ Events:
74
+ Use events for a compact session timeline without dumping full app logs.
75
+ agent-device events
76
+ agent-device events 50 100
77
+ Events preserve command names, status, durations, bounded device/app inventory previews, lifecycle outcomes, artifact basenames, and structural action details such as scroll distance/direction, safe refs, and coordinates. User-entered text, clipboard contents, push/event payloads, selector values, free-form flags/messages/paths, and raw unknown command arguments are omitted or replaced with content-free placeholders. --no-record suppresses action.recorded entries, but request start/finish entries still record command, status, and timing.
78
+
79
+ Network:
80
+ Use network dump for recent session HTTP traffic parsed from app logs.
81
+ agent-device network dump --include headers
82
+ agent-device network dump 20 --include all
83
+ Use this instead of logs path when the question is request/response metadata.
84
+ network log is a supported alias, but network dump --include headers is the clearest plan form. Do not write network log headers.
85
+
86
+ Audio:
87
+ Use audio probe when the question is whether a browser page, macOS session, iOS simulator, or Android emulator produced audible output during a short observation window.
88
+ agent-device audio probe start 10 1000 --platform web
89
+ agent-device audio probe status --platform web
90
+ agent-device audio probe stop --platform web
91
+ agent-device audio probe start 10 1000 --platform macos
92
+ agent-device audio probe start 10 1000 --platform ios
93
+ agent-device audio probe start 10 1000 --platform android
94
+ audio probe start uses duration seconds first, then bucket milliseconds. Results are compact rmsDbfs and peakDbfs arrays so agents can correlate audible moments with screenshots, actions, network entries, or frame samples.
95
+ On web, audio probe samples HTML media elements and URL-backed media may be routed through the probe AudioContext while observed.
96
+ On macOS hosts, audio probe samples host system audio through ScreenCaptureKit for macOS sessions, iOS simulators, and Android emulators. It requires Screen Recording permission and is system-audio evidence, not app-instrumented audio. Physical iOS and Android devices are not supported.
97
+
98
+ Crash symbolication:
99
+ Crash routing:
100
+ Use logs when you need the lead-up timeline before a failure.
101
+ Use debug symbols when you have crash.ips/crash.log plus a matching dSYM/build directory and need the failing frame.
102
+ Use Xcode/LLDB when you need live state, breakpoints, variables, memory, or stepping.
103
+ Use debug symbols when you already have an Apple crash artifact and local dSYMs and need the failing code path, not a full log dump:
104
+ agent-device debug symbols --artifact crash.log --dsym MyApp.dSYM --out crash-symbolicated.log
105
+ agent-device debug symbols --artifact crash.ips --search-path ./build --out crash-symbolicated.ips
106
+ debug is intentionally narrow. Do not use it for logs, network/audio evidence, performance samples, recordings, traces, or React Native internals.
107
+ Apple support matches crash Binary Images / IPS usedImages UUIDs against dwarfdump --uuid output from .dSYM bundles, then writes a symbolicated artifact path and compact crash report: app/thread, exception or termination, top symbolicated frames, and first-frame finding. This is better than pasting crash logs because it keeps agent context small while preserving the artifact on disk for inspection.
108
+ Android Java/R8 mapping.txt and native ndk-stack/addr2line symbolication are not in this first debug symbols workflow; capture crash evidence with logs and use the Android toolchain externally for now.
109
+
110
+ Alerts:
111
+ Native and platform dialogs:
112
+ agent-device alert wait 3000
113
+ agent-device alert accept
114
+ agent-device alert dismiss
115
+ Android support is snapshot-derived for runtime permission prompts and native app dialogs. iOS support is runner-derived for XCTest alerts, app-owned modal popups with native blocking markers, and blocking system dialogs. Use cheap alert get for an immediate check; use alert wait <short-ms> only when a prompt may appear after async work.
116
+ If alert says no alert but a sheet is visibly on screen, treat it as app-owned UI:
117
+ agent-device snapshot -i
118
+ agent-device press 'label="Allow"'
119
+ Do not use settings permission to answer a dialog already on screen. Reserve settings permission for setup/resetting permission state before a flow.
120
+
121
+ Diagnostics and traces:
122
+ Use --debug for CLI/daemon diagnostic ids and log paths.
123
+ Use AGENT_DEVICE_EXEC_TRACE=1 when you need host-tool spawn timing without full debug streaming; it flushes the full request diagnostics file on successful requests that spawn host tools.
124
+ Open output includes Session state; JSON also includes runnerLogPath and requestLogPath.
125
+ For open timing under --debug, run open --debug --json and inspect requestLogPath for the open_timing event.
126
+ Session requests/<request-id>.ndjson holds daemon request diagnostics; session runner.log holds Apple runner/xcodebuild output.
127
+ Against a remote daemon the Diagnostics Log path is always local: the failing request's record is fetched to <state-dir>/remote-diagnostics/, and if it cannot be fetched the line reads "unavailable" with the reason instead of a daemon-host path.
128
+ daemon.log is global daemon lifecycle evidence, not the primary per-run log.
129
+ Use trace for low-level session diagnostics around one repro:
130
+ agent-device trace start ./traces/diagnostics.trace
131
+ agent-device press 'id="load-diagnostics"'
132
+ agent-device trace stop ./traces/diagnostics.trace
133
+ The trace path is positional. Do not use --path for trace start or trace stop.
134
+ Use perf xctrace only for Apple native CPU/profile or Animation Hitches artifacts:
135
+ agent-device perf cpu profile start --kind xctrace --template "Time Profiler" --out ./artifacts/app.trace
136
+ agent-device perf cpu profile stop --kind xctrace --out ./artifacts/app.trace
137
+ agent-device perf cpu profile report --kind xctrace --out ./artifacts/app-profile.json
138
+ agent-device perf trace start --kind xctrace --template "Animation Hitches" --out ./artifacts/hitches.trace
139
+ agent-device perf trace stop --kind xctrace --out ./artifacts/hitches.trace
140
+ perf xctrace keeps the .trace artifact on disk; CPU report returns a bounded weighted top-function summary. Do not dump .trace contents into context.
141
+ For Android native CPU/trace evidence, use perf artifacts instead of raw adb/simpleperf/perfetto output:
142
+ agent-device perf cpu profile start --kind simpleperf --out /tmp/cpu.perf.data
143
+ agent-device perf cpu profile stop --kind simpleperf
144
+ agent-device perf cpu profile report --kind simpleperf --out /tmp/cpu-report.json
145
+ agent-device perf trace start --kind perfetto --out /tmp/app.perfetto-trace
146
+ agent-device perf trace stop --kind perfetto
147
+ Treat native perf output as the agent evidence: for example, state=stopped, outPath=/tmp/app.perfetto-trace, sizeBytes=5392410, method=adb-shell-perfetto. The 5.3 MB raw trace stays in the artifact.
148
+ CPU reports return at most ten top functions in structured data and print five in default CLI output.
149
+ Use explicit perf frames, perf memory, perf cpu, or perf trace forms. Aggregate perf was removed in 0.21: bare perf, perf sample, perf metrics, and metrics fail with exact replacements.
150
+ Startup duration belongs to the open command's startup result; read it there.
151
+
152
+ Memory diagnostics:
153
+ Use perf memory when the symptom is leak/growth/OOM suspicion and you need agent-readable evidence.
154
+ agent-device perf memory sample --json
155
+ agent-device perf memory snapshot --kind android-hprof --out ./artifacts/app.hprof
156
+ agent-device perf memory snapshot --kind memgraph --out ./artifacts/app.memgraph
157
+ Example sample shape:
158
+ {"metrics":{"memory":{"available":true,"totalPssKb":562958,"totalRssKb":570304,"topConsumers":[{"name":"Dalvik Heap","pssKb":213456}]}}}
159
+ Example default snapshot output:
160
+ Memory artifact (android-hprof): /tmp/app.hprof (42MB)
161
+ Prefer perf memory sample over raw dumpsys/leaks output for first-pass agent diagnosis: it keeps arrays bounded and returns only relevant memory evidence.
162
+ Prefer perf memory snapshot over printing heap/memgraph data: snapshots return path, size, kind, method, and support metadata while the large artifact stays on disk for external inspection.
163
+ Unsupported platforms return artifact.available=false with reason/hint; do not pretend a heap or memgraph was captured.
164
+
165
+ Stabilizers:
166
+ Android animation-sensitive flows:
167
+ agent-device settings animations off
168
+ agent-device snapshot
169
+ agent-device settings animations on
170
+ Re-enable settings you changed before finishing.
171
+
172
+ Text-entry quirks:
173
+ iOS Allow Paste cannot be exercised under XCUITest; prefill with clipboard write "some text" instead and test the system prompt manually.
174
+ Android Gboard handwriting/stylus UI can capture text in an IME-owned input instead of the app field. If fill reports that input was captured by the keyboard/IME, use the diagnostic targetInput/actualInput details, inspect keyboard status/get if needed, and switch or disable handwriting outside the command plan before retrying. Do not keep retrying fill/type against the same field while the IME owns focus. If the exact target changes but app-owned formatting prevents raw equality, fill succeeds with verification: "unconfirmed" plus target-bound requested/before/after evidence; inspect that evidence instead of retrying the same mutation.
175
+
176
+ React Native internals:
177
+ If the question is about React Native performance, profiling, props, state, hooks, render causes, slow components, or rerenders, use help react-devtools instead of inferring from screenshots or logs.`}},C={dogfood:{summary:`Exploratory QA workflow with reproducible evidence`,body:`agent-device help dogfood
178
+
179
+ Use this when asked to dogfood, exploratory test, bug hunt, QA, or find issues in an app.
180
+
181
+ Goal:
182
+ Find user-visible issues from runtime behavior. Do not read app source or invent findings from code.
183
+ Produce a concise report with severity, repro commands, expected/actual behavior, and evidence paths.
184
+
185
+ Loop:
186
+ 1. Identify target app/platform; ask only if missing.
187
+ 2. Create output dirs and open the app. If auth or OTP is required, sign in or ask the user for the code.
188
+ 3. Capture baseline snapshot -i and screenshot.
189
+ 4. Map top-level navigation, then exercise primary flows and edge states.
190
+ 5. For each issue, capture evidence and write the finding immediately, then continue.
191
+ 6. Close the session and reconcile the report summary.
192
+ Keep stateful commands serial within the same session. Parallel runs can pollute text fields, focus, alerts, and navigation state.
193
+
194
+ Coverage:
195
+ Navigation, forms, empty/error/loading states, offline or retry behavior, permissions, settings, accessibility labels, orientation/keyboard, and obvious performance stalls.
196
+ React Native warning/error overlays can be real findings or test blockers. Capture them, use react-native dismiss-overlay if unrelated, re-snapshot, and report them.
197
+ Expo Go/dev-client shells: use the provided exp:// or dev-client URL and record whether the shell, project load, or app UI is being tested. On iOS dogfood, prefer agent-device open "Expo Go" <url> when Expo Go is the known shell, then snapshot -i to confirm the project UI rather than the runner splash.
198
+ Android RN/Expo/Re.Pack dev server: direct Android localhost URL opens with a port auto-configure host reachability.
199
+ Categories: visual, functional, UX, content, performance, diagnostics, permissions, accessibility.
200
+ Severity: critical blocks a core flow/data/crashes; high breaks a major feature; medium has friction or workaround; low is polish.
201
+
202
+ Evidence commands:
203
+ mkdir -p ./dogfood-output/screenshots ./dogfood-output/videos ./dogfood-output/traces
204
+ agent-device open <app> --platform ios
205
+ agent-device snapshot -i
206
+ agent-device screenshot ./dogfood-output/screenshots/initial.png
207
+ agent-device screenshot ./dogfood-output/screenshots/issue-001.png --overlay-refs
208
+ agent-device logs clear --restart
209
+ agent-device logs mark "issue-001 repro"
210
+ agent-device logs path
211
+ agent-device record start ./dogfood-output/videos/issue-001.mp4
212
+ agent-device record start ./dogfood-output/videos/benchmark.mp4 --hide-touches
213
+ agent-device record stop
214
+ agent-device close
215
+
216
+ Evidence rules:
217
+ Interactive/behavioral issues need step screenshots and usually a repro video.
218
+ Static/on-load issues can use one screenshot; set repro video to N/A.
219
+ Use screenshot --overlay-refs when showing the tappable target or broken state helps repro.
220
+
221
+ Report shape:
222
+ ./dogfood-output/report.md
223
+ Include date, platform, target app, session, scope, severity counts, and issues.
224
+ For each finding: ID, severity, category, title, affected flow/screen, repro commands, expected, actual, evidence files, notes.
225
+ Target 5-10 well-evidenced issues when available. If no issues are found, report coverage completed and residual risk instead of claiming the app is bug-free.
226
+
227
+ Rules:
228
+ Findings must come from observed runtime behavior, not source reads.
229
+ After each mutation, use the --settle diff as evidence when available; otherwise re-snapshot.
230
+ Wait timeouts are integer milliseconds in the trailing positional: agent-device wait 'role=tab' 10000. Do not write duration suffixes such as 10s.
231
+ scroll takes a selector-less direction+amount form: agent-device scroll down 0.8. One gesture cannot travel further than 0.8 of the viewport axis, so a larger amount saturates rather than covering more ground; to cross several screens use agent-device scroll down --until <selector> or scroll bottom. Use --settle to wait for the UI to go quiet and get the settled diff.
232
+ Keep commands in the report reproducible; use selectors or refs from fresh snapshots, not guessed coordinates.
233
+ Prefer refs for exploration and selectors for deterministic replay.
234
+ Use logs, network, screenshot --overlay-refs, trace, perf frames, perf memory, native profiles, or react-devtools only when they add evidence to a specific issue.
235
+ Never delete screenshots, videos, traces, or report artifacts during a session.
236
+ Escalate to help debugging or help react-devtools when runtime symptoms require those tools.`},validate:{summary:`Engineering self-validation with device evidence and cleanup`,body:`agent-device help validate
237
+
238
+ Use this when validating a code change, release candidate, performance fix, visual behavior, logging path, replay, or device-facing regression.
239
+
240
+ Contract:
241
+ Prove the changed behavior through public agent-device surfaces. Do not validate against stale dist output, a retained stale daemon, or a runner built before the change.
242
+ Keep evidence reproducible: exact commands, target device/app, observed output, artifact paths, and cleanup status.
243
+
244
+ Required freshness gate before device verification:
245
+ For a TypeScript runtime or CLI output change, start with pnpm build. For non-Android device verification, run pnpm clean:daemon next.
246
+ Before local Android verification, run pnpm build:android before pnpm clean:daemon so the bundled helpers match current source.
247
+ For an Apple runner change, run pnpm build:xcuitest and avoid inherited retained runners from older source. Do not build the Apple runner for TypeScript-only changes.
248
+ Use open --relaunch when startup state matters. Use a purpose-specific --session for multi-step validation.
249
+ CI may cache ~/.agent-device/apple-runner/derived with an exact key that includes the agent-device package and Xcode version. Runner reuse is authorized only by the cache metadata's content manifest, so a restore that fails validation rebuilds; prepare ios-runner already recovers one retryable non-connecting runner launch.
250
+
251
+ Loop:
252
+ 1. Build or prepare the changed surface with the repo command that owns it.
253
+ 2. Open the target app/device state explicitly.
254
+ 3. Use snapshot -i and press/fill/click/longpress --settle for UI-driving steps.
255
+ 4. Use the settled diff as evidence when it shows the changed behavior; otherwise verify with wait/get/is/find, screenshot, logs, network, perf, or trace based on the claim.
256
+ 5. Record timings, token/output size, screenshots/videos, logs, or perf artifacts only when they answer the validation question.
257
+ 6. Close sessions and release leases before finishing.
258
+
259
+ Evidence:
260
+ CLI/runtime freshness: pnpm build, pnpm clean:daemon, then agent-device --version or the command under test.
261
+ Apple runner freshness: pnpm build:xcuitest, then a live agent-device command on the target simulator/device.
262
+ Visual claim: screenshot, optionally screenshot --overlay-refs when target mapping matters.
263
+ Runtime/logging claim: logs clear --restart, logs mark, reproduce, logs path.
264
+ Network claim: network dump --include headers when headers are relevant.
265
+ Performance claim: perf frames, perf memory sample, native profile reports, or trace artifacts with bounded output.
266
+ Replay/regression claim: replay or test through the public command path.
267
+
268
+ Report:
269
+ Summarize what changed, exact validation commands, pass/fail observations, artifact paths, and residual risk.
270
+ If live validation is blocked, state the blocker, device/session, and exact next command needed.`}};function w(){return`agent-device <command> [args] [--json]
3
271
 
4
272
  Automates iOS, Android, macOS, TV, and web apps for AI agents.
5
273
  All ${n().length} commands: agent-device help commands
@@ -50,62 +318,11 @@ Guides (agent-device help <topic>):
50
318
  react-native / react-devtools / cdp / tv / web / macos / remote
51
319
  physical-device / ios-system-ui / maestro
52
320
  foldable iPhone Duo panels, the fold command, and why refs die on a pose change
53
- `}var b=e({buildCommandUsageText:()=>L,buildUsageText:()=>A,helpTopicIds:()=>z,resolveHelpTargetUsageText:()=>R});const x=[`Default config files: ~/.agent-device/config.json, ./agent-device.json (project-safe defaults only).`,`Use --config <path> or AGENT_DEVICE_CONFIG for explicit connection/provider defaults; project config cannot select endpoints or credentials.`],S=[{label:`AGENT_DEVICE_SESSION`,description:`Explicit session name`},{label:`AGENT_DEVICE_PLATFORM`,description:`Default platform binding`},{label:`AGENT_DEVICE_SCREENSHOT_SCALE`,description:`Default screenshot scale factor`},{label:`AGENT_DEVICE_SESSION_LOCK`,description:`Bound-session conflict mode`},{label:`AGENT_DEVICE_DAEMON_BASE_URL`,description:`Connect to remote daemon`},{label:`AGENT_DEVICE_DAEMON_AUTH_TOKEN`,description:`Remote daemon service/API token`},{label:`AGENT_DEVICE_CLOUD_BASE_URL`,description:`Bridge/control-plane API origin for cloud auth and /api-keys`}],C=[`agent-device open Settings --platform ios`,`agent-device open https://example.com --platform web`,`agent-device snapshot -i`,`agent-device fill @e3 "test@example.com"`,`agent-device replay ./session.ad`,`agent-device wait absent 'label="Loading..."' 3000`,`agent-device test ./suite --platform android`],w=`Wait failure contract:
54
- Read error.details.reason in --json, not the message text.
55
- wait_target_absent: a readable capture ran and found no match.
56
- wait_target_present: wait absent timed out with matches; details include matches and firstMatch.
57
- predicate_failed: wait absent had no valid capture; final observation/diagnostic is preserved.
58
- wait_capture_stalled: no readable capture finished before the deadline -- retriable.
59
- wait_deadline_exceeded: a later capture used the remaining budget after an earlier readable one.
60
- wait_landmark_identity_mismatch: a replay destination guard found the selector but not the recorded identity.
61
- wait_stable_timeout: wait stable never saw a stable UI -- not an absence verdict.
62
- `,T={commands:{summary:`Full command catalog, global flags, configuration, and environment`,body:`agent-device help commands`},"manual-qa":{summary:`Follow manual test scripts with exact interactions and verification`,body:`agent-device help manual-qa
63
-
64
- Use this when asked to follow a manual QA script, test case, checklist, acceptance flow, or user-provided instructions.
65
-
66
- Contract:
67
- Execute the script. Do not explore unrelated screens, read app source, invent missing requirements, or broaden scope.
68
- Stop and report ambiguity when a required target or expected result is not visible after the documented recovery steps.
69
-
70
- Loop:
71
- 1. Open the requested app; use --relaunch only when the script needs fresh state.
72
- 2. Run snapshot -i to get current refs for the next step.
73
- 3. Run press/fill/click/longpress <ref-or-selector> --settle for each mutating step.
74
- 4. Treat a settled:true diff as the next observation. Do not add wait stable or another snapshot when the diff already shows the next target or expected result.
75
- 5. If --settle prints not settled, follow its hint before the next ref-based action.
76
- 6. Verify named expectations with wait text/selector/absent, get, is, find, or the settled diff. A bare screenshot/snapshot is not verification for a named expectation.
77
- 7. Close the session when the script ends.
78
-
79
- Command shapes:
80
- agent-device open com.example.app --relaunch
81
- agent-device open https://example.com/deep-link
82
- agent-device snapshot -i
83
- agent-device press @e12 --settle
84
- agent-device press 'label="Follow"' --settle
85
- agent-device fill @e13 "qa@example.com" --settle
86
- agent-device wait text "Order placed" 3000
87
- agent-device wait absent 'label="Loading..."' 3000
88
- agent-device close
89
- --relaunch forces fresh app state; a deep link/URL open does not need it. Labels with an apostrophe or quote (label="Don't leave") are shell-quoting hazards: prefer the @ref from the latest snapshot/settle output over quoting the literal label.
90
-
91
- Targets:
92
- Prefer refs from the latest snapshot -i or settled diff. Use durable selectors when the label/id is known: label="Search", id="submit", role=button label="Follow". If label text matches both a field and its caption, target the field with label="Email" editable=true.
93
- For text fields, use fill <target> <text> --settle to replace the field value; use type only to append to an already-focused field.
94
- Do not use placeholders such as @ref, @eN, <button>, or <selector> in a final command plan. If the ref is unknown, first run snapshot -i.
95
- Coordinates are fallback-only after refs/selectors fail or accessibility omits the target; use screenshot or snapshot -i --json to choose a visible center point.
96
-
97
- Recovery:
98
- Network/typeahead result missing: wait text "Expected result" or wait <selector>.
99
- A target that should be gone/disappear: use wait absent <selector>; wait exists ... is rejected in favor of the plain selector wait.
100
- Keyboard visible over the next target: an element whose center sits behind the keyboard is refused with tap_keyboard_occludes_target, because the touch would activate a key instead of the target. End editing first -- the app's own Done/Cancel control, or keyboard enter when submission is wanted -- then retry. A target whose center stays above the keys still presses; a raw coordinate behind the keyboard taps anyway and reports the reason in warning.
101
- Sparse or recovered accessibility snapshot: use screenshot as visual truth, leave the bad screen if needed, then retry snapshot -i.
102
- Non-hittable success hint: verify with the settled diff or snapshot; retarget by a better ref/selector if the UI did not change.
103
-
104
- ${w}`},maestro:{summary:`Supported Maestro YAML commands, grammar, and runtime boundaries`,body:`agent-device help maestro
321
+ `}var T=e({buildCommandUsageText:()=>V,buildUsageText:()=>P,helpTopicIds:()=>U,resolveHelpTargetUsageText:()=>H});const E=[`Default config files: ~/.agent-device/config.json, ./agent-device.json (project-safe defaults only).`,`Use --config <path> or AGENT_DEVICE_CONFIG for explicit connection/provider defaults; project config cannot select endpoints or credentials.`],D=[{label:`AGENT_DEVICE_SESSION`,description:`Explicit session name`},{label:`AGENT_DEVICE_PLATFORM`,description:`Default platform binding`},{label:`AGENT_DEVICE_SCREENSHOT_SCALE`,description:`Default screenshot scale factor`},{label:`AGENT_DEVICE_SESSION_LOCK`,description:`Bound-session conflict mode`},{label:`AGENT_DEVICE_DAEMON_BASE_URL`,description:`Connect to remote daemon`},{label:`AGENT_DEVICE_DAEMON_AUTH_TOKEN`,description:`Remote daemon service/API token`},{label:`AGENT_DEVICE_CLOUD_BASE_URL`,description:`Bridge/control-plane API origin for cloud auth and /api-keys`}],O=[`agent-device open Settings --platform ios`,`agent-device open https://example.com --platform web`,`agent-device snapshot -i`,`agent-device fill @e3 "test@example.com"`,`agent-device replay ./session.ad`,`agent-device wait absent 'label="Loading..."' 3000`,`agent-device test ./suite --platform android`],k={commands:{summary:`Full command catalog, global flags, configuration, and environment`,body:`agent-device help commands`},...x,maestro:{summary:`Supported Maestro YAML commands, grammar, and runtime boundaries`,body:`agent-device help maestro
105
322
 
106
323
  Run Maestro compatibility flows with replay <flow.yaml> --maestro or test <path> --maestro. Bind an iOS or Android target with --platform or an existing session.
107
324
 
108
- ${p()}
325
+ ${m()}
109
326
 
110
327
  Unsupported syntax fails loudly rather than being skipped. Architecture, performance tradeoffs, and declared conformance divergences: https://github.com/callstack/agent-device/blob/main/docs/adr/0015-direct-maestro-engine.md
111
328
  Focused compatibility request: https://github.com/callstack/agent-device/issues/new`},workflow:{summary:`Normal agent-device bootstrap, exploration, and validation loop`,body:`agent-device help workflow
@@ -148,7 +365,7 @@ Session ordering:
148
365
  Stateful commands (open/press/fill/type/scroll/back/alert/replay/batch/close) run serially within one session. Parallelize only read-only commands, or separate sessions/devices.
149
366
 
150
367
  Read-only and waits:
151
- ${w}
368
+ ${b}
152
369
  snapshot/get/is/find answer read-only questions; snapshot -i is for refs. --settle confirms local UI quieted; delayed results use wait text "Expected result" or wait <selector> instead of polling; strict disappearance uses wait absent <selector>.
153
370
  wait stable [quietMs] [timeoutMs] (defaults 500/10000) is the fallback for open/relaunch/navigation, or an intentionally-unsettled mutation -- not after a --settle whose diff already shows the change. Ambiguous find: add --first or --last.
154
371
 
@@ -296,129 +513,7 @@ Focus and visual truth:
296
513
  On Android TV and tvOS, if snapshot -i exposes a focused node, verify it with is focused <selector>.
297
514
  Use wait focused=true only when repeated snapshots preserve focus metadata for the app.
298
515
  If the app exposes only a surface view, or focus metadata is transient, use screenshot --overlay-refs, screenshot, or diff snapshot as visual truth and keep moving focus with tv-remote. On Vega OS, use the VVD display as visual truth until capture support lands.
299
- Do not assume press/click @ref works on Android TV, tvOS, or Vega OS until the desired element is focused.`},debugging:{summary:`Targeted failure evidence without dumping stale context`,body:`agent-device help debugging
300
-
301
- Use this when behavior fails, hangs, times out, throws alerts, or needs runtime evidence.
302
-
303
- Logs:
304
- Keep log windows small. Prefer clear, mark, reproduce, then path.
305
- agent-device logs clear --restart
306
- agent-device logs mark "before diagnostics retry"
307
- agent-device press 'id="load-diagnostics"'
308
- agent-device logs path
309
- Do not cat a full stale log into agent context. Open or grep only the relevant window when needed.
310
- logs clear --restart is the compact command to clear old logs and start a fresh capture; do not split it into logs stop, logs clear, logs start.
311
- On iOS simulators, logs scope by bundle id and resolved app executable, so use this instead of raw simctl log stream predicates.
312
- On iOS physical devices, logs clear --restart relaunches the session app through devicectl process launch --console so stdout/stderr can be captured.
313
- For iOS simulator launch-time stdout/stderr, use --launch-console on the direct app launch:
314
- agent-device open MyApp --platform ios --relaunch --launch-console ./artifacts/app.console.log
315
- --launch-console is only for direct iOS simulator app launches, not URL opens.
316
-
317
- Events:
318
- Use events for a compact session timeline without dumping full app logs.
319
- agent-device events
320
- agent-device events 50 100
321
- Events preserve command names, status, durations, bounded device/app inventory previews, lifecycle outcomes, artifact basenames, and structural action details such as scroll distance/direction, safe refs, and coordinates. User-entered text, clipboard contents, push/event payloads, selector values, free-form flags/messages/paths, and raw unknown command arguments are omitted or replaced with content-free placeholders. --no-record suppresses action.recorded entries, but request start/finish entries still record command, status, and timing.
322
-
323
- Network:
324
- Use network dump for recent session HTTP traffic parsed from app logs.
325
- agent-device network dump --include headers
326
- agent-device network dump 20 --include all
327
- Use this instead of logs path when the question is request/response metadata.
328
- network log is a supported alias, but network dump --include headers is the clearest plan form. Do not write network log headers.
329
-
330
- Audio:
331
- Use audio probe when the question is whether a browser page, macOS session, iOS simulator, or Android emulator produced audible output during a short observation window.
332
- agent-device audio probe start 10 1000 --platform web
333
- agent-device audio probe status --platform web
334
- agent-device audio probe stop --platform web
335
- agent-device audio probe start 10 1000 --platform macos
336
- agent-device audio probe start 10 1000 --platform ios
337
- agent-device audio probe start 10 1000 --platform android
338
- audio probe start uses duration seconds first, then bucket milliseconds. Results are compact rmsDbfs and peakDbfs arrays so agents can correlate audible moments with screenshots, actions, network entries, or frame samples.
339
- On web, audio probe samples HTML media elements and URL-backed media may be routed through the probe AudioContext while observed.
340
- On macOS hosts, audio probe samples host system audio through ScreenCaptureKit for macOS sessions, iOS simulators, and Android emulators. It requires Screen Recording permission and is system-audio evidence, not app-instrumented audio. Physical iOS and Android devices are not supported.
341
-
342
- Crash symbolication:
343
- Crash routing:
344
- Use logs when you need the lead-up timeline before a failure.
345
- Use debug symbols when you have crash.ips/crash.log plus a matching dSYM/build directory and need the failing frame.
346
- Use Xcode/LLDB when you need live state, breakpoints, variables, memory, or stepping.
347
- Use debug symbols when you already have an Apple crash artifact and local dSYMs and need the failing code path, not a full log dump:
348
- agent-device debug symbols --artifact crash.log --dsym MyApp.dSYM --out crash-symbolicated.log
349
- agent-device debug symbols --artifact crash.ips --search-path ./build --out crash-symbolicated.ips
350
- debug is intentionally narrow. Do not use it for logs, network/audio evidence, performance samples, recordings, traces, or React Native internals.
351
- Apple support matches crash Binary Images / IPS usedImages UUIDs against dwarfdump --uuid output from .dSYM bundles, then writes a symbolicated artifact path and compact crash report: app/thread, exception or termination, top symbolicated frames, and first-frame finding. This is better than pasting crash logs because it keeps agent context small while preserving the artifact on disk for inspection.
352
- Android Java/R8 mapping.txt and native ndk-stack/addr2line symbolication are not in this first debug symbols workflow; capture crash evidence with logs and use the Android toolchain externally for now.
353
-
354
- Alerts:
355
- Native and platform dialogs:
356
- agent-device alert wait 3000
357
- agent-device alert accept
358
- agent-device alert dismiss
359
- Android support is snapshot-derived for runtime permission prompts and native app dialogs. iOS support is runner-derived for XCTest alerts, app-owned modal popups with native blocking markers, and blocking system dialogs. Use cheap alert get for an immediate check; use alert wait <short-ms> only when a prompt may appear after async work.
360
- If alert says no alert but a sheet is visibly on screen, treat it as app-owned UI:
361
- agent-device snapshot -i
362
- agent-device press 'label="Allow"'
363
- Do not use settings permission to answer a dialog already on screen. Reserve settings permission for setup/resetting permission state before a flow.
364
-
365
- Diagnostics and traces:
366
- Use --debug for CLI/daemon diagnostic ids and log paths.
367
- Use AGENT_DEVICE_EXEC_TRACE=1 when you need host-tool spawn timing without full debug streaming; it flushes the full request diagnostics file on successful requests that spawn host tools.
368
- Open output includes Session state; JSON also includes runnerLogPath and requestLogPath.
369
- For open timing under --debug, run open --debug --json and inspect requestLogPath for the open_timing event.
370
- Session requests/<request-id>.ndjson holds daemon request diagnostics; session runner.log holds Apple runner/xcodebuild output.
371
- Against a remote daemon the Diagnostics Log path is always local: the failing request's record is fetched to <state-dir>/remote-diagnostics/, and if it cannot be fetched the line reads "unavailable" with the reason instead of a daemon-host path.
372
- daemon.log is global daemon lifecycle evidence, not the primary per-run log.
373
- Use trace for low-level session diagnostics around one repro:
374
- agent-device trace start ./traces/diagnostics.trace
375
- agent-device press 'id="load-diagnostics"'
376
- agent-device trace stop ./traces/diagnostics.trace
377
- The trace path is positional. Do not use --path for trace start or trace stop.
378
- Use perf xctrace only for Apple native CPU/profile or Animation Hitches artifacts:
379
- agent-device perf cpu profile start --kind xctrace --template "Time Profiler" --out ./artifacts/app.trace
380
- agent-device perf cpu profile stop --kind xctrace --out ./artifacts/app.trace
381
- agent-device perf cpu profile report --kind xctrace --out ./artifacts/app-profile.json
382
- agent-device perf trace start --kind xctrace --template "Animation Hitches" --out ./artifacts/hitches.trace
383
- agent-device perf trace stop --kind xctrace --out ./artifacts/hitches.trace
384
- perf xctrace keeps the .trace artifact on disk; CPU report returns a bounded weighted top-function summary. Do not dump .trace contents into context.
385
- For Android native CPU/trace evidence, use perf artifacts instead of raw adb/simpleperf/perfetto output:
386
- agent-device perf cpu profile start --kind simpleperf --out /tmp/cpu.perf.data
387
- agent-device perf cpu profile stop --kind simpleperf
388
- agent-device perf cpu profile report --kind simpleperf --out /tmp/cpu-report.json
389
- agent-device perf trace start --kind perfetto --out /tmp/app.perfetto-trace
390
- agent-device perf trace stop --kind perfetto
391
- Treat native perf output as the agent evidence: for example, state=stopped, outPath=/tmp/app.perfetto-trace, sizeBytes=5392410, method=adb-shell-perfetto. The 5.3 MB raw trace stays in the artifact.
392
- CPU reports return at most ten top functions in structured data and print five in default CLI output.
393
- Use explicit perf frames, perf memory, perf cpu, or perf trace forms. Aggregate perf was removed in 0.21: bare perf, perf sample, perf metrics, and metrics fail with exact replacements.
394
- Startup duration belongs to the open command's startup result; read it there.
395
-
396
- Memory diagnostics:
397
- Use perf memory when the symptom is leak/growth/OOM suspicion and you need agent-readable evidence.
398
- agent-device perf memory sample --json
399
- agent-device perf memory snapshot --kind android-hprof --out ./artifacts/app.hprof
400
- agent-device perf memory snapshot --kind memgraph --out ./artifacts/app.memgraph
401
- Example sample shape:
402
- {"metrics":{"memory":{"available":true,"totalPssKb":562958,"totalRssKb":570304,"topConsumers":[{"name":"Dalvik Heap","pssKb":213456}]}}}
403
- Example default snapshot output:
404
- Memory artifact (android-hprof): /tmp/app.hprof (42MB)
405
- Prefer perf memory sample over raw dumpsys/leaks output for first-pass agent diagnosis: it keeps arrays bounded and returns only relevant memory evidence.
406
- Prefer perf memory snapshot over printing heap/memgraph data: snapshots return path, size, kind, method, and support metadata while the large artifact stays on disk for external inspection.
407
- Unsupported platforms return artifact.available=false with reason/hint; do not pretend a heap or memgraph was captured.
408
-
409
- Stabilizers:
410
- Android animation-sensitive flows:
411
- agent-device settings animations off
412
- agent-device snapshot
413
- agent-device settings animations on
414
- Re-enable settings you changed before finishing.
415
-
416
- Text-entry quirks:
417
- iOS Allow Paste cannot be exercised under XCUITest; prefill with clipboard write "some text" instead and test the system prompt manually.
418
- Android Gboard handwriting/stylus UI can capture text in an IME-owned input instead of the app field. If fill reports that input was captured by the keyboard/IME, use the diagnostic targetInput/actualInput details, inspect keyboard status/get if needed, and switch or disable handwriting outside the command plan before retrying. Do not keep retrying fill/type against the same field while the IME owns focus. If the exact target changes but app-owned formatting prevents raw equality, fill succeeds with verification: "unconfirmed" plus target-bound requested/before/after evidence; inspect that evidence instead of retrying the same mutation.
419
-
420
- React Native internals:
421
- If the question is about React Native performance, profiling, props, state, hooks, render causes, slow components, or rerenders, use help react-devtools instead of inferring from screenshots or logs.`},"react-devtools":{summary:`React Native performance, profiling, and component internals`,body:`agent-device help react-devtools
516
+ Do not assume press/click @ref works on Android TV, tvOS, or Vega OS until the desired element is focused.`},...S,"react-devtools":{summary:`React Native performance, profiling, and component internals`,body:`agent-device help react-devtools
422
517
 
423
518
  Use this for React Native performance/profiling and internals that the accessibility tree cannot expose: components, props, state, hooks, ownership, slow renders, and rerenders.
424
519
 
@@ -678,23 +773,7 @@ Rules:
678
773
  Do not hard-code Edit/Done/Add Widget or other SpringBoard label text into a plan as a fixed assumption; take them from the latest snapshot -i so the plan survives iOS version/locale differences.
679
774
  A real system permission alert can appear mid-flow; it composes with this workflow normally, so handle it with alert wait/accept/dismiss or by pressing the visible label like any other step.
680
775
  Prefer refs/selectors from the fresh snapshot for every step except the two documented coordinate fallbacks (empty-space long-press to enter edit mode, and the gallery search-result tap).
681
- This topic covers what already works by opening SpringBoard as the session app. It does not yet cover keeping an app session open while alternating individual commands against SpringBoard, or Live Activity/Dynamic Island semantics; those land separately.`},foldable:{summary:`Foldable Apple devices: panels, pose, and which screen you are on`,body:`agent-device help foldable
682
-
683
- A foldable Apple device (iPhone Duo) carries two integrated panels, which Apple calls the outer display and the inner display. Only one is lit at a time, and which one is lit is the device pose.
684
-
685
- Screens are handled for you:
686
- Each iOS simulator capture resolves the CoreDevice display table, captures the lit panel explicitly, and normalizes density with that panel's own point scale. Do not add a screen flag to the normal loop; there is none, because the lit panel is always the only capturable one: the dark panel yields an all-black PNG.
687
- The two panels are different sizes (iPhone Duo: 466x678 points closed on the outer panel, 669x951 open on the inner). A pose change therefore invalidates every ref and coordinate. Re-snapshot after any pose change and never carry coordinates or refs across one.
688
- Check which panel is lit before trusting a geometry claim: agent-device screenshot reports its point size, and 466x678 versus 669x951 says which panel you captured.
689
-
690
- Changing the pose:
691
- agent-device fold closed | half-open | open
692
- fold sends a private HID hinge event inside the selected simulator and then reads the hinge angle back from CoreDevice until it agrees: closed is 0 degrees, open is 180, and half-open is any angle between them (requested at 130 degrees). An angle in that interval only proves the category, so half-open is reported once two consecutive readings both fall inside it and agree within 0.5 degrees. The response reports the verified pose, the hinge angle, and the panel the device now lights with its native panel point size, marked coordinateSpace "native-panel". That point size is the panel's own geometry, not the next snapshot's viewport, so it cannot place a tap: the active app window can differ (a 669x951 inner panel hosts a 951x669 window). A hinge whose last reading is some other pose fails with COMMAND_FAILED and reason fold-pose-unverified, naming the angle CoreDevice still reports; a hinge seen half-open but never at rest fails with reason fold-pose-unsettled, naming the observed and previous angles. A single-panel simulator fails with UNSUPPORTED_OPERATION. A simulator scoped to a non-default set with --ios-simulator-device-set is refused before any hinge is touched, with UNSUPPORTED_OPERATION and reason unsupported-device-scope: the HID send honors the set, but CoreDevice's display inventory and hinge-angle readback resolve a scoped simulator as not found, so the pose could not be verified. Run fold without --ios-simulator-device-set (in the default set).
693
- Expect a fold to take 10-16 seconds: each hinge read is a five-second devicectl stream, and half-open waits for the hinge to stop moving. Re-snapshot after every fold; refs and coordinates from before it are stale, and the command's message says so.
694
- Timed motion: fold --keyframes '[{"atMs":0,"angle":0},{"atMs":5000,"angle":180}]'. Use 2–64 frames starting at 0ms, increasing integer timestamps up to 60000ms, and angles from 0 to 180. The last timestamp sets motion duration, excluding setup and verification. Equal angles hold; cancellation stops motion. See the fold examples in the command and Node API documentation for trajectories.
695
-
696
- Requirements: an iOS simulator session on a foldable device and an Xcode toolchain with the iOS simulator SDK and foldable HID support (verified on Xcode 27.1). Device Hub and host Accessibility permission are not required. The command runs a small helper through simctl spawn for the session UDID; the helper is built once per Fold.m source hash and Xcode toolchain, cached under ~/.agent-device/fold-helper, and rebuilt only when the source or the toolchain changes. Build or dispatch failures are reported without a UI fallback. The app under test reads the resulting pose as UIHinge.status.
697
- If a task asserts behavior for more than one pose, fold to each pose and re-snapshot, and report which poses the run covered.`},remote:{summary:`Direct proxy, cloud profiles, and remote config`,body:`agent-device help remote
776
+ This topic covers what already works by opening SpringBoard as the session app. It does not yet cover keeping an app session open while alternating individual commands against SpringBoard, or Live Activity/Dynamic Island semantics; those land separately.`},foldable:o,remote:{summary:`Direct proxy, cloud profiles, and remote config`,body:`agent-device help remote
698
777
 
699
778
  Remote connection providers use the same lifecycle:
700
779
  connect -> install/open -> commands -> close -> disconnect
@@ -888,126 +967,33 @@ Out of scope for agent-device web support:
888
967
  Rules:
889
968
  Do not claim web e2e CI exists unless a project workflow explicitly provides it.
890
969
  Do not use native mobile or desktop setup commands such as boot, apps, install, settings, alert, keyboard, perf, logs, or react-devtools for --platform web.
891
- Keep browser plans session-scoped: open a URL, inspect refs, act on refs/selectors, verify with wait/get/is/snapshot, capture screenshot only when visual evidence is needed, then close.`},dogfood:{summary:`Exploratory QA workflow with reproducible evidence`,body:`agent-device help dogfood
892
-
893
- Use this when asked to dogfood, exploratory test, bug hunt, QA, or find issues in an app.
894
-
895
- Goal:
896
- Find user-visible issues from runtime behavior. Do not read app source or invent findings from code.
897
- Produce a concise report with severity, repro commands, expected/actual behavior, and evidence paths.
898
-
899
- Loop:
900
- 1. Identify target app/platform; ask only if missing.
901
- 2. Create output dirs and open the app. If auth or OTP is required, sign in or ask the user for the code.
902
- 3. Capture baseline snapshot -i and screenshot.
903
- 4. Map top-level navigation, then exercise primary flows and edge states.
904
- 5. For each issue, capture evidence and write the finding immediately, then continue.
905
- 6. Close the session and reconcile the report summary.
906
- Keep stateful commands serial within the same session. Parallel runs can pollute text fields, focus, alerts, and navigation state.
907
-
908
- Coverage:
909
- Navigation, forms, empty/error/loading states, offline or retry behavior, permissions, settings, accessibility labels, orientation/keyboard, and obvious performance stalls.
910
- React Native warning/error overlays can be real findings or test blockers. Capture them, use react-native dismiss-overlay if unrelated, re-snapshot, and report them.
911
- Expo Go/dev-client shells: use the provided exp:// or dev-client URL and record whether the shell, project load, or app UI is being tested. On iOS dogfood, prefer agent-device open "Expo Go" <url> when Expo Go is the known shell, then snapshot -i to confirm the project UI rather than the runner splash.
912
- Android RN/Expo/Re.Pack dev server: direct Android localhost URL opens with a port auto-configure host reachability.
913
- Categories: visual, functional, UX, content, performance, diagnostics, permissions, accessibility.
914
- Severity: critical blocks a core flow/data/crashes; high breaks a major feature; medium has friction or workaround; low is polish.
915
-
916
- Evidence commands:
917
- mkdir -p ./dogfood-output/screenshots ./dogfood-output/videos ./dogfood-output/traces
918
- agent-device open <app> --platform ios
919
- agent-device snapshot -i
920
- agent-device screenshot ./dogfood-output/screenshots/initial.png
921
- agent-device screenshot ./dogfood-output/screenshots/issue-001.png --overlay-refs
922
- agent-device logs clear --restart
923
- agent-device logs mark "issue-001 repro"
924
- agent-device logs path
925
- agent-device record start ./dogfood-output/videos/issue-001.mp4
926
- agent-device record start ./dogfood-output/videos/benchmark.mp4 --hide-touches
927
- agent-device record stop
928
- agent-device close
929
-
930
- Evidence rules:
931
- Interactive/behavioral issues need step screenshots and usually a repro video.
932
- Static/on-load issues can use one screenshot; set repro video to N/A.
933
- Use screenshot --overlay-refs when showing the tappable target or broken state helps repro.
934
-
935
- Report shape:
936
- ./dogfood-output/report.md
937
- Include date, platform, target app, session, scope, severity counts, and issues.
938
- For each finding: ID, severity, category, title, affected flow/screen, repro commands, expected, actual, evidence files, notes.
939
- Target 5-10 well-evidenced issues when available. If no issues are found, report coverage completed and residual risk instead of claiming the app is bug-free.
940
-
941
- Rules:
942
- Findings must come from observed runtime behavior, not source reads.
943
- After each mutation, use the --settle diff as evidence when available; otherwise re-snapshot.
944
- Wait timeouts are integer milliseconds in the trailing positional: agent-device wait 'role=tab' 10000. Do not write duration suffixes such as 10s.
945
- scroll takes a selector-less direction+amount form: agent-device scroll down 0.8. One gesture cannot travel further than 0.8 of the viewport axis, so a larger amount saturates rather than covering more ground; to cross several screens use agent-device scroll down --until <selector> or scroll bottom. Use --settle to wait for the UI to go quiet and get the settled diff.
946
- Keep commands in the report reproducible; use selectors or refs from fresh snapshots, not guessed coordinates.
947
- Prefer refs for exploration and selectors for deterministic replay.
948
- Use logs, network, screenshot --overlay-refs, trace, perf frames, perf memory, native profiles, or react-devtools only when they add evidence to a specific issue.
949
- Never delete screenshots, videos, traces, or report artifacts during a session.
950
- Escalate to help debugging or help react-devtools when runtime symptoms require those tools.`},validate:{summary:`Engineering self-validation with device evidence and cleanup`,body:`agent-device help validate
951
-
952
- Use this when validating a code change, release candidate, performance fix, visual behavior, logging path, replay, or device-facing regression.
953
-
954
- Contract:
955
- Prove the changed behavior through public agent-device surfaces. Do not validate against stale dist output, a retained stale daemon, or a runner built before the change.
956
- Keep evidence reproducible: exact commands, target device/app, observed output, artifact paths, and cleanup status.
957
-
958
- Required freshness gate before device verification:
959
- For a TypeScript runtime or CLI output change, start with pnpm build. For non-Android device verification, run pnpm clean:daemon next.
960
- Before local Android verification, run pnpm build:android before pnpm clean:daemon so the bundled helpers match current source.
961
- For an Apple runner change, run pnpm build:xcuitest and avoid inherited retained runners from older source. Do not build the Apple runner for TypeScript-only changes.
962
- Use open --relaunch when startup state matters. Use a purpose-specific --session for multi-step validation.
963
- CI may cache ~/.agent-device/apple-runner/derived with an exact key that includes the agent-device package and Xcode version. Runner reuse is authorized only by the cache metadata's content manifest, so a restore that fails validation rebuilds; prepare ios-runner already recovers one retryable non-connecting runner launch.
964
-
965
- Loop:
966
- 1. Build or prepare the changed surface with the repo command that owns it.
967
- 2. Open the target app/device state explicitly.
968
- 3. Use snapshot -i and press/fill/click/longpress --settle for UI-driving steps.
969
- 4. Use the settled diff as evidence when it shows the changed behavior; otherwise verify with wait/get/is/find, screenshot, logs, network, perf, or trace based on the claim.
970
- 5. Record timings, token/output size, screenshots/videos, logs, or perf artifacts only when they answer the validation question.
971
- 6. Close sessions and release leases before finishing.
972
-
973
- Evidence:
974
- CLI/runtime freshness: pnpm build, pnpm clean:daemon, then agent-device --version or the command under test.
975
- Apple runner freshness: pnpm build:xcuitest, then a live agent-device command on the target simulator/device.
976
- Visual claim: screenshot, optionally screenshot --overlay-refs when target mapping matters.
977
- Runtime/logging claim: logs clear --restart, logs mark, reproduce, logs path.
978
- Network claim: network dump --include headers when headers are relevant.
979
- Performance claim: perf frames, perf memory sample, native profile reports, or trace artifacts with bounded output.
980
- Replay/regression claim: replay or test through the public command path.
981
-
982
- Report:
983
- Summarize what changed, exact validation commands, pass/fail observations, artifact paths, and residual risk.
984
- If live validation is blocked, state the blocker, device/session, and exact next command needed.`}};function E(e,t,n){let r=n.endsWith(`?`),i=r?n.slice(0,-1):n,a=/^[a-z-]+(?:\|[a-z-]+)+$/i.test(i),o=a||t.usageOverride!==void 0&&t.usageOverride.startsWith(`${e} ${i}`);return r?a?`[${i}]`:o?i:`[${i}]`:o?i:`<${i}>`}function D(e,t){return t.listUsageOverride?t.listUsageOverride:[e,...(t.positionalArgs??[]).map(n=>E(e,t,n))].join(` `)}function O(){return y()}function k(){return`agent-device help commands
970
+ Keep browser plans session-scoped: open a URL, inspect refs, act on refs/selectors, verify with wait/get/is/snapshot, capture screenshot only when visual evidence is needed, then close.`},...C};function A(e,t,n){let r=n.endsWith(`?`),i=r?n.slice(0,-1):n,a=/^[a-z-]+(?:\|[a-z-]+)+$/i.test(i),o=a||t.usageOverride!==void 0&&t.usageOverride.startsWith(`${e} ${i}`);return r?a?`[${i}]`:o?i:`[${i}]`:o?i:`<${i}>`}function j(e,t){return t.listUsageOverride?t.listUsageOverride:[e,...(t.positionalArgs??[]).map(n=>A(e,t,n))].join(` `)}function M(){return w()}function N(){return`agent-device help commands
985
971
 
986
972
  Full command catalog. Use agent-device help <command> for exact flags and behavior.
987
973
 
988
- ${I(n().map(e=>{let t=c(e);return{name:e,schema:t,usage:D(e,t)}}))}
974
+ ${B(n().map(e=>{let t=l(e);return{name:e,schema:t,usage:j(e,t)}}))}
989
975
 
990
- ${N(`Device Selection (shared by device commands; help <command> lists each command's flags):`,j(o))}
976
+ ${L(`Device Selection (shared by device commands; help <command> lists each command's flags):`,F(i))}
991
977
 
992
- ${N(`Global Flags:`,j(i))}
978
+ ${L(`Global Flags:`,F(s))}
993
979
 
994
- ${F(`Configuration:`,x)}
980
+ ${z(`Configuration:`,E)}
995
981
 
996
- ${P(`Environment:`,S)}
982
+ ${R(`Environment:`,D)}
997
983
 
998
- ${F(`Examples:`,C)}
999
- `}function A(){return O()}function j(e){return r().filter(t=>e.has(t.key)&&t.usageLabel!==void 0&&t.usageDescription!==void 0)}function M(e,t){return t?e.map(e=>{let n=t[e.key];return n===void 0?e:{...e,usageDescription:n}}):e}function N(e,t){return P(e,t.map(e=>({label:e.usageLabel??``,description:e.usageDescription??``})))}function P(e,t){if(t.length===0)return`${e}\n (none)`;let n=Math.max(...t.map(e=>Math.min(e.label.length,26)))+2,r=[e];for(let e of t){let t=e.label.length<=26?e.label.padEnd(n):`${e.label} `;r.push(` ${t}${e.description}`)}return r.join(`
1000
- `)}function F(e,t){return t.length===0?`${e}\n (none)`:[e,...t.map(e=>` ${e}`)].join(`
1001
- `)}function I(e){return P(`Commands:`,e.map(e=>({label:e.usage,description:e.schema.text.summary})))}function L(e){let t=B(e);if(t)return t;let n=l(e);if(!n)return null;let r=v(e,n),i=M(j(new Set(n.allowedFlags??[])),n.flagDescriptionOverrides),o=[];i.length>0&&o.push(N(`Command flags:`,i));let s=o.length>0?`\n\n${o.join(`
984
+ ${z(`Examples:`,O)}
985
+ `}function P(){return M()}function F(e){return r().filter(t=>e.has(t.key)&&t.usageLabel!==void 0&&t.usageDescription!==void 0)}function I(e,t){return t?e.map(e=>{let n=t[e.key];return n===void 0?e:{...e,usageDescription:n}}):e}function L(e,t){return R(e,t.map(e=>({label:e.usageLabel??``,description:e.usageDescription??``})))}function R(e,t){if(t.length===0)return`${e}\n (none)`;let n=Math.max(...t.map(e=>Math.min(e.label.length,26)))+2,r=[e];for(let e of t){let t=e.label.length<=26?e.label.padEnd(n):`${e.label} `;r.push(` ${t}${e.description}`)}return r.join(`
986
+ `)}function z(e,t){return t.length===0?`${e}\n (none)`:[e,...t.map(e=>` ${e}`)].join(`
987
+ `)}function B(e){return R(`Commands:`,e.map(e=>({label:e.usage,description:e.schema.text.summary})))}function V(e){let t=W(e);if(t)return t;let n=u(e);if(!n)return null;let r=y(e,n),i=I(F(new Set(n.allowedFlags??[])),n.flagDescriptionOverrides),o=[];i.length>0&&o.push(L(`Command flags:`,i));let s=o.length>0?`\n\n${o.join(`
1002
988
 
1003
989
  `)}`:``;return`Usage:
1004
990
  agent-device ${r}
1005
991
 
1006
992
  ${a(n.text)}${s}
1007
- `}function R(e){return L(u(e))}function z(){return Object.keys(T)}function B(e){let t=T[e];return t?`${V(e,e===`commands`?k():t.body)}
993
+ `}function H(e){return V(d(e))}function U(){return Object.keys(k)}function W(e){let t=k[e];return t?`${G(e,e===`commands`?N():t.body)}
1008
994
 
1009
995
  Related:
1010
996
  agent-device help <command> command-specific flags
1011
997
  agent-device help manual-qa routine QA loop
1012
998
  agent-device help workflow full automation reference
1013
- `:null}function V(e,t){let n=`agent-device help ${e}`;return t.startsWith(n)?`agent-device ${s()} — ${e}${t.slice(n.length)}`:t}export{R as i,b as n,z as r,A as t};
999
+ `:null}function G(e,t){let n=`agent-device help ${e}`;return t.startsWith(n)?`agent-device ${c()} — ${e}${t.slice(n.length)}`:t}export{H as i,T as n,U as r,P as t};