agent-device 0.21.19 → 0.21.21

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 (369) hide show
  1. package/android/ime-helper/dist/{agent-device-android-ime-helper-0.21.19.apk → agent-device-android-ime-helper-0.21.21.apk} +0 -0
  2. package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.21.apk.sha256 +1 -0
  3. package/android/ime-helper/dist/{agent-device-android-ime-helper-0.21.19.manifest.json → agent-device-android-ime-helper-0.21.21.manifest.json} +4 -4
  4. package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.21.apk +0 -0
  5. package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.21.apk.sha256 +1 -0
  6. package/android/snapshot-helper/dist/{agent-device-android-snapshot-helper-0.21.19.manifest.json → agent-device-android-snapshot-helper-0.21.21.manifest.json} +6 -6
  7. package/apple/macos-helper/Sources/AgentDeviceMacOSHelper/AppWindowScreenshot.swift +73 -0
  8. package/apple/macos-helper/Sources/AgentDeviceMacOSHelper/BackgroundInteraction.swift +557 -0
  9. package/apple/macos-helper/Sources/AgentDeviceMacOSHelper/GhostCursor.swift +141 -0
  10. package/apple/macos-helper/Sources/AgentDeviceMacOSHelper/SnapshotTraversal.swift +107 -3
  11. package/apple/macos-helper/Sources/AgentDeviceMacOSHelper/main.swift +136 -22
  12. package/apple/macos-helper/Tests/AgentDeviceMacOSHelperTests/BackgroundInteractionTests.swift +88 -0
  13. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunner/AgentDeviceRunnerApp.m +133 -4
  14. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSynthesizedGesture.h +10 -2
  15. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSynthesizedGesture.m +36 -9
  16. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Alert.swift +28 -0
  17. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandJournal.swift +1 -14
  18. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Interaction.swift +14 -16
  19. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Models.swift +67 -14
  20. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedCommitDeadline.swift +6 -1
  21. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedGesturePolicy.swift +7 -2
  22. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedInteraction.swift +21 -7
  23. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedTextEntry.swift +121 -17
  24. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntry.swift +179 -6
  25. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryConfirmation.swift +119 -0
  26. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryFocus.swift +8 -1
  27. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryReadiness.swift +23 -11
  28. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextInputProbe.swift +59 -6
  29. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextTyping.swift +112 -23
  30. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TypeExecution.swift +25 -12
  31. package/dist/apple/runner/AgentDeviceRunner/RecordingScripts/RecordingExportSupport.swift +6 -1
  32. package/dist/apple/runner/AgentDeviceRunner/RecordingScripts/recording-overlay.swift +43 -13
  33. package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotModels.swift +20 -5
  34. package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotPresentationProjection.swift +2 -15
  35. package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotVisibilityFold.swift +10 -25
  36. package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotVisibilityFoldProjection.swift +1 -18
  37. package/dist/src/adapter.js +1 -1
  38. package/dist/src/adb-executor.js +2 -2
  39. package/dist/src/adb-failure.js +1 -1
  40. package/dist/src/adb-transport.js +1 -1
  41. package/dist/src/agent-browser-lifecycle.js +1 -1
  42. package/dist/src/agent-browser-process-record.js +1 -1
  43. package/dist/src/agent-browser-provider.js +1 -1
  44. package/dist/src/agent-browser-tool.js +1 -1
  45. package/dist/src/agent-device-client.js +2 -2
  46. package/dist/src/ai-sdk.js +1 -1
  47. package/dist/src/alert-runtime.js +1 -1
  48. package/dist/src/alert.js +1 -0
  49. package/dist/src/android-adb.d.ts +12 -0
  50. package/dist/src/android-input-ownership.js +1 -1
  51. package/dist/src/app-backend.js +1 -0
  52. package/dist/src/app-catalog.js +1 -1
  53. package/dist/src/app-deployment-resolution.js +1 -1
  54. package/dist/src/app-inventory.js +1 -1
  55. package/dist/src/app-launch.js +2 -2
  56. package/dist/src/app-lifecycle.js +2 -2
  57. package/dist/src/app-lifecycle2.js +1 -1
  58. package/dist/src/app-log-files.js +1 -1
  59. package/dist/src/app-log-reconnect.js +1 -1
  60. package/dist/src/app-log-runtime2.js +3 -3
  61. package/dist/src/app-log-session-resource.js +1 -0
  62. package/dist/src/app-resolution.js +2 -2
  63. package/dist/src/apple-runner-platform.js +1 -1
  64. package/dist/src/application-lifecycle-interaction.js +1 -1
  65. package/dist/src/archive.js +2 -2
  66. package/dist/src/artifact-download.js +1 -1
  67. package/dist/src/auth-session.js +1 -1
  68. package/dist/src/auth.js +1 -1
  69. package/dist/src/back-mode.js +1 -1
  70. package/dist/src/backend-snapshot-options.js +1 -1
  71. package/dist/src/boot-diagnostics.js +1 -1
  72. package/dist/src/browser-launch.js +1 -1
  73. package/dist/src/cache.js +1 -1
  74. package/dist/src/capabilities.js +1 -1
  75. package/dist/src/capture.js +1 -1
  76. package/dist/src/cli-config.js +1 -1
  77. package/dist/src/cli-help.js +317 -323
  78. package/dist/src/cli-runner.js +1 -1
  79. package/dist/src/cli.js +4 -4
  80. package/dist/src/click-button.js +1 -1
  81. package/dist/src/client-metro-companion.js +1 -1
  82. package/dist/src/client-metro.js +1 -1
  83. package/dist/src/client-options.js +3 -0
  84. package/dist/src/client-types.d.ts +101 -6
  85. package/dist/src/clipboard-shell-response.js +1 -1
  86. package/dist/src/{scroll-command.d.ts → cloud-artifacts.d.ts} +249 -240
  87. package/dist/src/code-signature-cache.js +1 -1
  88. package/dist/src/code-signature.js +1 -1
  89. package/dist/src/command-schema.js +3 -3
  90. package/dist/src/command-tools.js +2 -2
  91. package/dist/src/command.js +1 -1
  92. package/dist/src/config.js +1 -1
  93. package/dist/src/connection-runtime.js +1 -1
  94. package/dist/src/connection.js +5 -5
  95. package/dist/src/contracts.d.ts +1 -1
  96. package/dist/src/contracts.js +1 -1
  97. package/dist/src/daemon-artifacts.js +1 -0
  98. package/dist/src/daemon-client-lease-beat.js +1 -1
  99. package/dist/src/daemon-client-lifecycle.js +1 -1
  100. package/dist/src/daemon-client-liveness-probe.js +1 -0
  101. package/dist/src/daemon-client-transport.js +1 -1
  102. package/dist/src/daemon-http.js +1 -0
  103. package/dist/src/daemon-policy-file.js +1 -1
  104. package/dist/src/daemon-registration-owner.js +1 -0
  105. package/dist/src/daemon-registration.js +1 -1
  106. package/dist/src/daemon-resolution.js +1 -1
  107. package/dist/src/daemon-shutdown-report.js +1 -1
  108. package/dist/src/daemon.js +2 -2
  109. package/dist/src/debug-symbols-facade.js +3 -3
  110. package/dist/src/device-claim-inspection.js +1 -1
  111. package/dist/src/device-claim-rule.js +1 -1
  112. package/dist/src/device-inventory-context.js +1 -1
  113. package/dist/src/device-readiness-runtime.js +1 -1
  114. package/dist/src/device-release.js +1 -1
  115. package/dist/src/device-rotation.js +1 -1
  116. package/dist/src/device-selection-resolver.js +1 -1
  117. package/dist/src/device-session.js +1 -1
  118. package/dist/src/device-shell.js +1 -1
  119. package/dist/src/device.js +1 -1
  120. package/dist/src/device2.js +1 -3
  121. package/dist/src/device3.js +3 -0
  122. package/dist/src/devicectl.js +1 -1
  123. package/dist/src/diagnostics.js +3 -3
  124. package/dist/src/dispatch-resolve.js +4 -1
  125. package/dist/src/display-inventory.js +1 -1
  126. package/dist/src/doctor-facade.js +1 -1
  127. package/dist/src/doctor2.js +1 -1
  128. package/dist/src/durable-capture-resource.js +1 -0
  129. package/dist/src/engine-eval-script.js +1 -1
  130. package/dist/src/error.js +1 -1
  131. package/dist/src/exec.js +1 -1
  132. package/dist/src/file.js +1 -1
  133. package/dist/src/find.js +1 -1
  134. package/dist/src/generic-settle.js +1 -1
  135. package/dist/src/generic.js +1 -1
  136. package/dist/src/gesture-admission.js +1 -1
  137. package/dist/src/gesture-plan.js +1 -1
  138. package/dist/src/gesture-runtime.js +1 -1
  139. package/dist/src/harmonyos.js +1 -1
  140. package/dist/src/hdc.js +1 -1
  141. package/dist/src/helper.js +2 -2
  142. package/dist/src/host-file.js +1 -1
  143. package/dist/src/host.js +1 -1
  144. package/dist/src/human-control-contract.js +1 -1
  145. package/dist/src/human-control.js +1 -1
  146. package/dist/src/index.d.ts +2 -2
  147. package/dist/src/index.js +1 -1
  148. package/dist/src/input-actions.js +1 -1
  149. package/dist/src/input-actions2.js +2 -2
  150. package/dist/src/install-artifact-facade.js +1 -1
  151. package/dist/src/install-source-network-transport.js +1 -1
  152. package/dist/src/install-source.d.ts +5 -0
  153. package/dist/src/install-source2.js +1 -1
  154. package/dist/src/instance-client.js +1 -0
  155. package/dist/src/interaction-positionals.js +1 -1
  156. package/dist/src/interaction-ref-policy.js +1 -1
  157. package/dist/src/interaction.js +1 -1
  158. package/dist/src/interaction2.js +1 -1
  159. package/dist/src/interactor-operation-binding.js +1 -1
  160. package/dist/src/interactor.js +5 -5
  161. package/dist/src/interactor2.js +1 -1
  162. package/dist/src/interactors.js +1 -1
  163. package/dist/src/internal/bin.js +1 -1
  164. package/dist/src/internal/daemon.js +1 -2
  165. package/dist/src/internal/png-worker.js +1 -1
  166. package/dist/src/internal/run-script-http-child.js +1 -1
  167. package/dist/src/inventory.js +4 -4
  168. package/dist/src/inventory2.js +1 -1
  169. package/dist/src/inventory3.js +1 -1
  170. package/dist/src/inventory5.js +1 -1
  171. package/dist/src/ios-client.js +4 -30
  172. package/dist/src/ios-settings.js +1 -0
  173. package/dist/src/ios-snapshot-engine.js +1 -1
  174. package/dist/src/ios-snapshot-runtime.js +1 -1
  175. package/dist/src/launch-confirmation.js +1 -0
  176. package/dist/src/lease-context.js +1 -1
  177. package/dist/src/lease-registry-scope.js +1 -0
  178. package/dist/src/lease-scope.js +1 -1
  179. package/dist/src/lease.js +1 -1
  180. package/dist/src/legacy-xctest-device-set.js +1 -1
  181. package/dist/src/limrun-download-file.js +1 -1
  182. package/dist/src/limrun-runtime-dependencies.js +1 -1
  183. package/dist/src/limrun.d.ts +78 -44
  184. package/dist/src/limrun.js +1 -1
  185. package/dist/src/linux.js +1 -1
  186. package/dist/src/load.js +1 -0
  187. package/dist/src/location-coordinates.js +1 -1
  188. package/dist/src/macos-facade.js +1 -1
  189. package/dist/src/managed-device-scope.js +1 -1
  190. package/dist/src/mechanics.js +16 -16
  191. package/dist/src/observation.js +1 -1
  192. package/dist/src/observe-until.js +1 -1
  193. package/dist/src/overlay.js +2 -2
  194. package/dist/src/owner-identity.js +3 -3
  195. package/dist/src/path-resolution.js +1 -1
  196. package/dist/src/perf-facade.js +1 -1
  197. package/dist/src/perf-runtime-operation-builder.js +1 -1
  198. package/dist/src/perf-runtime-plan.js +1 -1
  199. package/dist/src/perf-target.js +1 -1
  200. package/dist/src/perf.js +1 -1
  201. package/dist/src/physical-device-control.js +1 -1
  202. package/dist/src/platform-request-scope.js +1 -1
  203. package/dist/src/platform-runtime-android-adb-host.js +1 -1
  204. package/dist/src/platform-runtime-app-log-process.js +1 -1
  205. package/dist/src/platform-runtime-host.js +1 -1
  206. package/dist/src/platform-runtime-managed-owner.js +1 -1
  207. package/dist/src/platform-runtime-open-target.js +1 -1
  208. package/dist/src/platform-runtime-operation-host.js +2 -2
  209. package/dist/src/platform-runtime-runtime-hints.js +2 -2
  210. package/dist/src/platform-runtime-screen-recording-android-host.js +1 -1
  211. package/dist/src/platform-runtime-screen-recording-apple-runner-transport.js +1 -1
  212. package/dist/src/platform-runtime-screen-recording-apple-simulator-host.js +1 -1
  213. package/dist/src/platform-runtime-screen-recording-finalizer-host.js +1 -1
  214. package/dist/src/platform-runtime-screen-recording-output-host.js +1 -1
  215. package/dist/src/platform-runtime-screen-recording-process-host.js +1 -1
  216. package/dist/src/platform-runtime-unavailable.js +1 -1
  217. package/dist/src/platform-runtime.js +1 -1
  218. package/dist/src/platform-runtime2.js +1 -1
  219. package/dist/src/plugins.d.ts +9 -0
  220. package/dist/src/plugins.js +1 -0
  221. package/dist/src/plugins2.js +2 -0
  222. package/dist/src/png-crop-bytes.js +1 -1
  223. package/dist/src/png-size.js +1 -1
  224. package/dist/src/png-worker-client.js +1 -1
  225. package/dist/src/png.js +1 -1
  226. package/dist/src/prepare-kind.js +1 -1
  227. package/dist/src/process.js +1 -1
  228. package/dist/src/project-runtime.js +1 -1
  229. package/dist/src/provider-credential-fingerprint.js +1 -0
  230. package/dist/src/provider-device-admission.js +1 -1
  231. package/dist/src/provider-device-runtimes.js +1 -0
  232. package/dist/src/provider-limrun-credentials.js +1 -0
  233. package/dist/src/provider-profile-fields.js +1 -0
  234. package/dist/src/provider-session-ownership.js +2 -2
  235. package/dist/src/provider-webdriver.js +2 -1
  236. package/dist/src/providers.js +1 -1
  237. package/dist/src/proxy.js +1 -1
  238. package/dist/src/quality-warnings.js +1 -1
  239. package/dist/src/react-native.js +1 -1
  240. package/dist/src/record-runtime.js +1 -1
  241. package/dist/src/record-trace.js +1 -1
  242. package/dist/src/recording.js +1 -1
  243. package/dist/src/rect-center.js +1 -1
  244. package/dist/src/register-builtins.js +1 -1
  245. package/dist/src/registry.js +52 -36
  246. package/dist/src/remote-config2.js +1 -1
  247. package/dist/src/replay-divergence.js +1 -1
  248. package/dist/src/replay.js +2 -2
  249. package/dist/src/reporting.js +5 -5
  250. package/dist/src/request-admission.js +1 -1
  251. package/dist/src/request-cancel.js +1 -1
  252. package/dist/src/request-cancellation.js +1 -1
  253. package/dist/src/request-runtime-binding.js +1 -1
  254. package/dist/src/result-serialization.js +1 -1
  255. package/dist/src/retry.js +1 -1
  256. package/dist/src/runner-artifact-manifest.js +1 -1
  257. package/dist/src/runner-cache-metadata.js +3 -3
  258. package/dist/src/runner-client.js +1 -1
  259. package/dist/src/runner-dev-tools-security.js +1 -1
  260. package/dist/src/runner-device-readiness.js +1 -1
  261. package/dist/src/runner-disposal.js +1 -1
  262. package/dist/src/runner-error-classification.js +2 -2
  263. package/dist/src/runner-exchange.js +1 -1
  264. package/dist/src/runner-operations-facade.js +1 -1
  265. package/dist/src/runner-session-types.js +1 -1
  266. package/dist/src/runner-start-budget.js +1 -1
  267. package/dist/src/runner.js +1 -1
  268. package/dist/src/runtime-admission.js +1 -1
  269. package/dist/src/runtime-transport-hints.js +1 -1
  270. package/dist/src/runtime.js +1 -1
  271. package/dist/src/runtime10.js +2 -2
  272. package/dist/src/runtime2.js +3 -3
  273. package/dist/src/runtime3.js +1 -1
  274. package/dist/src/runtime4.js +5 -5
  275. package/dist/src/runtime5.js +1 -1
  276. package/dist/src/runtime6.js +1 -1
  277. package/dist/src/runtime7.js +1 -1
  278. package/dist/src/runtime8.js +1 -1
  279. package/dist/src/runtime9.js +1 -1
  280. package/dist/src/screen-recording-admission-ledger.js +1 -1
  281. package/dist/src/screen-recording-completion.js +1 -1
  282. package/dist/src/screen-recording-options.js +1 -1
  283. package/dist/src/screen-recording-resource-recovery.js +1 -1
  284. package/dist/src/screen-recording-transport.js +1 -1
  285. package/dist/src/screenshot-density.js +1 -1
  286. package/dist/src/screenshot-image.js +1 -1
  287. package/dist/src/screenshot-result.js +1 -1
  288. package/dist/src/screenshot-runtime.js +1 -1
  289. package/dist/src/screenshot.js +1 -1
  290. package/dist/src/screenshot3.js +1 -1
  291. package/dist/src/script.js +1 -1
  292. package/dist/src/scroll-command.js +1 -1
  293. package/dist/src/scroll-gesture.js +1 -1
  294. package/dist/src/sdk-batch-runner.js +2 -2
  295. package/dist/src/sdk-batch.js +2 -2
  296. package/dist/src/sdk-contracts.d.ts +47 -2
  297. package/dist/src/sdk-contracts.js +2 -2
  298. package/dist/src/sdk-device.js +1 -1
  299. package/dist/src/sdk-io.js +1 -1
  300. package/dist/src/sdk-remote-config.js +1 -1
  301. package/dist/src/sdk-selectors.d.ts +37 -8
  302. package/dist/src/selection.js +0 -0
  303. package/dist/src/selector-runtime.js +1 -1
  304. package/dist/src/selectors.d.ts +2 -2
  305. package/dist/src/selectors.js +1 -1
  306. package/dist/src/server.js +1 -1
  307. package/dist/src/session-allocation.js +1 -1
  308. package/dist/src/session-artifact-paths.js +1 -1
  309. package/dist/src/session-repair-tombstone.js +1 -1
  310. package/dist/src/session-routing.js +1 -1
  311. package/dist/src/session-runtime-admission.js +1 -1
  312. package/dist/src/session-snapshot.js +1 -1
  313. package/dist/src/session-stream.js +27 -0
  314. package/dist/src/session.js +1 -1
  315. package/dist/src/session2.js +5 -5
  316. package/dist/src/settings.js +1 -1
  317. package/dist/src/settings2.js +1 -1
  318. package/dist/src/simctl-settings-facade.js +1 -0
  319. package/dist/src/simctl-settings.js +1 -0
  320. package/dist/src/simctl.js +1 -1
  321. package/dist/src/simulator-boot.js +1 -1
  322. package/dist/src/simulator.js +1 -1
  323. package/dist/src/snapshot-diagnostics.js +1 -1
  324. package/dist/src/snapshot-runtime-binding.js +1 -1
  325. package/dist/src/snapshot-runtime.js +1 -1
  326. package/dist/src/snapshot-state.js +1 -1
  327. package/dist/src/snapshot2.js +1 -1
  328. package/dist/src/snapshot3.js +1 -1
  329. package/dist/src/snapshot4.js +1 -1
  330. package/dist/src/src.js +1 -1
  331. package/dist/src/src7.js +1 -1
  332. package/dist/src/src8.js +2 -2
  333. package/dist/src/store.js +1 -0
  334. package/dist/src/string-enum.js +1 -1
  335. package/dist/src/surface-snapshot.js +1 -1
  336. package/dist/src/takeover.js +1 -1
  337. package/dist/src/target-evidence.js +1 -1
  338. package/dist/src/telemetry.js +1 -1
  339. package/dist/src/text-entry-focus.js +1 -1
  340. package/dist/src/tool-provider.js +3 -3
  341. package/dist/src/tool-provider2.js +1 -1
  342. package/dist/src/tool-provider3.js +1 -1
  343. package/dist/src/toolchain-probe.js +2 -2
  344. package/dist/src/touch-runtime.js +1 -1
  345. package/dist/src/touch-runtime2.js +1 -1
  346. package/dist/src/transport.js +2 -2
  347. package/dist/src/tv-remote.js +1 -1
  348. package/dist/src/type-text-runtime.js +1 -1
  349. package/dist/src/update-check.js +1 -1
  350. package/dist/src/vars.js +1 -1
  351. package/dist/src/verified-file.js +1 -1
  352. package/dist/src/version.js +1 -1
  353. package/dist/src/video.js +1 -1
  354. package/dist/src/viewport.js +1 -1
  355. package/dist/src/web.js +1 -1
  356. package/dist/src/web2.js +1 -1
  357. package/dist/src/webdriver-source.js +1 -1
  358. package/package.json +5 -1
  359. package/server.json +2 -2
  360. package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.19.apk.sha256 +0 -1
  361. package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.19.apk +0 -0
  362. package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.19.apk.sha256 +0 -1
  363. package/dist/src/api.js +0 -3
  364. package/dist/src/daemon-process.js +0 -1
  365. package/dist/src/multitouch-support.js +0 -1
  366. package/dist/src/parameterized-recorded-fill.js +0 -1
  367. package/dist/src/runner-startup-transport.js +0 -1
  368. package/dist/src/runner-xctestrun.js +0 -1
  369. package/dist/src/session-store.js +0 -4
@@ -1,65 +1,16 @@
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,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]
3
-
4
- Automates iOS, Android, macOS, TV, and web apps for AI agents.
5
- All ${n().length} commands: agent-device help commands
6
-
7
- Start:
8
- When starting a task with a known app, first run:
9
- agent-device open <app> --foreground
10
- It starts the session and returns the initial interactive snapshot with @refs.
11
- Do not probe first with devices, apps, appstate, snapshot, or screenshot.
12
- Unknown app id: devices, then apps, then open <discovered-id>. Never invent ids.
13
- Resuming an existing session: continue from its current state; do not reopen it.
14
-
15
- Loop:
16
- press|click|fill|longpress <target> ... --settle
17
- hover <target> --settle (web only; reveals hover-gated UI)
18
- scroll <direction|top|bottom> [amount] --settle; back --settle
19
- acts, waits for quiet, and prints the UI diff. Continue from that diff.
20
- Run snapshot -i only when the diff lacks the next target or did not settle.
21
- Verify a named expectation with the diff, wait text "...", wait <selector>, wait absent <selector>,
22
- is, get, or find. A bare screenshot is not verification.
23
- End with: agent-device close
24
-
25
- Targets:
26
- Copy refs exactly: @e12, @e12~s4. Keep @ and any ~sN pin; refs go stale
27
- after mutations. A literal @handle is label="@handle", not a bare ref.
28
- Prefer refs, then id/label/role selectors. Selector keys: ${t.join(` `)}.
29
- Coordinates are last resort: after snapshot -i shows no semantic target, or a
30
- sparse/AX-unavailable warning says its refs and selectors are invalid.
31
- Then screenshot, press <x> <y>, and re-snapshot on the changed screen.
32
-
33
- Rules:
34
- --settle is only for press/click/fill/longpress/hover/scroll/back; never open,
35
- snapshot, or close. type never accepts --settle.
36
- fill <target> <text> --settle replaces; type <text> appends after focus.
37
- Late network/debounce result: wait text "Expected", not snapshot polling.
38
- Output full agent-device commands; no pipes, grep, jq, or pseudo-commands.
39
- Stop when the requested end state is visible. Mutations run serially.
40
-
41
- More commands (exact shapes: agent-device help <command>):
42
- open install devices apps boot close app and device lifecycle
43
- screenshot record logs network perf trace evidence and diagnostics
44
- replay test batch session scripted flows
45
- alert keyboard clipboard settings gesture system and input
46
-
47
- Guides (agent-device help <topic>):
48
- workflow full refs, selectors, waits, recovery, and platform limits
49
- manual-qa / dogfood / validate / debugging / scripting / gestures
50
- react-native / react-devtools / cdp / tv / web / macos / remote
51
- physical-device / ios-system-ui / maestro
52
- 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
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; runFlow.when and repeat.while conditions (platform, visible, notVisible, and true, all re-evaluated before every repeat iteration); onFlowStart/onFlowComplete; repeat with times, while, or both; 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 and condition true: fields (runFlow.when and repeat.while share one evaluator) are evaluated as JavaScript (flow env and prior output leaves are string-typed); a true: field that is a boolean, a maestro.platform comparison, or plain literal text after ${VAR} lookups is decided without JavaScript, with the assertTrue falsy table for literal text. Other fields stay literal or ${VAR} lookup-only — assertTrue supports literals and bare lookups, 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, evalScript, and JavaScript condition true: fields 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 and true: fields that need JavaScript are 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
63
14
 
64
15
  Use this when asked to follow a manual QA script, test case, checklist, acceptance flow, or user-provided instructions.
65
16
 
@@ -89,23 +40,290 @@ Command shapes:
89
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.
90
41
 
91
42
  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.
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
+ iOS accessibility-driven fill into a field whose accessibility value does not echo the typed text (an OTP input announcing "6 of 6 digits") succeeds with the same verification: "unconfirmed" evidence when that field's value moved off its post-clear baseline. Dropped characters and stale prefixes still fail, and the coordinate-driven fill route still requires an exact match. Confirm the code through the slots or the next screen; do not retry the fill or switch to per-character typing.
176
+
177
+ React Native internals:
178
+ 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
179
+
180
+ Use this when asked to dogfood, exploratory test, bug hunt, QA, or find issues in an app.
181
+
182
+ Goal:
183
+ Find user-visible issues from runtime behavior. Do not read app source or invent findings from code.
184
+ Produce a concise report with severity, repro commands, expected/actual behavior, and evidence paths.
185
+
186
+ Loop:
187
+ 1. Identify target app/platform; ask only if missing.
188
+ 2. Create output dirs and open the app. If auth or OTP is required, sign in or ask the user for the code.
189
+ 3. Capture baseline snapshot -i and screenshot.
190
+ 4. Map top-level navigation, then exercise primary flows and edge states.
191
+ 5. For each issue, capture evidence and write the finding immediately, then continue.
192
+ 6. Close the session and reconcile the report summary.
193
+ Keep stateful commands serial within the same session. Parallel runs can pollute text fields, focus, alerts, and navigation state.
194
+
195
+ Coverage:
196
+ Navigation, forms, empty/error/loading states, offline or retry behavior, permissions, settings, accessibility labels, orientation/keyboard, and obvious performance stalls.
197
+ 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.
198
+ 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.
199
+ Android RN/Expo/Re.Pack dev server: direct Android localhost URL opens with a port auto-configure host reachability.
200
+ Categories: visual, functional, UX, content, performance, diagnostics, permissions, accessibility.
201
+ Severity: critical blocks a core flow/data/crashes; high breaks a major feature; medium has friction or workaround; low is polish.
202
+
203
+ Evidence commands:
204
+ mkdir -p ./dogfood-output/screenshots ./dogfood-output/videos ./dogfood-output/traces
205
+ agent-device open <app> --platform ios
206
+ agent-device snapshot -i
207
+ agent-device screenshot ./dogfood-output/screenshots/initial.png
208
+ agent-device screenshot ./dogfood-output/screenshots/issue-001.png --overlay-refs
209
+ agent-device logs clear --restart
210
+ agent-device logs mark "issue-001 repro"
211
+ agent-device logs path
212
+ agent-device record start ./dogfood-output/videos/issue-001.mp4
213
+ agent-device record start ./dogfood-output/videos/benchmark.mp4 --hide-touches
214
+ agent-device record stop
215
+ agent-device close
216
+
217
+ Evidence rules:
218
+ Interactive/behavioral issues need step screenshots and usually a repro video.
219
+ Static/on-load issues can use one screenshot; set repro video to N/A.
220
+ Use screenshot --overlay-refs when showing the tappable target or broken state helps repro.
221
+
222
+ Report shape:
223
+ ./dogfood-output/report.md
224
+ Include date, platform, target app, session, scope, severity counts, and issues.
225
+ For each finding: ID, severity, category, title, affected flow/screen, repro commands, expected, actual, evidence files, notes.
226
+ 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.
227
+
228
+ Rules:
229
+ Findings must come from observed runtime behavior, not source reads.
230
+ After each mutation, use the --settle diff as evidence when available; otherwise re-snapshot.
231
+ Wait timeouts are integer milliseconds in the trailing positional: agent-device wait 'role=tab' 10000. Do not write duration suffixes such as 10s.
232
+ 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.
233
+ Keep commands in the report reproducible; use selectors or refs from fresh snapshots, not guessed coordinates.
234
+ Prefer refs for exploration and selectors for deterministic replay.
235
+ 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.
236
+ Never delete screenshots, videos, traces, or report artifacts during a session.
237
+ 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
238
+
239
+ Use this when validating a code change, release candidate, performance fix, visual behavior, logging path, replay, or device-facing regression.
240
+
241
+ Contract:
242
+ 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.
243
+ Keep evidence reproducible: exact commands, target device/app, observed output, artifact paths, and cleanup status.
244
+
245
+ Required freshness gate before device verification:
246
+ For a TypeScript runtime or CLI output change, start with pnpm build. For non-Android device verification, run pnpm clean:daemon next.
247
+ Before local Android verification, run pnpm build:android before pnpm clean:daemon so the bundled helpers match current source.
248
+ 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.
249
+ Use open --relaunch when startup state matters. Use a purpose-specific --session for multi-step validation.
250
+ 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.
251
+
252
+ Loop:
253
+ 1. Build or prepare the changed surface with the repo command that owns it.
254
+ 2. Open the target app/device state explicitly.
255
+ 3. Use snapshot -i and press/fill/click/longpress --settle for UI-driving steps.
256
+ 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.
257
+ 5. Record timings, token/output size, screenshots/videos, logs, or perf artifacts only when they answer the validation question.
258
+ 6. Close sessions and release leases before finishing.
259
+
260
+ Evidence:
261
+ CLI/runtime freshness: pnpm build, pnpm clean:daemon, then agent-device --version or the command under test.
262
+ Apple runner freshness: pnpm build:xcuitest, then a live agent-device command on the target simulator/device.
263
+ Visual claim: screenshot, optionally screenshot --overlay-refs when target mapping matters.
264
+ Runtime/logging claim: logs clear --restart, logs mark, reproduce, logs path.
265
+ Network claim: network dump --include headers when headers are relevant.
266
+ Performance claim: perf frames, perf memory sample, native profile reports, or trace artifacts with bounded output.
267
+ Replay/regression claim: replay or test through the public command path.
268
+
269
+ Report:
270
+ Summarize what changed, exact validation commands, pass/fail observations, artifact paths, and residual risk.
271
+ If live validation is blocked, state the blocker, device/session, and exact next command needed.`}};function w(){return`agent-device <command> [args] [--json]
272
+
273
+ Automates iOS, Android, macOS, TV, and web apps for AI agents.
274
+ All ${n().length} commands: agent-device help commands
275
+
276
+ Start:
277
+ When starting a task with a known app, first run:
278
+ agent-device open <app> --foreground
279
+ It starts the session and returns the initial interactive snapshot with @refs.
280
+ Do not probe first with devices, apps, appstate, snapshot, or screenshot.
281
+ Unknown app id: devices, then apps, then open <discovered-id>. Never invent ids.
282
+ Resuming an existing session: continue from its current state; do not reopen it.
283
+
284
+ Loop:
285
+ press|click|fill|longpress <target> ... --settle
286
+ hover <target> --settle (web only; reveals hover-gated UI)
287
+ scroll <direction|top|bottom> [amount] --settle; back --settle
288
+ acts, waits for quiet, and prints the UI diff. Continue from that diff.
289
+ Run snapshot -i only when the diff lacks the next target or did not settle.
290
+ Verify a named expectation with the diff, wait text "...", wait <selector>, wait absent <selector>,
291
+ is, get, or find. A bare screenshot is not verification.
292
+ End with: agent-device close
293
+
294
+ Targets:
295
+ Copy refs exactly: @e12, @e12~s4. Keep @ and any ~sN pin; refs go stale
296
+ after mutations. A literal @handle is label="@handle", not a bare ref.
297
+ Prefer refs, then id/label/role selectors. Selector keys: ${t.join(` `)}.
298
+ Coordinates are last resort: after snapshot -i shows no semantic target, or a
299
+ sparse/AX-unavailable warning says its refs and selectors are invalid.
300
+ Then screenshot, press <x> <y>, and re-snapshot on the changed screen.
96
301
 
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.
302
+ Rules:
303
+ --settle is only for press/click/fill/longpress/hover/scroll/back; never open,
304
+ snapshot, or close. type never accepts --settle.
305
+ fill <target> <text> --settle replaces; type <text> appends after focus.
306
+ Late network/debounce result: wait text "Expected", not snapshot polling.
307
+ Output full agent-device commands; no pipes, grep, jq, or pseudo-commands.
308
+ Stop when the requested end state is visible. Mutations run serially.
309
+
310
+ More commands (exact shapes: agent-device help <command>):
311
+ open install devices apps boot close app and device lifecycle
312
+ screenshot record logs network perf trace evidence and diagnostics
313
+ replay test batch session scripted flows
314
+ alert keyboard clipboard settings gesture system and input
103
315
 
104
- ${w}`},maestro:{summary:`Supported Maestro YAML commands, grammar, and runtime boundaries`,body:`agent-device help maestro
316
+ Guides (agent-device help <topic>):
317
+ workflow full refs, selectors, waits, recovery, and platform limits
318
+ manual-qa / dogfood / validate / debugging / scripting / gestures
319
+ react-native / react-devtools / cdp / tv / web / macos / remote
320
+ physical-device / ios-system-ui / maestro
321
+ foldable iPhone Duo panels, the fold command, and why refs die on a pose change
322
+ `}var T=e({buildCommandUsageText:()=>V,buildUsageText:()=>P,helpTopicIds:()=>U,resolveHelpTargetUsageText:()=>H});const E=[`Default config files: ~/.agent-device/config.json (or <AGENT_DEVICE_HOME>/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
323
 
106
324
  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
325
 
108
- ${p()}
326
+ ${m()}
109
327
 
110
328
  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
329
  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 +366,7 @@ Session ordering:
148
366
  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
367
 
150
368
  Read-only and waits:
151
- ${w}
369
+ ${b}
152
370
  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
371
  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
372
 
@@ -187,6 +405,10 @@ Script paths are the caller's:
187
405
  replay <path> and test <path-or-glob> resolve and read on the machine running the command, then send the script content (Maestro runFlow includes too) with the request. The same flows therefore run against a local daemon and against a remote one (AGENT_DEVICE_DAEMON_BASE_URL) with no copy step, and a missing script fails immediately, naming the path you typed. --save-script writes on the DAEMON host and is rejected against a remote daemon.
188
406
  test --json marks a failed test with infrastructure: true only when the owning runtime classified a device, runner, boot, or transport failure. It remains a failed test; consumers may use the tag to distinguish "the oracle did not run" from a behavioral replay divergence without weakening either gate.
189
407
 
408
+ Script line grammar:
409
+ A .ad line is <command> [positional...] [flag...]. Whitespace splits tokens; a token quoted with " or ' is one argument, and single quotes keep a double quote literal, exactly as at the shell (press 'id="far"' is one selector). Values in double quotes are JSON strings (escape \\\\, \\", \\t, \\n). Values in single quotes are literal, as at the shell: a backslash keeps its own character and the only escape is \\' for an apostrophe. A script carries only the flags declared for that command and marked recorded, so the script form of a step matches the CLI form: scroll down --until 'id="x"', wait 'label="Sign in"' --raw. CLI-only spellings and per-request options are not part of a step: --settle, --verify, scroll --pixels/--duration-ms, and the device-selection flags (--platform, --serial, --device) are the common ones a script does not carry.
410
+ Reaching an off-screen target is viewport-independent in a script the same way it is at the CLI: write scroll down --until <selector>, not a fixed scroll amount that passes on one screen size and fails on another.
411
+
190
412
  Reusable open-to-destination scripts:
191
413
  Arm recording on the first open, perform the full journey, verify the destination with a selector-targeted wait, then publish without closing:
192
414
  agent-device open com.example.app --relaunch --save-script=screen-x.ad
@@ -296,129 +518,7 @@ Focus and visual truth:
296
518
  On Android TV and tvOS, if snapshot -i exposes a focused node, verify it with is focused <selector>.
297
519
  Use wait focused=true only when repeated snapshots preserve focus metadata for the app.
298
520
  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
521
+ 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
522
 
423
523
  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
524
 
@@ -678,23 +778,7 @@ Rules:
678
778
  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
779
  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
780
  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
781
+ 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
782
 
699
783
  Remote connection providers use the same lifecycle:
700
784
  connect -> install/open -> commands -> close -> disconnect
@@ -737,7 +821,7 @@ Human takeover of a leased remote device:
737
821
  agent-device takeover --session remote-session
738
822
  agent-device takeover status
739
823
  agent-device takeover release <hold-id>
740
- An HTTP-mode daemon also accepts authenticated GET/PUT/DELETE requests at /admin/human-control/holds on its loopback listener. Host administrators supply the exact lease backend/provider/device key and use the local daemon token, not a tenant credential. This host-admin route is intentionally not forwarded by agent-device proxy. Holds do not survive daemon restart; re-establish them after reconnecting.
824
+ An HTTP-mode daemon also accepts authenticated GET/PUT/DELETE requests at /admin/human-control/holds on its loopback listener. Host administrators supply the exact lease backend/provider/device key and use the local daemon token, not a tenant credential. This host-admin route is intentionally not forwarded by agent-device proxy. Holds do not survive daemon restart; re-establish them after reconnecting. The same listener and token serve GET/PUT/DELETE /admin/leases, where a host allocates a macos-app lease confining a client to one app (<bundleId> or <bundleId>@<pid>); tenants cannot allocate one.
741
825
 
742
826
  Cloud profile flow:
743
827
  agent-device connect
@@ -769,6 +853,8 @@ Limrun direct-device flow:
769
853
  agent-device connect limrun --platform android
770
854
 
771
855
  Limrun creates remote iOS simulators and Android emulators only. Do not pass local device selectors such as --udid, --serial, or --device.
856
+ To drive an existing instance without the API key, set LIM_IOS_INSTANCE_URL and LIM_IOS_INSTANCE_TOKEN, or LIM_ANDROID_INSTANCE_URL, LIM_ANDROID_INSTANCE_TOKEN, and LIM_ANDROID_INSTANCE_ADB_URL, from the instance status before connect. agent-device then never creates or deletes that instance; install, and apps before the first open, still need LIMRUN_API_KEY.
857
+ Set LIMRUN_KEEP_ALIVE=1 to ping the instance every 30 seconds while a session is open, so an idle session does not hit the Limrun inactivity timeout. It is off by default.
772
858
  agent-device apps
773
859
  agent-device open Example.apk
774
860
  agent-device snapshot -i
@@ -792,11 +878,12 @@ Rules:
792
878
  Prefer connect --remote-config over --daemon-base-url, --tenant, --run-id, and --lease-id when using a local profile.
793
879
  Use agent-device proxy for direct tunnel access to a Mac you control. Expose the printed proxy URL through cloudflared/ngrok, then run agent-device connect proxy with the tunnel URL and printed token before normal commands.
794
880
  Use Limrun, BrowserStack, and AWS Device Farm through local provider profiles; they do not accept a remote agent-device daemon URL.
795
- Device cloud credentials must be available before the command starts. Limrun uses LIMRUN_API_KEY. BrowserStack uses BROWSERSTACK_USERNAME and BROWSERSTACK_ACCESS_KEY. AWS Device Farm uses the AWS CLI credential chain, including CI-provided AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY/AWS_SESSION_TOKEN, AWS profiles, or web identity role variables.
881
+ Device cloud credentials must be available before the command starts. Limrun uses LIMRUN_API_KEY, or the LIM_*_INSTANCE_* variables for an existing instance. BrowserStack uses BROWSERSTACK_USERNAME and BROWSERSTACK_ACCESS_KEY. AWS Device Farm uses the AWS CLI credential chain, including CI-provided AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY/AWS_SESSION_TOKEN, AWS profiles, or web identity role variables.
882
+ A local daemon keeps the Limrun and BrowserStack credentials it started with. When the shell holds different ones, the first command that allocates a lease refuses with reason provider-credentials-changed; run agent-device daemon stop with the same --state-dir, then rerun the command. A shell that sets none of them uses the daemon's. A daemon with an HTTP auth hook serves remote callers and does not compare.
796
883
  Direct-provider connect performs read-only provider calls and saves active connection state only after verification succeeds. It never creates a device, instance, App Automate session, or AWS remote access session.
797
884
  connect without --session always creates a fresh remote session and prints that session in its next-step commands. Concurrent callers must pass the returned --session on every command; the ambient active connection is only a single-workflow convenience.
798
885
  To replace an existing connection, pass its returned session explicitly with --session <name> --force. --force without --session creates another fresh session and does not release or overwrite an unrelated active connection.
799
- Prefer short-lived AWS role credentials in CI. Generated connection profiles store app/device selectors and ARNs, not Limrun API keys, BrowserStack access keys, or AWS credentials.
886
+ Prefer short-lived AWS role credentials in CI. Generated connection profiles store app/device selectors and ARNs, not Limrun API keys or instance tokens, BrowserStack access keys, or AWS credentials.
800
887
  Limrun Android supports direct ADB port reverse for local Metro. Limrun iOS requires a public Metro/React DevTools URL because it cannot reach local host ports directly.
801
888
  After closing a device cloud session, run agent-device artifacts --json to retrieve provider video/log/dashboard URLs when the provider has made them available.
802
889
  connect proxy stores the connection profile and client identity. Proxy device leases are acquired on open and expire after five minutes without commands; devices may inspect proxy inventory without allocating.
@@ -888,126 +975,33 @@ Out of scope for agent-device web support:
888
975
  Rules:
889
976
  Do not claim web e2e CI exists unless a project workflow explicitly provides it.
890
977
  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
978
+ 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
979
 
986
980
  Full command catalog. Use agent-device help <command> for exact flags and behavior.
987
981
 
988
- ${I(n().map(e=>{let t=c(e);return{name:e,schema:t,usage:D(e,t)}}))}
982
+ ${B(n().map(e=>{let t=l(e);return{name:e,schema:t,usage:j(e,t)}}))}
989
983
 
990
- ${N(`Device Selection (shared by device commands; help <command> lists each command's flags):`,j(o))}
984
+ ${L(`Device Selection (shared by device commands; help <command> lists each command's flags):`,F(i))}
991
985
 
992
- ${N(`Global Flags:`,j(i))}
986
+ ${L(`Global Flags:`,F(s))}
993
987
 
994
- ${F(`Configuration:`,x)}
988
+ ${z(`Configuration:`,E)}
995
989
 
996
- ${P(`Environment:`,S)}
990
+ ${R(`Environment:`,D)}
997
991
 
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(`
992
+ ${z(`Examples:`,O)}
993
+ `}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(`
994
+ `)}function z(e,t){return t.length===0?`${e}\n (none)`:[e,...t.map(e=>` ${e}`)].join(`
995
+ `)}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
996
 
1003
997
  `)}`:``;return`Usage:
1004
998
  agent-device ${r}
1005
999
 
1006
1000
  ${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)}
1001
+ `}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
1002
 
1009
1003
  Related:
1010
1004
  agent-device help <command> command-specific flags
1011
1005
  agent-device help manual-qa routine QA loop
1012
1006
  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};
1007
+ `: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};