agent-device 0.20.9 → 0.21.0

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 (492) hide show
  1. package/README.md +2 -2
  2. package/android/ime-helper/dist/{agent-device-android-ime-helper-0.20.9.apk → agent-device-android-ime-helper-0.21.0.apk} +0 -0
  3. package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.0.apk.sha256 +1 -0
  4. package/android/ime-helper/dist/{agent-device-android-ime-helper-0.20.9.manifest.json → agent-device-android-ime-helper-0.21.0.manifest.json} +4 -4
  5. package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.0.apk +0 -0
  6. package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.0.apk.sha256 +1 -0
  7. package/android/snapshot-helper/dist/{agent-device-android-snapshot-helper-0.20.9.manifest.json → agent-device-android-snapshot-helper-0.21.0.manifest.json} +6 -6
  8. package/apple/macos-helper/Sources/AgentDeviceMacOSHelper/AudioProbe.swift +35 -33
  9. package/apple/macos-helper/Sources/AgentDeviceMacOSHelper/main.swift +6 -1
  10. package/apple/snapshot-bridge/LICENSE.idb +23 -0
  11. package/apple/snapshot-bridge/README.md +49 -0
  12. package/apple/snapshot-bridge/SnapshotBridge.m +280 -0
  13. package/apple/snapshot-bridge/SnapshotBridgeRuntime.h +33 -0
  14. package/apple/snapshot-bridge/SnapshotBridgeRuntime.m +382 -0
  15. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunner/AgentDeviceRunnerApp.m +58 -0
  16. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunner.xcodeproj/project.pbxproj +19 -0
  17. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerAlertVerification.swift +36 -0
  18. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerStringNormalization.swift +8 -0
  19. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSynthesizedGesture.h +12 -1
  20. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSynthesizedGesture.m +100 -6
  21. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTapPointPolicy.swift +2 -2
  22. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+AXSnapshotFallback.swift +21 -12
  23. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Alert.swift +21 -88
  24. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+AlertObservation.swift +124 -0
  25. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift +110 -107
  26. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandJournal.swift +6 -14
  27. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Interaction.swift +85 -114
  28. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Lifecycle.swift +13 -6
  29. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Models.swift +72 -175
  30. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Navigation.swift +10 -11
  31. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+PrivateAXElementTypes.swift +12 -0
  32. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+PrivateAXPresentation.swift +78 -64
  33. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+ScreenRecorder.swift +17 -9
  34. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+ScrollGesture.swift +47 -13
  35. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Snapshot.swift +232 -438
  36. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotBackendCapabilities.swift +98 -0
  37. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotCapturePlan.swift +229 -168
  38. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotPresentationInvariant.swift +19 -0
  39. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotTiming.swift +110 -0
  40. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedCommitDeadline.swift +206 -0
  41. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedTextEntry.swift +147 -25
  42. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SystemModal.swift +21 -18
  43. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntry.swift +24 -307
  44. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryFocus.swift +206 -0
  45. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryReadiness.swift +158 -0
  46. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextInputCandidatePolicy.swift +19 -0
  47. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextTyping.swift +49 -16
  48. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Transport.swift +2 -11
  49. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TvRemote.swift +4 -19
  50. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests.swift +16 -20
  51. package/dist/apple/runner/AgentDeviceRunner/RecordingScripts/RecordingExportSupport.swift +111 -0
  52. package/dist/apple/runner/AgentDeviceRunner/RecordingScripts/recording-overlay.swift +42 -81
  53. package/dist/apple/runner/AgentDeviceRunner/RecordingScripts/recording-trim.swift +35 -82
  54. package/dist/apple/snapshot-presentation/Package.swift +21 -0
  55. package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotGeometry.swift +56 -0
  56. package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotModels.swift +259 -0
  57. package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotPresentation.swift +153 -0
  58. package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotPresentationFailure.swift +27 -0
  59. package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotPresentationInvariant.swift +91 -0
  60. package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotPresentationProjection.swift +161 -0
  61. package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotScopePolicy.swift +53 -0
  62. package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotVisibilityFold.swift +242 -0
  63. package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotVisibilityFoldProjection.swift +97 -0
  64. package/dist/src/adapter.js +1 -0
  65. package/dist/src/adb-executor.js +2 -0
  66. package/dist/src/adb-failure.js +1 -0
  67. package/dist/src/adb-host.js +1 -0
  68. package/dist/src/adb.js +1 -0
  69. package/dist/src/agent-browser-lifecycle.js +1 -0
  70. package/dist/src/agent-browser-process-record.js +1 -0
  71. package/dist/src/agent-browser-provider.js +1 -0
  72. package/dist/src/agent-browser-tool.js +1 -1
  73. package/dist/src/agent-device-client.js +2 -2
  74. package/dist/src/ai-sdk.d.ts +61 -0
  75. package/dist/src/ai-sdk.js +1 -0
  76. package/dist/src/alert-contract.js +1 -0
  77. package/dist/src/alert-runtime.js +1 -0
  78. package/dist/src/android-adb.d.ts +27 -19
  79. package/dist/src/android-adb.js +1 -1
  80. package/dist/src/android-input-ownership.js +1 -0
  81. package/dist/src/android-system-chrome.js +1 -0
  82. package/dist/src/android.js +1 -1
  83. package/dist/src/api.js +11 -0
  84. package/dist/src/app-catalog.js +1 -0
  85. package/dist/src/app-deployment-resolution.js +2 -0
  86. package/dist/src/app-helpers.js +1 -1
  87. package/dist/src/app-inventory-contract.js +1 -0
  88. package/dist/src/app-inventory.js +1 -0
  89. package/dist/src/app-launch.js +2 -0
  90. package/dist/src/app-lifecycle-facade.js +1 -0
  91. package/dist/src/app-lifecycle.js +3 -6
  92. package/dist/src/app-lifecycle2.js +2 -2
  93. package/dist/src/app-lifecycle3.js +1 -0
  94. package/dist/src/app-log-files.js +1 -1
  95. package/dist/src/app-log-reconnect.js +1 -1
  96. package/dist/src/app-log-runtime.js +1 -4
  97. package/dist/src/app-log-runtime2.js +4 -0
  98. package/dist/src/app-parsers.js +4 -0
  99. package/dist/src/app-resolution-cache.js +1 -0
  100. package/dist/src/app-resolution-facade.js +1 -0
  101. package/dist/src/app-resolution.js +2 -2
  102. package/dist/src/app-state.js +1 -2
  103. package/dist/src/application-lifecycle-interaction.js +1 -0
  104. package/dist/src/application-lifecycle-runtime.js +1 -0
  105. package/dist/src/apps-simctl.js +1 -0
  106. package/dist/src/archive.js +4 -0
  107. package/dist/src/artifact-download.js +1 -0
  108. package/dist/src/artifacts.d.ts +6 -2
  109. package/dist/src/artifacts.js +1 -1
  110. package/dist/src/async-lifecycle.js +1 -0
  111. package/dist/src/audio-probe-result.js +1 -0
  112. package/dist/src/audio-probe-runtime.js +1 -0
  113. package/dist/src/audio-probe-support.js +1 -0
  114. package/dist/src/auth-session.js +1 -1
  115. package/dist/src/auth.js +1 -1
  116. package/dist/src/back-mode.js +1 -0
  117. package/dist/src/{url.js → base-url.js} +1 -1
  118. package/dist/src/boot-diagnostics.js +2 -2
  119. package/dist/src/byte-limit-stream.js +1 -1
  120. package/dist/src/capabilities.js +1 -0
  121. package/dist/src/capture.js +1 -0
  122. package/dist/src/catalog.js +1 -0
  123. package/dist/src/cli-command-aliases.js +1 -0
  124. package/dist/src/cli-config.js +1 -1
  125. package/dist/src/cli-help.js +77 -51
  126. package/dist/src/cli-output.js +1 -1
  127. package/dist/src/cli-runner.js +1 -1
  128. package/dist/src/cli.js +5 -7
  129. package/dist/src/click-button.js +1 -0
  130. package/dist/src/client-metro-companion.js +1 -0
  131. package/dist/src/client-metro.js +1 -1
  132. package/dist/src/client-types.d.ts +1606 -0
  133. package/dist/src/clipboard.js +1 -0
  134. package/dist/src/code-signature-cache.js +1 -0
  135. package/dist/src/code-signature.js +1 -0
  136. package/dist/src/color.js +1 -0
  137. package/dist/src/command-metadata.js +1 -1
  138. package/dist/src/command-schema.js +3 -3
  139. package/dist/src/command-surface.js +1 -1
  140. package/dist/src/command-tools.js +2 -0
  141. package/dist/src/command.js +1 -0
  142. package/dist/src/{selector-vocabulary.js → compatibility-policy.js} +1 -1
  143. package/dist/src/config.js +1 -1
  144. package/dist/src/config2.js +1 -0
  145. package/dist/src/connection-runtime.js +1 -1
  146. package/dist/src/connection.js +5 -5
  147. package/dist/src/contracts.d.ts +1 -1
  148. package/dist/src/contracts.js +1 -1
  149. package/dist/src/daemon-client-lifecycle.js +1 -0
  150. package/dist/src/daemon-process.js +1 -0
  151. package/dist/src/daemon-registration.js +1 -0
  152. package/dist/src/daemon-shutdown-report.js +1 -1
  153. package/dist/src/daemon.js +2 -2
  154. package/dist/src/debug-symbols-facade.js +5 -0
  155. package/dist/src/deploy-result-target.js +1 -0
  156. package/dist/src/device-claim-inspection.js +1 -1
  157. package/dist/src/device-claim-rule.js +1 -0
  158. package/dist/src/device-input-state.d.ts +190 -3
  159. package/dist/src/device-inventory-context.js +1 -0
  160. package/dist/src/device-isolation.js +1 -0
  161. package/dist/src/device-release.js +1 -0
  162. package/dist/src/device-rotation.js +1 -0
  163. package/dist/src/device-selection-resolver.js +1 -0
  164. package/dist/src/device-session.js +1 -0
  165. package/dist/src/device.js +1 -1
  166. package/dist/src/device2.js +3 -2
  167. package/dist/src/diagnostics.js +3 -0
  168. package/dist/src/diagnostics2.js +1 -0
  169. package/dist/src/dispatch-resolve.js +1 -0
  170. package/dist/src/doctor-facade.js +1 -0
  171. package/dist/src/doctor-output.js +1 -0
  172. package/dist/src/doctor.js +1 -0
  173. package/dist/src/doctor2.js +1 -0
  174. package/dist/src/doctor3.js +1 -0
  175. package/dist/src/durable-resource.js +1 -0
  176. package/dist/src/entities.js +1 -1
  177. package/dist/src/error.js +2 -0
  178. package/dist/src/exec.js +1 -0
  179. package/dist/src/file.js +1 -0
  180. package/dist/src/find.js +1 -1
  181. package/dist/src/finders.js +1 -1
  182. package/dist/src/format.js +2 -0
  183. package/dist/src/generic-settle.js +1 -1
  184. package/dist/src/generic.js +1 -1
  185. package/dist/src/gesture-admission.js +1 -0
  186. package/dist/src/gesture-plan-types.js +1 -0
  187. package/dist/src/gesture-plan.js +1 -0
  188. package/dist/src/gesture-runtime.js +1 -0
  189. package/dist/src/harmonyos.js +1 -1
  190. package/dist/src/hdc.js +1 -1
  191. package/dist/src/helper.js +2 -2
  192. package/dist/src/host-file.js +1 -0
  193. package/dist/src/human-control-contract.js +1 -0
  194. package/dist/src/human-control.js +1 -0
  195. package/dist/src/index.d.ts +2 -1578
  196. package/dist/src/index.js +1 -1
  197. package/dist/src/input-actions.js +1 -4
  198. package/dist/src/input-actions2.js +2 -1
  199. package/dist/src/install-artifact-facade.js +1 -0
  200. package/dist/src/install-source-network-transport.js +1 -0
  201. package/dist/src/install-source.d.ts +3 -10
  202. package/dist/src/install-source2.js +1 -1
  203. package/dist/src/interaction-positionals.js +1 -0
  204. package/dist/src/interaction-ref-policy.js +1 -0
  205. package/dist/src/interaction.js +1 -1
  206. package/dist/src/interaction2.js +1 -1
  207. package/dist/src/interactor-operation-catalog.js +1 -0
  208. package/dist/src/interactor-types.js +1 -0
  209. package/dist/src/interactor.js +6 -2
  210. package/dist/src/interactor2.js +1 -1
  211. package/dist/src/interactors.js +1 -1
  212. package/dist/src/internal/bin.d.ts +1 -1
  213. package/dist/src/internal/bin.js +1 -2
  214. package/dist/src/internal/companion-tunnel.d.ts +1 -1
  215. package/dist/src/internal/companion-tunnel.js +1 -1
  216. package/dist/src/internal/daemon.d.ts +1 -1
  217. package/dist/src/internal/daemon.js +2 -4
  218. package/dist/src/internal/png-worker.d.ts +4 -4
  219. package/dist/src/internal/png-worker.js +1 -1
  220. package/dist/src/internal/run-script-http-child.d.ts +4 -0
  221. package/dist/src/internal/run-script-http-child.js +1 -0
  222. package/dist/src/internal/update-check-entry.d.ts +1 -1
  223. package/dist/src/inventory.js +4 -4
  224. package/dist/src/inventory2.js +1 -1
  225. package/dist/src/inventory3.js +1 -1
  226. package/dist/src/inventory5.js +1 -1
  227. package/dist/src/inventory6.js +1 -1
  228. package/dist/src/ios-client.js +16 -0
  229. package/dist/src/ios-snapshot-acquisition.js +1 -0
  230. package/dist/src/ios-snapshot-adapter.js +1 -0
  231. package/dist/src/ios-snapshot-planning.js +1 -0
  232. package/dist/src/ios-snapshot-runtime.js +1 -0
  233. package/dist/src/json.js +1 -0
  234. package/dist/src/keyboard-actions.js +1 -0
  235. package/dist/src/launch-console.js +1 -0
  236. package/dist/src/lease-context.js +1 -1
  237. package/dist/src/lease-scope.js +1 -0
  238. package/dist/src/lease.js +1 -1
  239. package/dist/src/limrun-runtime-dependencies.js +1 -1
  240. package/dist/src/limrun.d.ts +1618 -7
  241. package/dist/src/limrun.js +1 -1
  242. package/dist/src/linux.js +1 -1
  243. package/dist/src/local-interactor-operation-set.js +1 -0
  244. package/dist/src/location-coordinates.js +1 -1
  245. package/dist/src/logcat.js +1 -1
  246. package/dist/src/macos-facade.js +1 -0
  247. package/dist/src/managed-device-scope.js +1 -0
  248. package/dist/src/mechanics.js +19 -0
  249. package/dist/src/metro.d.ts +4 -2
  250. package/dist/src/metro.js +1 -1
  251. package/dist/src/metro2.js +1 -1
  252. package/dist/src/mobile-snapshot-semantics.js +1 -0
  253. package/dist/src/multitouch-support.js +1 -0
  254. package/dist/src/numeric.js +1 -0
  255. package/dist/src/observability.js +1 -1
  256. package/dist/src/observation.js +2 -0
  257. package/dist/src/output-path.js +1 -1
  258. package/dist/src/owner-identity.js +3 -1
  259. package/dist/src/parameterized-recorded-fill.js +1 -0
  260. package/dist/src/parser.js +1 -1
  261. package/dist/src/perf-facade.js +2 -0
  262. package/dist/src/perf-runtime-operation-builder.js +1 -0
  263. package/dist/src/perf-runtime-plan.js +1 -0
  264. package/dist/src/perf-runtime.js +1 -0
  265. package/dist/src/perf.js +1 -4
  266. package/dist/src/physical-device-control.js +1 -1
  267. package/dist/src/physical-device-facade.js +1 -0
  268. package/dist/src/platform-request-scope.js +1 -0
  269. package/dist/src/platform-runtime-android-adb-host.js +1 -0
  270. package/dist/src/platform-runtime-android-mechanics.js +1 -0
  271. package/dist/src/platform-runtime-app-log-android-transport.js +1 -1
  272. package/dist/src/platform-runtime-app-log-process.js +1 -1
  273. package/dist/src/platform-runtime-apple-resources.js +1 -0
  274. package/dist/src/platform-runtime-host.js +1 -1
  275. package/dist/src/platform-runtime-managed-owner.js +1 -0
  276. package/dist/src/platform-runtime-network-web-transport.js +1 -1
  277. package/dist/src/platform-runtime-open-target.js +1 -1
  278. package/dist/src/platform-runtime-operation-host.js +4 -4
  279. package/dist/src/platform-runtime-runtime-hints.js +2 -2
  280. package/dist/src/platform-runtime-screen-recording-android-host.js +1 -1
  281. package/dist/src/platform-runtime-screen-recording-apple-runner-host.js +1 -1
  282. package/dist/src/platform-runtime-screen-recording-apple-runner-transport.js +1 -1
  283. package/dist/src/platform-runtime-screen-recording-apple-simulator-host.js +1 -1
  284. package/dist/src/platform-runtime-screen-recording-apple-transport.js +1 -1
  285. package/dist/src/platform-runtime-screen-recording-finalizer-host.js +1 -1
  286. package/dist/src/platform-runtime-screen-recording-harmony-host.js +1 -1
  287. package/dist/src/platform-runtime-screen-recording-process-host.js +1 -0
  288. package/dist/src/platform-runtime-screen-recording-web-host.js +1 -1
  289. package/dist/src/platform-runtime-unavailable.js +1 -0
  290. package/dist/src/platform-runtime.js +1 -1
  291. package/dist/src/platform-runtime2.js +1 -1
  292. package/dist/src/plist.js +1 -1
  293. package/dist/src/png-worker-contract.js +1 -1
  294. package/dist/src/prepare-kind.js +1 -15
  295. package/dist/src/process-exit.js +1 -1
  296. package/dist/src/process.js +1 -0
  297. package/dist/src/provider-device-runtime.js +1 -0
  298. package/dist/src/provider-session-ownership.js +2 -0
  299. package/dist/src/provider-webdriver.js +1 -1
  300. package/dist/src/provider.js +1 -1
  301. package/dist/src/providers.js +1 -0
  302. package/dist/src/proxy.js +2 -2
  303. package/dist/src/react-native-overlay.js +1 -0
  304. package/dist/src/react-native.js +1 -1
  305. package/dist/src/record-runtime.js +1 -1
  306. package/dist/src/record-trace.js +1 -1
  307. package/dist/src/rect-center.js +1 -0
  308. package/dist/src/register-builtins.js +1 -0
  309. package/dist/src/registry.js +39 -28
  310. package/dist/src/remote-config2.js +1 -1
  311. package/dist/src/replay-divergence.js +2 -0
  312. package/dist/src/replay.js +2 -2
  313. package/dist/src/reporting.js +8 -8
  314. package/dist/src/request-admission.js +1 -0
  315. package/dist/src/request-cancel.js +1 -0
  316. package/dist/src/request-cancellation.js +1 -0
  317. package/dist/src/request-progress-protocol.js +1 -0
  318. package/dist/src/request-providers.js +1 -0
  319. package/dist/src/request-runtime-binding.js +1 -0
  320. package/dist/src/request.js +1 -0
  321. package/dist/src/result-serialization.js +1 -0
  322. package/dist/src/retry.js +1 -0
  323. package/dist/src/rolldown-runtime.js +1 -1
  324. package/dist/src/runner-cache-metadata.js +2 -0
  325. package/dist/src/runner-client.js +1 -1
  326. package/dist/src/runner-disposal.js +1 -1
  327. package/dist/src/runner-operations-facade.js +1 -0
  328. package/dist/src/runner-owner-facade.js +1 -0
  329. package/dist/src/runner-owner-state.js +1 -0
  330. package/dist/src/runner-presentation.js +1 -0
  331. package/dist/src/runner-selector-query.js +1 -0
  332. package/dist/src/runner.js +1 -0
  333. package/dist/src/{runtime-transport.js → runtime-transport-hints.js} +1 -1
  334. package/dist/src/runtime.js +3 -3
  335. package/dist/src/runtime2.js +4 -4
  336. package/dist/src/runtime3.js +1 -1
  337. package/dist/src/runtime4.js +4 -3
  338. package/dist/src/runtime5.js +1 -1
  339. package/dist/src/runtime6.js +1 -1
  340. package/dist/src/runtime7.js +1 -1
  341. package/dist/src/runtime8.js +1 -1
  342. package/dist/src/runtime9.js +1 -1
  343. package/dist/src/scoped-provider.js +1 -1
  344. package/dist/src/screen-recording-completion.js +1 -0
  345. package/dist/src/screen-recording-live-handle.js +1 -0
  346. package/dist/src/screen-recording-options.js +1 -0
  347. package/dist/src/screen-recording-resource-recovery.js +1 -0
  348. package/dist/src/screen-recording-runtime.js +1 -0
  349. package/dist/src/screenshot-density.js +1 -1
  350. package/dist/src/screenshot-result.js +1 -6
  351. package/dist/src/screenshot-runtime.js +1 -0
  352. package/dist/src/screenshot.js +1 -1
  353. package/dist/src/screenshot2.js +1 -0
  354. package/dist/src/screenshot3.js +5 -0
  355. package/dist/src/script.js +1 -0
  356. package/dist/src/scroll-command.js +1 -0
  357. package/dist/src/scroll-gesture.js +1 -0
  358. package/dist/src/scroll-indicator.js +1 -0
  359. package/dist/src/sdk-batch-runner.d.ts +23 -6
  360. package/dist/src/sdk-batch-runner.js +2 -3
  361. package/dist/src/sdk-batch.js +2 -0
  362. package/dist/src/sdk-contracts.d.ts +222 -99
  363. package/dist/src/sdk-contracts.js +2 -2
  364. package/dist/src/sdk-device.js +1 -1
  365. package/dist/src/sdk-finders.d.ts +1 -1
  366. package/dist/src/sdk-finders.js +1 -1
  367. package/dist/src/sdk-io.js +1 -1
  368. package/dist/src/sdk-remote-config.d.ts +1 -1
  369. package/dist/src/sdk-remote-config.js +1 -1
  370. package/dist/src/sdk-selectors.d.ts +539 -199
  371. package/dist/src/sdk-selectors.js +1 -1
  372. package/dist/src/selection.js +1 -0
  373. package/dist/src/selector-runtime.js +1 -1
  374. package/dist/src/selectors.js +1 -1
  375. package/dist/src/semantic-index.js +1 -0
  376. package/dist/src/server.js +10 -3
  377. package/dist/src/session-allocation.js +1 -0
  378. package/dist/src/session-artifact-paths.js +1 -0
  379. package/dist/src/session-paths.js +1 -0
  380. package/dist/src/session-repair-tombstone.js +1 -0
  381. package/dist/src/session-routing.js +1 -0
  382. package/dist/src/session-runtime-admission.js +1 -0
  383. package/dist/src/session-snapshot.js +1 -0
  384. package/dist/src/session-store.js +4 -0
  385. package/dist/src/session-target-evidence.js +1 -1
  386. package/dist/src/session2.js +5 -28
  387. package/dist/src/settings.js +1 -0
  388. package/dist/src/shared.js +2 -2
  389. package/dist/src/simctl-facade.js +1 -0
  390. package/dist/src/simctl.js +1 -1
  391. package/dist/src/simulator-facade.js +1 -0
  392. package/dist/src/simulator.js +1 -1
  393. package/dist/src/snapshot-capture-annotations.js +1 -0
  394. package/dist/src/snapshot-desktop-projection.js +1 -0
  395. package/dist/src/snapshot-diagnostics.js +1 -0
  396. package/dist/src/snapshot-process.js +1 -0
  397. package/dist/src/snapshot-quality-backend-capabilities.js +1 -0
  398. package/dist/src/snapshot-quality-verdict.js +1 -0
  399. package/dist/src/snapshot-runtime-binding.js +1 -0
  400. package/dist/src/snapshot-runtime.js +1 -1
  401. package/dist/src/snapshot-scope.js +1 -0
  402. package/dist/src/snapshot-state.js +1 -0
  403. package/dist/src/snapshot.js +1 -8
  404. package/dist/src/snapshot2.js +1 -1
  405. package/dist/src/snapshot3.js +1 -1
  406. package/dist/src/snapshot4.js +1 -0
  407. package/dist/src/src.js +1 -1
  408. package/dist/src/src2.js +1 -1
  409. package/dist/src/src3.js +1 -2
  410. package/dist/src/src4.js +1 -0
  411. package/dist/src/src5.js +1 -0
  412. package/dist/src/src6.js +1 -0
  413. package/dist/src/src7.js +2 -0
  414. package/dist/src/src8.js +115 -0
  415. package/dist/src/startup-recovery-fence.js +1 -0
  416. package/dist/src/status-markers.js +1 -0
  417. package/dist/src/string-enum.js +1 -1
  418. package/dist/src/success-text.js +1 -0
  419. package/dist/src/surface-snapshot.js +1 -0
  420. package/dist/src/surface-snapshot2.js +1 -0
  421. package/dist/src/takeover.js +5 -0
  422. package/dist/src/tool-provider-facade.js +1 -0
  423. package/dist/src/tool-provider.js +4 -3
  424. package/dist/src/tool-provider2.js +1 -1
  425. package/dist/src/tool-provider3.js +1 -0
  426. package/dist/src/toolchain-probe.js +2 -0
  427. package/dist/src/touch-runtime.js +1 -0
  428. package/dist/src/transport.js +3 -0
  429. package/dist/src/tree.js +1 -0
  430. package/dist/src/ttl-memo.js +1 -0
  431. package/dist/src/tv-remote.js +1 -0
  432. package/dist/src/type-text-runtime.js +1 -0
  433. package/dist/src/undici.js +99 -0
  434. package/dist/src/update-check.js +1 -1
  435. package/dist/src/verified-file.js +1 -1
  436. package/dist/src/version.js +1 -1
  437. package/dist/src/video.js +2 -2
  438. package/dist/src/web.js +2 -1
  439. package/dist/src/web2.js +1 -0
  440. package/dist/src/webdriver-ios-snapshot.js +1 -0
  441. package/dist/src/webdriver-source.js +1 -0
  442. package/linux/atspi-dump.py +54 -9
  443. package/package.json +73 -38
  444. package/server.json +9 -3
  445. package/android/ime-helper/dist/agent-device-android-ime-helper-0.20.9.apk.sha256 +0 -1
  446. package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.20.9.apk +0 -0
  447. package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.20.9.apk.sha256 +0 -1
  448. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CoordinateTextEntryTests.swift +0 -4
  449. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+FlatSnapshotFiltering.swift +0 -75
  450. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+LifecycleCacheTests.swift +0 -6
  451. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+RecordingTests.swift +0 -4
  452. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SelectorMatchPolicyTests.swift +0 -4
  453. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotTraversalIdentityTests.swift +0 -4
  454. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryPolicyTests.swift +0 -4
  455. package/dist/src/appearance.js +0 -1
  456. package/dist/src/apps.js +0 -5
  457. package/dist/src/audio-probe.js +0 -1
  458. package/dist/src/cancel.js +0 -1
  459. package/dist/src/cli-grammar.js +0 -1
  460. package/dist/src/command-catalog.js +0 -1
  461. package/dist/src/debug-symbols.js +0 -5
  462. package/dist/src/device-input-state.js +0 -2
  463. package/dist/src/device-ready.js +0 -1
  464. package/dist/src/dispatch.js +0 -1
  465. package/dist/src/handler-utils.js +0 -1
  466. package/dist/src/helper-package-install.js +0 -1
  467. package/dist/src/host-process.js +0 -3
  468. package/dist/src/ime-lifecycle.js +0 -2
  469. package/dist/src/ime-recovery-marker.js +0 -1
  470. package/dist/src/input-actions3.js +0 -1
  471. package/dist/src/install-artifact.js +0 -1
  472. package/dist/src/install-artifact2.js +0 -1
  473. package/dist/src/interaction-common.js +0 -1
  474. package/dist/src/interaction-runtime.js +0 -1
  475. package/dist/src/interaction-snapshot.js +0 -1
  476. package/dist/src/manifest.js +0 -1
  477. package/dist/src/method-scope.js +0 -1
  478. package/dist/src/png-resize.js +0 -1
  479. package/dist/src/process-lock.js +0 -1
  480. package/dist/src/runner-lease.js +0 -1
  481. package/dist/src/runner-sequence.js +0 -1
  482. package/dist/src/screenshot-geometry.js +0 -1
  483. package/dist/src/sdk-android-adb.d.ts +0 -245
  484. package/dist/src/sdk-android-adb.js +0 -4
  485. package/dist/src/sdk.js +0 -1
  486. package/dist/src/setting-state.js +0 -1
  487. package/dist/src/shell-quote.js +0 -1
  488. package/dist/src/snapshot-session.js +0 -1
  489. package/dist/src/timing-safe-equal.js +0 -1
  490. package/dist/src/unsupported-interactor.js +0 -1
  491. package/dist/src/verdict.js +0 -1
  492. /package/dist/src/{recording-telemetry.js → telemetry.js} +0 -0
@@ -0,0 +1,1606 @@
1
+ import { B as NormalizedError, C as SnapshotNode, E as SnapshotQualityVerdict, I as PlatformSelector, L as PublicPlatform, N as DeviceKind, O as SnapshotUnchanged, P as DeviceTarget, _ as SessionIsolationMode, a as DaemonRequest, f as LeaseBackend, g as ResponseLevel, i as DaemonLockPolicy, j as AppleOS, k as SnapshotVisibility, m as NetworkIncludeMode, o as DaemonResponse, r as DaemonInstallSource, s as DaemonResponseData, t as DaemonArtifact, v as SessionRuntimeHints, z as DaemonError } from "./sdk-contracts.js";
2
+ import { t as AppsFilter } from "./app-inventory.js";
3
+ import { A as ScrollInputDirection, C as BackMode, F as AndroidSnapshotBackendMetadata, I as FindLocator, L as ScreenshotResultData, M as SwipePreset, N as TransformGestureParams, P as ClickButton, R as SnapshotDiagnosticsSummary, S as DeviceRotation, _ as HoverCommandResponseData, b as SettleObservation, g as FindCommandResponseData, h as FillCommandResponseData, j as SwipePattern, k as ScrollDirection, m as ClickCommandResponseData, p as ScrollCommandResult, v as LongPressCommandResponseData, w as GesturePointerCount, x as TvRemoteButton, y as PressCommandResponseData, z as SessionSurface } from "./sdk-selectors.js";
4
+ import { a as RemoteConnectionProfileFields, c as MetroPrepareResult, i as CloudProviderProfileFields, l as MetroReloadOptions, s as MetroPrepareOptions, u as MetroReloadResult } from "./sdk-remote-config.js";
5
+ import { t as BatchRunResult } from "./sdk-batch-runner.js";
6
+ import { r as CloudProviderSessionResult, t as AgentArtifactsResult } from "./cloud-artifacts.js";
7
+ //#region packages/contracts/src/json.d.ts
8
+ type JsonPrimitive = string | number | boolean | null;
9
+ type JsonValue = JsonPrimitive | JsonObject | JsonValue[];
10
+ type JsonObject = {
11
+ [key: string]: JsonValue;
12
+ };
13
+ //#endregion
14
+ //#region packages/contracts/src/target-shutdown-contract.d.ts
15
+ type TargetShutdownResult = {
16
+ success: boolean;
17
+ exitCode: number;
18
+ stdout: string;
19
+ stderr: string;
20
+ error?: NormalizedError;
21
+ };
22
+ //#endregion
23
+ //#region packages/contracts/src/client-connection.d.ts
24
+ type AgentDeviceDaemonTransportContext = {
25
+ authToken?: string;
26
+ };
27
+ type AgentDeviceDaemonTransport = (req: Omit<DaemonRequest, 'token'>, context?: AgentDeviceDaemonTransportContext) => Promise<DaemonResponse>;
28
+ type AgentDeviceClientConfig = RemoteConnectionProfileFields & CloudProviderProfileFields & {
29
+ session?: string;
30
+ lockPolicy?: DaemonLockPolicy;
31
+ lockPlatform?: PlatformSelector;
32
+ requestId?: string;
33
+ sessionIsolation?: SessionIsolationMode;
34
+ leaseBackend?: LeaseBackend;
35
+ leaseTtlMs?: number;
36
+ runtime?: SessionRuntimeHints;
37
+ cwd?: string;
38
+ debug?: boolean;
39
+ cost?: boolean;
40
+ responseLevel?: ResponseLevel;
41
+ iosXctestrunFile?: string;
42
+ iosXctestDerivedDataPath?: string;
43
+ iosXctestEnvDir?: string;
44
+ };
45
+ type AgentDeviceRequestOverrides = Pick<AgentDeviceClientConfig, 'session' | 'lockPolicy' | 'lockPlatform' | 'requestId' | 'daemonBaseUrl' | 'daemonAuthToken' | 'daemonTransport' | 'daemonServerMode' | 'tenant' | 'sessionIsolation' | 'runId' | 'leaseId' | 'leaseBackend' | 'leaseProvider' | 'deviceKey' | 'clientId' | 'providerApp' | 'providerOsVersion' | 'providerProject' | 'providerBuild' | 'providerSessionName' | 'providerDeviceOrientation' | 'providerGeoLocation' | 'providerTimezone' | 'providerLanguage' | 'providerLocale' | 'providerNetworkProfile' | 'providerCustomNetwork' | 'providerNoResignApp' | 'awsProjectArn' | 'awsDeviceArn' | 'awsAppArn' | 'awsRegion' | 'awsInteractionMode' | 'leaseTtlMs' | 'cwd' | 'debug' | 'cost' | 'responseLevel' | 'iosXctestrunFile' | 'iosXctestDerivedDataPath' | 'iosXctestEnvDir'>;
46
+ type AgentDeviceIdentifiers = {
47
+ session?: string;
48
+ deviceId?: string;
49
+ deviceName?: string;
50
+ udid?: string;
51
+ serial?: string;
52
+ appId?: string;
53
+ appBundleId?: string;
54
+ package?: string;
55
+ };
56
+ type AgentDeviceSelectionOptions = {
57
+ platform?: PlatformSelector;
58
+ target?: DeviceTarget;
59
+ device?: string;
60
+ udid?: string;
61
+ serial?: string;
62
+ iosSimulatorDeviceSet?: string;
63
+ androidDeviceAllowlist?: string;
64
+ };
65
+ type DeviceCommandBaseOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions;
66
+ //#endregion
67
+ //#region packages/contracts/src/client-device-view.d.ts
68
+ type AgentDeviceDevice = {
69
+ platform: PublicPlatform;
70
+ target: DeviceTarget;
71
+ kind: DeviceKind;
72
+ id: string;
73
+ name: string;
74
+ booted?: boolean;
75
+ /**
76
+ * Additive Apple-OS discriminant (iPhone/iPad/tvOS/visionOS/macOS). Present only for
77
+ * Apple devices; `platform` still carries the leaf (`ios`/`macos`).
78
+ */
79
+ appleOs?: AppleOS;
80
+ identifiers: AgentDeviceIdentifiers;
81
+ /**
82
+ * Present when a host-local device claim currently blocks foreign use of
83
+ * this device (#1320). Provably dead owners are not projected — the next
84
+ * open reconciles and replaces them automatically.
85
+ */
86
+ claimedBy?: {
87
+ session: string;
88
+ workspace: string;
89
+ };
90
+ ios?: {
91
+ udid: string;
92
+ };
93
+ android?: {
94
+ serial: string;
95
+ };
96
+ harmonyos?: {
97
+ serial: string;
98
+ };
99
+ vega?: {
100
+ serial: string;
101
+ };
102
+ };
103
+ type AgentDeviceCapabilitiesResult = {
104
+ device: AgentDeviceDevice;
105
+ availableCommands: string[];
106
+ };
107
+ type AgentDeviceSessionDevice = {
108
+ platform: PublicPlatform;
109
+ target: DeviceTarget;
110
+ id: string;
111
+ name: string;
112
+ /**
113
+ * Additive Apple-OS discriminant (iPhone/iPad/tvOS/visionOS/macOS). Present only for
114
+ * Apple devices; `platform` still carries the leaf (`ios`/`macos`).
115
+ */
116
+ appleOs?: AppleOS;
117
+ identifiers: AgentDeviceIdentifiers;
118
+ ios?: {
119
+ udid: string;
120
+ simulatorSetPath?: string | null;
121
+ };
122
+ android?: {
123
+ serial: string;
124
+ };
125
+ harmonyos?: {
126
+ serial: string;
127
+ };
128
+ vega?: {
129
+ serial: string;
130
+ };
131
+ };
132
+ type AgentDeviceSession = {
133
+ name: string;
134
+ /**
135
+ * The exact value `--session` must carry to address this session, which is not always `name`:
136
+ * a session opened without `--session` is named `default` but stored — and addressed — as
137
+ * `cwd:<hash>:default` (#2031/#1394). Optional only because a daemon older than the field does
138
+ * not send it.
139
+ */
140
+ address?: string;
141
+ createdAt: number;
142
+ sessionStateDir?: string;
143
+ runnerLogPath?: string;
144
+ device: AgentDeviceSessionDevice;
145
+ identifiers: AgentDeviceIdentifiers;
146
+ };
147
+ type StartupPerfSample = {
148
+ durationMs: number;
149
+ measuredAt: string;
150
+ method: string;
151
+ appTarget?: string;
152
+ appBundleId?: string;
153
+ };
154
+ type DeviceBootOptions = DeviceCommandBaseOptions & {
155
+ headless?: boolean;
156
+ };
157
+ type DeviceShutdownOptions = DeviceCommandBaseOptions;
158
+ //#endregion
159
+ //#region packages/contracts/src/client-app.d.ts
160
+ type DeviceSelectionReason = 'explicit-selector' | 'existing-session' | 'single-booted-local' | 'single-bootable-local' | 'single-app-installed-local' | 'preferred-local' | 'single-provider-device';
161
+ type DeviceSelectionSource = 'session' | 'local' | 'provider';
162
+ /** Deterministic device-selection evidence shared by daemon responses and the published client. */
163
+ type DeviceSelectionMetadata = {
164
+ reason: DeviceSelectionReason;
165
+ source: DeviceSelectionSource;
166
+ candidateCount: number;
167
+ /** Whether this request booted a previously stopped local virtual target during open. */
168
+ bootOccurred: boolean;
169
+ };
170
+ type AppInstallOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
171
+ app?: string;
172
+ appPath: string;
173
+ };
174
+ type AppDeployOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
175
+ app: string;
176
+ appPath: string;
177
+ };
178
+ type AppDeployResult = {
179
+ app: string;
180
+ appPath: string;
181
+ platform: PublicPlatform;
182
+ appId?: string;
183
+ bundleId?: string;
184
+ package?: string;
185
+ identifiers: AgentDeviceIdentifiers;
186
+ };
187
+ type AppOpenOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
188
+ app?: string;
189
+ url?: string;
190
+ surface?: SessionSurface;
191
+ activity?: string;
192
+ launchConsole?: string;
193
+ launchArgs?: string[];
194
+ relaunch?: boolean;
195
+ /** Startup budget in milliseconds: bounds the Simulator boot wait on a cold device. */
196
+ timeoutMs?: number;
197
+ /**
198
+ * Include the initial interactive snapshot in a fresh open response. With
199
+ * no app argument, iOS can discover the sole running app on the sole booted
200
+ * simulator and fails closed when that environment is ambiguous.
201
+ */
202
+ foreground?: boolean;
203
+ saveScript?: boolean | string;
204
+ /** #1258: overwrite an existing --save-script target instead of refusing. Alias: --overwrite. */
205
+ force?: boolean;
206
+ deviceHub?: boolean;
207
+ testIme?: boolean;
208
+ noRecord?: boolean;
209
+ runtime?: SessionRuntimeHints;
210
+ };
211
+ type AppOpenResult = {
212
+ session: string;
213
+ warnings?: string[];
214
+ sessionStateDir?: string;
215
+ runnerLogPath?: string;
216
+ requestLogPath?: string;
217
+ eventLogPath?: string;
218
+ appName?: string;
219
+ appBundleId?: string;
220
+ appId?: string;
221
+ startup?: StartupPerfSample;
222
+ runtime?: SessionRuntimeHints;
223
+ selection?: DeviceSelectionMetadata;
224
+ device?: AgentDeviceSessionDevice;
225
+ /**
226
+ * Initial interactive snapshot captured immediately after an open that
227
+ * requested `foreground`, composed from the same snapshot-runtime dispatch
228
+ * `agent-device snapshot -i` uses. It stays loosely typed rather than reusing
229
+ * `CaptureSnapshotResult` because the daemon-side composition does not attach
230
+ * client-only fields like `identifiers`.
231
+ */
232
+ snapshot?: Record<string, unknown>;
233
+ /**
234
+ * open --foreground: present when the session opened successfully but the
235
+ * composed initial snapshot capture failed. Carries the FULL daemon error
236
+ * shape (code, message, hint, details, diagnosticId, logPath) so recovery
237
+ * guidance survives to the caller; the session itself is open and usable —
238
+ * a `warnings` entry says so and points at `snapshot -i`.
239
+ */
240
+ initialSnapshotError?: DaemonError;
241
+ identifiers: AgentDeviceIdentifiers;
242
+ };
243
+ type AppCloseOptions = AgentDeviceRequestOverrides & {
244
+ app?: string;
245
+ shutdown?: boolean;
246
+ saveScript?: boolean | string;
247
+ /** #1258: overwrite an existing --save-script target instead of refusing. Alias: --overwrite. */
248
+ force?: boolean;
249
+ };
250
+ type AppCloseResult = {
251
+ session: string;
252
+ closedApp?: string;
253
+ shutdown?: TargetShutdownResult;
254
+ /**
255
+ * #1258: absolute path of the committed session/healed script when this close
256
+ * published one (`close --save-script`, or a repair-armed session's finalize)
257
+ * — so a client that requested publication learns where the file landed.
258
+ */
259
+ savedScript?: string;
260
+ identifiers: AgentDeviceIdentifiers;
261
+ };
262
+ type AppInstallFromSourceOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
263
+ source: DaemonInstallSource;
264
+ retainPaths?: boolean;
265
+ retentionMs?: number;
266
+ };
267
+ type AppInstallFromSourceResult = {
268
+ appName?: string;
269
+ appId?: string;
270
+ bundleId?: string;
271
+ packageName?: string;
272
+ launchTarget: string;
273
+ installablePath?: string;
274
+ archivePath?: string;
275
+ materializationId?: string;
276
+ materializationExpiresAt?: string;
277
+ identifiers: AgentDeviceIdentifiers;
278
+ };
279
+ type AppListOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
280
+ appsFilter?: AppsFilter;
281
+ };
282
+ type AppPushOptions = DeviceCommandBaseOptions & {
283
+ app: string;
284
+ payload: string | JsonObject;
285
+ };
286
+ type AppTriggerEventOptions = DeviceCommandBaseOptions & {
287
+ event: string;
288
+ payload?: JsonObject;
289
+ };
290
+ type MaterializationReleaseOptions = AgentDeviceRequestOverrides & {
291
+ materializationId: string;
292
+ };
293
+ type MaterializationReleaseResult = {
294
+ released: boolean;
295
+ materializationId: string;
296
+ identifiers: AgentDeviceIdentifiers;
297
+ };
298
+ //#endregion
299
+ //#region packages/contracts/src/snapshot-capture-annotations.d.ts
300
+ type SnapshotCaptureAnalysis = {
301
+ rawNodeCount: number;
302
+ maxDepth: number;
303
+ };
304
+ type SnapshotCaptureFreshness = {
305
+ action: string;
306
+ retryCount: number;
307
+ staleAfterRetries: boolean;
308
+ reason?: 'empty-interactive' | 'sharp-drop' | 'stuck-route';
309
+ };
310
+ type SnapshotCaptureAnnotations = {
311
+ analysis?: SnapshotCaptureAnalysis;
312
+ androidSnapshot?: AndroidSnapshotBackendMetadata;
313
+ freshness?: SnapshotCaptureFreshness;
314
+ quality?: SnapshotQualityVerdict;
315
+ warnings?: string[];
316
+ };
317
+ type PublicSnapshotCaptureAnnotations = Pick<SnapshotCaptureAnnotations, 'androidSnapshot' | 'warnings'> & {
318
+ snapshotQuality?: SnapshotQualityVerdict;
319
+ };
320
+ //#endregion
321
+ //#region packages/contracts/src/client-capture.d.ts
322
+ type CaptureSnapshotOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
323
+ interactiveOnly?: boolean;
324
+ depth?: number;
325
+ scope?: string;
326
+ raw?: boolean;
327
+ /** List accessibility custom actions on merged elements (iOS simulator). */
328
+ customActions?: boolean;
329
+ forceFull?: boolean;
330
+ timeoutMs?: number;
331
+ /**
332
+ * #1271 stage 2 (ADR 0012 amendment): `snapshot` is observation-only and
333
+ * excluded from a repair-armed heal by default; `record` forces it
334
+ * through. Mutually exclusive with `noRecord`.
335
+ */
336
+ noRecord?: boolean;
337
+ record?: boolean;
338
+ };
339
+ type CaptureSnapshotResult = {
340
+ nodes: SnapshotNode[];
341
+ /** Present only when the capture owner establishes whether the tree was truncated. */
342
+ truncated?: boolean;
343
+ appName?: string;
344
+ appBundleId?: string;
345
+ visibility?: SnapshotVisibility;
346
+ unchanged?: SnapshotUnchanged;
347
+ snapshotDiagnostics?: SnapshotDiagnosticsSummary;
348
+ /**
349
+ * Screenshot captured automatically when the semantic snapshot was sparse.
350
+ * Remote clients receive a materialized local path through the daemon artifact channel.
351
+ */
352
+ fallbackScreenshotPath?: string;
353
+ identifiers: AgentDeviceIdentifiers;
354
+ /**
355
+ * ADR 0014: the response-level ref-frame epoch the plain node refs were minted
356
+ * from. A ref-issuing snapshot carries it ONCE (nodes stay plain `@e12` for the
357
+ * token budget); pair a ref with it (`@e12~s<refsGeneration>`) before a mutation.
358
+ */
359
+ refsGeneration?: number;
360
+ /**
361
+ * Digest response view only: a capped list of `{ ref, label? }` pairs taken
362
+ * from the full `nodes` tree so the MCP layer can still pin refs when the
363
+ * default-level `nodes` payload is intentionally omitted.
364
+ */
365
+ refs?: Array<{
366
+ ref: string;
367
+ label?: string;
368
+ }>;
369
+ } & PublicSnapshotCaptureAnnotations;
370
+ type CaptureScreenshotOptions = AgentDeviceRequestOverrides & {
371
+ path?: string;
372
+ overlayRefs?: boolean;
373
+ /** Crop the capture to the frame of the selector resolved on the same screen. */
374
+ cropOn?: string;
375
+ pixelDensity?: number;
376
+ fullscreen?: boolean;
377
+ scale?: number;
378
+ stabilize?: boolean;
379
+ normalizeStatusBar?: boolean;
380
+ surface?: SessionSurface;
381
+ };
382
+ type CaptureScreenshotResult = ScreenshotResultData & {
383
+ path: string;
384
+ identifiers: AgentDeviceIdentifiers;
385
+ };
386
+ type CaptureDiffOptions = DeviceCommandBaseOptions & Pick<CaptureSnapshotOptions, 'interactiveOnly' | 'depth' | 'scope' | 'raw'> & {
387
+ kind: 'snapshot';
388
+ out?: string;
389
+ };
390
+ type SelectorSnapshotCommandOptions = Pick<CaptureSnapshotOptions, 'depth' | 'scope' | 'raw'>;
391
+ type FindSnapshotCommandOptions = Pick<CaptureSnapshotOptions, 'depth' | 'raw'>;
392
+ //#endregion
393
+ //#region packages/contracts/src/client-target.d.ts
394
+ type PointTarget = {
395
+ x: number;
396
+ y: number;
397
+ ref?: never;
398
+ selector?: never;
399
+ label?: never;
400
+ };
401
+ type RefTarget = {
402
+ ref: string;
403
+ label?: string;
404
+ x?: never;
405
+ y?: never;
406
+ selector?: never;
407
+ };
408
+ type SelectorTarget = {
409
+ selector: string;
410
+ x?: never;
411
+ y?: never;
412
+ ref?: never;
413
+ label?: never;
414
+ };
415
+ type InteractionTarget = PointTarget | RefTarget | SelectorTarget;
416
+ type ElementTarget = RefTarget | SelectorTarget;
417
+ //#endregion
418
+ //#region packages/contracts/src/client-gesture.d.ts
419
+ type RepeatedPressOptions = {
420
+ count?: number;
421
+ intervalMs?: number;
422
+ holdMs?: number;
423
+ jitterPx?: number;
424
+ doubleTap?: boolean;
425
+ };
426
+ /**
427
+ * Opt-in (#1101): after the action, wait for the UI to go quiet and return the
428
+ * settled diff vs the pre-action tree (`settle` on the result) in the same
429
+ * response. Best-effort — never fails the action. `settleQuietMs` tunes the
430
+ * quiet window (default 500ms); `timeoutMs` bounds the settle wait (default
431
+ * 10s) when `settle` is true. A bare `timeoutMs` without `settle` is ignored
432
+ * for compatibility; `settleQuietMs` still requires `settle`.
433
+ */
434
+ type SettleCommandOptions = {
435
+ settle?: boolean;
436
+ settleQuietMs?: number;
437
+ timeoutMs?: number;
438
+ };
439
+ type ClickOptions = DeviceCommandBaseOptions & SelectorSnapshotCommandOptions & InteractionTarget & RepeatedPressOptions & SettleCommandOptions & {
440
+ button?: ClickButton;
441
+ /**
442
+ * Opt-in (#1047): return cheap post-action evidence (AX digest, node counts,
443
+ * changedFromBefore) in the response instead of requiring a follow-up
444
+ * snapshot to confirm the action had an effect.
445
+ */
446
+ verify?: boolean;
447
+ };
448
+ type PressOptions = DeviceCommandBaseOptions & SelectorSnapshotCommandOptions & InteractionTarget & RepeatedPressOptions & SettleCommandOptions & {
449
+ verify?: boolean;
450
+ };
451
+ type LongPressOptions = DeviceCommandBaseOptions & SelectorSnapshotCommandOptions & InteractionTarget & SettleCommandOptions & {
452
+ durationMs?: number;
453
+ };
454
+ type HoverOptions = DeviceCommandBaseOptions & SelectorSnapshotCommandOptions & InteractionTarget & SettleCommandOptions;
455
+ type SwipeOptions = DeviceCommandBaseOptions & {
456
+ from: {
457
+ x: number;
458
+ y: number;
459
+ };
460
+ to: {
461
+ x: number;
462
+ y: number;
463
+ };
464
+ count?: number;
465
+ pauseMs?: number;
466
+ pattern?: SwipePattern;
467
+ };
468
+ type PanOptions = DeviceCommandBaseOptions & {
469
+ x: number;
470
+ y: number;
471
+ dx: number;
472
+ dy: number;
473
+ pointerCount?: GesturePointerCount;
474
+ durationMs?: number;
475
+ };
476
+ type DragOptions = DeviceCommandBaseOptions & {
477
+ source: string;
478
+ destination: string;
479
+ sourceHoldMs?: number;
480
+ moveMs?: number;
481
+ destinationHoldMs?: number;
482
+ };
483
+ type FlingOptions = DeviceCommandBaseOptions & {
484
+ direction: ScrollDirection;
485
+ x: number;
486
+ y: number;
487
+ distance?: number;
488
+ };
489
+ type SwipeGestureOptions = DeviceCommandBaseOptions & {
490
+ preset: SwipePreset;
491
+ };
492
+ type FocusOptions = DeviceCommandBaseOptions & {
493
+ x: number;
494
+ y: number;
495
+ };
496
+ type TypeTextOptions = DeviceCommandBaseOptions & {
497
+ text: string;
498
+ delayMs?: number;
499
+ };
500
+ type FillOptions = DeviceCommandBaseOptions & SelectorSnapshotCommandOptions & InteractionTarget & SettleCommandOptions & {
501
+ text: string;
502
+ delayMs?: number;
503
+ /** Publish this fill value as `${VAR}` when script recording is armed. */
504
+ recordAs?: string;
505
+ verify?: boolean;
506
+ };
507
+ type PinchOptions = DeviceCommandBaseOptions & {
508
+ scale: number;
509
+ x?: number;
510
+ y?: number;
511
+ };
512
+ type RotateGestureOptions = DeviceCommandBaseOptions & {
513
+ degrees: number;
514
+ x?: number;
515
+ y?: number;
516
+ };
517
+ type TransformGestureOptions = DeviceCommandBaseOptions & TransformGestureParams;
518
+ type ScrollOptions = DeviceCommandBaseOptions & SettleCommandOptions & {
519
+ direction: ScrollInputDirection;
520
+ amount?: number;
521
+ pixels?: number;
522
+ durationMs?: number;
523
+ };
524
+ //#endregion
525
+ //#region packages/contracts/src/client-lease.d.ts
526
+ type Lease = {
527
+ leaseId: string;
528
+ tenantId: string;
529
+ runId: string;
530
+ backend: LeaseBackend;
531
+ leaseProvider?: string;
532
+ deviceKey?: string;
533
+ clientId?: string;
534
+ createdAt?: number;
535
+ heartbeatAt?: number;
536
+ expiresAt?: number;
537
+ };
538
+ type LeaseOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
539
+ ttlMs?: number;
540
+ };
541
+ type LeaseAllocateOptions = LeaseOptions & {
542
+ tenant: string;
543
+ runId: string;
544
+ leaseBackend?: LeaseBackend;
545
+ leaseProvider?: string;
546
+ provider?: string;
547
+ deviceKey?: string;
548
+ clientId?: string;
549
+ };
550
+ type LeaseScopedOptions = LeaseOptions & {
551
+ tenant?: string;
552
+ runId?: string;
553
+ leaseId: string;
554
+ leaseBackend?: LeaseBackend;
555
+ leaseProvider?: string;
556
+ provider?: string;
557
+ deviceKey?: string;
558
+ clientId?: string;
559
+ };
560
+ type CloudArtifactsOptions = AgentDeviceRequestOverrides & {
561
+ provider?: string;
562
+ providerSessionId?: string;
563
+ };
564
+ type HumanControlHoldScope = {
565
+ backend: LeaseBackend;
566
+ leaseProvider?: string;
567
+ deviceKey: string;
568
+ };
569
+ type HumanControlHold = {
570
+ id: string;
571
+ scope: HumanControlHoldScope;
572
+ reason?: string;
573
+ state: 'activating' | 'active';
574
+ createdAt: number;
575
+ updatedAt: number;
576
+ expiresAt?: number;
577
+ };
578
+ type HumanControlHoldOptions = {
579
+ reason?: string;
580
+ ttlMs?: number;
581
+ };
582
+ //#endregion
583
+ //#region packages/contracts/src/logs.d.ts
584
+ declare const LOG_ACTION_VALUES: readonly ['path', 'start', 'stop', 'doctor', 'mark', 'clear'];
585
+ type LogAction = (typeof LOG_ACTION_VALUES)[number];
586
+ //#endregion
587
+ //#region packages/contracts/src/perf.d.ts
588
+ declare const PERF_AREA_VALUES: readonly ['frames', 'memory', 'cpu', 'trace'];
589
+ declare const PERF_ACTION_VALUES: readonly ['sample', 'snapshot', 'start', 'stop', 'report'];
590
+ declare const PERF_SUBJECT_VALUES: readonly ['profile'];
591
+ declare const PERF_KIND_VALUES: readonly ['xctrace', 'simpleperf', 'perfetto', 'android-hprof', 'memgraph'];
592
+ type PerfArea = (typeof PERF_AREA_VALUES)[number];
593
+ type PerfAction = (typeof PERF_ACTION_VALUES)[number];
594
+ type PerfSubject = (typeof PERF_SUBJECT_VALUES)[number];
595
+ type PerfKind = (typeof PERF_KIND_VALUES)[number];
596
+ //#endregion
597
+ //#region packages/contracts/src/recording-export-quality.d.ts
598
+ declare const RECORDING_EXPORT_QUALITIES: readonly ['medium', 'high'];
599
+ type RecordingExportQuality = (typeof RECORDING_EXPORT_QUALITIES)[number];
600
+ //#endregion
601
+ //#region packages/contracts/src/recording-scope.d.ts
602
+ declare const RECORDING_SCOPE_VALUES: readonly ['app', 'device', 'system'];
603
+ type RecordingScope = (typeof RECORDING_SCOPE_VALUES)[number];
604
+ //#endregion
605
+ //#region packages/contracts/src/client-observability.d.ts
606
+ type PerfOptions = DeviceCommandBaseOptions & {
607
+ /** Select focused performance evidence. */
608
+ area: PerfArea;
609
+ subject?: PerfSubject;
610
+ action?: PerfAction;
611
+ kind?: PerfKind;
612
+ template?: string;
613
+ out?: string;
614
+ tracePath?: string;
615
+ };
616
+ type LogsOptions = AgentDeviceRequestOverrides & {
617
+ action?: LogAction;
618
+ message?: string;
619
+ restart?: boolean;
620
+ };
621
+ type EventsOptions = AgentDeviceRequestOverrides & {
622
+ cursor?: string;
623
+ limit?: number;
624
+ };
625
+ type NetworkOptions = DeviceCommandBaseOptions & {
626
+ action?: 'dump' | 'log';
627
+ limit?: number;
628
+ include?: NetworkIncludeMode;
629
+ };
630
+ type AudioOptions = DeviceCommandBaseOptions & {
631
+ action?: 'probe';
632
+ probeAction?: 'start' | 'status' | 'stop';
633
+ durationMs?: number;
634
+ bucketMs?: number;
635
+ };
636
+ type RecordOptions = AgentDeviceRequestOverrides & {
637
+ action: 'start' | 'stop';
638
+ path?: string;
639
+ fps?: number;
640
+ quality?: RecordingExportQuality;
641
+ hideTouches?: boolean;
642
+ recordingScope?: RecordingScope;
643
+ };
644
+ type TraceOptions = AgentDeviceRequestOverrides & {
645
+ action: 'start' | 'stop';
646
+ path?: string;
647
+ };
648
+ //#endregion
649
+ //#region packages/contracts/src/client-replay.d.ts
650
+ type ReplayRunOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
651
+ path: string;
652
+ runtime?: SessionRuntimeHints;
653
+ /**
654
+ * @deprecated ADR 0012 migration step 6: `--update` no longer rewrites
655
+ * the script. Accepted for backward compatibility; every divergence
656
+ * already carries ranked selector suggestions regardless of this flag.
657
+ */
658
+ update?: boolean;
659
+ /** @deprecated Use backend: 'maestro'. */
660
+ maestro?: boolean;
661
+ backend?: string;
662
+ env?: string[];
663
+ timeoutMs?: number;
664
+ /**
665
+ * ADR 0012 decision 4 / migration step 5: resume at this 1-based plan
666
+ * step, skipping `1..resumeFrom-1` without executing them. Requires
667
+ * `resumePlanDigest` from the divergence report that reported this
668
+ * step as the failure. `replay` only — `test` has no resume fields.
669
+ */
670
+ resumeFrom?: number;
671
+ /** The `resume.planDigest` from the divergence report `resumeFrom` came from. */
672
+ resumePlanDigest?: string;
673
+ /** Leave the session active by suppressing an authored terminal `close` in native `.ad`. */
674
+ keepSession?: boolean;
675
+ /**
676
+ * ADR 0012 decision 6, R1/R6: arms agent-supervised re-record repair
677
+ * from this replay attempt onward. Optional string value is the healed
678
+ * `.ad`'s output path; absent one, it defaults to the `<path>` sibling
679
+ * `<stem>.healed.ad` when the repair ends with `close --save-script`.
680
+ */
681
+ saveScript?: boolean | string;
682
+ /** #1258: overwrite an existing --save-script target instead of refusing. Alias: --overwrite. */
683
+ force?: boolean;
684
+ };
685
+ type ReplayTestOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
686
+ paths: string[];
687
+ runtime?: SessionRuntimeHints;
688
+ update?: boolean;
689
+ /** @deprecated Use backend: 'maestro'. */
690
+ maestro?: boolean;
691
+ backend?: string;
692
+ env?: string[];
693
+ failFast?: boolean;
694
+ timeoutMs?: number;
695
+ retries?: number;
696
+ recordVideo?: boolean;
697
+ artifactsDir?: string;
698
+ /** @deprecated Use the CLI --reporter junit:<path> or --report-junit <path>. */
699
+ reportJunit?: string;
700
+ shardAll?: number;
701
+ shardSplit?: number;
702
+ };
703
+ type BatchStep = {
704
+ command: string;
705
+ input: Record<string, unknown>;
706
+ runtime?: SessionRuntimeHints;
707
+ };
708
+ type BatchRunOptions = AgentDeviceRequestOverrides & {
709
+ steps: BatchStep[];
710
+ onError?: 'stop';
711
+ maxSteps?: number;
712
+ out?: string;
713
+ };
714
+ //#endregion
715
+ //#region packages/contracts/src/replay.d.ts
716
+ type ReplayCommandResult = {
717
+ replayed: number;
718
+ healed: number;
719
+ session: string;
720
+ /**
721
+ * True iff `session` still exists in the daemon's session store when the
722
+ * response is built. This remains true when replay suppresses an authored
723
+ * terminal `close` for an explicit live-session handoff. The client uses
724
+ * this, not script parsing, to decide whether an owned one-shot daemon must
725
+ * stay alive so the caller can keep addressing this session.
726
+ */
727
+ sessionActive: boolean;
728
+ artifactPaths: string[];
729
+ warnings?: string[];
730
+ snapshotDiagnostics?: SnapshotDiagnosticsSummary;
731
+ message: string;
732
+ };
733
+ type ReplaySuiteTestSkipReason = 'skipped-by-filter';
734
+ type ReplaySuiteAttemptFailure = {
735
+ attempt: number;
736
+ message: string;
737
+ durationMs?: number;
738
+ };
739
+ type ReplaySuiteTestPassed = {
740
+ file: string;
741
+ title?: string;
742
+ session: string;
743
+ status: 'passed';
744
+ durationMs: number;
745
+ finalAttemptDurationMs?: number;
746
+ attempts: number;
747
+ artifactsDir?: string;
748
+ replayed: number;
749
+ healed: number;
750
+ warnings?: string[];
751
+ attemptFailures?: ReplaySuiteAttemptFailure[];
752
+ shardIndex?: number;
753
+ shardCount?: number;
754
+ deviceId?: string;
755
+ deviceName?: string;
756
+ snapshotDiagnostics?: SnapshotDiagnosticsSummary;
757
+ };
758
+ type ReplaySuiteTestFailed = {
759
+ file: string;
760
+ title?: string;
761
+ session: string;
762
+ status: 'failed';
763
+ durationMs: number;
764
+ attempts: number;
765
+ artifactsDir?: string;
766
+ error: DaemonError;
767
+ /** Present when the owning runtime classified the failure as device/runner infrastructure. */
768
+ infrastructure?: true;
769
+ shardIndex?: number;
770
+ shardCount?: number;
771
+ deviceId?: string;
772
+ deviceName?: string;
773
+ snapshotDiagnostics?: SnapshotDiagnosticsSummary;
774
+ };
775
+ type ReplaySuiteTestSkipped = {
776
+ file: string;
777
+ title?: string;
778
+ status: 'skipped';
779
+ durationMs: 0;
780
+ reason: ReplaySuiteTestSkipReason;
781
+ message: string;
782
+ };
783
+ type ReplaySuiteTestResult = ReplaySuiteTestPassed | ReplaySuiteTestFailed | ReplaySuiteTestSkipped;
784
+ type ReplaySuiteResult = {
785
+ total: number;
786
+ executed: number;
787
+ passed: number;
788
+ failed: number;
789
+ skipped: number;
790
+ notRun: number;
791
+ durationMs: number;
792
+ failures: ReplaySuiteTestFailed[];
793
+ tests: ReplaySuiteTestResult[];
794
+ /**
795
+ * The suite's own artifacts root (the parent of every test's `artifactsDir`), as resolved on
796
+ * the host that ran the suite. Absent when the suite produced no attempt (e.g. every source
797
+ * was filtered out). #2246: a remote daemon rewrites this to the caller-local path once the
798
+ * directory has been transferred back, so it always names a path the caller can open.
799
+ */
800
+ artifactsDir?: string;
801
+ snapshotDiagnostics?: SnapshotDiagnosticsSummary;
802
+ };
803
+ //#endregion
804
+ //#region packages/contracts/src/client-request.d.ts
805
+ type CommandRequestResult = DaemonResponseData;
806
+ //#endregion
807
+ //#region packages/contracts/src/is-predicate.d.ts
808
+ /** The complete predicate vocabulary accepted by the `is` command. */
809
+ declare const IS_PREDICATES: readonly ['visible', 'hidden', 'exists', 'absent', 'editable', 'selected', 'focused', 'text'];
810
+ type IsPredicate = (typeof IS_PREDICATES)[number];
811
+ //#endregion
812
+ //#region packages/contracts/src/client-selector-read.d.ts
813
+ /**
814
+ * #1271 stage 2 (ADR 0012 amendment): `get`/`is`/`find` are observation-only
815
+ * and excluded from a repair-armed heal by default. `record` forces this
816
+ * action through (the corrective-read case); `noRecord` continues to opt the
817
+ * action out entirely. Mutually exclusive.
818
+ */
819
+ type RecordControlOptions = {
820
+ noRecord?: boolean;
821
+ record?: boolean;
822
+ };
823
+ type GetOptions = DeviceCommandBaseOptions & SelectorSnapshotCommandOptions & ElementTarget & RecordControlOptions & {
824
+ format: 'text' | 'attrs';
825
+ };
826
+ type IsTextPredicateOptions = DeviceCommandBaseOptions & SelectorSnapshotCommandOptions & RecordControlOptions & {
827
+ predicate: Extract<IsPredicate, 'text'>;
828
+ selector: string;
829
+ value: string;
830
+ };
831
+ type IsStatePredicateOptions = DeviceCommandBaseOptions & SelectorSnapshotCommandOptions & RecordControlOptions & {
832
+ predicate: Exclude<IsPredicate, 'text'>;
833
+ selector: string;
834
+ value?: never;
835
+ };
836
+ type IsOptions = IsTextPredicateOptions | IsStatePredicateOptions;
837
+ type FindBaseOptions = DeviceCommandBaseOptions & FindSnapshotCommandOptions & RecordControlOptions & {
838
+ locator?: FindLocator;
839
+ query: string;
840
+ first?: boolean;
841
+ last?: boolean;
842
+ };
843
+ type FindOptions = (FindBaseOptions & {
844
+ action?: 'click' | 'focus' | 'exists' | 'getText' | 'getAttrs' | 'list';
845
+ }) | (FindBaseOptions & {
846
+ action: 'wait';
847
+ timeoutMs?: number;
848
+ }) | (FindBaseOptions & {
849
+ action: 'fill' | 'type';
850
+ value: string;
851
+ });
852
+ //#endregion
853
+ //#region packages/contracts/src/client-session.d.ts
854
+ type SessionCloseResult = {
855
+ session: string;
856
+ shutdown?: TargetShutdownResult;
857
+ provider?: CloudProviderSessionResult;
858
+ /**
859
+ * #1258: absolute path of the committed session/healed script when this close
860
+ * published one (`close --save-script`, or a repair-armed session's finalize)
861
+ * — so a client that requested publication learns where the file landed.
862
+ */
863
+ savedScript?: string;
864
+ identifiers: AgentDeviceIdentifiers;
865
+ };
866
+ type SessionSaveScriptOptions = AgentDeviceRequestOverrides & {
867
+ path?: string;
868
+ /** Atomically replace an existing target instead of refusing publication. */
869
+ force?: boolean;
870
+ };
871
+ type SessionSaveScriptResult = {
872
+ session: string;
873
+ savedScript: string;
874
+ actionCount: number;
875
+ identifiers: AgentDeviceIdentifiers;
876
+ };
877
+ //#endregion
878
+ //#region packages/contracts/src/client-settings.d.ts
879
+ type PermissionTarget = 'camera' | 'microphone' | 'photos' | 'contacts' | 'contacts-limited' | 'notifications' | 'calendar' | 'location' | 'location-always' | 'media-library' | 'motion' | 'reminders' | 'siri' | 'accessibility' | 'screen-recording' | 'input-monitoring';
880
+ type SettingsUpdateOptions = (DeviceCommandBaseOptions & {
881
+ setting: 'clear-app-state';
882
+ state: 'clear';
883
+ app?: string;
884
+ }) | (DeviceCommandBaseOptions & {
885
+ setting: 'reset-keychain';
886
+ state: 'clear';
887
+ }) | (DeviceCommandBaseOptions & {
888
+ setting: 'wifi' | 'airplane' | 'location';
889
+ state: 'on' | 'off';
890
+ }) | (DeviceCommandBaseOptions & {
891
+ setting: 'location';
892
+ state: 'set';
893
+ latitude: number;
894
+ longitude: number;
895
+ }) | (DeviceCommandBaseOptions & {
896
+ setting: 'animations';
897
+ state: 'on' | 'off';
898
+ }) | (DeviceCommandBaseOptions & {
899
+ setting: 'appearance';
900
+ state: 'light' | 'dark' | 'toggle';
901
+ }) | (DeviceCommandBaseOptions & {
902
+ setting: 'faceid' | 'touchid';
903
+ state: 'match' | 'nonmatch' | 'enroll' | 'unenroll';
904
+ }) | (DeviceCommandBaseOptions & {
905
+ setting: 'fingerprint';
906
+ state: 'match' | 'nonmatch';
907
+ }) | (DeviceCommandBaseOptions & {
908
+ setting: 'permission';
909
+ state: 'grant' | 'deny' | 'reset';
910
+ permission: PermissionTarget;
911
+ mode?: 'full' | 'limited';
912
+ });
913
+ //#endregion
914
+ //#region packages/contracts/src/alert-contract.d.ts
915
+ declare const ALERT_ACTIONS: readonly ['get', 'accept', 'dismiss', 'wait'];
916
+ type AlertAction = (typeof ALERT_ACTIONS)[number];
917
+ //#endregion
918
+ //#region packages/contracts/src/client-system.d.ts
919
+ type WaitCommandTarget = {
920
+ durationMs: number;
921
+ text?: never;
922
+ ref?: never;
923
+ selector?: never;
924
+ absent?: never;
925
+ stable?: never;
926
+ quietMs?: never;
927
+ timeoutMs?: never;
928
+ } | (SelectorSnapshotCommandOptions & {
929
+ text: string;
930
+ durationMs?: never;
931
+ ref?: never;
932
+ selector?: never;
933
+ absent?: never;
934
+ stable?: never;
935
+ quietMs?: never;
936
+ timeoutMs?: number;
937
+ }) | (SelectorSnapshotCommandOptions & {
938
+ ref: string;
939
+ durationMs?: never;
940
+ text?: never;
941
+ selector?: never;
942
+ absent?: never;
943
+ stable?: never;
944
+ quietMs?: never;
945
+ timeoutMs?: number;
946
+ }) | (SelectorSnapshotCommandOptions & {
947
+ selector: string;
948
+ durationMs?: never;
949
+ text?: never;
950
+ ref?: never;
951
+ absent?: never;
952
+ stable?: never;
953
+ quietMs?: never;
954
+ timeoutMs?: number;
955
+ }) | (SelectorSnapshotCommandOptions & {
956
+ absent: string;
957
+ durationMs?: never;
958
+ text?: never;
959
+ ref?: never;
960
+ selector?: never;
961
+ stable?: never;
962
+ quietMs?: never;
963
+ timeoutMs?: number;
964
+ }) | (SelectorSnapshotCommandOptions & {
965
+ stable: true;
966
+ durationMs?: never;
967
+ text?: never;
968
+ ref?: never;
969
+ selector?: never;
970
+ absent?: never;
971
+ quietMs?: number;
972
+ timeoutMs?: number;
973
+ });
974
+ type WaitCommandOptions = DeviceCommandBaseOptions & WaitCommandTarget;
975
+ type AlertCommandOptions = DeviceCommandBaseOptions & {
976
+ action?: AlertAction;
977
+ timeoutMs?: number;
978
+ };
979
+ type AppStateCommandOptions = DeviceCommandBaseOptions;
980
+ /** #1638: `back` carries the shared `--settle` triple, and its result may carry the settled diff. */
981
+ type BackCommandOptions = DeviceCommandBaseOptions & {
982
+ mode?: BackMode;
983
+ } & SettleCommandOptions;
984
+ type HomeCommandOptions = DeviceCommandBaseOptions;
985
+ type OrientationCommandOptions = DeviceCommandBaseOptions & {
986
+ orientation: DeviceRotation;
987
+ };
988
+ type AppSwitcherCommandOptions = DeviceCommandBaseOptions;
989
+ type TvRemoteCommandOptions = DeviceCommandBaseOptions & {
990
+ button: TvRemoteButton;
991
+ durationMs?: number;
992
+ };
993
+ type KeyboardCommandOptions = DeviceCommandBaseOptions & {
994
+ action?: 'status' | 'dismiss' | 'enter' | 'return';
995
+ };
996
+ type ClipboardCommandOptions = (DeviceCommandBaseOptions & {
997
+ action: 'read';
998
+ }) | (DeviceCommandBaseOptions & {
999
+ action: 'write';
1000
+ text: string;
1001
+ });
1002
+ type ReactNativeCommandOptions = DeviceCommandBaseOptions & {
1003
+ action: 'dismiss-overlay';
1004
+ };
1005
+ type PrepareCommandOptions = DeviceCommandBaseOptions & {
1006
+ action: 'ios-runner';
1007
+ timeoutMs?: number;
1008
+ };
1009
+ type DoctorCommandOptions = DeviceCommandBaseOptions & {
1010
+ targetApp?: string;
1011
+ remote?: boolean;
1012
+ };
1013
+ type ViewportCommandOptions = DeviceCommandBaseOptions & {
1014
+ width: number;
1015
+ height: number;
1016
+ };
1017
+ //#endregion
1018
+ //#region packages/contracts/src/app-events.d.ts
1019
+ type TriggerAppEventCommandResult = {
1020
+ event: string;
1021
+ eventUrl: string;
1022
+ transport: 'deep-link';
1023
+ message: string;
1024
+ };
1025
+ //#endregion
1026
+ //#region packages/contracts/src/app-state.d.ts
1027
+ /**
1028
+ * Closed result of the `appstate` command, grounded in the daemon handler's
1029
+ * success returns (src/daemon/handlers/session-state.ts `handleAppStateCommand`).
1030
+ * A discriminated union on `platform`:
1031
+ * - Apple (`ios` / `macos`) session state, with iOS-only device locators that
1032
+ * the previous hand-written mirror omitted; and
1033
+ * - Android and HarmonyOS foreground `package` / `activity`.
1034
+ *
1035
+ * The handler returns one of these fixed objects (errors take the `ok: false`
1036
+ * path), so each branch is closed.
1037
+ */
1038
+ type AppStateCommandResult = {
1039
+ platform: 'ios' | 'macos';
1040
+ appName: string;
1041
+ appBundleId?: string;
1042
+ source: 'session';
1043
+ surface: SessionSurface;
1044
+ /** iOS only — the session device's UDID. */
1045
+ device_udid?: string;
1046
+ /** iOS only — the simulator set path, or `null` when unknown. */
1047
+ ios_simulator_device_set?: string | null;
1048
+ } | {
1049
+ platform: 'android' | 'harmonyos';
1050
+ package: string;
1051
+ activity: string;
1052
+ };
1053
+ //#endregion
1054
+ //#region packages/contracts/src/device.d.ts
1055
+ /**
1056
+ * Closed result of the `boot` command. Mirrors the daemon handler's only
1057
+ * success return EXACTLY (src/daemon/handlers/session-state.ts) — the fixed
1058
+ * object literal `{ platform, target, device, id, kind, booted }` plus the
1059
+ * additive `appleOs` discriminant, emitted only for Apple devices.
1060
+ */
1061
+ type BootCommandResult = {
1062
+ platform: PublicPlatform;
1063
+ target: DeviceTarget;
1064
+ /** Human-readable device name (`device.name`). */
1065
+ device: string;
1066
+ /** Stable device id (`device.id`). */
1067
+ id: string;
1068
+ kind: DeviceKind;
1069
+ /** Always `true` on the success path. */
1070
+ booted: true;
1071
+ /**
1072
+ * Additive Apple-OS discriminant (`device.appleOs`): iPhone/iPad/tvOS/visionOS/macOS.
1073
+ * Present only for Apple devices; absent for non-Apple platforms. `platform` stays the
1074
+ * leaf (`ios`/`macos`) — this is an extra field, not a replacement.
1075
+ */
1076
+ appleOs?: AppleOS;
1077
+ };
1078
+ /**
1079
+ * Closed result of the `shutdown` command. Mirrors the daemon handler's success
1080
+ * return EXACTLY (src/daemon/handlers/session-state.ts) — the fixed object
1081
+ * literal `{ platform, target, device, id, kind, shutdown }` plus the additive
1082
+ * `appleOs` discriminant (Apple devices only). The `shutdown` field is the raw
1083
+ * {@link TargetShutdownResult} returned by the bound `shutdownTarget` operation.
1084
+ */
1085
+ type ShutdownCommandResult = {
1086
+ platform: PublicPlatform;
1087
+ target: DeviceTarget;
1088
+ /** Human-readable device name (`device.name`). */
1089
+ device: string;
1090
+ /** Stable device id (`device.id`). */
1091
+ id: string;
1092
+ kind: DeviceKind;
1093
+ shutdown: TargetShutdownResult;
1094
+ /**
1095
+ * Additive Apple-OS discriminant (`device.appleOs`): iPhone/iPad/tvOS/visionOS/macOS.
1096
+ * Present only for Apple devices; absent for non-Apple platforms. `platform` stays the
1097
+ * leaf (`ios`/`macos`) — this is an extra field, not a replacement.
1098
+ */
1099
+ appleOs?: AppleOS;
1100
+ };
1101
+ //#endregion
1102
+ //#region packages/contracts/src/prepare.d.ts
1103
+ type PrepareIosRunnerCacheKind = 'exact' | 'restore-key' | 'miss' | 'external';
1104
+ type PrepareIosRunnerArtifactState = 'valid' | 'rebuilt';
1105
+ type PrepareIosRunnerTiming = {
1106
+ totalMs: number;
1107
+ additiveParts: {
1108
+ buildMs?: number;
1109
+ connectAfterBuildMs: number;
1110
+ healthCheckMs: number;
1111
+ };
1112
+ containment: {
1113
+ connectMs?: ['buildMs'];
1114
+ healthCheckMs: [];
1115
+ };
1116
+ note: string;
1117
+ };
1118
+ /**
1119
+ * Public daemon result for `prepare ios-runner`. The runner-local prepare result
1120
+ * is projected by `prepareIosRunnerResponseData` with device identity and timing
1121
+ * guidance before it reaches the client.
1122
+ */
1123
+ type PrepareCommandResult = {
1124
+ action: 'ios-runner';
1125
+ platform: PublicPlatform;
1126
+ deviceId: string;
1127
+ deviceName: string;
1128
+ kind: DeviceKind;
1129
+ durationMs: number;
1130
+ runner: JsonObject;
1131
+ cache?: PrepareIosRunnerCacheKind;
1132
+ artifact?: PrepareIosRunnerArtifactState;
1133
+ buildMs?: number;
1134
+ connectMs: number;
1135
+ healthCheckMs: number;
1136
+ xctestrunPath?: string;
1137
+ recoveryReason?: string;
1138
+ failureReason?: string;
1139
+ timing: PrepareIosRunnerTiming;
1140
+ message: string;
1141
+ };
1142
+ //#endregion
1143
+ //#region packages/contracts/src/push.d.ts
1144
+ type PushCommandResult = {
1145
+ platform: 'ios';
1146
+ bundleId: string;
1147
+ message: string;
1148
+ } | {
1149
+ platform: 'android';
1150
+ package: string;
1151
+ action: string;
1152
+ extrasCount: number;
1153
+ message: string;
1154
+ };
1155
+ //#endregion
1156
+ //#region packages/contracts/src/debug-symbols.d.ts
1157
+ type DebugSymbolsOptions = {
1158
+ action?: 'symbols';
1159
+ artifact: string;
1160
+ dsym?: string;
1161
+ searchPath?: string;
1162
+ out?: string;
1163
+ cwd?: string;
1164
+ };
1165
+ type DebugSymbolsImage = {
1166
+ name: string;
1167
+ uuid: string;
1168
+ arch?: string;
1169
+ dsymPath: string;
1170
+ binaryPath: string;
1171
+ };
1172
+ type DebugSymbolsCrashFrame = {
1173
+ index: number;
1174
+ image: string;
1175
+ address: string;
1176
+ symbol?: string;
1177
+ };
1178
+ type DebugSymbolsCrashSummary = {
1179
+ format: 'ips' | 'text';
1180
+ appName?: string;
1181
+ bundleId?: string;
1182
+ version?: string;
1183
+ incident?: string;
1184
+ timestamp?: string;
1185
+ exceptionType?: string;
1186
+ exceptionCodes?: string;
1187
+ terminationReason?: string;
1188
+ crashedThread?: number;
1189
+ topFrames: DebugSymbolsCrashFrame[];
1190
+ findings: string[];
1191
+ };
1192
+ type DebugSymbolsResult = {
1193
+ kind: 'debugSymbols';
1194
+ platform: 'apple';
1195
+ artifactPath: string;
1196
+ outPath: string;
1197
+ crash: DebugSymbolsCrashSummary;
1198
+ matchedImages: DebugSymbolsImage[];
1199
+ symbolicatedFrames: number;
1200
+ skippedImages: number;
1201
+ warnings?: string[];
1202
+ message: string;
1203
+ };
1204
+ //#endregion
1205
+ //#region packages/contracts/src/doctor.d.ts
1206
+ type DoctorStatus = 'pass' | 'warn' | 'fail' | 'info';
1207
+ type DoctorKind = 'auto' | 'react-native' | 'expo' | 'repack';
1208
+ type DoctorCheck = {
1209
+ id: string;
1210
+ status: DoctorStatus;
1211
+ summary: string;
1212
+ hint?: string;
1213
+ command?: string;
1214
+ evidence?: Record<string, unknown>;
1215
+ };
1216
+ type DoctorCommandResult = {
1217
+ status: DoctorStatus;
1218
+ summary: string;
1219
+ kind: DoctorKind;
1220
+ platform?: PlatformSelector;
1221
+ target?: DeviceTarget;
1222
+ targetApp?: string;
1223
+ metro?: {
1224
+ host: string;
1225
+ port: number;
1226
+ };
1227
+ checks: DoctorCheck[];
1228
+ };
1229
+ //#endregion
1230
+ //#region packages/contracts/src/diff.d.ts
1231
+ type SnapshotDiffLine = {
1232
+ kind: 'added' | 'removed' | 'unchanged';
1233
+ text: string;
1234
+ /**
1235
+ * Plain ref body (`e12`) of the current-tree node behind an added line.
1236
+ * Only populated with `withRefs`; removed and unchanged lines never carry it.
1237
+ */
1238
+ ref?: string;
1239
+ };
1240
+ type SnapshotDiffSummary = {
1241
+ additions: number;
1242
+ removals: number;
1243
+ unchanged: number;
1244
+ };
1245
+ type DiffSnapshotCommandResult = {
1246
+ mode: 'snapshot';
1247
+ baselineInitialized: boolean;
1248
+ summary: SnapshotDiffSummary;
1249
+ lines: SnapshotDiffLine[];
1250
+ warnings?: string[];
1251
+ };
1252
+ //#endregion
1253
+ //#region packages/contracts/src/viewport.d.ts
1254
+ type ViewportCommandResult = {
1255
+ width: number;
1256
+ height: number;
1257
+ message: string;
1258
+ };
1259
+ //#endregion
1260
+ //#region packages/contracts/src/navigation.d.ts
1261
+ /**
1262
+ * Closed results of the navigation/global action commands. Each mirrors its
1263
+ * request-scoped runtime's literal return: a fixed `action` discriminant plus the always-present
1264
+ * `successText` message (the handlers always pass a non-empty message, so it is
1265
+ * required here). The handlers spread nothing else, so the shapes are closed —
1266
+ * consistent with the `viewport` contract, the generic-dispatch Android
1267
+ * dialog-recovery `warning` annotation is intentionally not part of the contract.
1268
+ */
1269
+ /** `home` — `{ action: 'home', message: 'Home' }`. */
1270
+ type HomeCommandResult = {
1271
+ action: 'home';
1272
+ message: string;
1273
+ };
1274
+ /**
1275
+ * `back` — `{ action: 'back', mode, message: 'Back' }`; `mode` defaults to
1276
+ * `'in-app'`. The one field the generic route may add on top of the dispatch
1277
+ * runtime's literal return: `settle`, the opt-in `--settle` observation
1278
+ * (#1638), attached after the command by the generic dispatcher.
1279
+ */
1280
+ type BackCommandResult = {
1281
+ action: 'back';
1282
+ mode: BackMode;
1283
+ message: string;
1284
+ settle?: SettleObservation;
1285
+ };
1286
+ /** `orientation` — `{ action: 'orientation', orientation, message: 'Rotated to <orientation>' }`. */
1287
+ type OrientationCommandResult = {
1288
+ action: 'orientation';
1289
+ orientation: DeviceRotation;
1290
+ message: string;
1291
+ };
1292
+ /** `app-switcher` — `{ action: 'app-switcher', message: 'Opened app switcher' }`. */
1293
+ type AppSwitcherCommandResult = {
1294
+ action: 'app-switcher';
1295
+ message: string;
1296
+ };
1297
+ /** `tv-remote` — `{ action: 'tv-remote', button, durationMs?, message }`. */
1298
+ type TvRemoteCommandResult = {
1299
+ action: 'tv-remote';
1300
+ button: TvRemoteButton;
1301
+ durationMs?: number;
1302
+ message: string;
1303
+ };
1304
+ //#endregion
1305
+ //#region packages/contracts/src/clipboard.d.ts
1306
+ /**
1307
+ * Closed result of the `clipboard` command. Mirrors the session runtime's
1308
+ * literal return exactly (`src/daemon/handlers/session-clipboard.ts`): a
1309
+ * discriminated union on `action`. `read` returns the clipboard `text`; `write`
1310
+ * reports the written `textLength` plus the `successText` message. The handler
1311
+ * spreads nothing else, so each branch is closed.
1312
+ */
1313
+ type ClipboardCommandResult = {
1314
+ action: 'read';
1315
+ text: string;
1316
+ } | {
1317
+ action: 'write';
1318
+ textLength: number;
1319
+ message: string;
1320
+ };
1321
+ //#endregion
1322
+ //#region packages/contracts/src/keyboard.d.ts
1323
+ /**
1324
+ * Closed result of the `keyboard` command, grounded in the runtime operation
1325
+ * results projected by `src/daemon/keyboard-runtime.ts`.
1326
+ *
1327
+ * `platform` and `action` are always present; the remaining fields appear per
1328
+ * branch (Android `status`/`dismiss` carry the keyboard-state fields; `enter`
1329
+ * and iOS `dismiss` carry a `message`). It is kept as a flat closed shape rather
1330
+ * than a five-way `platform`×`action` union because the per-branch field sets
1331
+ * overlap heavily and the underlying Android keyboard-state types live in the
1332
+ * platform layer (below the public contract). The `Record` index signature of
1333
+ * the previous hand-written mirror is dropped, and the spurious `| null`s are
1334
+ * removed (the handler never returns `null` for these).
1335
+ */
1336
+ type KeyboardCommandResult = {
1337
+ platform: 'android' | 'ios';
1338
+ action: 'status' | 'dismiss' | 'enter';
1339
+ visible?: boolean;
1340
+ wasVisible?: boolean;
1341
+ dismissed?: boolean;
1342
+ attempts?: number;
1343
+ inputType?: string;
1344
+ type?: 'text' | 'number' | 'email' | 'phone' | 'password' | 'datetime' | 'unknown';
1345
+ inputMethodPackage?: string;
1346
+ focusedPackage?: string;
1347
+ focusedResourceId?: string;
1348
+ inputOwner?: 'app' | 'ime' | 'unknown';
1349
+ message?: string;
1350
+ /** iOS `dismiss` only (#1598): which mechanism actually resigned the
1351
+ * keyboard — 'dismissKey' (tapped the keyboard's own Hide/Dismiss/Done
1352
+ * key). Generic background-tap dismissal is deliberately unsupported
1353
+ * (#1606 review): no query can prove a coordinate is side-effect-free,
1354
+ * so the runner only ever taps the keyboard's own control. Absent when
1355
+ * the keyboard was not dismissed. */
1356
+ mechanism?: 'dismissKey';
1357
+ };
1358
+ //#endregion
1359
+ //#region packages/contracts/src/wait.d.ts
1360
+ /**
1361
+ * Public daemon result for `wait`. The runtime-local result carries a `kind`
1362
+ * discriminant, but `toDaemonWaitData` intentionally projects the normal daemon
1363
+ * payload to this compact shape. The direct iOS selector fast path may still
1364
+ * include `kind: 'selector'` additively.
1365
+ */
1366
+ type WaitCommandResult = {
1367
+ waitedMs: number;
1368
+ kind?: 'selector';
1369
+ text?: string;
1370
+ selector?: string;
1371
+ captures?: number;
1372
+ nodeCount?: number;
1373
+ hint?: string;
1374
+ warning?: string;
1375
+ };
1376
+ //#endregion
1377
+ //#region packages/contracts/src/recording.d.ts
1378
+ type RecordingAppIdentity = {
1379
+ bundleId: string;
1380
+ name?: string;
1381
+ };
1382
+ type RecordingStartCommandResult = {
1383
+ recording: 'started';
1384
+ outPath: string;
1385
+ sessionStateDir: string;
1386
+ recordingBackend?: string;
1387
+ recordingScope?: RecordingScope;
1388
+ recordOnlySession?: boolean;
1389
+ activeSessionApp?: RecordingAppIdentity;
1390
+ showTouches: boolean;
1391
+ };
1392
+ type RecordingStopCommandResult = {
1393
+ recording: 'stopped';
1394
+ outPath: string;
1395
+ telemetryPath?: string;
1396
+ artifacts: DaemonArtifact[];
1397
+ recordingBackend?: string;
1398
+ recordingScope?: RecordingScope;
1399
+ recordOnlySession?: boolean;
1400
+ activeSessionApp?: RecordingAppIdentity;
1401
+ durationMs: number;
1402
+ showTouches: boolean;
1403
+ warning?: string;
1404
+ overlayWarning?: string;
1405
+ chunks?: Array<{
1406
+ index: number;
1407
+ path: string;
1408
+ }>;
1409
+ };
1410
+ type RecordingCommandResult = RecordingStartCommandResult | RecordingStopCommandResult;
1411
+ type TraceCommandResult = {
1412
+ trace: 'started';
1413
+ outPath: string;
1414
+ } | {
1415
+ trace: 'stopped';
1416
+ outPath: string;
1417
+ artifacts: DaemonArtifact[];
1418
+ };
1419
+ //#endregion
1420
+ //#region packages/command-registry/src/command-result.d.ts
1421
+ /**
1422
+ * The additive typed-result spine (ADR-0008, Phase 1 step 6).
1423
+ *
1424
+ * Maps a command name to the per-command result type from `@agent-device/contracts`. It
1425
+ * is SEEDED, not exhaustive: a command is listed here only once its accurate,
1426
+ * closed result shape lives in the contracts layer. Commands whose daemon
1427
+ * handler spreads dynamic/Record data (screenshot overlays, gesture
1428
+ * visualization, perf, logs, …) are deliberately omitted rather than given an
1429
+ * invented shape.
1430
+ *
1431
+ * Batches 1-2 wired `boot` / `shutdown` / `viewport` and the navigation/action
1432
+ * commands `home` / `back` / `orientation` / `app-switcher` alongside the seed
1433
+ * interaction quartet. Batch 3 adds `clipboard` (a closed `read`/`write` union) and
1434
+ * `appstate` (a closed `platform` union — Apple session state with the iOS-only
1435
+ * device locators, or Android package/activity). Batch 4 adds `keyboard` (a
1436
+ * closed flat shape). Batch 5 adds the compact daemon projections for `wait`,
1437
+ * `prepare`, `push`, and `trigger-app-event`. #1652 adds `scroll`
1438
+ * (ScrollCommandResult): the shared dispatch vocabulary plus the opt-in
1439
+ * settle observation, so the settle-capable generic-route pair (`back`,
1440
+ * `scroll`) is fully typed and its MCP output schema derives from the trait.
1441
+ * Each entry is grounded in a
1442
+ * re-read of the handler's literal return; see the per-type docstrings.
1443
+ */
1444
+ interface CommandResultMap {
1445
+ 'app-switcher': AppSwitcherCommandResult;
1446
+ appstate: AppStateCommandResult;
1447
+ back: BackCommandResult;
1448
+ boot: BootCommandResult;
1449
+ click: ClickCommandResponseData;
1450
+ clipboard: ClipboardCommandResult;
1451
+ diff: DiffSnapshotCommandResult;
1452
+ doctor: DoctorCommandResult;
1453
+ fill: FillCommandResponseData;
1454
+ find: FindCommandResponseData;
1455
+ home: HomeCommandResult;
1456
+ hover: HoverCommandResponseData;
1457
+ keyboard: KeyboardCommandResult;
1458
+ longpress: LongPressCommandResponseData;
1459
+ orientation: OrientationCommandResult;
1460
+ prepare: PrepareCommandResult;
1461
+ press: PressCommandResponseData;
1462
+ push: PushCommandResult;
1463
+ record: RecordingCommandResult;
1464
+ replay: ReplayCommandResult;
1465
+ scroll: ScrollCommandResult;
1466
+ shutdown: ShutdownCommandResult;
1467
+ test: ReplaySuiteResult;
1468
+ trace: TraceCommandResult;
1469
+ 'trigger-app-event': TriggerAppEventCommandResult;
1470
+ 'tv-remote': TvRemoteCommandResult;
1471
+ viewport: ViewportCommandResult;
1472
+ wait: WaitCommandResult;
1473
+ }
1474
+ /**
1475
+ * The typed result for a command named `N`. Seeded commands resolve to their
1476
+ * contract result type from {@link CommandResultMap}; every other (unmigrated)
1477
+ * command falls back to the untyped `Record<string, unknown>` bag. That default
1478
+ * branch is what keeps the mapping total over every command name, so consumers
1479
+ * can switch to `CommandResult<Name>` without first migrating every command.
1480
+ */
1481
+ type CommandResult<N extends string> = N extends keyof CommandResultMap ? CommandResultMap[N] : Record<string, unknown>;
1482
+ //#endregion
1483
+ //#region src/client/client-types.d.ts
1484
+ type AgentDeviceCommandClient = {
1485
+ back: (options?: BackCommandOptions) => Promise<CommandResult<'back'>>;
1486
+ home: (options?: HomeCommandOptions) => Promise<CommandResult<'home'>>;
1487
+ orientation: (options: OrientationCommandOptions) => Promise<CommandResult<'orientation'>>;
1488
+ appSwitcher: (options?: AppSwitcherCommandOptions) => Promise<CommandResult<'app-switcher'>>;
1489
+ tvRemote: (options: TvRemoteCommandOptions) => Promise<CommandResult<'tv-remote'>>;
1490
+ wait: (options: WaitCommandOptions) => Promise<CommandResult<'wait'>>;
1491
+ alert: (options?: AlertCommandOptions) => Promise<CommandRequestResult>;
1492
+ appState: (options?: AppStateCommandOptions) => Promise<CommandResult<'appstate'>>;
1493
+ keyboard: (options?: KeyboardCommandOptions) => Promise<CommandResult<'keyboard'>>;
1494
+ clipboard: (options: ClipboardCommandOptions) => Promise<CommandResult<'clipboard'>>;
1495
+ reactNative: (options: ReactNativeCommandOptions) => Promise<CommandRequestResult>;
1496
+ doctor: (options?: DoctorCommandOptions) => Promise<CommandResult<'doctor'>>;
1497
+ /**
1498
+ * JSON prepare results include timing.additiveParts for additive wall-clock phases.
1499
+ * Top-level buildMs/connectMs/healthCheckMs are diagnostics and may overlap.
1500
+ */
1501
+ prepare: (options: PrepareCommandOptions) => Promise<CommandResult<'prepare'>>;
1502
+ viewport: (options: ViewportCommandOptions) => Promise<CommandResult<'viewport'>>;
1503
+ };
1504
+ type AgentDeviceClient = {
1505
+ command: AgentDeviceCommandClient;
1506
+ devices: {
1507
+ list: (options?: AgentDeviceRequestOverrides & AgentDeviceSelectionOptions) => Promise<AgentDeviceDevice[]>;
1508
+ capabilities: (options?: AgentDeviceRequestOverrides & AgentDeviceSelectionOptions) => Promise<AgentDeviceCapabilitiesResult>;
1509
+ boot: (options?: DeviceBootOptions) => Promise<CommandResult<'boot'>>;
1510
+ shutdown: (options?: DeviceShutdownOptions) => Promise<CommandResult<'shutdown'>>;
1511
+ };
1512
+ sessions: {
1513
+ list: (options?: AgentDeviceRequestOverrides) => Promise<AgentDeviceSession[]>;
1514
+ stateDir: (options?: AgentDeviceRequestOverrides & Pick<AgentDeviceClientConfig, 'stateDir'>) => Promise<string>;
1515
+ close: (options?: AgentDeviceRequestOverrides & {
1516
+ shutdown?: boolean;
1517
+ saveScript?: boolean | string;
1518
+ /** #1258: overwrite an existing --save-script target instead of refusing. Alias: --overwrite. */
1519
+ force?: boolean;
1520
+ }) => Promise<SessionCloseResult>;
1521
+ saveScript: (options?: SessionSaveScriptOptions) => Promise<SessionSaveScriptResult>;
1522
+ artifacts: (options?: CloudArtifactsOptions) => Promise<AgentArtifactsResult>;
1523
+ };
1524
+ apps: {
1525
+ install: (options: AppInstallOptions) => Promise<AppDeployResult>;
1526
+ reinstall: (options: AppDeployOptions) => Promise<AppDeployResult>;
1527
+ installFromSource: (options: AppInstallFromSourceOptions) => Promise<AppInstallFromSourceResult>;
1528
+ list: (options?: AppListOptions) => Promise<string[]>;
1529
+ open: (options: AppOpenOptions) => Promise<AppOpenResult>;
1530
+ close: (options?: AppCloseOptions) => Promise<AppCloseResult>;
1531
+ push: (options: AppPushOptions) => Promise<CommandResult<'push'>>;
1532
+ triggerEvent: (options: AppTriggerEventOptions) => Promise<CommandResult<'trigger-app-event'>>;
1533
+ };
1534
+ materializations: {
1535
+ release: (options: MaterializationReleaseOptions) => Promise<MaterializationReleaseResult>;
1536
+ };
1537
+ leases: {
1538
+ allocate: (options: LeaseAllocateOptions) => Promise<Lease>;
1539
+ heartbeat: (options: LeaseScopedOptions) => Promise<Lease>;
1540
+ release: (options: LeaseScopedOptions) => Promise<{
1541
+ released: boolean;
1542
+ provider?: CloudProviderSessionResult;
1543
+ }>;
1544
+ humanControl: {
1545
+ list: (options?: AgentDeviceRequestOverrides) => Promise<HumanControlHold[]>;
1546
+ put: (id: string, input?: HumanControlHoldOptions, options?: AgentDeviceRequestOverrides) => Promise<HumanControlHold>;
1547
+ remove: (id: string, options?: AgentDeviceRequestOverrides) => Promise<boolean>;
1548
+ };
1549
+ };
1550
+ metro: {
1551
+ prepare: (options: MetroPrepareOptions) => Promise<MetroPrepareResult>;
1552
+ reload: (options?: MetroReloadOptions) => Promise<MetroReloadResult>;
1553
+ };
1554
+ capture: {
1555
+ snapshot: (options?: CaptureSnapshotOptions) => Promise<CaptureSnapshotResult>;
1556
+ screenshot: (options?: CaptureScreenshotOptions) => Promise<CaptureScreenshotResult>;
1557
+ diff: (options: CaptureDiffOptions) => Promise<CommandResult<'diff'>>;
1558
+ };
1559
+ interactions: {
1560
+ click: (options: ClickOptions) => Promise<CommandResult<'click'>>;
1561
+ press: (options: PressOptions) => Promise<CommandResult<'press'>>;
1562
+ longPress: (options: LongPressOptions) => Promise<CommandResult<'longpress'>>;
1563
+ hover: (options: HoverOptions) => Promise<CommandResult<'hover'>>;
1564
+ swipe: (options: SwipeOptions) => Promise<CommandRequestResult>;
1565
+ pan: (options: PanOptions) => Promise<CommandRequestResult>;
1566
+ drag: (options: DragOptions) => Promise<CommandRequestResult>;
1567
+ fling: (options: FlingOptions) => Promise<CommandRequestResult>;
1568
+ swipeGesture: (options: SwipeGestureOptions) => Promise<CommandRequestResult>;
1569
+ focus: (options: FocusOptions) => Promise<CommandRequestResult>;
1570
+ type: (options: TypeTextOptions) => Promise<CommandRequestResult>;
1571
+ fill: (options: FillOptions) => Promise<CommandResult<'fill'>>;
1572
+ scroll: (options: ScrollOptions) => Promise<CommandRequestResult>;
1573
+ pinch: (options: PinchOptions) => Promise<CommandRequestResult>;
1574
+ rotateGesture: (options: RotateGestureOptions) => Promise<CommandRequestResult>;
1575
+ transformGesture: (options: TransformGestureOptions) => Promise<CommandRequestResult>;
1576
+ get: (options: GetOptions) => Promise<CommandRequestResult>;
1577
+ is: (options: IsOptions) => Promise<CommandRequestResult>;
1578
+ find: (options: FindOptions) => Promise<CommandResult<'find'>>;
1579
+ };
1580
+ replay: {
1581
+ run: (options: ReplayRunOptions) => Promise<CommandResult<'replay'>>;
1582
+ test: (options: ReplayTestOptions) => Promise<CommandResult<'test'>>;
1583
+ };
1584
+ batch: {
1585
+ run: (options: BatchRunOptions) => Promise<BatchRunResult>;
1586
+ };
1587
+ observability: {
1588
+ perf: (options: PerfOptions) => Promise<CommandRequestResult>;
1589
+ logs: (options?: LogsOptions) => Promise<CommandRequestResult>;
1590
+ events: (options?: EventsOptions) => Promise<CommandRequestResult>;
1591
+ network: (options?: NetworkOptions) => Promise<CommandRequestResult>;
1592
+ audio: (options?: AudioOptions) => Promise<CommandRequestResult>;
1593
+ };
1594
+ debug: {
1595
+ symbols: (options: DebugSymbolsOptions) => Promise<DebugSymbolsResult>;
1596
+ };
1597
+ recording: {
1598
+ record: (options: RecordOptions) => Promise<CommandResult<'record'>>;
1599
+ trace: (options: TraceOptions) => Promise<CommandResult<'trace'>>;
1600
+ };
1601
+ settings: {
1602
+ update: (options: SettingsUpdateOptions) => Promise<CommandRequestResult>;
1603
+ };
1604
+ };
1605
+ //#endregion
1606
+ export { AgentDeviceClientConfig as n, AgentDeviceDaemonTransport as r, AgentDeviceClient as t };