agent-device 0.21.37 → 0.21.38

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 (485) hide show
  1. package/android/ime-helper/dist/{agent-device-android-ime-helper-0.21.37.apk → agent-device-android-ime-helper-0.21.38.apk} +0 -0
  2. package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.38.apk.sha256 +1 -0
  3. package/android/ime-helper/dist/{agent-device-android-ime-helper-0.21.37.manifest.json → agent-device-android-ime-helper-0.21.38.manifest.json} +4 -4
  4. package/android/snapshot-helper/dist/{agent-device-android-snapshot-helper-0.21.37.apk → agent-device-android-snapshot-helper-0.21.38.apk} +0 -0
  5. package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.38.apk.sha256 +1 -0
  6. package/android/snapshot-helper/dist/{agent-device-android-snapshot-helper-0.21.37.manifest.json → agent-device-android-snapshot-helper-0.21.38.manifest.json} +7 -7
  7. package/apple/fold-helper/Fold.m +8 -4
  8. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerKeyboardReturnKey.swift +53 -0
  9. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+AXSnapshotFallback.swift +42 -4
  10. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift +26 -18
  11. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Interaction.swift +42 -11
  12. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Keyboard.swift +123 -22
  13. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Models.swift +7 -0
  14. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Navigation.swift +570 -53
  15. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests.swift +41 -0
  16. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerXCTestEventBridge.h +7 -0
  17. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerXCTestEventBridge.m +17 -1
  18. package/dist/src/THIRD_PARTY_NOTICES.txt +2 -2
  19. package/dist/src/absence-observation-errors.js +1 -1
  20. package/dist/src/absence-observation.js +1 -1
  21. package/dist/src/adapter.js +1 -1
  22. package/dist/src/adb-executor.js +1 -1
  23. package/dist/src/adb-failure.js +2 -2
  24. package/dist/src/adb-transport.js +1 -1
  25. package/dist/src/agent-browser-lifecycle.js +1 -1
  26. package/dist/src/agent-browser-process-record.js +1 -1
  27. package/dist/src/agent-browser-provider.js +1 -1
  28. package/dist/src/agent-browser-tool.js +1 -1
  29. package/dist/src/ai-sdk.d.ts +1 -1
  30. package/dist/src/ai-sdk.js +1 -1
  31. package/dist/src/alert-contract.js +1 -1
  32. package/dist/src/alert-tree-driver.js +1 -1
  33. package/dist/src/alert.js +1 -1
  34. package/dist/src/android-adb.d.ts +1 -1
  35. package/dist/src/android.js +1 -1
  36. package/dist/src/android2.js +1 -1
  37. package/dist/src/app-backend.js +1 -1
  38. package/dist/src/app-catalog.js +1 -1
  39. package/dist/src/app-deployment-resolution.js +1 -1
  40. package/dist/src/app-inventory.js +1 -1
  41. package/dist/src/app-launch.js +1 -1
  42. package/dist/src/app-lifecycle.js +4 -4
  43. package/dist/src/app-lifecycle2.js +2 -2
  44. package/dist/src/app-log-files.js +1 -1
  45. package/dist/src/app-log-runtime2.js +2 -2
  46. package/dist/src/app-log-session-resource.js +1 -1
  47. package/dist/src/app-resolution.js +1 -1
  48. package/dist/src/app-state-read.js +1 -1
  49. package/dist/src/app-state-runtime.d.ts +1 -1
  50. package/dist/src/application-lifecycle-interaction.js +1 -1
  51. package/dist/src/archive.js +1 -1
  52. package/dist/src/args.js +1 -1
  53. package/dist/src/artifact-download.js +1 -1
  54. package/dist/src/artifact-tracking.js +1 -1
  55. package/dist/src/auth-session.js +1 -1
  56. package/dist/src/auth.js +1 -1
  57. package/dist/src/automation-helper-artifact.js +1 -1
  58. package/dist/src/automation-helper.js +1 -1
  59. package/dist/src/await-with-signal.js +1 -1
  60. package/dist/src/backend-snapshot-options.js +1 -1
  61. package/dist/src/boot-diagnostics.js +1 -1
  62. package/dist/src/bridge-source.js +1 -1
  63. package/dist/src/browser-launch.js +1 -1
  64. package/dist/src/browserstack-device-features.js +1 -1
  65. package/dist/src/browserstack.js +1 -1
  66. package/dist/src/cache.js +1 -1
  67. package/dist/src/capture-disclosure.js +1 -1
  68. package/dist/src/capture-lifecycle.js +1 -1
  69. package/dist/src/cli-config.js +1 -1
  70. package/dist/src/cli-help.js +19 -16
  71. package/dist/src/cli-output.js +11 -11
  72. package/dist/src/cli-runner.js +1 -1
  73. package/dist/src/cli.js +2 -2
  74. package/dist/src/click-button.js +1 -1
  75. package/dist/src/client-metro-companion.js +1 -1
  76. package/dist/src/client-metro.js +1 -1
  77. package/dist/src/client-options.js +1 -1
  78. package/dist/src/client-port.d.ts +246 -208
  79. package/dist/src/clipboard-shell-response.js +1 -1
  80. package/dist/src/cloud-artifacts.d.ts +7 -2
  81. package/dist/src/code-signature-cache.js +1 -1
  82. package/dist/src/command-schema.js +6 -4
  83. package/dist/src/command-tools.js +3 -3
  84. package/dist/src/command.js +1 -1
  85. package/dist/src/composed-inventory-gateways.js +1 -1
  86. package/dist/src/composite-resource-admission.js +1 -1
  87. package/dist/src/config.js +1 -1
  88. package/dist/src/connection-lease-transaction.js +1 -1
  89. package/dist/src/connection-metro-runtime.js +1 -1
  90. package/dist/src/connection-runtime.js +1 -1
  91. package/dist/src/connection-verification.js +1 -1
  92. package/dist/src/connection.js +3 -3
  93. package/dist/src/context.js +1 -1
  94. package/dist/src/contract.d.ts +2 -1
  95. package/dist/src/contracts.d.ts +1 -1
  96. package/dist/src/contracts.js +1 -1
  97. package/dist/src/daemon-client-attach.js +1 -1
  98. package/dist/src/daemon-client-dispatch-disclosure.js +1 -1
  99. package/dist/src/daemon-client-ensure.js +1 -1
  100. package/dist/src/daemon-client-ensuring.js +1 -1
  101. package/dist/src/daemon-client-lease-beat.js +1 -1
  102. package/dist/src/daemon-client-lifecycle.js +1 -1
  103. package/dist/src/daemon-client-liveness-probe.js +1 -1
  104. package/dist/src/daemon-client-remote-health-cache.js +1 -0
  105. package/dist/src/daemon-client-remote-health-recovery.js +1 -0
  106. package/dist/src/daemon-client-transport.js +1 -1
  107. package/dist/src/daemon-command-registry.js +1 -1
  108. package/dist/src/daemon-composition.js +1 -1
  109. package/dist/src/daemon-diagnostics-scope.js +1 -1
  110. package/dist/src/daemon-http.js +1 -1
  111. package/dist/src/daemon-launch-spec.js +1 -1
  112. package/dist/src/daemon-lifecycle-errors.js +1 -1
  113. package/dist/src/daemon-policy-file.js +1 -1
  114. package/dist/src/daemon-registration-owner.js +3 -3
  115. package/dist/src/daemon-registration.js +1 -1
  116. package/dist/src/daemon-resolution.js +1 -1
  117. package/dist/src/daemon-startup-diagnostics.js +1 -1
  118. package/dist/src/daemon-stop.js +1 -1
  119. package/dist/src/daemon.js +1 -1
  120. package/dist/src/debug-symbols-facade.js +3 -3
  121. package/dist/src/device-claim-admission.js +1 -0
  122. package/dist/src/device-claim-reconciliation.js +1 -0
  123. package/dist/src/device-claim-recovery.js +1 -1
  124. package/dist/src/device-claim-rule.js +1 -1
  125. package/dist/src/device-claims.js +1 -1
  126. package/dist/src/device-input-state.d.ts +1 -1
  127. package/dist/src/device-inventory-context.js +1 -1
  128. package/dist/src/device-selection-resolver.js +1 -1
  129. package/dist/src/device-session.js +1 -1
  130. package/dist/src/device-shell.js +1 -1
  131. package/dist/src/device.js +1 -1
  132. package/dist/src/device3.js +3 -3
  133. package/dist/src/devicectl.js +1 -1
  134. package/dist/src/diagnostics.js +1 -1
  135. package/dist/src/discovery.js +1 -1
  136. package/dist/src/dispatch-resolve.js +1 -1
  137. package/dist/src/display-inventory.js +1 -1
  138. package/dist/src/doctor-facade.js +1 -1
  139. package/dist/src/doctor2.js +1 -1
  140. package/dist/src/durable-capture-resource.js +1 -1
  141. package/dist/src/durable-capture.js +1 -1
  142. package/dist/src/durable-resource.js +1 -1
  143. package/dist/src/ended-lease.js +1 -1
  144. package/dist/src/engine-eval-script.js +1 -1
  145. package/dist/src/error.js +2 -2
  146. package/dist/src/errors.js +1 -1
  147. package/dist/src/explicit-session-resolution.js +1 -1
  148. package/dist/src/expo-dev-client-launch.js +1 -1
  149. package/dist/src/failure-output.js +1 -1
  150. package/dist/src/file.js +1 -1
  151. package/dist/src/find.js +1 -1
  152. package/dist/src/finders.js +1 -1
  153. package/dist/src/flag-registry.js +1 -1
  154. package/dist/src/focus-runtime.js +1 -1
  155. package/dist/src/fold-helper.js +1 -1
  156. package/dist/src/generic-settle.js +1 -1
  157. package/dist/src/generic.js +1 -1
  158. package/dist/src/gesture-admission.js +1 -1
  159. package/dist/src/gesture-plan-types.d.ts +1 -1
  160. package/dist/src/gesture-plan.js +1 -1
  161. package/dist/src/gesture-runtime.js +1 -1
  162. package/dist/src/hdc.js +1 -1
  163. package/dist/src/helper-artifacts.js +1 -1
  164. package/dist/src/helper.js +2 -2
  165. package/dist/src/host-file.js +1 -1
  166. package/dist/src/host.js +1 -1
  167. package/dist/src/host2.js +1 -1
  168. package/dist/src/host3.js +1 -1
  169. package/dist/src/host4.js +1 -1
  170. package/dist/src/host5.js +1 -1
  171. package/dist/src/host6.js +1 -1
  172. package/dist/src/human-control-contract.js +1 -1
  173. package/dist/src/human-control.js +1 -1
  174. package/dist/src/ime-rebind.js +1 -1
  175. package/dist/src/ime-settings-record.js +1 -1
  176. package/dist/src/ime-state.js +1 -1
  177. package/dist/src/index.d.ts +3 -3
  178. package/dist/src/index.js +1 -1
  179. package/dist/src/input-actions.js +1 -1
  180. package/dist/src/input-actions2.js +1 -1
  181. package/dist/src/install-artifact-facade.js +1 -1
  182. package/dist/src/install-source-network-transport.js +1 -1
  183. package/dist/src/install-source2.js +1 -1
  184. package/dist/src/interaction-error.js +1 -1
  185. package/dist/src/interaction-positionals.js +1 -1
  186. package/dist/src/interaction-ref-policy.js +1 -1
  187. package/dist/src/interaction2.js +1 -1
  188. package/dist/src/interactor-operation-binding.js +1 -1
  189. package/dist/src/interactor.js +5 -5
  190. package/dist/src/interactor2.js +1 -1
  191. package/dist/src/interactor3.js +1 -1
  192. package/dist/src/interactor4.js +1 -1
  193. package/dist/src/interactor5.js +1 -1
  194. package/dist/src/interactors.js +1 -1
  195. package/dist/src/internal/bin.js +1 -1
  196. package/dist/src/internal/companion-tunnel.js +1 -1
  197. package/dist/src/internal/daemon.js +1 -1
  198. package/dist/src/internal/png-worker.js +1 -1
  199. package/dist/src/internal/run-script-child.js +1 -1
  200. package/dist/src/inventory.js +1 -1
  201. package/dist/src/inventory2.js +1 -1
  202. package/dist/src/inventory3.js +1 -1
  203. package/dist/src/inventory5.js +1 -1
  204. package/dist/src/ios-node-interpretation.js +1 -1
  205. package/dist/src/ios-simulator-accessibility.js +1 -1
  206. package/dist/src/ios-snapshot-acquisition.js +1 -1
  207. package/dist/src/ios-snapshot-engine.js +1 -1
  208. package/dist/src/ios-snapshot-runtime.js +1 -1
  209. package/dist/src/launch-confirmation.js +1 -1
  210. package/dist/src/launch-services-registration.js +1 -1
  211. package/dist/src/lease-context.js +1 -1
  212. package/dist/src/lease-registry-scope.js +1 -1
  213. package/dist/src/lease-release2.js +1 -1
  214. package/dist/src/lease-scope.js +1 -1
  215. package/dist/src/lease.js +1 -1
  216. package/dist/src/leased-recording-retention.js +1 -1
  217. package/dist/src/legacy.js +1 -1
  218. package/dist/src/limrun-download-file.js +1 -1
  219. package/dist/src/limrun-ios-files.js +1 -1
  220. package/dist/src/limrun-ios-runner.js +2 -2
  221. package/dist/src/limrun-runtime-dependencies.js +1 -1
  222. package/dist/src/limrun.d.ts +1 -1
  223. package/dist/src/local-interactor-operation-set.js +1 -1
  224. package/dist/src/local-simulator-apps.js +1 -1
  225. package/dist/src/local-simulator-files.js +1 -1
  226. package/dist/src/location-coordinates.js +1 -1
  227. package/dist/src/manifest.js +1 -1
  228. package/dist/src/mechanics.js +12 -12
  229. package/dist/src/merge-flags.js +1 -1
  230. package/dist/src/metro-reload-endpoints.js +1 -1
  231. package/dist/src/metro-session-hints.js +1 -1
  232. package/dist/src/metro.d.ts +1 -1
  233. package/dist/src/mobile-snapshot-semantics.js +1 -1
  234. package/dist/src/network-traffic.js +1 -1
  235. package/dist/src/node-http.js +1 -1
  236. package/dist/src/node-touch-point.js +1 -1
  237. package/dist/src/observation.js +1 -1
  238. package/dist/src/open-script.js +1 -1
  239. package/dist/src/open-target-device-resolution.js +1 -1
  240. package/dist/src/orientation.js +1 -1
  241. package/dist/src/parameterized-recorded-fill.js +1 -1
  242. package/dist/src/perf-facade.js +1 -1
  243. package/dist/src/perf-runtime-operation-builder.js +1 -1
  244. package/dist/src/perf-runtime-plan.js +1 -1
  245. package/dist/src/perf-target.js +2 -2
  246. package/dist/src/perf.js +1 -1
  247. package/dist/src/physical-device-control.js +1 -1
  248. package/dist/src/platform-runtime-android-adb-host.js +1 -1
  249. package/dist/src/platform-runtime-app-log-process.js +1 -1
  250. package/dist/src/platform-runtime-apple-application-tools.js +1 -1
  251. package/dist/src/platform-runtime-claim-recovery.js +1 -1
  252. package/dist/src/platform-runtime-host.js +1 -1
  253. package/dist/src/platform-runtime-open-target.js +1 -1
  254. package/dist/src/platform-runtime-operation-host.js +3 -3
  255. package/dist/src/platform-runtime-runtime-hints.js +1 -1
  256. package/dist/src/platform-runtime-screen-recording-apple-runner-transport.js +1 -1
  257. package/dist/src/platform-runtime-screen-recording-apple-simulator-host.js +1 -1
  258. package/dist/src/platform-runtime-screen-recording-finalizer-host.js +1 -1
  259. package/dist/src/platform-runtime-screen-recording-process-host.js +1 -1
  260. package/dist/src/platform-runtime-shutdown-error.js +1 -1
  261. package/dist/src/platform-runtime-unavailable.js +1 -1
  262. package/dist/src/platform-runtime.js +1 -1
  263. package/dist/src/platform-runtime2.js +1 -1
  264. package/dist/src/plist.js +1 -1
  265. package/dist/src/plugins2.js +1 -1
  266. package/dist/src/png-crop-bytes.js +1 -1
  267. package/dist/src/png-resize.js +1 -1
  268. package/dist/src/png-size.js +1 -1
  269. package/dist/src/png-worker-client.js +1 -1
  270. package/dist/src/png.js +1 -1
  271. package/dist/src/post-gesture-stability.js +1 -1
  272. package/dist/src/process-executable-path.js +1 -0
  273. package/dist/src/process-exit.js +1 -1
  274. package/dist/src/provider-device-runtime.d.ts +2 -2
  275. package/dist/src/provider-limrun-credentials.js +1 -1
  276. package/dist/src/provider-plugin.d.ts +1 -1
  277. package/dist/src/provider-profile-fields.js +1 -1
  278. package/dist/src/provider-webdriver.js +1 -1
  279. package/dist/src/provider.js +1 -1
  280. package/dist/src/proxy.js +2 -2
  281. package/dist/src/react-devtools-connection.js +1 -1
  282. package/dist/src/react-devtools-inspect-command.js +1 -1
  283. package/dist/src/react-native-overlay2.js +2 -2
  284. package/dist/src/react-native.js +1 -1
  285. package/dist/src/react-profile-command.js +1 -1
  286. package/dist/src/record-runtime.js +1 -1
  287. package/dist/src/record-trace.js +1 -1
  288. package/dist/src/recording-gestures.js +1 -1
  289. package/dist/src/recording.js +1 -1
  290. package/dist/src/rect-center.js +1 -1
  291. package/dist/src/register-builtins.js +1 -1
  292. package/dist/src/registry.js +1 -1
  293. package/dist/src/remote-config-core.js +1 -1
  294. package/dist/src/remote-config-flags.js +1 -1
  295. package/dist/src/remote-connection-state.js +1 -1
  296. package/dist/src/replay-backend-host.js +1 -1
  297. package/dist/src/replay-divergence.js +1 -1
  298. package/dist/src/replay-maestro-backend.js +2 -2
  299. package/dist/src/replay.d.ts +1 -1
  300. package/dist/src/replay2.js +1 -1
  301. package/dist/src/reporting.js +1 -1
  302. package/dist/src/request-dispatch-disclosure.js +1 -1
  303. package/dist/src/request-ended-leases.js +1 -1
  304. package/dist/src/request-providers.js +1 -1
  305. package/dist/src/request-runtime-binding.js +1 -1
  306. package/dist/src/request.js +1 -1
  307. package/dist/src/result-serialization.js +2 -2
  308. package/dist/src/retry.js +1 -1
  309. package/dist/src/run-script-execution.js +6 -8
  310. package/dist/src/run-script-http.js +1 -1
  311. package/dist/src/runner-cache-metadata.js +1 -1
  312. package/dist/src/runner-cache-retention.js +1 -1
  313. package/dist/src/runner-client.js +1 -1
  314. package/dist/src/runner-contract.js +1 -1
  315. package/dist/src/runner-dev-tools-security.js +1 -1
  316. package/dist/src/runner-device-readiness.js +1 -1
  317. package/dist/src/runner-device-set.js +1 -1
  318. package/dist/src/runner-disposal.js +1 -1
  319. package/dist/src/runner-error-classification.js +2 -2
  320. package/dist/src/runner-exchange.js +1 -1
  321. package/dist/src/runner-io.js +1 -1
  322. package/dist/src/runner-launched-session.js +1 -1
  323. package/dist/src/runner-lease.js +1 -1
  324. package/dist/src/runner-lifecycle.js +1 -1
  325. package/dist/src/runner-operations-facade.js +1 -1
  326. package/dist/src/runner-panel.js +1 -1
  327. package/dist/src/runner-retention.js +1 -1
  328. package/dist/src/runner-runtime.js +1 -1
  329. package/dist/src/runner-selector-query.js +1 -1
  330. package/dist/src/runner-sequence.js +1 -1
  331. package/dist/src/runner-start-budget.js +1 -1
  332. package/dist/src/runner-startup-transport.js +1 -1
  333. package/dist/src/runner-toolchain-identity.js +1 -1
  334. package/dist/src/runtime-admission.js +1 -1
  335. package/dist/src/runtime-deployment.js +1 -1
  336. package/dist/src/runtime-factory.js +1 -1
  337. package/dist/src/runtime-session.js +1 -1
  338. package/dist/src/runtime-transport-hints.js +1 -1
  339. package/dist/src/runtime.js +2 -2
  340. package/dist/src/runtime10.js +1 -1
  341. package/dist/src/runtime11.js +1 -1
  342. package/dist/src/runtime12.js +1 -1
  343. package/dist/src/runtime13.js +2 -2
  344. package/dist/src/runtime2.js +2 -2
  345. package/dist/src/runtime4.js +3 -3
  346. package/dist/src/runtime5.js +1 -1
  347. package/dist/src/runtime6.js +1 -1
  348. package/dist/src/runtime7.js +2 -2
  349. package/dist/src/runtime8.js +1 -1
  350. package/dist/src/runtime9.js +1 -1
  351. package/dist/src/screen-recording-admission-ledger.js +1 -0
  352. package/dist/src/screen-recording-completion.js +1 -1
  353. package/dist/src/screen-recording-options.js +1 -1
  354. package/dist/src/screen-recording-resource-recovery.js +1 -1
  355. package/dist/src/screen-recording-stop-recovery.js +1 -1
  356. package/dist/src/screen-recording-transport.js +1 -1
  357. package/dist/src/screenshot-density.js +1 -1
  358. package/dist/src/screenshot-image-size.js +1 -1
  359. package/dist/src/screenshot-image.js +1 -1
  360. package/dist/src/screenshot-runtime.js +1 -1
  361. package/dist/src/screenshot-runtime2.js +1 -1
  362. package/dist/src/screenshot.js +1 -1
  363. package/dist/src/screenshot2.js +1 -1
  364. package/dist/src/screenshot4.js +1 -1
  365. package/dist/src/script-source.js +1 -1
  366. package/dist/src/script.js +1 -1
  367. package/dist/src/scroll-command.js +1 -1
  368. package/dist/src/scroll-gesture.js +1 -1
  369. package/dist/src/sdk-batch-runner.d.ts +1 -1
  370. package/dist/src/sdk-batch-runner.js +2 -2
  371. package/dist/src/sdk-batch.js +2 -2
  372. package/dist/src/sdk-contracts.d.ts +26 -2
  373. package/dist/src/sdk-contracts.js +2 -2
  374. package/dist/src/sdk-device.js +1 -1
  375. package/dist/src/sdk-finders.d.ts +1 -1
  376. package/dist/src/sdk-finders.js +1 -1
  377. package/dist/src/sdk-io.js +5 -5
  378. package/dist/src/sdk-remote-config.d.ts +1 -1
  379. package/dist/src/sdk-remote-config.js +1 -1
  380. package/dist/src/sdk-selectors.d.ts +9 -6
  381. package/dist/src/sdk-selectors.js +1 -1
  382. package/dist/src/selection.js +0 -0
  383. package/dist/src/selector-pipeline-policy.js +1 -1
  384. package/dist/src/selector-runtime.js +1 -1
  385. package/dist/src/selectors.js +1 -1
  386. package/dist/src/server-shutdown.js +1 -1
  387. package/dist/src/server-startup.js +2 -2
  388. package/dist/src/server.js +4 -4
  389. package/dist/src/session-allocation.js +1 -1
  390. package/dist/src/session-artifact-paths.js +1 -1
  391. package/dist/src/session-capture-binding.js +1 -1
  392. package/dist/src/session-device-resolution.js +1 -1
  393. package/dist/src/session-event-action.js +1 -1
  394. package/dist/src/session-open.js +1 -1
  395. package/dist/src/session-repair-tombstone.js +1 -1
  396. package/dist/src/session-replay-vars.js +1 -1
  397. package/dist/src/session-routing.js +1 -1
  398. package/dist/src/session-runtime-admission.js +1 -1
  399. package/dist/src/session-runtime.js +1 -1
  400. package/dist/src/session-script-destination.js +1 -0
  401. package/dist/src/session-selector.js +1 -1
  402. package/dist/src/session-store.js +3 -3
  403. package/dist/src/session-teardown.js +1 -1
  404. package/dist/src/session-tenant-scope.js +1 -1
  405. package/dist/src/session2.js +5 -5
  406. package/dist/src/settings-bluetooth.js +1 -1
  407. package/dist/src/settings-global-toggle.js +1 -1
  408. package/dist/src/settings.js +1 -1
  409. package/dist/src/settings2.js +1 -1
  410. package/dist/src/settle-observation-capture.js +1 -1
  411. package/dist/src/simctl-execution.js +1 -1
  412. package/dist/src/simctl-facade.js +1 -1
  413. package/dist/src/simctl.js +1 -1
  414. package/dist/src/simulator-app-budget.js +1 -1
  415. package/dist/src/simulator-boot.js +1 -1
  416. package/dist/src/simulator-facade.js +1 -1
  417. package/dist/src/simulator-state.js +1 -1
  418. package/dist/src/simulator.js +1 -1
  419. package/dist/src/snapshot-baseline.js +1 -1
  420. package/dist/src/snapshot-chrome.js +1 -1
  421. package/dist/src/snapshot-desktop-projection.js +1 -1
  422. package/dist/src/snapshot-diagnostics.js +1 -1
  423. package/dist/src/snapshot-helper-install.js +3 -3
  424. package/dist/src/snapshot-helper-session.js +1 -1
  425. package/dist/src/snapshot-lines.js +1 -1
  426. package/dist/src/snapshot-node-lookup.js +1 -1
  427. package/dist/src/snapshot-occlusion.js +1 -1
  428. package/dist/src/snapshot-private-evidence.js +1 -1
  429. package/dist/src/snapshot-runtime-binding.js +1 -1
  430. package/dist/src/snapshot-runtime-capture-input.js +1 -1
  431. package/dist/src/snapshot-runtime.js +1 -1
  432. package/dist/src/snapshot-state.js +1 -1
  433. package/dist/src/snapshot.js +1 -1
  434. package/dist/src/snapshot2.js +1 -1
  435. package/dist/src/snapshot3.js +2 -2
  436. package/dist/src/snapshot4.js +1 -1
  437. package/dist/src/source-channel.js +1 -1
  438. package/dist/src/src.js +1 -1
  439. package/dist/src/src10.js +1 -1
  440. package/dist/src/src11.js +1 -1
  441. package/dist/src/src2.js +1 -1
  442. package/dist/src/src3.js +5 -5
  443. package/dist/src/src4.js +2 -2
  444. package/dist/src/src5.js +1 -1
  445. package/dist/src/src6.js +1 -1
  446. package/dist/src/src8.js +1 -1
  447. package/dist/src/store-legacy.js +1 -1
  448. package/dist/src/store.js +1 -1
  449. package/dist/src/string-enum.js +1 -1
  450. package/dist/src/surface-snapshot.js +1 -1
  451. package/dist/src/surface-snapshot2.js +1 -1
  452. package/dist/src/sync-cache.js +1 -1
  453. package/dist/src/system-surface-foreground.js +2 -2
  454. package/dist/src/takeover.js +1 -1
  455. package/dist/src/tap-keyboard-occlusion.js +1 -1
  456. package/dist/src/target-evidence-tree.js +1 -1
  457. package/dist/src/target-evidence.js +1 -1
  458. package/dist/src/telephony-runtime.js +1 -1
  459. package/dist/src/tool-provider-facade.js +1 -1
  460. package/dist/src/tool-provider.js +3 -3
  461. package/dist/src/tool-provider2.js +1 -1
  462. package/dist/src/tool-provider3.js +1 -1
  463. package/dist/src/toolchain-probe.js +1 -1
  464. package/dist/src/touch-runtime.js +1 -1
  465. package/dist/src/touch-runtime2.js +1 -1
  466. package/dist/src/transport.js +2 -2
  467. package/dist/src/tree.js +1 -1
  468. package/dist/src/tv-remote-runtime.js +1 -1
  469. package/dist/src/tv-remote.js +1 -1
  470. package/dist/src/type-text-runtime.js +1 -1
  471. package/dist/src/unsupported-interactor.js +1 -1
  472. package/dist/src/update-check.js +1 -1
  473. package/dist/src/validation.js +1 -1
  474. package/dist/src/vars.js +1 -1
  475. package/dist/src/vega-executable.js +1 -1
  476. package/dist/src/verified-file.js +1 -1
  477. package/dist/src/video.js +2 -2
  478. package/dist/src/viewport.js +1 -1
  479. package/dist/src/web.js +1 -1
  480. package/dist/src/webdriver-source.js +1 -1
  481. package/package.json +2 -2
  482. package/server.json +2 -2
  483. package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.37.apk.sha256 +0 -1
  484. package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.37.apk.sha256 +0 -1
  485. package/dist/src/capture-output-ownership.js +0 -1
@@ -0,0 +1 @@
1
+ 72caf8771f85319c0aa1e0408a388e7b63f89fd14c4f2d863aca6932cc8f0c78 agent-device-android-ime-helper-0.21.38.apk
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "android-ime-helper",
3
- "version": "0.21.37",
4
- "assetName": "agent-device-android-ime-helper-0.21.37.apk",
5
- "sha256": "937f1f4114341d328947e3bd440b5e09d3f8b43e03a57f64f7b3a0e519a78605",
3
+ "version": "0.21.38",
4
+ "assetName": "agent-device-android-ime-helper-0.21.38.apk",
5
+ "sha256": "72caf8771f85319c0aa1e0408a388e7b63f89fd14c4f2d863aca6932cc8f0c78",
6
6
  "packageName": "com.callstack.agentdevice.imehelper",
7
- "versionCode": 21037,
7
+ "versionCode": 21038,
8
8
  "serviceComponent": "com.callstack.agentdevice.imehelper/.TestInputMethodService",
9
9
  "broadcastProtocol": "android-ime-helper-v1"
10
10
  }
@@ -0,0 +1 @@
1
+ 96df633fd6d6870d8689e922f233513564bbf326e2c59c233a1d88fc26d52715 agent-device-android-snapshot-helper-0.21.38.apk
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "android-snapshot-helper",
3
- "version": "0.21.37",
4
- "releaseTag": "v0.21.37",
5
- "assetName": "agent-device-android-snapshot-helper-0.21.37.apk",
6
- "apkUrl": "https://github.com/callstack/agent-device/releases/download/v0.21.37/agent-device-android-snapshot-helper-0.21.37.apk",
7
- "sha256": "bfb470a1cc168e823766fedc62bf052b60b0fafa4527033e6fc7c709f8d1f317",
8
- "checksumName": "agent-device-android-snapshot-helper-0.21.37.apk.sha256",
3
+ "version": "0.21.38",
4
+ "releaseTag": "v0.21.38",
5
+ "assetName": "agent-device-android-snapshot-helper-0.21.38.apk",
6
+ "apkUrl": "https://github.com/callstack/agent-device/releases/download/v0.21.38/agent-device-android-snapshot-helper-0.21.38.apk",
7
+ "sha256": "96df633fd6d6870d8689e922f233513564bbf326e2c59c233a1d88fc26d52715",
8
+ "checksumName": "agent-device-android-snapshot-helper-0.21.38.apk.sha256",
9
9
  "packageName": "com.callstack.agentdevice.snapshothelper",
10
- "versionCode": 21037,
10
+ "versionCode": 21038,
11
11
  "instrumentationRunner": "com.callstack.agentdevice.snapshothelper/.SnapshotInstrumentation",
12
12
  "minSdk": 23,
13
13
  "targetSdk": 36,
@@ -106,14 +106,18 @@ static int runSet(NSString *argument) {
106
106
  return dispatchEvents(^BOOL(CFTypeRef client) { return runFrames(client, frames); });
107
107
  }
108
108
 
109
- // The orientation control has no upside-down value.
109
+ // The upside-down picker value is spelled "pud" on the wire; "portrait-upside-down" is
110
+ // ignored by the guest. It matters because each picker event rotates the display by
111
+ // (new - previous) picker value: without a 180 value, one of the four display orientations
112
+ // can never be landed (measured on iPhone Duo).
110
113
  static int runRotate(NSString *orientation) {
111
- if (![@[@"portrait", @"landscape-left", @"landscape-right"] containsObject:orientation]) {
112
- fprintf(stderr, "Expected orientation portrait, landscape-left or landscape-right\n");
114
+ NSString *value = [orientation isEqualToString:@"portrait-upside-down"] ? @"pud" : orientation;
115
+ if (![@[@"portrait", @"landscape-left", @"landscape-right", @"pud"] containsObject:value]) {
116
+ fprintf(stderr, "Expected orientation portrait, landscape-left, landscape-right or portrait-upside-down\n");
113
117
  return 2;
114
118
  }
115
119
  return dispatchEvents(^BOOL(CFTypeRef client) {
116
- return sendControl(client, @"orientation-picker-control", @"enum", orientation);
120
+ return sendControl(client, @"orientation-picker-control", @"enum", value);
117
121
  });
118
122
  }
119
123
 
@@ -0,0 +1,53 @@
1
+ import Foundation
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+ enum RunnerKeyboardReturnKey: String {
23
+ case go
24
+ case search
25
+ case send
26
+ case next
27
+ case done
28
+ case join
29
+ case route
30
+ case `continue`
31
+ case enter
32
+ case unknown
33
+
34
+
35
+ static let probeLabels = ["return", "Return", "Enter", "Go", "Search", "Next", "Done", "Send", "Join"]
36
+
37
+
38
+
39
+ static func kind(of text: String) -> RunnerKeyboardReturnKey {
40
+ switch text.trimmingCharacters(in: .whitespacesAndNewlines).lowercased() {
41
+ case "go": return .go
42
+ case "search": return .search
43
+ case "send": return .send
44
+ case "next": return .next
45
+ case "done": return .done
46
+ case "join": return .join
47
+ case "route": return .route
48
+ case "continue": return .continue
49
+ case "return", "enter": return .enter
50
+ default: return .unknown
51
+ }
52
+ }
53
+ }
@@ -281,9 +281,25 @@ extension RunnerTests {
281
281
  bundleId: String?,
282
282
  rootFrame: CGRect
283
283
  ) -> SnapshotViewport {
284
- let fallback = SnapshotViewport.derived(box: rootFrame)
284
+ let fallback = {
285
+ let fullScreenFrame = Self.fullScreenFrame(of: app)
286
+ let viewport = Self.privateAXRootViewport(rootFrame: rootFrame, fullScreenFrame: fullScreenFrame)
287
+ let kind: String
288
+ switch viewport {
289
+ case .reported: kind = "reported"
290
+ case .derived: kind = "derived"
291
+ case .missing: kind = "missing"
292
+ }
293
+ NSLog(
294
+ "AGENT_DEVICE_RUNNER_PRIVATE_AX_ROOT_VIEWPORT kind=%@ root=%@ fullScreen=%@",
295
+ kind,
296
+ String(describing: rootFrame),
297
+ fullScreenFrame.isNull ? "none" : String(describing: fullScreenFrame)
298
+ )
299
+ return viewport
300
+ }
285
301
  guard shouldReadPrivateAXViewportViaXCTest(bundleId: bundleId) else {
286
- return fallback
302
+ return fallback()
287
303
  }
288
304
  do {
289
305
  let reported = try runMainThreadWork(
@@ -294,13 +310,35 @@ extension RunnerTests {
294
310
  try self.safeSnapshotViewport(app: app, readingOrientation: true)
295
311
  }
296
312
  if case .missing = reported {
297
- return fallback
313
+ return fallback()
298
314
  }
299
315
  return reported
300
316
  } catch {
301
317
  NSLog("AGENT_DEVICE_RUNNER_PRIVATE_AX_VIEWPORT_FALLBACK=%@", String(describing: error))
302
- return fallback
318
+ return fallback()
319
+ }
320
+ }
321
+
322
+
323
+ private static func fullScreenFrame(of app: XCUIApplication) -> CGRect {
324
+ #if os(iOS)
325
+ return RunnerFullScreenApplicationFrame(app)
326
+ #else
327
+ return .null
328
+ #endif
329
+ }
330
+
331
+
332
+
333
+
334
+
335
+ static func privateAXRootViewport(rootFrame: CGRect, fullScreenFrame: CGRect) -> SnapshotViewport {
336
+
337
+
338
+ guard !fullScreenFrame.isNull, rootFrame.origin == .zero, rootFrame == fullScreenFrame else {
339
+ return .derived(box: rootFrame)
303
340
  }
341
+ return .reported(box: rootFrame, interfaceOrientation: RunnerInterfaceOrientation.unknown)
304
342
  }
305
343
 
306
344
  func privateAXRect(_ value: Any?) -> CGRect {
@@ -425,7 +425,11 @@ extension RunnerTests {
425
425
  guard pressTvRemote(button, duration: duration) else {
426
426
  return Response(
427
427
  ok: false,
428
- error: ErrorPayload(code: "UNSUPPORTED_OPERATION", message: "remotePress is only supported on tvOS")
428
+ error: ErrorPayload(
429
+ code: RunnerWireErrorCode.hardwareControlUnavailable,
430
+ message: "remotePress is only supported on tvOS",
431
+ hint: "Only a tvOS target has a Siri Remote. On a TV target use tv-remote; on a phone or Mac, press the app's own control by its ref."
432
+ )
429
433
  )
430
434
  }
431
435
  return Response(ok: true, data: DataPayload(message: "remote pressed"))
@@ -461,6 +465,9 @@ extension RunnerTests {
461
465
  guard let selectorKey = command.selectorKey, let selectorValue = command.selectorValue else {
462
466
  return Response(ok: false, error: ErrorPayload(message: "querySelector requires selectorKey and selectorValue"))
463
467
  }
468
+ if command.hittabilityProbe == true {
469
+ return try probeElementHittability(app: activeApp, selectorKey: selectorKey, selectorValue: selectorValue)
470
+ }
464
471
  return try queryElement(app: activeApp, selectorKey: selectorKey, selectorValue: selectorValue)
465
472
  case .readText:
466
473
  guard let x = command.x, let y = command.y else {
@@ -567,7 +574,7 @@ extension RunnerTests {
567
574
  return Response(
568
575
  ok: false,
569
576
  error: ErrorPayload(
570
- code: "UNSUPPORTED_OPERATION",
577
+ code: RunnerWireErrorCode.hardwareControlUnavailable,
571
578
  message: "actionButton requires a device model with an Action Button",
572
579
  hint: "The Action Button is on iPhone 15 Pro and later and iPad Pro (M4) and later. Assign a Shortcut or App Intent to it in Settings > Action Button."
573
580
  )
@@ -579,7 +586,7 @@ extension RunnerTests {
579
586
  return Response(
580
587
  ok: false,
581
588
  error: ErrorPayload(
582
- code: "UNSUPPORTED_OPERATION",
589
+ code: RunnerWireErrorCode.hardwareControlUnavailable,
583
590
  message: "\(command.command) requires a physical iPhone or iPad; XCUIDevice exposes no volume press on a simulator",
584
591
  hint: "hardware-button volume-up/volume-down is supported on physical iOS devices through the runner or Appium; iOS Simulators have no pressable volume key."
585
592
  )
@@ -587,17 +594,15 @@ extension RunnerTests {
587
594
  }
588
595
  return Response(ok: true, data: DataPayload(message: command.command.rawValue))
589
596
  case .keyboardDismiss:
590
- let result = dismissKeyboard(app: activeApp)
597
+ var dismissal: RunnerKeyboardDismissOutcome?
598
+ withBoundedInteractionIdleTimeoutIfSupported(activeApp, waits: .bothSkipped) {
599
+ dismissal = dismissKeyboard(app: activeApp)
600
+ }
601
+ guard let result = dismissal else {
602
+ return Response(ok: false, error: ErrorPayload(message: "keyboardDismiss produced no result"))
603
+ }
591
604
  if result.wasVisible && !result.dismissed {
592
- return Response(
593
- ok: false,
594
- error: ErrorPayload(
595
- code: "UNSUPPORTED_OPERATION",
596
- message: "Unable to dismiss the iOS keyboard: the keyboard exposes no dismiss key, and background taps are never attempted (no tap outside the keyboard can be proven side-effect-free)",
597
- hint:
598
- "An element whose center sits behind the on-screen keyboard is refused with tap_keyboard_occludes_target; one whose center stays above the keys presses normally. To end editing, tap the app's own Done/Cancel control, or use keyboard enter to press the return key when submission is wanted."
599
- )
600
- )
605
+ return Response(ok: false, error: keyboardDismissRefusal(dispatchedDismissal: result.dispatchedDismissal))
601
606
  }
602
607
  return Response(
603
608
  ok: true,
@@ -610,14 +615,17 @@ extension RunnerTests {
610
615
  )
611
616
  )
612
617
  case .keyboardReturn:
613
- let result = pressKeyboardReturn(app: activeApp)
618
+ var press: (wasVisible: Bool, pressed: Bool, visible: Bool, fieldAttempted: Bool)?
619
+ withBoundedInteractionIdleTimeoutIfSupported(activeApp, waits: .preEventSkipped) {
620
+ press = pressKeyboardReturn(app: activeApp)
621
+ }
622
+ guard let result = press else {
623
+ return Response(ok: false, error: ErrorPayload(message: "keyboardReturn produced no result"))
624
+ }
614
625
  if !result.pressed {
615
626
  return Response(
616
627
  ok: false,
617
- error: ErrorPayload(
618
- code: "UNSUPPORTED_OPERATION",
619
- message: "Unable to press the iOS keyboard return key"
620
- )
628
+ error: result.fieldAttempted ? keyboardReturnFieldAttemptFailure : keyboardReturnRefusal
621
629
  )
622
630
  }
623
631
  return Response(
@@ -334,17 +334,7 @@ extension RunnerTests {
334
334
  guard !value.isEmpty else {
335
335
  return SelectorElementMatch(element: nil, isAmbiguous: false, usedNonHittableFallback: false)
336
336
  }
337
- let predicate: NSPredicate
338
- switch selectorKey {
339
- case "id":
340
- predicate = NSPredicate(format: "identifier ==[c] %@", value)
341
- case "label":
342
- predicate = NSPredicate(format: "label ==[c] %@", value)
343
- case "value":
344
- predicate = NSPredicate(format: "value ==[c] %@", value)
345
- case "text":
346
- predicate = NSPredicate(format: "label ==[c] %@ OR identifier ==[c] %@ OR value ==[c] %@", value, value, value)
347
- default:
337
+ guard let predicate = Self.selectorPredicate(key: selectorKey, value: value) else {
348
338
  return SelectorElementMatch(element: nil, isAmbiguous: false, usedNonHittableFallback: false)
349
339
  }
350
340
 
@@ -493,6 +483,47 @@ extension RunnerTests {
493
483
  try resolveRunnerWindow(app: app).frame
494
484
  }
495
485
 
486
+ static func selectorPredicate(key: String, value: String) -> NSPredicate? {
487
+ switch key {
488
+ case "id":
489
+ return NSPredicate(format: "identifier ==[c] %@", value)
490
+ case "label":
491
+ return NSPredicate(format: "label ==[c] %@", value)
492
+ case "value":
493
+ return NSPredicate(format: "value ==[c] %@", value)
494
+ case "text":
495
+ return NSPredicate(format: "label ==[c] %@ OR identifier ==[c] %@ OR value ==[c] %@", value, value, value)
496
+ default:
497
+ return nil
498
+ }
499
+ }
500
+
501
+
502
+
503
+
504
+
505
+ func probeElementHittability(app: XCUIApplication, selectorKey: String, selectorValue: String) throws -> Response {
506
+ let value = selectorValue.trimmingCharacters(in: .whitespacesAndNewlines)
507
+ guard !value.isEmpty, let predicate = Self.selectorPredicate(key: selectorKey, value: value) else {
508
+ return Response(ok: true, data: DataPayload(found: false, matchCount: 0))
509
+ }
510
+ let matches = try elementQueries(app: app, matching: .any)
511
+ .flatMap { $0.matching(predicate).allElementsBoundByIndex }
512
+ .filter(\.exists)
513
+ guard matches.count == 1, let element = matches.first else {
514
+ return Response(ok: true, data: DataPayload(found: !matches.isEmpty, matchCount: matches.count))
515
+ }
516
+ return Response(
517
+ ok: true,
518
+ data: DataPayload(
519
+ found: true,
520
+ matchCount: 1,
521
+ hittable: element.isHittable,
522
+ rect: SnapshotRect(element.frame)
523
+ )
524
+ )
525
+ }
526
+
496
527
  func queryElement(app: XCUIApplication, selectorKey: String, selectorValue: String) throws -> Response {
497
528
 
498
529
 
@@ -33,6 +33,18 @@ enum RunnerKeyboardDismissMechanism: String {
33
33
 
34
34
 
35
35
 
36
+ struct RunnerKeyboardDismissOutcome {
37
+ let wasVisible: Bool
38
+ let dismissed: Bool
39
+ let visible: Bool
40
+ let mechanism: RunnerKeyboardDismissMechanism?
41
+
42
+
43
+ let dispatchedDismissal: Bool
44
+ }
45
+
46
+
47
+
36
48
 
37
49
  enum RunnerKeyboardBandFact: Equatable {
38
50
  case visible(CGRect)
@@ -189,20 +201,32 @@ extension RunnerTests {
189
201
  return visibleKeyboardFrame(app: app) != nil
190
202
  }
191
203
 
192
- func dismissKeyboard(
193
- app: XCUIApplication
194
- ) -> (wasVisible: Bool, dismissed: Bool, visible: Bool, mechanism: RunnerKeyboardDismissMechanism?) {
204
+ func dismissKeyboard(app: XCUIApplication) -> RunnerKeyboardDismissOutcome {
195
205
  let keyboard = app.keyboards.firstMatch
196
206
  let wasVisible = isKeyboardVisible(app: app)
197
207
  guard wasVisible else {
198
- return (wasVisible: false, dismissed: false, visible: false, mechanism: nil)
208
+ return RunnerKeyboardDismissOutcome(
209
+ wasVisible: false,
210
+ dismissed: false,
211
+ visible: false,
212
+ mechanism: nil,
213
+ dispatchedDismissal: false
214
+ )
199
215
  }
200
216
 
201
217
  #if os(tvOS)
202
218
  _ = pressTvRemote(.menu)
203
219
  sleepFor(0.2)
204
- let visible = isKeyboardVisible(app: app)
205
- return (wasVisible: true, dismissed: !visible, visible: visible, mechanism: visible ? nil : .dismissKey)
220
+ let tvVisible = isKeyboardVisible(app: app)
221
+ return RunnerKeyboardDismissOutcome(
222
+ wasVisible: true,
223
+ dismissed: !tvVisible,
224
+ visible: tvVisible,
225
+ mechanism: tvVisible ? nil : .dismissKey,
226
+
227
+
228
+ dispatchedDismissal: true
229
+ )
206
230
  #else
207
231
  if tapKeyboardDismissControl(app: app) {
208
232
  _ = keyboard.waitForNonExistence(timeout: KeyboardDismissObservationTiming.timeout)
@@ -213,7 +237,13 @@ extension RunnerTests {
213
237
  requiredConsecutiveMatches: KeyboardDismissObservationTiming.settleRequiredConsecutiveMatches
214
238
  )
215
239
  let visible = isKeyboardVisible(app: app)
216
- return (wasVisible: true, dismissed: !visible, visible: visible, mechanism: visible ? nil : .dismissKey)
240
+ return RunnerKeyboardDismissOutcome(
241
+ wasVisible: true,
242
+ dismissed: !visible,
243
+ visible: visible,
244
+ mechanism: visible ? nil : .dismissKey,
245
+ dispatchedDismissal: true
246
+ )
217
247
  }
218
248
 
219
249
 
@@ -222,7 +252,13 @@ extension RunnerTests {
222
252
 
223
253
 
224
254
 
225
- return (wasVisible: true, dismissed: false, visible: isKeyboardVisible(app: app), mechanism: nil)
255
+ return RunnerKeyboardDismissOutcome(
256
+ wasVisible: true,
257
+ dismissed: false,
258
+ visible: isKeyboardVisible(app: app),
259
+ mechanism: nil,
260
+ dispatchedDismissal: false
261
+ )
226
262
  #endif
227
263
  }
228
264
 
@@ -231,6 +267,53 @@ extension RunnerTests {
231
267
 
232
268
 
233
269
 
270
+ func keyboardDismissRefusal(dispatchedDismissal: Bool) -> ErrorPayload {
271
+ if dispatchedDismissal {
272
+ return ErrorPayload(
273
+ code: "UNSUPPORTED_OPERATION",
274
+ message: "Unable to dismiss the keyboard: a dismiss mechanism ran and the keyboard stayed visible",
275
+ hint: keyboardDismissRefusalHint
276
+ )
277
+ }
278
+ return ErrorPayload(
279
+ code: RunnerWireErrorCode.keyboardDismissUnavailable,
280
+ message: "Unable to dismiss the keyboard: it exposes no dismiss key, and background taps are never attempted (no tap outside the keyboard can be proven side-effect-free)",
281
+ hint: keyboardDismissRefusalHint
282
+ )
283
+ }
284
+
285
+ private var keyboardDismissRefusalHint: String {
286
+ return
287
+ "An element whose center sits behind the on-screen keyboard is refused with tap_keyboard_occludes_target; one whose center stays above the keys presses normally. To end editing, tap the app's own Done/Cancel control, or use keyboard enter to press the return key when submission is wanted."
288
+ }
289
+
290
+
291
+
292
+
293
+
294
+ var keyboardReturnRefusal: ErrorPayload {
295
+ return ErrorPayload(
296
+ code: RunnerWireErrorCode.keyboardReturnUnavailable,
297
+ message: "Unable to press the keyboard return key: the keyboard exposes no return-like key and no text field was available to submit",
298
+ hint: "Tap the app's own submit control by its ref, or focus a text field with fill or type before asking keyboard enter to submit it."
299
+ )
300
+ }
301
+
302
+
303
+
304
+ var keyboardReturnFieldAttemptFailure: ErrorPayload {
305
+ return ErrorPayload(
306
+ code: "UNSUPPORTED_OPERATION",
307
+ message: "Unable to press the keyboard return key: the only text field was found, but tapping it and typing a return failed",
308
+ hint: "Focus the field with fill or type, or tap the app's own submit control by its ref."
309
+ )
310
+ }
311
+
312
+
313
+
314
+
315
+
316
+
234
317
 
235
318
 
236
319
 
@@ -271,26 +354,30 @@ extension RunnerTests {
271
354
  return runnerPngData(for: image)
272
355
  }
273
356
 
274
- func pressKeyboardReturn(app: XCUIApplication) -> (wasVisible: Bool, pressed: Bool, visible: Bool) {
357
+
358
+
359
+ func pressKeyboardReturn(
360
+ app: XCUIApplication
361
+ ) -> (wasVisible: Bool, pressed: Bool, visible: Bool, fieldAttempted: Bool) {
275
362
  #if os(tvOS)
276
- return (wasVisible: false, pressed: pressTvRemote(.select), visible: false)
363
+ return (wasVisible: false, pressed: pressTvRemote(.select), visible: false, fieldAttempted: false)
277
364
  #elseif os(iOS)
278
365
  let wasVisible = isKeyboardVisible(app: app)
279
366
  if tapKeyboardReturnControl(app: app) {
280
367
  sleepFor(0.2)
281
- return (wasVisible: wasVisible, pressed: true, visible: isKeyboardVisible(app: app))
368
+ return (wasVisible: wasVisible, pressed: true, visible: isKeyboardVisible(app: app), fieldAttempted: false)
282
369
  }
283
370
 
284
371
  guard typeKeyboardReturn({ app.typeText(XCUIKeyboardKey.return.rawValue) }) else {
285
372
  if let singleTarget = singleTextEntryElement(app: app) {
286
373
  return pressKeyboardReturn(on: singleTarget, app: app, wasVisible: wasVisible)
287
374
  }
288
- return (wasVisible: wasVisible, pressed: false, visible: isKeyboardVisible(app: app))
375
+ return (wasVisible: wasVisible, pressed: false, visible: isKeyboardVisible(app: app), fieldAttempted: false)
289
376
  }
290
377
  sleepFor(0.2)
291
- return (wasVisible: wasVisible, pressed: true, visible: isKeyboardVisible(app: app))
378
+ return (wasVisible: wasVisible, pressed: true, visible: isKeyboardVisible(app: app), fieldAttempted: false)
292
379
  #else
293
- return (wasVisible: false, pressed: false, visible: false)
380
+ return (wasVisible: false, pressed: false, visible: false, fieldAttempted: false)
294
381
  #endif
295
382
  }
296
383
 
@@ -312,7 +399,7 @@ extension RunnerTests {
312
399
  on element: XCUIElement,
313
400
  app: XCUIApplication,
314
401
  wasVisible: Bool
315
- ) -> (wasVisible: Bool, pressed: Bool, visible: Bool) {
402
+ ) -> (wasVisible: Bool, pressed: Bool, visible: Bool, fieldAttempted: Bool) {
316
403
  #if os(iOS)
317
404
 
318
405
 
@@ -321,12 +408,12 @@ extension RunnerTests {
321
408
  app.typeText(XCUIKeyboardKey.return.rawValue)
322
409
  })
323
410
  guard typed else {
324
- return (wasVisible: wasVisible, pressed: false, visible: isKeyboardVisible(app: app))
411
+ return (wasVisible: wasVisible, pressed: false, visible: isKeyboardVisible(app: app), fieldAttempted: true)
325
412
  }
326
413
  sleepFor(0.2)
327
- return (wasVisible: wasVisible, pressed: true, visible: isKeyboardVisible(app: app))
414
+ return (wasVisible: wasVisible, pressed: true, visible: isKeyboardVisible(app: app), fieldAttempted: true)
328
415
  #else
329
- return (wasVisible: wasVisible, pressed: false, visible: false)
416
+ return (wasVisible: wasVisible, pressed: false, visible: false, fieldAttempted: false)
330
417
  #endif
331
418
  }
332
419
 
@@ -406,20 +493,34 @@ extension RunnerTests {
406
493
  #endif
407
494
  }
408
495
 
409
- private func tapKeyboardReturnControl(app: XCUIApplication) -> Bool {
496
+
497
+
498
+
499
+ func findKeyboardReturnControl(app: XCUIApplication) -> XCUIElement? {
410
500
  #if os(iOS)
411
- for label in ["return", "Return", "Enter", "Go", "Search", "Next", "Done", "Send", "Join"] {
501
+ for label in RunnerKeyboardReturnKey.probeLabels {
412
502
  let candidates = [
413
503
  app.keyboards.buttons[label],
414
504
  app.keyboards.keys[label],
415
505
  ]
416
506
  if let hittable = candidates.first(where: { $0.exists && $0.isHittable }) {
417
- hittable.tap()
418
- return true
507
+ return hittable
419
508
  }
420
509
  }
421
510
  #endif
511
+ return nil
512
+ }
513
+
514
+ private func tapKeyboardReturnControl(app: XCUIApplication) -> Bool {
515
+ #if os(iOS)
516
+ guard let control = findKeyboardReturnControl(app: app) else {
517
+ return false
518
+ }
519
+ control.tap()
520
+ return true
521
+ #else
422
522
  return false
523
+ #endif
423
524
  }
424
525
 
425
526
  private func isKeyboardAccessoryControl(_ element: XCUIElement, keyboardFrame: CGRect) -> Bool {
@@ -246,6 +246,8 @@ struct Command: Codable {
246
246
  let text: String?
247
247
  let selectorKey: String?
248
248
  let selectorValue: String?
249
+
250
+ let hittabilityProbe: Bool?
249
251
  let allowNonHittableCoordinateFallback: Bool?
250
252
  let delayMs: Int?
251
253
  let textEntryMode: String?
@@ -572,6 +574,11 @@ struct DataPayload: Codable {
572
574
 
573
575
 
574
576
  var screenshotMetadata: ScreenshotMetadataPayload?
577
+
578
+
579
+ var matchCount: Int?
580
+ var hittable: Bool?
581
+ var rect: SnapshotRect?
575
582
  }
576
583
 
577
584