agent-device 0.20.10 → 0.21.1

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 (510) hide show
  1. package/README.md +2 -2
  2. package/android/ime-helper/dist/{agent-device-android-ime-helper-0.20.10.apk → agent-device-android-ime-helper-0.21.1.apk} +0 -0
  3. package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.1.apk.sha256 +1 -0
  4. package/android/ime-helper/dist/{agent-device-android-ime-helper-0.20.10.manifest.json → agent-device-android-ime-helper-0.21.1.manifest.json} +4 -4
  5. package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.1.apk +0 -0
  6. package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.1.apk.sha256 +1 -0
  7. package/android/snapshot-helper/dist/{agent-device-android-snapshot-helper-0.20.10.manifest.json → agent-device-android-snapshot-helper-0.21.1.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 +106 -0
  12. package/apple/snapshot-bridge/SnapshotBridge.m +286 -0
  13. package/apple/snapshot-bridge/SnapshotBridgeCapture.h +25 -0
  14. package/apple/snapshot-bridge/SnapshotBridgeCapture.m +138 -0
  15. package/apple/snapshot-bridge/SnapshotBridgeRuntime.h +34 -0
  16. package/apple/snapshot-bridge/SnapshotBridgeRuntime.m +411 -0
  17. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunner/AgentDeviceRunnerApp.m +58 -0
  18. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunner.xcodeproj/project.pbxproj +19 -0
  19. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerAXSnapshotBridge.h +12 -0
  20. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerAXSnapshotBridge.m +20 -0
  21. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerAlertVerification.swift +36 -0
  22. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSelectorMatchPolicy.swift +15 -15
  23. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerStringNormalization.swift +8 -0
  24. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSynthesizedGesture.h +12 -1
  25. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSynthesizedGesture.m +100 -6
  26. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSystemSurfaceHostPolicy.swift +72 -0
  27. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTapPointPolicy.swift +63 -14
  28. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+AXSnapshotFallback.swift +677 -83
  29. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Alert.swift +35 -92
  30. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+AlertObservation.swift +124 -0
  31. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+BlockingSystemModalResolution.swift +39 -4
  32. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift +1058 -213
  33. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandJournal.swift +296 -14
  34. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Environment.swift +1 -1
  35. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Exceptions.swift +10 -10
  36. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Interaction.swift +309 -149
  37. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Keyboard.swift +101 -42
  38. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Lifecycle.swift +24 -17
  39. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Models.swift +124 -199
  40. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Navigation.swift +71 -4
  41. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+PrivateAXElementTypes.swift +12 -0
  42. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+PrivateAXPresentation.swift +211 -78
  43. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+ScreenRecorder.swift +30 -10
  44. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+ScrollGesture.swift +254 -24
  45. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SequenceExecution.swift +206 -22
  46. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Snapshot.swift +465 -494
  47. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotBackendCapabilities.swift +168 -0
  48. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotCapturePlan.swift +802 -247
  49. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotPresentationInvariant.swift +19 -0
  50. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotTiming.swift +185 -0
  51. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedCommitDeadline.swift +206 -0
  52. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedGesturePolicy.swift +83 -5
  53. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedTextEntry.swift +156 -34
  54. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SystemModal.swift +5 -4
  55. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntry.swift +35 -318
  56. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryFocus.swift +206 -0
  57. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryReadiness.swift +158 -0
  58. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextInputCandidatePolicy.swift +28 -0
  59. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextInputProbe.swift +101 -0
  60. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextTyping.swift +56 -23
  61. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Transport.swift +56 -27
  62. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TvRemote.swift +30 -24
  63. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests.swift +126 -80
  64. package/dist/apple/runner/AgentDeviceRunner/RecordingScripts/RecordingExportSupport.swift +111 -0
  65. package/dist/apple/runner/AgentDeviceRunner/RecordingScripts/recording-overlay.swift +47 -86
  66. package/dist/apple/runner/AgentDeviceRunner/RecordingScripts/recording-trim.swift +32 -79
  67. package/dist/apple/snapshot-presentation/Package.swift +21 -0
  68. package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotGeometry.swift +56 -0
  69. package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotModels.swift +259 -0
  70. package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotPresentation.swift +153 -0
  71. package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotPresentationFailure.swift +27 -0
  72. package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotPresentationInvariant.swift +91 -0
  73. package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotPresentationProjection.swift +161 -0
  74. package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotScopePolicy.swift +53 -0
  75. package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotVisibilityFold.swift +242 -0
  76. package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotVisibilityFoldProjection.swift +97 -0
  77. package/dist/src/adapter.js +1 -0
  78. package/dist/src/adb-executor.js +2 -0
  79. package/dist/src/adb-failure.js +1 -0
  80. package/dist/src/adb-host.js +1 -0
  81. package/dist/src/adb.js +1 -0
  82. package/dist/src/agent-browser-lifecycle.js +1 -0
  83. package/dist/src/agent-browser-process-record.js +1 -0
  84. package/dist/src/agent-browser-provider.js +1 -0
  85. package/dist/src/agent-browser-tool.js +1 -1
  86. package/dist/src/agent-device-client.js +2 -2
  87. package/dist/src/ai-sdk.d.ts +2 -2
  88. package/dist/src/ai-sdk.js +1 -1
  89. package/dist/src/alert-contract.js +1 -0
  90. package/dist/src/alert-runtime.js +1 -0
  91. package/dist/src/android-adb.d.ts +27 -19
  92. package/dist/src/android-adb.js +1 -1
  93. package/dist/src/android-input-ownership.js +1 -0
  94. package/dist/src/android-system-chrome.js +1 -0
  95. package/dist/src/android.js +1 -1
  96. package/dist/src/api.js +11 -0
  97. package/dist/src/app-catalog.js +1 -0
  98. package/dist/src/app-deployment-resolution.js +2 -0
  99. package/dist/src/app-helpers.js +1 -1
  100. package/dist/src/app-inventory-contract.js +1 -0
  101. package/dist/src/app-inventory.js +1 -0
  102. package/dist/src/app-launch.js +2 -0
  103. package/dist/src/app-lifecycle-facade.js +1 -0
  104. package/dist/src/app-lifecycle.js +3 -6
  105. package/dist/src/app-lifecycle2.js +2 -2
  106. package/dist/src/app-lifecycle3.js +1 -0
  107. package/dist/src/app-log-files.js +1 -1
  108. package/dist/src/app-log-reconnect.js +1 -1
  109. package/dist/src/app-log-runtime.js +1 -4
  110. package/dist/src/app-log-runtime2.js +4 -0
  111. package/dist/src/app-parsers.js +4 -0
  112. package/dist/src/app-resolution-cache.js +1 -0
  113. package/dist/src/app-resolution-facade.js +1 -0
  114. package/dist/src/app-resolution.js +2 -2
  115. package/dist/src/app-state.js +1 -2
  116. package/dist/src/apple-runner-platform.js +1 -0
  117. package/dist/src/application-lifecycle-interaction.js +1 -0
  118. package/dist/src/application-lifecycle-runtime.js +1 -0
  119. package/dist/src/apps-simctl.js +1 -0
  120. package/dist/src/archive.js +4 -0
  121. package/dist/src/artifact-download.js +1 -0
  122. package/dist/src/artifacts.d.ts +6 -2
  123. package/dist/src/artifacts.js +1 -1
  124. package/dist/src/async-lifecycle.js +1 -0
  125. package/dist/src/audio-probe-result.js +1 -0
  126. package/dist/src/audio-probe-runtime.js +1 -0
  127. package/dist/src/audio-probe-support.js +1 -0
  128. package/dist/src/auth-session.js +1 -1
  129. package/dist/src/auth.js +1 -1
  130. package/dist/src/backend-snapshot-options.js +1 -1
  131. package/dist/src/{url.js → base-url.js} +1 -1
  132. package/dist/src/boot-diagnostics.js +2 -2
  133. package/dist/src/byte-limit-stream.js +1 -1
  134. package/dist/src/capabilities.js +1 -0
  135. package/dist/src/capture.js +1 -0
  136. package/dist/src/catalog.js +1 -0
  137. package/dist/src/cli-command-aliases.js +1 -0
  138. package/dist/src/cli-config.js +1 -1
  139. package/dist/src/cli-help.js +74 -51
  140. package/dist/src/cli-output.js +1 -1
  141. package/dist/src/cli-runner.js +1 -1
  142. package/dist/src/cli.js +4 -6
  143. package/dist/src/click-button.js +1 -0
  144. package/dist/src/client-metro-companion.js +1 -0
  145. package/dist/src/client-metro.js +1 -1
  146. package/dist/src/client-types.d.ts +280 -242
  147. package/dist/src/clipboard.js +1 -0
  148. package/dist/src/code-signature-cache.js +1 -0
  149. package/dist/src/code-signature.js +1 -0
  150. package/dist/src/color.js +1 -0
  151. package/dist/src/command-metadata.js +1 -1
  152. package/dist/src/command-schema.js +3 -3
  153. package/dist/src/command-surface.js +1 -1
  154. package/dist/src/command-tools.js +2 -2
  155. package/dist/src/command.js +1 -0
  156. package/dist/src/compatibility-policy.js +1 -0
  157. package/dist/src/config.js +1 -1
  158. package/dist/src/config2.js +1 -0
  159. package/dist/src/connection-runtime.js +1 -1
  160. package/dist/src/connection.js +5 -5
  161. package/dist/src/contracts.d.ts +1 -1
  162. package/dist/src/contracts.js +1 -1
  163. package/dist/src/daemon-client-lifecycle.js +1 -0
  164. package/dist/src/daemon-process.js +1 -0
  165. package/dist/src/daemon-registration.js +1 -0
  166. package/dist/src/daemon-shutdown-report.js +1 -1
  167. package/dist/src/daemon.js +2 -2
  168. package/dist/src/debug-symbols-facade.js +5 -0
  169. package/dist/src/deploy-result-target.js +1 -0
  170. package/dist/src/device-claim-inspection.js +1 -1
  171. package/dist/src/device-claim-rule.js +1 -0
  172. package/dist/src/device-input-state.d.ts +190 -3
  173. package/dist/src/device-inventory-context.js +1 -0
  174. package/dist/src/device-isolation.js +1 -0
  175. package/dist/src/device-release.js +1 -0
  176. package/dist/src/device-rotation.js +1 -0
  177. package/dist/src/device-selection-resolver.js +1 -0
  178. package/dist/src/device-session.js +1 -0
  179. package/dist/src/device.js +1 -1
  180. package/dist/src/device2.js +3 -2
  181. package/dist/src/diagnostics.js +3 -0
  182. package/dist/src/diagnostics2.js +1 -0
  183. package/dist/src/dispatch-resolve.js +1 -0
  184. package/dist/src/doctor-facade.js +1 -0
  185. package/dist/src/doctor-output.js +1 -0
  186. package/dist/src/doctor.js +1 -0
  187. package/dist/src/doctor2.js +1 -0
  188. package/dist/src/doctor3.js +1 -0
  189. package/dist/src/durable-resource.js +1 -0
  190. package/dist/src/entities.js +1 -1
  191. package/dist/src/error.js +2 -0
  192. package/dist/src/exec.js +1 -0
  193. package/dist/src/file.js +1 -0
  194. package/dist/src/find.js +1 -1
  195. package/dist/src/finders.js +1 -1
  196. package/dist/src/generic-settle.js +1 -1
  197. package/dist/src/generic.js +1 -1
  198. package/dist/src/gesture-admission.js +1 -0
  199. package/dist/src/gesture-plan-types.js +1 -0
  200. package/dist/src/gesture-plan.js +1 -0
  201. package/dist/src/gesture-runtime.js +1 -0
  202. package/dist/src/harmonyos.js +1 -1
  203. package/dist/src/hdc.js +1 -1
  204. package/dist/src/helper.js +2 -2
  205. package/dist/src/host-file.js +1 -0
  206. package/dist/src/human-control-contract.js +1 -0
  207. package/dist/src/human-control.js +1 -0
  208. package/dist/src/index.d.ts +1 -1
  209. package/dist/src/index.js +1 -1
  210. package/dist/src/input-actions.js +1 -4
  211. package/dist/src/input-actions2.js +2 -1
  212. package/dist/src/install-artifact-facade.js +1 -0
  213. package/dist/src/install-source-network-transport.js +1 -0
  214. package/dist/src/install-source.d.ts +3 -10
  215. package/dist/src/install-source2.js +1 -1
  216. package/dist/src/interaction-positionals.js +1 -0
  217. package/dist/src/interaction-ref-policy.js +1 -0
  218. package/dist/src/interaction.js +1 -1
  219. package/dist/src/interaction2.js +1 -1
  220. package/dist/src/interactor-operation-catalog.js +1 -0
  221. package/dist/src/interactor-types.js +1 -0
  222. package/dist/src/interactor.js +6 -2
  223. package/dist/src/interactor2.js +1 -1
  224. package/dist/src/interactors.js +1 -1
  225. package/dist/src/internal/bin.d.ts +1 -1
  226. package/dist/src/internal/bin.js +1 -2
  227. package/dist/src/internal/companion-tunnel.d.ts +1 -1
  228. package/dist/src/internal/companion-tunnel.js +1 -1
  229. package/dist/src/internal/daemon.d.ts +1 -1
  230. package/dist/src/internal/daemon.js +2 -4
  231. package/dist/src/internal/png-worker.d.ts +4 -4
  232. package/dist/src/internal/png-worker.js +1 -1
  233. package/dist/src/internal/run-script-http-child.d.ts +4 -0
  234. package/dist/src/internal/run-script-http-child.js +1 -0
  235. package/dist/src/internal/update-check-entry.d.ts +1 -1
  236. package/dist/src/inventory.js +4 -4
  237. package/dist/src/inventory2.js +1 -1
  238. package/dist/src/inventory3.js +1 -1
  239. package/dist/src/inventory5.js +1 -1
  240. package/dist/src/inventory6.js +1 -1
  241. package/dist/src/ios-client.js +16 -0
  242. package/dist/src/ios-snapshot-acquisition.js +1 -0
  243. package/dist/src/ios-snapshot-adapter.js +1 -0
  244. package/dist/src/ios-snapshot-planning.js +1 -0
  245. package/dist/src/ios-snapshot-runtime.js +1 -0
  246. package/dist/src/ios-system-surface.js +1 -0
  247. package/dist/src/json.js +1 -0
  248. package/dist/src/keyboard-actions.js +1 -0
  249. package/dist/src/launch-console.js +1 -0
  250. package/dist/src/lease-context.js +1 -1
  251. package/dist/src/lease-scope.js +1 -0
  252. package/dist/src/lease.js +1 -1
  253. package/dist/src/limrun-runtime-dependencies.js +1 -1
  254. package/dist/src/limrun.d.ts +1610 -7
  255. package/dist/src/limrun.js +1 -1
  256. package/dist/src/linux.js +1 -1
  257. package/dist/src/local-interactor-operation-set.js +1 -0
  258. package/dist/src/location-coordinates.js +1 -1
  259. package/dist/src/logcat.js +1 -1
  260. package/dist/src/macos-facade.js +1 -0
  261. package/dist/src/managed-device-scope.js +1 -0
  262. package/dist/src/mechanics.js +19 -0
  263. package/dist/src/metro.d.ts +4 -2
  264. package/dist/src/metro.js +1 -1
  265. package/dist/src/metro2.js +1 -1
  266. package/dist/src/mobile-snapshot-semantics.js +1 -1
  267. package/dist/src/multitouch-support.js +1 -0
  268. package/dist/src/numeric.js +1 -0
  269. package/dist/src/observability.js +1 -1
  270. package/dist/src/observation.js +2 -0
  271. package/dist/src/open-target-resolution.js +1 -0
  272. package/dist/src/output-path.js +1 -1
  273. package/dist/src/owner-identity.js +3 -1
  274. package/dist/src/parameterized-recorded-fill.js +1 -0
  275. package/dist/src/parser.js +1 -1
  276. package/dist/src/perf-facade.js +2 -0
  277. package/dist/src/perf-process-identity.js +1 -0
  278. package/dist/src/perf-runtime-operation-builder.js +1 -0
  279. package/dist/src/perf-runtime-plan.js +1 -0
  280. package/dist/src/perf-runtime.js +1 -0
  281. package/dist/src/perf.js +1 -4
  282. package/dist/src/physical-device-control.js +1 -1
  283. package/dist/src/physical-device-facade.js +1 -0
  284. package/dist/src/platform-request-scope.js +1 -0
  285. package/dist/src/platform-runtime-android-adb-host.js +1 -0
  286. package/dist/src/platform-runtime-android-mechanics.js +1 -0
  287. package/dist/src/platform-runtime-app-log-android-transport.js +1 -1
  288. package/dist/src/platform-runtime-app-log-process.js +1 -1
  289. package/dist/src/platform-runtime-host.js +1 -1
  290. package/dist/src/platform-runtime-managed-owner.js +1 -0
  291. package/dist/src/platform-runtime-network-web-transport.js +1 -1
  292. package/dist/src/platform-runtime-open-target.js +1 -1
  293. package/dist/src/platform-runtime-operation-host.js +4 -4
  294. package/dist/src/platform-runtime-runtime-hints.js +2 -2
  295. package/dist/src/platform-runtime-screen-recording-android-host.js +1 -1
  296. package/dist/src/platform-runtime-screen-recording-apple-runner-host.js +1 -1
  297. package/dist/src/platform-runtime-screen-recording-apple-runner-transport.js +1 -1
  298. package/dist/src/platform-runtime-screen-recording-apple-simulator-host.js +1 -1
  299. package/dist/src/platform-runtime-screen-recording-apple-transport.js +1 -1
  300. package/dist/src/platform-runtime-screen-recording-finalizer-host.js +1 -1
  301. package/dist/src/platform-runtime-screen-recording-harmony-host.js +1 -1
  302. package/dist/src/platform-runtime-screen-recording-process-host.js +1 -0
  303. package/dist/src/platform-runtime-screen-recording-web-host.js +1 -1
  304. package/dist/src/platform-runtime-unavailable.js +1 -0
  305. package/dist/src/platform-runtime.js +1 -1
  306. package/dist/src/platform-runtime2.js +1 -1
  307. package/dist/src/plist.js +1 -1
  308. package/dist/src/png-worker-contract.js +1 -1
  309. package/dist/src/prepare-kind.js +1 -0
  310. package/dist/src/process-exit.js +1 -1
  311. package/dist/src/process.js +1 -0
  312. package/dist/src/provider-device-runtime.js +1 -0
  313. package/dist/src/provider-session-ownership.js +2 -0
  314. package/dist/src/provider-webdriver.js +1 -1
  315. package/dist/src/provider.js +1 -1
  316. package/dist/src/providers.js +1 -0
  317. package/dist/src/proxy.js +2 -2
  318. package/dist/src/react-native-overlay.js +1 -0
  319. package/dist/src/react-native.js +1 -1
  320. package/dist/src/record-runtime.js +1 -1
  321. package/dist/src/record-trace.js +1 -1
  322. package/dist/src/rect-center.js +1 -0
  323. package/dist/src/register-builtins.js +1 -0
  324. package/dist/src/registry.js +40 -28
  325. package/dist/src/remote-config2.js +1 -1
  326. package/dist/src/replay-divergence.js +2 -0
  327. package/dist/src/replay.js +2 -2
  328. package/dist/src/reporting.js +8 -7
  329. package/dist/src/request-admission.js +1 -0
  330. package/dist/src/request-cancel.js +1 -0
  331. package/dist/src/request-cancellation.js +1 -0
  332. package/dist/src/request-progress-protocol.js +1 -0
  333. package/dist/src/request-providers.js +1 -0
  334. package/dist/src/request-runtime-binding.js +1 -0
  335. package/dist/src/request.js +1 -0
  336. package/dist/src/result-serialization.js +1 -0
  337. package/dist/src/retry.js +1 -0
  338. package/dist/src/rolldown-runtime.js +1 -1
  339. package/dist/src/runner-cache-metadata.js +2 -0
  340. package/dist/src/runner-client.js +1 -1
  341. package/dist/src/runner-disposal.js +1 -1
  342. package/dist/src/runner-operations-facade.js +1 -0
  343. package/dist/src/runner-owner-facade.js +1 -0
  344. package/dist/src/runner-owner-state.js +1 -0
  345. package/dist/src/runner-presentation.js +1 -0
  346. package/dist/src/runner.js +1 -0
  347. package/dist/src/{runtime-transport.js → runtime-transport-hints.js} +1 -1
  348. package/dist/src/runtime.js +3 -3
  349. package/dist/src/runtime2.js +4 -4
  350. package/dist/src/runtime3.js +1 -1
  351. package/dist/src/runtime4.js +5 -3
  352. package/dist/src/runtime5.js +1 -1
  353. package/dist/src/runtime6.js +1 -1
  354. package/dist/src/runtime7.js +1 -1
  355. package/dist/src/runtime8.js +1 -1
  356. package/dist/src/runtime9.js +1 -1
  357. package/dist/src/scoped-provider.js +1 -1
  358. package/dist/src/screen-recording-completion.js +1 -0
  359. package/dist/src/screen-recording-live-handle.js +1 -0
  360. package/dist/src/screen-recording-options.js +1 -0
  361. package/dist/src/screen-recording-resource-recovery.js +1 -0
  362. package/dist/src/screen-recording-runtime.js +1 -0
  363. package/dist/src/screenshot-density.js +1 -1
  364. package/dist/src/screenshot-result.js +1 -6
  365. package/dist/src/screenshot-runtime.js +1 -0
  366. package/dist/src/screenshot.js +1 -1
  367. package/dist/src/screenshot2.js +1 -0
  368. package/dist/src/screenshot3.js +5 -0
  369. package/dist/src/script.js +1 -0
  370. package/dist/src/scroll-command.js +1 -0
  371. package/dist/src/scroll-gesture.js +1 -0
  372. package/dist/src/scroll-indicator.js +1 -0
  373. package/dist/src/sdk-batch-runner.d.ts +23 -6
  374. package/dist/src/sdk-batch-runner.js +2 -3
  375. package/dist/src/sdk-batch.js +2 -0
  376. package/dist/src/sdk-contracts.d.ts +170 -41
  377. package/dist/src/sdk-contracts.js +2 -2
  378. package/dist/src/sdk-device.js +1 -1
  379. package/dist/src/sdk-finders.d.ts +1 -1
  380. package/dist/src/sdk-finders.js +1 -1
  381. package/dist/src/sdk-io.js +1 -1
  382. package/dist/src/sdk-remote-config.d.ts +1 -1
  383. package/dist/src/sdk-remote-config.js +1 -1
  384. package/dist/src/sdk-selectors.d.ts +524 -140
  385. package/dist/src/sdk-selectors.js +1 -1
  386. package/dist/src/selection.js +1 -0
  387. package/dist/src/selector-runtime.js +1 -1
  388. package/dist/src/selectors.js +1 -1
  389. package/dist/src/semantic-index.js +1 -0
  390. package/dist/src/server.js +4 -4
  391. package/dist/src/session-allocation.js +1 -0
  392. package/dist/src/session-artifact-paths.js +1 -0
  393. package/dist/src/session-observation.js +1 -0
  394. package/dist/src/session-paths.js +1 -0
  395. package/dist/src/session-repair-tombstone.js +1 -0
  396. package/dist/src/session-routing.js +1 -0
  397. package/dist/src/session-runtime-admission.js +1 -0
  398. package/dist/src/session-snapshot.js +1 -0
  399. package/dist/src/session-store.js +4 -0
  400. package/dist/src/session-target-evidence.js +1 -1
  401. package/dist/src/session2.js +5 -27
  402. package/dist/src/settings.js +1 -0
  403. package/dist/src/shared.js +2 -2
  404. package/dist/src/simctl-facade.js +1 -0
  405. package/dist/src/simctl.js +1 -1
  406. package/dist/src/simulator-facade.js +1 -0
  407. package/dist/src/simulator.js +1 -1
  408. package/dist/src/snapshot-capture-annotations.js +1 -0
  409. package/dist/src/snapshot-desktop-projection.js +1 -0
  410. package/dist/src/snapshot-diagnostics.js +1 -0
  411. package/dist/src/snapshot-process.js +1 -0
  412. package/dist/src/snapshot-quality-backend-capabilities.js +1 -0
  413. package/dist/src/snapshot-quality-verdict.js +1 -0
  414. package/dist/src/snapshot-runtime-binding.js +1 -0
  415. package/dist/src/snapshot-runtime.js +1 -1
  416. package/dist/src/snapshot-scope.js +1 -1
  417. package/dist/src/snapshot-state.js +1 -0
  418. package/dist/src/snapshot.js +1 -8
  419. package/dist/src/snapshot2.js +1 -1
  420. package/dist/src/snapshot3.js +1 -1
  421. package/dist/src/snapshot4.js +1 -0
  422. package/dist/src/src.js +1 -1
  423. package/dist/src/src2.js +1 -1
  424. package/dist/src/src3.js +1 -2
  425. package/dist/src/src4.js +1 -1
  426. package/dist/src/src5.js +1 -0
  427. package/dist/src/src6.js +1 -0
  428. package/dist/src/src7.js +2 -0
  429. package/dist/src/src8.js +115 -0
  430. package/dist/src/startup-recovery-fence.js +1 -0
  431. package/dist/src/status-markers.js +1 -0
  432. package/dist/src/string-enum.js +1 -1
  433. package/dist/src/success-text.js +1 -0
  434. package/dist/src/surface-snapshot.js +1 -0
  435. package/dist/src/surface-snapshot2.js +1 -0
  436. package/dist/src/takeover.js +5 -0
  437. package/dist/src/tool-provider-facade.js +1 -0
  438. package/dist/src/tool-provider.js +4 -3
  439. package/dist/src/tool-provider2.js +1 -1
  440. package/dist/src/tool-provider3.js +1 -1
  441. package/dist/src/toolchain-probe.js +2 -0
  442. package/dist/src/touch-reference-frame.js +1 -0
  443. package/dist/src/touch-runtime.js +1 -0
  444. package/dist/src/transport.js +3 -0
  445. package/dist/src/tree.js +1 -0
  446. package/dist/src/ttl-memo.js +1 -0
  447. package/dist/src/tv-remote.js +1 -0
  448. package/dist/src/type-text-runtime.js +1 -0
  449. package/dist/src/undici.js +99 -0
  450. package/dist/src/update-check.js +1 -1
  451. package/dist/src/verified-file.js +1 -1
  452. package/dist/src/version.js +1 -1
  453. package/dist/src/video.js +2 -2
  454. package/dist/src/web.js +2 -1
  455. package/dist/src/web2.js +1 -0
  456. package/dist/src/webdriver-ios-snapshot.js +1 -0
  457. package/dist/src/webdriver-source.js +1 -0
  458. package/dist/src/window-state.js +1 -0
  459. package/linux/atspi-dump.py +54 -9
  460. package/package.json +58 -35
  461. package/server.json +9 -3
  462. package/android/ime-helper/dist/agent-device-android-ime-helper-0.20.10.apk.sha256 +0 -1
  463. package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.20.10.apk +0 -0
  464. package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.20.10.apk.sha256 +0 -1
  465. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CoordinateTextEntryTests.swift +0 -4
  466. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+FlatSnapshotFiltering.swift +0 -168
  467. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+LifecycleCacheTests.swift +0 -6
  468. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+RecordingTests.swift +0 -4
  469. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SelectorMatchPolicyTests.swift +0 -4
  470. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotPresentation.swift +0 -183
  471. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotPresentationTests.swift +0 -0
  472. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotTraversalIdentityTests.swift +0 -4
  473. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryPolicyTests.swift +0 -4
  474. package/dist/src/appearance.js +0 -1
  475. package/dist/src/apps.js +0 -5
  476. package/dist/src/audio-probe.js +0 -1
  477. package/dist/src/cli-grammar.js +0 -1
  478. package/dist/src/command-catalog.js +0 -1
  479. package/dist/src/debug-symbols.js +0 -5
  480. package/dist/src/device-input-state.js +0 -2
  481. package/dist/src/device-ready.js +0 -1
  482. package/dist/src/dispatch.js +0 -1
  483. package/dist/src/handler-utils.js +0 -1
  484. package/dist/src/helper-package-install.js +0 -1
  485. package/dist/src/host-process.js +0 -3
  486. package/dist/src/ime-lifecycle.js +0 -2
  487. package/dist/src/ime-recovery-marker.js +0 -1
  488. package/dist/src/input-actions3.js +0 -1
  489. package/dist/src/install-artifact.js +0 -1
  490. package/dist/src/install-artifact2.js +0 -1
  491. package/dist/src/interaction-common.js +0 -1
  492. package/dist/src/interaction-runtime.js +0 -1
  493. package/dist/src/interaction-snapshot.js +0 -1
  494. package/dist/src/manifest.js +0 -1
  495. package/dist/src/method-scope.js +0 -1
  496. package/dist/src/png-resize.js +0 -1
  497. package/dist/src/process-lock.js +0 -1
  498. package/dist/src/runner-lease.js +0 -1
  499. package/dist/src/runner-sequence.js +0 -1
  500. package/dist/src/script-source-bundle.js +0 -16
  501. package/dist/src/sdk-android-adb.d.ts +0 -245
  502. package/dist/src/sdk-android-adb.js +0 -4
  503. package/dist/src/sdk.js +0 -1
  504. package/dist/src/setting-state.js +0 -1
  505. package/dist/src/shell-quote.js +0 -1
  506. package/dist/src/snapshot-session.js +0 -1
  507. package/dist/src/timing-safe-equal.js +0 -1
  508. package/dist/src/unsupported-interactor.js +0 -1
  509. package/dist/src/verdict.js +0 -1
  510. /package/dist/src/{recording-telemetry.js → telemetry.js} +0 -0
@@ -1 +1 @@
1
- import{y as e}from"./sdk-android-adb.js";import t from"node:path";import n from"node:fs";import{fileURLToPath as r}from"node:url";const i=`agent-device`,a=`--agent-device-run-update-check`;function o(e){if(!c(e))return;let n=Date.now(),r=t.join(e.stateDir,`update-check.json`),a=d(r);l(a,e.currentVersion)&&(process.stderr.write(`Update available: ${i} ${e.currentVersion} -> ${a.latestVersion}. Run \`npm install -g ${i}@latest\` to upgrade the CLI.\n`),f(r,{...a,prompted:!0})),u(a,n)&&m(r,e.currentVersion)}async function s(e){let t=Date.now(),n=d(e.cachePath);try{let r=await h()??void 0;if(!r||_(r,e.currentVersion)<=0){f(e.cachePath,{checkedAt:new Date(t).toISOString()});return}f(e.cachePath,{checkedAt:new Date(t).toISOString(),latestVersion:r,prompted:n.latestVersion===r?n.prompted===!0:!1})}catch{f(e.cachePath,{...n,checkedAt:new Date(t).toISOString()})}}function c(e){return!e.command||e.command===`help`||e.command===`test`||e.flags.help||e.flags.version||e.flags.json||process.env.CI?.trim()||process.env.NODE_ENV===`test`||process.env.AGENT_DEVICE_NO_UPDATE_NOTIFIER?.trim()?!1:!!process.stderr.isTTY}function l(e,t){return!e.latestVersion||_(e.latestVersion,t)<=0?!1:e.prompted!==!0}function u(e,t){let n=g(e.checkedAt);return n===void 0||t-n>=12096e5}function d(e){try{let t=JSON.parse(n.readFileSync(e,`utf8`));return{checkedAt:typeof t.checkedAt==`string`?t.checkedAt:void 0,latestVersion:typeof t.latestVersion==`string`?t.latestVersion:void 0,prompted:t.prompted===!0}}catch{return{}}}function f(e,r){try{n.mkdirSync(t.dirname(e),{recursive:!0}),n.writeFileSync(e,`${JSON.stringify(r,null,2)}\n`,`utf8`)}catch{}}function p(){let e=r(import.meta.url),i=t.extname(e)||`.js`,a=[t.join(t.dirname(e),`update-check-entry${i}`),t.join(t.dirname(e),`internal`,`update-check-entry${i}`)].find(e=>n.existsSync(e));if(!a)throw Error(`Update check entrypoint not found. Rebuild the package to include the update-check worker entry.`);return a}function m(t,n){let r=p(),i=r.endsWith(`.ts`)?[`--experimental-strip-types`]:[];e(process.execPath,[...i,r,a,t,n])}async function h(){let e=await fetch(`https://registry.npmjs.org/${i}/latest`,{signal:AbortSignal.timeout(3500),headers:{accept:`application/json`}});if(!e.ok)return;let t=await e.json();return typeof t.version==`string`&&t.version.trim().length>0?t.version.trim():void 0}function g(e){if(!e)return;let t=Date.parse(e);return Number.isNaN(t)?void 0:t}function _(e,t){return e.localeCompare(t,void 0,{numeric:!0})}function v(e){if(e[0]!==a)return null;let t=e[1]?.trim(),n=e[2]?.trim();return!t||!n?null:{cachePath:t,currentVersion:n}}export{v as n,s as r,o as t};
1
+ import{u as e}from"./exec.js";import"./command.js";import t from"node:path";import n from"node:fs";import{fileURLToPath as r}from"node:url";const i=`agent-device`,a=`--agent-device-run-update-check`;function o(e){if(!c(e))return;let n=Date.now(),r=t.join(e.stateDir,`update-check.json`),a=d(r);l(a,e.currentVersion)&&(process.stderr.write(`Update available: ${i} ${e.currentVersion} -> ${a.latestVersion}. Run \`npm install -g ${i}@latest\` to upgrade the CLI.\n`),f(r,{...a,prompted:!0})),u(a,n)&&m(r,e.currentVersion)}async function s(e){let t=Date.now(),n=d(e.cachePath);try{let r=await h()??void 0;if(!r||_(r,e.currentVersion)<=0){f(e.cachePath,{checkedAt:new Date(t).toISOString()});return}f(e.cachePath,{checkedAt:new Date(t).toISOString(),latestVersion:r,prompted:n.latestVersion===r&&n.prompted===!0})}catch{f(e.cachePath,{...n,checkedAt:new Date(t).toISOString()})}}function c(e){return!e.command||e.command===`help`||e.command===`test`||e.flags.help||e.flags.version||e.flags.json||process.env.CI?.trim()||process.env.NODE_ENV===`test`||process.env.AGENT_DEVICE_NO_UPDATE_NOTIFIER?.trim()?!1:!!process.stderr.isTTY}function l(e,t){return!e.latestVersion||_(e.latestVersion,t)<=0?!1:e.prompted!==!0}function u(e,t){let n=g(e.checkedAt);return n===void 0||t-n>=12096e5}function d(e){try{let t=JSON.parse(n.readFileSync(e,`utf8`));return{checkedAt:typeof t.checkedAt==`string`?t.checkedAt:void 0,latestVersion:typeof t.latestVersion==`string`?t.latestVersion:void 0,prompted:t.prompted===!0}}catch{return{}}}function f(e,r){try{n.mkdirSync(t.dirname(e),{recursive:!0}),n.writeFileSync(e,`${JSON.stringify(r,null,2)}\n`,`utf8`)}catch{}}function p(){let e=r(import.meta.url),i=t.extname(e)||`.js`,a=[t.join(t.dirname(e),`update-check-entry${i}`),t.join(t.dirname(e),`internal`,`update-check-entry${i}`)].find(e=>n.existsSync(e));if(!a)throw Error(`Update check entrypoint not found. Rebuild the package to include the update-check worker entry.`);return a}function m(t,n){let r=p(),i=r.endsWith(`.ts`)?[`--experimental-strip-types`]:[];e(process.execPath,[...i,r,a,t,n])}async function h(){let e=await fetch(`https://registry.npmjs.org/${i}/latest`,{signal:AbortSignal.timeout(3500),headers:{accept:`application/json`}});if(!e.ok)return;let t=await e.json();return typeof t.version==`string`&&t.version.trim().length>0?t.version.trim():void 0}function g(e){if(!e)return;let t=Date.parse(e);return Number.isNaN(t)?void 0:t}function _(e,t){return e.localeCompare(t,void 0,{numeric:!0})}function v(e){if(e[0]!==a)return null;let t=e[1]?.trim(),n=e[2]?.trim();return!t||!n?null:{cachePath:t,currentVersion:n}}export{v as n,s as r,o as t};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime.js";import{_ as t,w as n}from"./sdk-contracts.js";import"./sdk-batch-runner.js";import{r,t as i}from"./snapshot-scope.js";import a from"node:fs";import{AsyncLocalStorage as o}from"node:async_hooks";var s=e({listDeviceInventory:()=>d,listLocalDeviceInventory:()=>p,readDeviceInventory:()=>f,shouldPropagateDeviceInventoryProbeError:()=>g,withDeviceInventoryContext:()=>u});const c=`device_inventory_context_unavailable`,l=new o;async function u(e,t){return await l.run(e,t)}async function d(e){return await m(`providerFirst`,e)}async function f(e){let t=h(),n=await t.providerFirst.discoverWithSource(e,t.requestScope);return{devices:n.devices.map(e=>({...e})),source:n.source}}async function p(e){return await m(`localOnly`,e)}async function m(e,t){let n=h();return(await n[e].discover(t,n.requestScope)).map(e=>({...e}))}function h(){let e=l.getStore();if(!e)throw new t(`COMMAND_FAILED`,`Device inventory gateway is unavailable outside request execution`,{reason:c});return e}function g(e){return n(e)||e instanceof t&&e.code===`COMMAND_FAILED`&&e.details?.reason===c?!0:e instanceof Error&&e.name===`AbortError`}function _(){return Object.freeze({captureSurface:b})}async function v(e,t){let{snapshotLinux:n}=await import(`./snapshot3.js`),r=await n(e?.surface,t);return C({nodes:r.nodes,truncated:r.truncated,backend:`linux-atspi`},e??{})}async function y(e,t){let n=e.surface;if(!n||n===`app`)throw TypeError(`Apple surface capture requires a non-app macOS surface`);let{runMacOsSnapshotAction:r}=await import(`./helper.js`).then(e=>e.t);return C(await r(n,{bundleId:n===`menubar`?e.appBundleId:void 0,signal:t}),e)}const b=async(e,t,n)=>e.platform===`linux`?await v(t,n):(x(e),await y(t??{},n));function x(e){if(e.platform!==`apple`||e.appleOs!==`macos`)throw TypeError(`Apple surface capture requires a non-app macOS surface`)}const S=[`button`,`menu`,`textfield`,`searchfield`,`checkbox`,`radio`,`switch`];function C(e,t){let n=e.nodes??[];return t.scope&&(n=w(n,t.scope)),t.interactiveOnly&&(n=T(n)),typeof t.depth==`number`&&(n=E(n,t.depth)),{...e,nodes:n}}function w(e,t){let n=i(e,t);if(!n)return[];let a=e.slice(n.start,n.end);return r(a,a[0]?.depth??0)}function T(e){if(e.length===0)return e;let t=new Map(e.map(e=>[e.index,e])),n=new Set;for(let r of e){if(!D(r))continue;let e=r;for(;e&&!n.has(e.index);)n.add(e.index),e=typeof e.parentIndex==`number`?t.get(e.parentIndex):void 0}return n.size===0?e:r(e.filter(e=>n.has(e.index)))}function E(e,t){return r(e.filter(e=>(e.depth??0)<=t))}function D(e){if([e.focused,e.hittable,e.rect].some(Boolean))return!0;let t=`${e.type??``} ${e.role??``} ${e.subrole??``}`.toLowerCase();return S.some(e=>t.includes(e))}function O(e){return j(e,a.constants.O_RDONLY,!1)}function k(e){return j(e,a.constants.O_WRONLY|a.constants.O_APPEND,!0)}function A(e){let t=j(e,a.constants.O_RDWR,!0);try{return a.ftruncateSync(t,0),t}catch(e){throw a.closeSync(t),e}}function j(e,t,n){for(let r=0;r<2;r+=1){let r=M(e,t,n);if(r.status!==`retry`)return r.status===`missing`?void 0:r.descriptor}throw Error(`Final file could not be opened without an identity race: ${e}`)}function M(e,t,n){let r=L(e);if(!r&&!n)return{status:`missing`};let i=N(e,t,r===void 0,n);if(typeof i!=`number`)return i;try{return F(e,i,r),{status:`opened`,descriptor:i}}catch(e){throw a.closeSync(i),e}}function N(e,t,n,r){try{return a.openSync(e,t|z()|(n?a.constants.O_CREAT|a.constants.O_EXCL:0),384)}catch(e){let t=e.code,i=P(t,n,r);if(i)return i;throw e}}function P(e,t,n){if(e===`EEXIST`)return t?{status:`retry`}:void 0;if(e===`ENOENT`&&!t)return{status:n?`retry`:`missing`}}function F(e,t,n){let r=a.fstatSync(t),i=L(e);if(!r.isFile()||!i||!R(r,i)||n&&!R(n,r))throw I(e)}function I(e){return Error(`Final file identity changed while it was opened: ${e}`)}function L(e){try{let t=a.lstatSync(e);if(!t.isFile())throw Error(`Final path must be a regular file: ${e}`);return t}catch(e){if(e.code===`ENOENT`)return;throw e}}function R(e,t){return e.dev===t.dev&&e.ino===t.ino}function z(){let e=a.constants.O_NOFOLLOW;return Number.isInteger(e)&&e>0?e:0}export{y as a,s as c,f as d,g as f,v as i,d as l,O as n,_ as o,u as p,A as r,w as s,k as t,p as u};
1
+ import{C as e}from"./sdk-contracts.js";import t from"node:fs";const n=`agent-device only reads and writes regular files at this path. Remove the symbolic link or special file there and retry.`,r=`Another process replaced the file at this path while it was being opened. Stop the concurrent writer, then retry.`;function i(e){return s(e,t.constants.O_RDONLY,!1)}function a(e){return s(e,t.constants.O_WRONLY|t.constants.O_APPEND,!0)}function o(e){let n=s(e,t.constants.O_RDWR,!0);try{return t.ftruncateSync(n,0),n}catch(e){throw t.closeSync(n),e}}function s(t,n,i){for(let e=0;e<2;e+=1){let e=c(t,n,i);if(e.status!==`retry`)return e.status===`missing`?void 0:e.descriptor}throw new e(`COMMAND_FAILED`,`Final file could not be opened without an identity race: ${t}`,{hint:r})}function c(e,n,r){let i=p(e);if(!i&&!r)return{status:`missing`};let a=l(e,n,i===void 0,r);if(typeof a!=`number`)return a;try{return d(e,a,i),{status:`opened`,descriptor:a}}catch(e){throw t.closeSync(a),e}}function l(e,n,r,i){try{return t.openSync(e,n|g()|(r?t.constants.O_CREAT|t.constants.O_EXCL:0),384)}catch(e){let t=e.code,n=u(t,r,i);if(n)return n;throw e}}function u(e,t,n){if(e===`EEXIST`)return t?{status:`retry`}:void 0;if(e===`ENOENT`&&!t)return{status:n?`retry`:`missing`}}function d(e,n,r){let i=t.fstatSync(n),a=p(e);if(!i.isFile()||!a||!h(i,a)||r&&!h(r,i))throw f(e)}function f(t){return new e(`COMMAND_FAILED`,`Final file identity changed while it was opened: ${t}`,{hint:r})}function p(t){let r=m(t);if(r&&!r.isFile())throw new e(`COMMAND_FAILED`,`Final path must be a regular file: ${t}`,{hint:n});return r}function m(e){try{return t.lstatSync(e)}catch(e){if(e.code===`ENOENT`)return;throw e}}function h(e,t){return e.dev===t.dev&&e.ino===t.ino}function g(){let e=t.constants.O_NOFOLLOW;return Number.isInteger(e)&&e>0?e:0}export{o as a,i,m as n,a as r,n as t};
@@ -1 +1 @@
1
- import e from"node:path";import t from"node:fs";import{fileURLToPath as n}from"node:url";function r(n=i()){try{let r=JSON.parse(t.readFileSync(e.join(n,`package.json`),`utf8`));return typeof r.version==`string`?r.version:`0.0.0`}catch{return`0.0.0`}}function i(){let r=e.dirname(n(import.meta.url)),i=r;for(let n=0;n<6;n+=1){let n=e.join(i,`package.json`);if(t.existsSync(n))return i;i=e.dirname(i)}return r}export{r as n,i as t};
1
+ import{r as e}from"./rolldown-runtime.js";import{t}from"./ttl-memo.js";import n from"node:path";import r from"node:fs";import{fileURLToPath as i}from"node:url";function a(e){let t=e,i=null;for(let e=0;e<8;e+=1){let e=n.join(t,`package.json`);if(r.existsSync(e)){i??=t;try{if(JSON.parse(r.readFileSync(e,`utf8`)).name===`agent-device`)return t}catch{}}t=n.dirname(t)}return i??e}const o=t(),s=t();function c(e=l()){let t=o.get(e);if(t!==void 0)return t;let i;try{i=JSON.parse(r.readFileSync(n.join(e,`package.json`),`utf8`))}catch{return`0.0.0`}let a=typeof i.version==`string`?i.version:`0.0.0`;return o.set(e,a),a}function l(){let e=s.get(`self`);if(e!==void 0)return e;let t=a(n.dirname(i(import.meta.url)));return s.set(`self`,t),t}var u=e({findProjectRoot:()=>l,readVersion:()=>c});export{l as n,c as r,u as t};
package/dist/src/video.js CHANGED
@@ -1,4 +1,4 @@
1
- import{_ as e}from"./sdk-contracts.js";import{_ as t}from"./sdk-android-adb.js";import{t as n}from"./timeouts.js";import{c as r}from"./host-process.js";import{t as i}from"./process-lock.js";import a from"node:path";import{createHash as o}from"node:crypto";import s from"node:fs";import c from"node:os";function l(e=process.env){let t=f(),n=a.join(t,`home`),r=a.join(t,`module-cache`);return s.mkdirSync(n,{recursive:!0}),s.mkdirSync(r,{recursive:!0}),{...e,HOME:n,CLANG_MODULE_CACHE_PATH:r}}async function u(e){let t=s.statSync(e.sourcePath),n=s.readFileSync(e.sourcePath),r=g(e.cacheName??a.basename(e.sourcePath,a.extname(e.sourcePath))),i=v([`2`,process.platform,process.arch,a.resolve(e.sourcePath),t.size,n]),o=a.join(f(),`bin`,`${r}-${i}`);return await p({sourcePath:e.sourcePath,executablePath:o,timeoutMs:e.timeoutMs}),o}async function d(e){let t=g(e.cacheName),n=v([`2`,process.platform,process.arch,e.source]),r=a.join(f(),`sources`,`${t}-${n}.swift`),i=a.join(f(),`bin`,`${t}-${n}`);return await p({sourcePath:r,executablePath:i,sourceText:e.source,timeoutMs:e.timeoutMs}),i}function f(){let e=process.env.AGENT_DEVICE_SWIFT_CACHE_DIR?.trim();return e?a.resolve(e):a.join(c.tmpdir(),`agent-device-swift-cache`)}async function p(e){if(h(e.executablePath))return;let n=a.dirname(e.executablePath);s.mkdirSync(n,{recursive:!0});let r=await m(`${e.executablePath}.lock`,e.executablePath,e.timeoutMs??12e4);if(!r)return;let i=s.mkdtempSync(a.join(n,`.${a.basename(e.executablePath)}.${process.pid}.`)),o=a.join(i,a.basename(e.executablePath));try{if(h(e.executablePath))return;e.sourceText!==void 0&&!s.existsSync(e.sourcePath)&&(s.mkdirSync(a.dirname(e.sourcePath),{recursive:!0}),s.writeFileSync(e.sourcePath,e.sourceText)),await t(`xcrun`,[`swiftc`,e.sourcePath,`-o`,o],{timeoutMs:e.timeoutMs??12e4,env:l()}),s.renameSync(o,e.executablePath)}finally{s.rmSync(i,{recursive:!0,force:!0}),await r()}}async function m(t,n,a){if(h(n))return null;try{return await i({lockDirPath:t,owner:{pid:process.pid,startTime:r(process.pid),acquiredAtMs:Date.now()},timeoutMs:a,pollMs:25,ownerGraceMs:a,description:`Swift cache lock: ${t} (${a}ms)`})}catch(n){throw n instanceof e&&n.message.startsWith(`Timed out waiting for Swift cache lock:`)?new e(`COMMAND_FAILED`,n.message,{...n.details,lockDir:t,timeoutMs:a,hint:`Another agent-device process may still be compiling this Swift helper. Retry shortly; if no agent-device process is active, remove "${t}" and retry.`}):n}}function h(e){try{return s.accessSync(e,s.constants.X_OK),s.statSync(e).isFile()}catch{return!1}}function g(e){return _(e.replaceAll(/[^A-Za-z0-9._-]/g,`-`))||`swift-helper`}function _(e){let t=0,n=e.length;for(;t<n&&e[t]===`-`;)t+=1;for(;n>t&&e[n-1]===`-`;)--n;return e.slice(t,n)}function v(e){let t=o(`sha256`);for(let n of e)t.update(Buffer.isBuffer(n)?n:String(n)),t.update(`\0`);return t.digest(`hex`).slice(0,16)}const y={block:161,blockGroup:160,cluster:524531317,codecId:134,documentType:17026,ebml:440786851,segment:408125543,simpleBlock:163,trackEntry:174,trackNumber:215,tracks:374648427,trackType:131};function b(e){let t=x(e);if(!t)return!1;let{bytes:n,fileSize:r}=t,i=M(n,0,n.length,r);if(!i||i.id!==y.ebml||!i.complete||i.unknownSize||!S(n,i))return!1;let a=M(n,i.nextOffset,n.length,r);return!a||a.id!==y.segment||!I(a,r)?!1:C(n,a,r)}function x(e){try{let t=s.openSync(e,`r`);try{let e=s.fstatSync(t).size;if(e<=0)return;let n=Buffer.alloc(Math.min(e,1048576));return s.readSync(t,n,0,n.length,0)===n.length?{bytes:n,fileSize:e}:void 0}finally{s.closeSync(t)}}catch{return}}function S(e,t){let n=j(e,t)?.find(e=>e.id===y.documentType);return n!==void 0&&e.toString(`ascii`,n.dataStart,n.dataEnd)===`webm`}function C(e,t,n){let r=new Set,i=new Set;for(let a=t.dataStart;a<t.dataEnd;){let o=M(e,a,t.dataEnd,n);if(!o||!I(o,n))return!1;if(o.id===y.tracks&&w(e,o,r),o.id===y.cluster&&E(e,o,n,i),L(r,i))return!0;if(!o.complete||o.unknownSize)return!1;a=o.nextOffset}return!1}function w(e,t,n){let r=j(e,t);if(r){for(let t of r)if(t.id===y.trackEntry){let r=T(e,t);r!==void 0&&n.add(r)}}}function T(e,t){let n=j(e,t),r=A(e,n,y.trackNumber),i=A(e,n,y.trackType),a=n?.find(e=>e.id===y.codecId),o=a?e.toString(`ascii`,a.dataStart,a.dataEnd):void 0;return i===1&&o?.startsWith(`V_`)?r:void 0}function E(e,t,n,r){for(let i=t.dataStart;i<t.dataEnd;){let a=M(e,i,t.dataEnd,n);if(!a||!I(a,n)||(a.id===y.simpleBlock&&O(e,a,r),a.id===y.blockGroup&&D(e,a,r),!a.complete||a.unknownSize))return;i=a.nextOffset}}function D(e,t,n){let r=j(e,t)?.find(e=>e.id===y.block);r&&O(e,r,n)}function O(e,t,n){if(!t.complete||t.unknownSize)return;let r=P(e,t.dataStart);!r||r.unknown||t.dataEnd-t.dataStart<r.length+4||n.add(r.value)}function k(e,t){let n=t.dataEnd-t.dataStart;if(n<1||n>6)return;let r=0;for(let n=t.dataStart;n<t.dataEnd;n+=1)r=r*256+e[n];return Number.isSafeInteger(r)?r:void 0}function A(e,t,n){let r=t?.find(e=>e.id===n);return r?k(e,r):void 0}function j(e,t){if(!t.complete||t.unknownSize)return;let n=[];for(let r=t.dataStart;r<t.dataEnd;){let i=M(e,r,t.dataEnd,e.length);if(!i||!i.complete||i.unknownSize)return;n.push(i),r=i.nextOffset}return n}function M(e,t,n,r){let i=N(e,t);if(!i)return;let a=P(e,t+i.length);if(!a)return;let o=t+i.length+a.length;if(o>n)return;let s=a.unknown?r:o+a.value;if(!(!Number.isSafeInteger(s)||s<o))return{id:i.value,dataStart:o,dataEnd:Math.min(s,n),nextOffset:s,complete:s<=n,unknownSize:a.unknown}}function N(e,t){let n=F(e,t,4);if(!n)return;let r=0;for(let i=0;i<n;i+=1)r=r*256+e[t+i];return{length:n,value:r}}function P(e,t){let n=F(e,t,8);if(!n)return;let r=e[t],i=128>>n-1;if((r&i-1)==i-1&&e.subarray(t+1,t+n).every(e=>e===255))return{length:n,value:0,unknown:!0};let a=r&i-1;for(let r=1;r<n;r+=1)a=a*256+e[t+r];return Number.isSafeInteger(a)?{length:n,value:a,unknown:!1}:void 0}function F(e,t,n){let r=e[t];if(r===void 0||r===0)return;let i=128,a=1;for(;(r&i)===0;)i>>=1,a+=1;return a<=n&&t+a<=e.length?a:void 0}function I(e,t){return e.unknownSize||e.nextOffset<=t}function L(e,t){for(let n of e)if(t.has(n))return!0;return!1}let R;async function z(e,t={}){let r=t.pollMs??150,i=t.attempts??12,a,o=0;for(let t=0;t<i;t+=1){let t=0;try{t=s.statSync(e).size}catch{t=0}if(t>0&&t===a){if(o+=1,o>=2)return}else o=0;a=t,await n(r)}}async function B(e){let n=G(e);if(!n)return!1;if(n===`webm`)return!0;try{let n=await t(await V(),[e],{allowFailure:!0,timeoutMs:1e4,env:l()});return n.exitCode===0?!0:W(n.stderr,n.stdout)}catch(e){if(H(e))return!0;throw e}}async function V(){R??=d({source:`import Foundation
1
+ import{C as e}from"./sdk-contracts.js";import{tr as t}from"./sdk-batch.js";import{b as n}from"./owner-identity.js";import{c as r}from"./exec.js";import{t as i}from"./timeouts.js";import{t as a}from"./file.js";import"./command.js";import"./retry.js";import"./process.js";import o from"node:path";import s from"node:fs";import{createHash as c}from"node:crypto";import l from"node:os";function u(e=process.env){let t=p(),n=o.join(t,`home`),r=o.join(t,`module-cache`);return s.mkdirSync(n,{recursive:!0}),s.mkdirSync(r,{recursive:!0}),{...e,HOME:n,CLANG_MODULE_CACHE_PATH:r}}async function d(e){let t=[e.sourcePath,...e.extraSourcePaths??[]],n=t.map(e=>({sourcePath:e,stat:s.statSync(e),source:s.readFileSync(e)})),r=_(e.cacheName??o.basename(e.sourcePath,o.extname(e.sourcePath))),i=v([`2`,process.platform,process.arch,...n.flatMap(({sourcePath:e,stat:t,source:n})=>[o.resolve(e),t.size,n])]),a=o.join(p(),`bin`,`${r}-${i}`);return await m({sourcePaths:t,executablePath:a,timeoutMs:e.timeoutMs}),a}async function f(e){let t=_(e.cacheName),n=v([`2`,process.platform,process.arch,e.source]),r=o.join(p(),`sources`,`${t}-${n}.swift`),i=o.join(p(),`bin`,`${t}-${n}`);return await m({sourcePaths:[r],executablePath:i,sourceText:e.source,timeoutMs:e.timeoutMs}),i}function p(){let e=process.env.AGENT_DEVICE_SWIFT_CACHE_DIR?.trim();return e?o.resolve(e):o.join(l.tmpdir(),`agent-device-swift-cache`)}async function m(e){if(g(e.executablePath))return;let t=o.dirname(e.executablePath);s.mkdirSync(t,{recursive:!0});let n=await h(`${e.executablePath}.lock`,e.executablePath,e.timeoutMs??12e4);if(!n)return;let i=s.mkdtempSync(o.join(t,`.${o.basename(e.executablePath)}.${process.pid}.`)),a=o.join(i,o.basename(e.executablePath));try{if(g(e.executablePath))return;let[t]=e.sourcePaths;e.sourceText!==void 0&&t&&!s.existsSync(t)&&(s.mkdirSync(o.dirname(t),{recursive:!0}),s.writeFileSync(t,e.sourceText)),await r(`xcrun`,[`swiftc`,...e.sourcePaths,`-o`,a],{timeoutMs:e.timeoutMs??12e4,env:u()}),s.renameSync(a,e.executablePath)}finally{s.rmSync(i,{recursive:!0,force:!0}),await n()}}async function h(t,r,i){if(g(r))return null;try{return await a({lockDirPath:t,owner:{pid:process.pid,startTime:n(process.pid),acquiredAtMs:Date.now()},timeoutMs:i,pollMs:25,ownerGraceMs:i,description:`Swift cache lock: ${t} (${i}ms)`})}catch(n){throw n instanceof e&&n.message.startsWith(`Timed out waiting for Swift cache lock:`)?new e(`COMMAND_FAILED`,n.message,{...n.details,lockDir:t,timeoutMs:i,hint:`Another agent-device process may still be compiling this Swift helper. Retry shortly; if no agent-device process is active, remove "${t}" and retry.`}):n}}function g(e){try{return s.accessSync(e,s.constants.X_OK),s.statSync(e).isFile()}catch{return!1}}function _(e){return t(e.replaceAll(/[^A-Za-z0-9._-]/g,`-`))||`swift-helper`}function v(e){let t=c(`sha256`);for(let n of e)t.update(Buffer.isBuffer(n)?n:String(n)),t.update(`\0`);return t.digest(`hex`).slice(0,16)}const y={block:161,blockGroup:160,cluster:524531317,codecId:134,documentType:17026,ebml:440786851,segment:408125543,simpleBlock:163,trackEntry:174,trackNumber:215,tracks:374648427,trackType:131};function b(e){let t=x(e);if(!t)return!1;let{bytes:n,fileSize:r}=t,i=M(n,0,n.length,r);if(!i||i.id!==y.ebml||!i.complete||i.unknownSize||!S(n,i))return!1;let a=M(n,i.nextOffset,n.length,r);return!a||a.id!==y.segment||!I(a,r)?!1:C(n,a,r)}function x(e){try{let t=s.openSync(e,`r`);try{let e=s.fstatSync(t).size;if(e<=0)return;let n=Buffer.alloc(Math.min(e,1048576));return s.readSync(t,n,0,n.length,0)===n.length?{bytes:n,fileSize:e}:void 0}finally{s.closeSync(t)}}catch{return}}function S(e,t){let n=j(e,t)?.find(e=>e.id===y.documentType);return n!==void 0&&e.toString(`ascii`,n.dataStart,n.dataEnd)===`webm`}function C(e,t,n){let r=new Set,i=new Set;for(let a=t.dataStart;a<t.dataEnd;){let o=M(e,a,t.dataEnd,n);if(!o||!I(o,n))return!1;if(o.id===y.tracks&&w(e,o,r),o.id===y.cluster&&E(e,o,n,i),L(r,i))return!0;if(!o.complete||o.unknownSize)return!1;a=o.nextOffset}return!1}function w(e,t,n){let r=j(e,t);if(r){for(let t of r)if(t.id===y.trackEntry){let r=T(e,t);r!==void 0&&n.add(r)}}}function T(e,t){let n=j(e,t),r=A(e,n,y.trackNumber),i=A(e,n,y.trackType),a=n?.find(e=>e.id===y.codecId),o=a?e.toString(`ascii`,a.dataStart,a.dataEnd):void 0;return i===1&&o?.startsWith(`V_`)?r:void 0}function E(e,t,n,r){for(let i=t.dataStart;i<t.dataEnd;){let a=M(e,i,t.dataEnd,n);if(!a||!I(a,n)||(a.id===y.simpleBlock&&O(e,a,r),a.id===y.blockGroup&&D(e,a,r),!a.complete||a.unknownSize))return;i=a.nextOffset}}function D(e,t,n){let r=j(e,t)?.find(e=>e.id===y.block);r&&O(e,r,n)}function O(e,t,n){if(!t.complete||t.unknownSize)return;let r=P(e,t.dataStart);!r||r.unknown||t.dataEnd-t.dataStart<r.length+4||n.add(r.value)}function k(e,t){let n=t.dataEnd-t.dataStart;if(n<1||n>6)return;let r=0;for(let n=t.dataStart;n<t.dataEnd;n+=1)r=r*256+e[n];return Number.isSafeInteger(r)?r:void 0}function A(e,t,n){let r=t?.find(e=>e.id===n);return r?k(e,r):void 0}function j(e,t){if(!t.complete||t.unknownSize)return;let n=[];for(let r=t.dataStart;r<t.dataEnd;){let i=M(e,r,t.dataEnd,e.length);if(!i||!i.complete||i.unknownSize)return;n.push(i),r=i.nextOffset}return n}function M(e,t,n,r){let i=N(e,t);if(!i)return;let a=P(e,t+i.length);if(!a)return;let o=t+i.length+a.length;if(o>n)return;let s=a.unknown?r:o+a.value;if(!(!Number.isSafeInteger(s)||s<o))return{id:i.value,dataStart:o,dataEnd:Math.min(s,n),nextOffset:s,complete:s<=n,unknownSize:a.unknown}}function N(e,t){let n=F(e,t,4);if(!n)return;let r=0;for(let i=0;i<n;i+=1)r=r*256+e[t+i];return{length:n,value:r}}function P(e,t){let n=F(e,t,8);if(!n)return;let r=e[t],i=128>>n-1;if((r&i-1)==i-1&&e.subarray(t+1,t+n).every(e=>e===255))return{length:n,value:0,unknown:!0};let a=r&i-1;for(let r=1;r<n;r+=1)a=a*256+e[t+r];return Number.isSafeInteger(a)?{length:n,value:a,unknown:!1}:void 0}function F(e,t,n){let r=e[t];if(r===void 0||r===0)return;let i=128,a=1;for(;(r&i)===0;)i>>=1,a+=1;return a<=n&&t+a<=e.length?a:void 0}function I(e,t){return e.unknownSize||e.nextOffset<=t}function L(e,t){for(let n of e)if(t.has(n))return!0;return!1}let R;async function z(e,t={}){let n=t.pollMs??150,r=t.attempts??12,a,o=0;for(let t=0;t<r;t+=1){let t=0;try{t=s.statSync(e).size}catch{t=0}if(t>0&&t===a){if(o+=1,o>=2)return}else o=0;a=t,await i(n)}}async function B(e){let t=G(e);if(!t)return!1;if(t===`webm`)return!0;try{let t=await V(),n=await r(t,[e],{allowFailure:!0,timeoutMs:1e4,env:u()});return n.exitCode===0||W(n.stderr,n.stdout)}catch(e){if(H(e))return!0;throw e}}async function V(){R??=f({source:`import Foundation
2
2
  import AVFoundation
3
3
 
4
4
  let url = URL(fileURLWithPath: CommandLine.arguments[1])
@@ -20,4 +20,4 @@ Task {
20
20
  }
21
21
 
22
22
  semaphore.wait()
23
- exit(exitCode)`,cacheName:`video-validator`,timeoutMs:3e4});try{return await R}catch(e){throw R=void 0,e}}function H(t){return t instanceof e?t.code===`TOOL_MISSING`?!0:W(String(t.details?.stderr??``),String(t.details?.stdout??``)):!1}async function U(e,t={}){let r=t.pollMs??150,i=t.attempts??12;for(let t=0;t<i;t+=1){if(await B(e))return;await n(r)}}function W(e,t){let n=`${e}\n${t}`;return/\b(no such module ['"]AVFoundation['"]|unable to find utility ["']swiftc?["']|xcrun: error: unable to find utility ["']swiftc?["'])\b/i.test(n)}function G(e){try{let t=s.statSync(e);if(!t.isFile()||t.size<=0)return}catch{return}if(e.toLowerCase().endsWith(`.webm`))return b(e)?`webm`:void 0;let t=K(e);return t.includes(`ftyp`)&&t.includes(`moov`)?`mp4`:void 0}function K(e){try{let t=s.openSync(e,`r`);try{let e=s.fstatSync(t).size,n=0,r=[];for(;n+8<=e&&r.length<16;){let e=Buffer.alloc(8);if(s.readSync(t,e,0,8,n)<8)break;let i=e.readUInt32BE(0),a=e.toString(`latin1`,4,8);if(r.push(a),i===1){let e=Buffer.alloc(8);if(s.readSync(t,e,0,8,n+8)<8)break;i=Number(e.readBigUInt64BE(0))}if(!Number.isFinite(i)||i<=0)break;n+=i}return r}finally{s.closeSync(t)}}catch{return[]}}export{u as a,l as i,U as n,z as r,B as t};
23
+ exit(exitCode)`,cacheName:`video-validator`,timeoutMs:3e4});try{return await R}catch(e){throw R=void 0,e}}function H(t){return t instanceof e?t.code===`TOOL_MISSING`||W(String(t.details?.stderr??``),String(t.details?.stdout??``)):!1}async function U(e,t={}){let n=t.pollMs??150,r=t.attempts??12;for(let t=0;t<r;t+=1){if(await B(e))return;await i(n)}}function W(e,t){let n=`${e}\n${t}`;return/\b(no such module ['"]AVFoundation['"]|unable to find utility ["']swiftc?["']|xcrun: error: unable to find utility ["']swiftc?["'])\b/i.test(n)}function G(e){try{let t=s.statSync(e);if(!t.isFile()||t.size<=0)return}catch{return}if(e.toLowerCase().endsWith(`.webm`))return b(e)?`webm`:void 0;let t=K(e);return t.includes(`ftyp`)&&t.includes(`moov`)?`mp4`:void 0}function K(e){try{let t=s.openSync(e,`r`);try{let e=s.fstatSync(t).size,n=0,r=[];for(;n+8<=e&&r.length<16;){let e=Buffer.alloc(8);if(s.readSync(t,e,0,8,n)<8)break;let i=e.readUInt32BE(0),a=e.toString(`latin1`,4,8);if(r.push(a),i===1){let e=Buffer.alloc(8);if(s.readSync(t,e,0,8,n+8)<8)break;i=Number(e.readBigUInt64BE(0))}if(!Number.isFinite(i)||i<=0)break;n+=i}return r}finally{s.closeSync(t)}}catch{return[]}}export{d as a,u as i,U as n,z as r,B as t};
package/dist/src/web.js CHANGED
@@ -1 +1,2 @@
1
- import{_ as e}from"./sdk-contracts.js";import{F as t}from"./sdk-android-adb.js";import{n}from"./provider.js";import{t as r}from"./unsupported-interactor.js";function i(){let i=()=>n();return{...r(`web`),open:(e,t)=>i().open(t?.url??e,{url:t?.url}),openDevice:()=>i().open(`about:blank`),close:e=>i().close(e),tap:(e,t)=>i().click(e,t),hover:async(t,n)=>{let r=i().hover;if(!r)throw new e(`UNSUPPORTED_OPERATION`,`hover is not supported by this web provider`);await r(t,n)},focus:(e,t)=>i().click(e,t),type:(e,t)=>i().typeText(e,{delayMs:t}),fill:(e,t,n,r)=>i().fill(e,t,n,{delayMs:r}),scroll:(e,t)=>i().scroll(e,t),screenshot:(e,t)=>i().screenshot(e,t),setViewport:(e,t)=>i().setViewport(e,t),snapshot:async e=>{let n=await t(`snapshot_capture`,async()=>await i().snapshot(e),{backend:`web`});return{nodes:n.nodes,truncated:n.truncated??!1,backend:`web`}},setOrientation:async()=>{throw new e(`UNSUPPORTED_OPERATION`,`orientation is not supported on web`)}}}export{i as createWebInteractor};
1
+ import{C as e}from"./sdk-contracts.js";import{printJson as t}from"./json.js";function n(){return Object.freeze({setup:async e=>{let{setupManagedAgentBrowser:t}=await import(`./src6.js`).then(e=>e.i);return await t(e)},doctor:async e=>{let{doctorManagedAgentBrowser:t}=await import(`./src6.js`).then(e=>e.i);return await t(e)}})}const r=n();async function i(t,n){switch(t[0]){case`setup`:{a(n.flags.json);let e=await r.setup({stateDir:n.stateDir});return o(n.flags.json,e),0}case`doctor`:{let e=await r.doctor({stateDir:n.stateDir});return s(n.flags.json,e.exitCode===0?`Web backend is healthy.`:`Web backend doctor reported issues.`,e),e.exitCode}default:throw new e(`INVALID_ARGS`,`web requires setup or doctor`)}}function a(e){e||process.stdout.write(`Setting up managed agent-browser backend (downloads if needed)...
2
+ `)}function o(e,n){if(e){t({success:!0,data:{status:c(n)}});return}process.stdout.write(`Managed web backend installed.\nagent-browser available at: ${n.binaryPath}\n`)}function s(e,n,r){if(e){t({success:!0,data:l(r)});return}process.stdout.write(`${n}\n`)}function c(e){let{socketDir:t,...n}=e;return n}function l(e){let t=e.status;return u(t)?{...e,status:c(t)}:e}function u(e){return typeof e==`object`&&!!e&&`socketDir`in e&&`installDir`in e&&`binaryPath`in e}export{i as runWebCommand};
@@ -0,0 +1 @@
1
+ import{C as e}from"./sdk-contracts.js";import{r as t}from"./interaction-positionals.js";import{c as n}from"./diagnostics.js";import"./diagnostics2.js";import{n as r}from"./src6.js";function i(t){let n=async n=>{throw new e(`UNSUPPORTED_OPERATION`,`${n} is not supported on ${t}`)};return{open:()=>n(`open`),openDevice:()=>n(`openDevice`),close:()=>n(`close`),tap:()=>n(`tap`),doubleTap:()=>n(`doubleTap`),longPress:()=>n(`longPress`),focus:()=>n(`focus`),type:()=>n(`type`),fill:()=>n(`fill`),scroll:()=>n(`scroll`),screenshot:()=>n(`screenshot`),snapshot:()=>n(`snapshot`),back:()=>n(`back`),home:()=>n(`home`),setOrientation:()=>n(`setOrientation`),appSwitcher:()=>n(`appSwitcher`),tvRemote:()=>n(`tvRemote`),readClipboard:()=>n(`readClipboard`),writeClipboard:()=>n(`writeClipboard`),setSetting:()=>n(`setSetting`),readAlert:()=>n(`readAlert`),awaitAlert:()=>n(`awaitAlert`),acceptAlert:()=>n(`acceptAlert`),dismissAlert:()=>n(`dismissAlert`)}}async function a(a){let o=a??await r(),s=o.clickRef,c=o.hover,l=o.hoverRef,u=o.fillRef;return{...i(`web`),open:(e,t)=>o.open(t?.url??e,{url:t?.url}),openDevice:()=>o.open(`about:blank`),close:e=>o.close(e),tap:(e,t)=>o.click(e,t),...s?{tapRef:async e=>(await s(e),{ref:t(e)})}:{},...c?{hover:async(e,t)=>await c(e,t)}:{},...l?{hoverRef:async e=>(await l(e),{ref:t(e)})}:{},focus:(e,t)=>o.click(e,t),type:(e,t)=>o.typeText(e,{delayMs:t}),fill:(e,t,n,r)=>o.fill(e,t,n,{delayMs:r}),...u?{fillRef:async(e,n,r)=>(await u(e,n,{delayMs:r}),{ref:t(e),text:n,delayMs:r??0})}:{},scroll:(e,t)=>o.scroll(e,t),screenshot:(e,t)=>o.screenshot(e,t),setViewport:(e,t)=>o.setViewport(e,t),snapshot:async e=>{let t=await n(`snapshot_capture`,async()=>await o.snapshot(e),{backend:`web`});return{nodes:t.nodes,truncated:t.truncated??!1,backend:`web`,producer:`agent-browser`}},setOrientation:async()=>{throw new e(`UNSUPPORTED_OPERATION`,`orientation is not supported on web`)}}}export{a as createWebInteractor};
@@ -0,0 +1 @@
1
+ import{t as e}from"./webdriver-source.js";import{r as t,t as n}from"./ios-snapshot-acquisition.js";async function r(e,t){return i(await e.source(),t)}function i(r,i){let a=e(r),o=t(a.roots)??{kind:`missing`,reason:`not-provided`};return n({producer:`appium-source`,nodes:a.nodes,viewport:o,lineage:i?{targetId:i}:{}})}export{r as captureWebDriverIosSnapshot};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime.js";import{C as t}from"./sdk-contracts.js";import{t as n}from"./bounds.js";import{t as r}from"./parser.js";var i=e({parseWebDriverSourceFacts:()=>p});function a(e){try{return r(e)}catch(e){throw new t(`COMMAND_FAILED`,`Failed to parse WebDriver page source XML: ${e instanceof Error?e.message:String(e)}`,void 0,e)}}function o(e){let t=n(e.bounds??null);if(t)return t;let r=d(e.x),i=d(e.y),a=d(e.width),o=d(e.height);if(r!==void 0&&i!==void 0&&a!==void 0&&o!==void 0)return{x:r,y:i,width:a,height:o}}function s(e,t){for(let n of t){let t=c(e[n]);if(t!==void 0)return t}}function c(e){return e||void 0}function l(e,t){return e===void 0?t:e===`true`||e===`1`?!0:e===`false`||e===`0`?!1:t===void 0&&void 0}function u(e){return!!(e&&e.width>0&&e.height>0)}function d(e){if(e===void 0||e===``)return;let t=Number(e);return Number.isFinite(t)?t:void 0}function f(e,t){return c(t.class)??c(e.replace(/^XCUIElementType/,``).toLowerCase())}function p(e,t=`ios`){let n=a(e),r=[],i=[];for(let e of n)m(r,e,void 0,0,i,t);return{nodes:r,roots:i}}function m(e,t,n,r,i,a){let o=h(t,a)?n:g(e,t,n,r,i,a),s=o===n?r:r+1;for(let n of t.children)m(e,n,o,s,i,a)}function h(e,t){if(Object.keys(e.attributes).length===0)return!0;let n=e.name.toLowerCase();return t===`ios`&&(n===`hierarchy`||n===`appiumaut`)}function g(e,t,n,r,i,a){let s=e.length,c=o(t.attributes);return e.push(_(s,t.name,t.attributes,n,r,c,a)),n===void 0&&i.push({type:t.name,...c?{rect:c}:{},rectStatus:x(t.attributes,c)}),s}function _(e,t,n,r,i,a,o){return{index:e,type:t,role:f(t,n),label:s(n,[`content-desc`,`label`,`text`,`name`]),value:c(n.value),identifier:s(n,[`resource-id`,`id`,`accessibility-id`,`name`]),rect:a,...v(n,a,o),depth:i,parentIndex:r}}function v(e,t,n){let r=n===`android`||void 0,i=l(e.enabled,r),a=l(e.displayed??e.visible,r);return n===`android`?{enabled:i,selected:l(e.selected,!1),focused:l(e.focused,!1),visibleToUser:a,hittable:a===!0&&i===!0&&u(t)}:{...y(`enabled`,i),...y(`selected`,l(e.selected)),...y(`focused`,l(e.focused)),...y(`visibleToUser`,a),...b(e.hittable)}}function y(e,t){return t===void 0?{}:{[e]:t}}function b(e){let t=l(e);return t===void 0?{}:{hittable:t}}function x(e,t){let n=e.bounds!==void 0,r=[`x`,`y`,`width`,`height`].every(t=>e[t]!==void 0);return!n&&!r?`not-provided`:u(t)?`reported`:`invalid`}export{i as n,p as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./adb.js";import{n as t,o as n,t as r}from"./app-parsers.js";const i=[[`shell`,`dumpsys`,`window`,`windows`],[`shell`,`dumpsys`,`window`]],a={foreground:{tiers:[i,[[`shell`,`dumpsys`,`activity`,`activities`],[`shell`,`dumpsys`,`activity`]]],section:g(t)},blockingDialog:{tiers:[i],section:g([r])}},o=RegExp(`(?:${t.map(_).join(`|`)})(.*)$`,`gm`),s=new Map;function c(t){let n=new Map;return r=>{let i=r.join(` `),a=n.get(i)??e(t,[...r],{allowFailure:!0}).then(e=>{let n=e.stdout??``;return f(t,i,n),n});return n.set(i,a),a}}async function l(e,t=c(e)){for(let n of p(e,`foreground`)){let e=v(await t(n));if(e)return e}return{}}async function u(e,t=c(e)){for(let r of p(e,`blockingDialog`)){let{focusObserved:e,focus:i}=n(await t(r));if(i)return{status:`dialog`,focus:i};if(e)return{status:`clear`}}return{status:`unknown`}}function d(){s.clear()}function f(e,t,n){if(n.length===0)return;let r=s.get(e.id)??new Map;for(let[e,i]of Object.entries(a)){let a=h(e,t);r.get(a)!==!0&&r.set(a,i.section.test(n))}s.set(e.id,r)}function p(e,t){let n=s.get(e.id);return a[t].tiers.flatMap(e=>m(e,t,n))}function m(e,t,n){if(!n)return e;let r=e=>n.get(h(t,e.join(` `)))===!1,i=e.filter(e=>!r(e));return i.length===e.length||i.length===0?e:[...i,...e.filter(r)]}function h(e,t){return`${e} ${t}`}function g(e){return new RegExp(e.map(_).join(`|`))}function _(e){return e.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}function v(e){for(let t of e.matchAll(o)){let e=t[1]?.match(/\b([A-Za-z][A-Za-z0-9_]*(?:\.[A-Za-z0-9_]+)+)\/([A-Za-z0-9_.$]+)/);if(e?.[1]&&e[2])return{package:e[1],activity:e[2]}}return null}export{d as i,l as n,u as r,c as t};
@@ -22,19 +22,48 @@ MAX_DESKTOP_APPS = 24
22
22
  VALID_SURFACES = ("desktop", "frontmost-app")
23
23
 
24
24
 
25
- def get_rect(accessible):
25
+ def get_screen_origin(accessible):
26
+ """The screen-absolute (x, y) of a top-level frame/window's own Component extents.
27
+
28
+ Unlike descendant widgets (see get_rect), a top-level's own SCREEN-coordinate extents are
29
+ correct — GTK4's AT-SPI bridge only loses the translation when walking from a widget up
30
+ through its ancestor chain to the root, not for the root itself.
31
+ """
26
32
  try:
27
33
  component = accessible.get_component_iface()
28
34
  if not component:
29
35
  return None
30
36
  extents = component.get_extents(Atspi.CoordType.SCREEN)
37
+ if not extents:
38
+ return None
39
+ return (extents.x, extents.y)
40
+ except Exception:
41
+ return None
42
+
43
+
44
+ def get_rect(accessible, frame_origin):
45
+ """A node's screen-absolute rect.
46
+
47
+ GTK4's AT-SPI bridge returns (0, 0) as the origin of Component.get_extents(SCREEN) for every
48
+ non-toplevel widget — confirmed live (CI run 32503838660): a raw xdotool click at the
49
+ computed center of a digit button's "screen" rect landed on the window's own header-bar
50
+ button instead. CoordType.WINDOW gives correct, distinct per-widget offsets, so the
51
+ screen-absolute rect is that offset plus the enclosing top-level frame's own (correct)
52
+ screen origin.
53
+ """
54
+ try:
55
+ component = accessible.get_component_iface()
56
+ if not component:
57
+ return None
58
+ extents = component.get_extents(Atspi.CoordType.WINDOW)
31
59
  if not extents:
32
60
  return None
33
61
  if extents.width <= 0 or extents.height <= 0:
34
62
  return None
63
+ origin_x, origin_y = frame_origin if frame_origin else (0, 0)
35
64
  return {
36
- "x": extents.x,
37
- "y": extents.y,
65
+ "x": extents.x + origin_x,
66
+ "y": extents.y + origin_y,
38
67
  "width": extents.width,
39
68
  "height": extents.height,
40
69
  }
@@ -43,14 +72,24 @@ def get_rect(accessible):
43
72
 
44
73
 
45
74
  def get_text_value(accessible):
75
+ """The Text interface's content, if any.
76
+
77
+ Must call Atspi.Text.get_text(accessible, ...) as an unbound/static call, NOT
78
+ accessible.get_text_iface().get_text(...) — the bound form resolves to the deprecated
79
+ 1-argument Atspi.Accessible.get_text() instead (a documented PyGObject binding collision:
80
+ https://discourse.gnome.org/t/how-can-i-explicitly-call-atspi-text-get-text/36684), raising
81
+ "takes exactly 1 argument (3 given)" for every node, silently swallowed as "no text" by the
82
+ except-Exception below. Confirmed live (CI run 32505154107): the static form correctly
83
+ returns typed text ("155") where the bound form threw on the same node.
84
+ """
46
85
  try:
47
86
  text_iface = accessible.get_text_iface()
48
87
  if not text_iface:
49
88
  return None
50
- count = text_iface.get_character_count()
89
+ count = Atspi.Text.get_character_count(accessible)
51
90
  if count <= 0:
52
91
  return None
53
- value = text_iface.get_text(0, count)
92
+ value = Atspi.Text.get_text(accessible, 0, count)
54
93
  return value if value else None
55
94
  except Exception:
56
95
  return None
@@ -76,7 +115,7 @@ def has_state(state_set, state_type):
76
115
  return False
77
116
 
78
117
 
79
- def traverse_node(accessible, depth, parent_index, ctx, app_info, window_title=None):
118
+ def traverse_node(accessible, depth, parent_index, ctx, app_info, window_title=None, frame_origin=None):
80
119
  if len(ctx["nodes"]) >= ctx["max_nodes"] or depth > ctx["max_depth"] or not accessible:
81
120
  return
82
121
 
@@ -96,7 +135,13 @@ def traverse_node(accessible, depth, parent_index, ctx, app_info, window_title=N
96
135
  description = ""
97
136
 
98
137
  label = name or description or None
99
- rect = get_rect(accessible)
138
+
139
+ # Entering a new top-level resets the frame origin used to translate its descendants'
140
+ # WINDOW-relative extents to screen-absolute (see get_rect) — each frame/dialog is a
141
+ # separate X11 top-level with its own screen position.
142
+ is_frame = role_name in ("frame", "window", "dialog")
143
+ effective_frame_origin = (get_screen_origin(accessible) or frame_origin) if is_frame else frame_origin
144
+ rect = get_rect(accessible, effective_frame_origin)
100
145
 
101
146
  try:
102
147
  state_set = accessible.get_state_set()
@@ -110,7 +155,7 @@ def traverse_node(accessible, depth, parent_index, ctx, app_info, window_title=N
110
155
  hittable = (enabled is not False) and visible and showing and (rect is not None)
111
156
 
112
157
  current_window_title = window_title
113
- if current_window_title is None and role_name in ("frame", "window", "dialog"):
158
+ if current_window_title is None and is_frame:
114
159
  current_window_title = label
115
160
 
116
161
  nodes = ctx["nodes"]
@@ -147,7 +192,7 @@ def traverse_node(accessible, depth, parent_index, ctx, app_info, window_title=N
147
192
  if child:
148
193
  traverse_node(
149
194
  child, depth + 1, node_index, ctx, app_info,
150
- current_window_title
195
+ current_window_title, effective_frame_origin
151
196
  )
152
197
  except Exception:
153
198
  pass
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-device",
3
- "version": "0.20.10",
3
+ "version": "0.21.1",
4
4
  "description": "Mobile app automation and verification for AI coding agents. CLI, MCP server, and typed Node.js API for iOS, Android, HarmonyOS, TV, web, macOS, and Linux.",
5
5
  "mcpName": "io.github.callstack/agent-device",
6
6
  "license": "MIT",
@@ -107,17 +107,24 @@
107
107
  "package:android-ime-helper:npm": "rm -rf android/ime-helper/dist && AGENT_DEVICE_ANDROID_HELPER=ime sh ./scripts/package-android-helper.sh $(node -p \"require('./package.json').version\") android/ime-helper/dist",
108
108
  "build:macos-helper": "node --experimental-strip-types scripts/swift-toolchain-tmpdir.ts swift build -c release --package-path apple/macos-helper",
109
109
  "build:macos-helper:clean": "node --experimental-strip-types scripts/swift-toolchain-tmpdir.ts swift package --package-path apple/macos-helper clean && pnpm build:macos-helper",
110
- "build:package": "pnpm build && pnpm build:xcuitest:ios && pnpm build:xcuitest:macos && pnpm build:xcuitest:tvos && pnpm build:xcuitest:visionos && pnpm build:macos-helper:clean && pnpm package:apple-runner:npm && pnpm build:android",
110
+ "prepare:publish-assets": "node scripts/prepare-publish-assets.mjs",
111
+ "build:package": "pnpm build && pnpm build:xcuitest:ios && pnpm build:xcuitest:macos && pnpm build:xcuitest:tvos && pnpm build:xcuitest:visionos && pnpm build:macos-helper:clean && pnpm prepare:publish-assets",
111
112
  "package:npm": "pnpm build:package && pnpm check:package",
112
- "release:prepare": "rm -rf .tmp/release && pnpm check:mcp-metadata && pnpm build:package && pnpm check:package -- --pack-destination .tmp/release",
113
- "release:publish": "pnpm release:prepare && npm publish --ignore-scripts .tmp/release/*.tgz",
113
+ "release:prepare": "node scripts/release-mark-dev.mjs --check-release-version && rm -rf .tmp/release && pnpm check:mcp-metadata && pnpm build:package && pnpm check:package -- --pack-destination .tmp/release",
114
+ "release:publish": "pnpm release:prepare && npm publish --ignore-scripts .tmp/release/*.tgz && pnpm release:mark-dev",
115
+ "release:mark-dev": "node scripts/release-mark-dev.mjs",
114
116
  "ad": "node bin/agent-device.mjs",
115
117
  "bench:help-conformance": "node scripts/help-conformance-bench.mjs",
116
- "maestro:conformance": "node --experimental-strip-types scripts/node-test-tmpdir.ts --experimental-strip-types --test packages/maestro/test/conformance/verify.test.ts packages/maestro/test/conformance/differential/run.test.ts packages/maestro/test/conformance/differential/invariants.test.ts",
118
+ "maestro:conformance": "node --experimental-strip-types scripts/node-test-tmpdir.ts --experimental-strip-types --test scripts/maestro-conformance/format-generated-json.test.mjs packages/maestro/test/conformance/verify.test.ts packages/maestro/test/conformance/differential/engine-process.test.ts packages/maestro/test/conformance/differential/report-output.test.ts packages/maestro/test/conformance/differential/run.test.ts packages/maestro/test/conformance/differential/invariants.test.ts",
117
119
  "maestro:conformance:regenerate": "node --experimental-strip-types scripts/maestro-conformance/regenerate.mjs",
118
120
  "maestro:conformance:differential": "node --experimental-strip-types packages/maestro/test/conformance/differential/run.ts",
121
+ "test:ios-snapshot-differential": "node --experimental-strip-types scripts/swift-toolchain-tmpdir.ts swift test --package-path apple/snapshot-presentation && node --experimental-strip-types scripts/node-test-tmpdir.ts --experimental-strip-types --test scripts/ios-snapshot-differential.test.ts",
119
122
  "size": "node scripts/size-report.mjs",
120
123
  "perf": "node --experimental-strip-types scripts/perf/run.ts",
124
+ "bench:ios-snapshot": "node --experimental-strip-types scripts/ios-snapshot-benchmark/run.ts",
125
+ "bench:ios-snapshot:deep-button": "node --experimental-strip-types scripts/ios-snapshot-benchmark/deep-button.ts",
126
+ "bench:ios-snapshot:evidence": "node --experimental-strip-types scripts/ios-snapshot-benchmark/evidence.ts",
127
+ "bench:ios-ax-bridge:targeted": "node --experimental-strip-types scripts/ios-ax-bridge-spike/targeted-run.ts",
121
128
  "mutation:run": "node --experimental-strip-types scripts/mutation/run.ts",
122
129
  "mutation:check": "node --experimental-strip-types scripts/mutation/run.ts --no-run",
123
130
  "mutation:affected": "node --experimental-strip-types scripts/mutation/run.ts --affected",
@@ -130,23 +137,26 @@
130
137
  "fallow:baseline": "fallow dead-code --save-baseline fallow-baselines/dead-code.json --summary && fallow health --report-only --save-baseline fallow-baselines/health.json --summary",
131
138
  "check:fallow": "fallow audit",
132
139
  "check:affected": "node --experimental-strip-types scripts/check-affected/run.ts",
133
- "check:affected:test": "node --experimental-strip-types scripts/node-test-tmpdir.ts --experimental-strip-types --test scripts/check-affected/model.test.ts scripts/check-affected/platform-packages.test.ts scripts/check-affected/run.test.ts",
140
+ "check:affected:test": "node --experimental-strip-types scripts/node-test-tmpdir.ts --experimental-strip-types --test scripts/check-affected/model.test.ts scripts/check-affected/platform-packages.test.ts scripts/check-affected/device-lanes.test.ts scripts/check-affected/lockfile-install-sync.test.ts scripts/check-affected/run.test.ts",
134
141
  "gate": "node --experimental-strip-types scripts/gate/run.ts",
135
142
  "check:gate-manifest": "node --experimental-strip-types scripts/gate/check.ts",
136
143
  "check:gate-manifest:test": "node --experimental-strip-types scripts/node-test-tmpdir.ts --experimental-strip-types --test scripts/gate/*.test.ts",
137
144
  "check:coverage-changed": "node --experimental-strip-types scripts/coverage-changed/run.ts",
138
145
  "check:coverage-changed:test": "node --experimental-strip-types scripts/node-test-tmpdir.ts --experimental-strip-types --test scripts/coverage-changed/model.test.ts scripts/coverage-changed/run.test.ts",
139
146
  "check:layering": "node --experimental-strip-types scripts/node-test-tmpdir.ts --experimental-strip-types --test scripts/layering/*.test.ts && node --experimental-strip-types scripts/layering/check.ts",
147
+ "check:di-seams": "node --experimental-strip-types scripts/node-test-tmpdir.ts --experimental-strip-types --test scripts/di-seams/*.test.ts && node --experimental-strip-types scripts/di-seams/check.ts",
140
148
  "depgraph": "node --experimental-strip-types scripts/depgraph/build.ts",
141
149
  "depgraph:test": "node --experimental-strip-types scripts/node-test-tmpdir.ts --experimental-strip-types --test scripts/depgraph/model.test.ts scripts/depgraph/affected.test.ts",
142
150
  "check:production-exports": "fallow dead-code --config fallow-production-exports.json --production --unused-exports --fail-on-issues",
143
151
  "check:bundle-owner-files": "node --experimental-strip-types scripts/check-bundle-owner-files.ts",
144
152
  "check:package": "node --experimental-strip-types scripts/check-package.ts",
145
153
  "check:command-docs": "vitest run --project unit-core src/__tests__/command-doc-coverage.test.ts",
154
+ "check:agent-guidance": "node --experimental-strip-types scripts/node-test-tmpdir.ts --experimental-strip-types --test scripts/__tests__/agent-guidance-contract.test.ts",
146
155
  "check:replay-compat": "node --experimental-strip-types scripts/check-replay-compat-provenance.ts",
147
156
  "check:daemon-wire-compat": "node --experimental-strip-types scripts/wire-compat/run.ts",
148
157
  "check:daemon-wire-compat:test": "node --experimental-strip-types scripts/node-test-tmpdir.ts --experimental-strip-types --test scripts/wire-compat/model.test.ts",
149
158
  "check:xctest-selection": "node --experimental-strip-types scripts/check-xctest-selection.ts",
159
+ "check:packaged-runner-swift": "node --experimental-strip-types scripts/check-packaged-runner-swift.ts",
150
160
  "check:tmpdir-leaks": "node --experimental-strip-types scripts/check-tmpdir-leaks.ts",
151
161
  "check:tmpdir-leaks:test": "node --experimental-strip-types scripts/node-test-tmpdir.ts --experimental-strip-types --test scripts/check-tmpdir-leaks-model.test.ts scripts/vitest-tmpdir-global-setup.test.ts scripts/node-test-tmpdir.test.ts scripts/swift-toolchain-tmpdir.test.ts",
152
162
  "check:freerange": "fr",
@@ -154,26 +164,28 @@
154
164
  "sync:mcp-metadata": "node scripts/sync-mcp-metadata.mjs",
155
165
  "check:mcp-metadata": "node scripts/sync-mcp-metadata.mjs --check",
156
166
  "version": "pnpm sync:mcp-metadata && git add server.json",
157
- "check:tooling": "pnpm format:check && pnpm lint && pnpm typecheck && pnpm check:layering && pnpm depgraph:test && pnpm check:gate-manifest:test && pnpm check:gate-manifest && pnpm check:production-exports && pnpm check:tmpdir-leaks:test && pnpm check:xctest-selection && pnpm check:mcp-metadata && pnpm build && pnpm check:bundle-owner-files && pnpm check:package",
167
+ "check:tooling": "pnpm format:check && pnpm lint && pnpm typecheck && pnpm check:layering && pnpm depgraph:test && pnpm check:gate-manifest:test && pnpm check:gate-manifest && pnpm check:production-exports && pnpm check:tmpdir-leaks:test && pnpm check:xctest-selection && pnpm check:packaged-runner-swift && pnpm check:mcp-metadata && pnpm build && pnpm check:bundle-owner-files && pnpm check:package",
158
168
  "check:unit": "pnpm test:unit && pnpm check:tmpdir-leaks && pnpm test:smoke",
159
169
  "check": "pnpm check:tooling && pnpm check:fallow && pnpm check:unit",
160
170
  "prepack": "pnpm check:mcp-metadata && pnpm package:npm",
161
- "typecheck": "tsc -b packages/xml packages/kernel packages/contracts packages/capture-kit packages/platform-apple packages/platform-android packages/platform-harmonyos packages/platform-vega packages/platform-linux packages/platform-web packages/ad-script packages/selectors packages/ad-replay packages/maestro packages/replay-test packages/provider-webdriver packages/provider-limrun && tsc -p tsconfig.json && tsc -p examples/sdk/tsconfig.json",
171
+ "typecheck": "tsc -b packages/xml packages/kernel packages/contracts packages/device-selection packages/host-kit packages/capture-kit packages/managed-allocation packages/provision-kit packages/platform-apple packages/platform-android packages/platform-harmonyos packages/platform-vega packages/platform-linux packages/platform-web packages/ad-script packages/selectors packages/command-registry packages/session-journal packages/ad-replay packages/maestro packages/replay-test packages/provider-webdriver packages/provider-limrun && tsc -p tsconfig.json && tsc -p examples/sdk/tsconfig.json",
162
172
  "test-app:install": "pnpm install --dir examples/test-app",
163
173
  "test-app:start": "pnpm --dir examples/test-app start",
164
174
  "test-app:ios": "pnpm --dir examples/test-app ios",
165
175
  "test-app:android": "pnpm --dir examples/test-app android",
166
176
  "test-app:typecheck": "pnpm --dir examples/test-app typecheck",
177
+ "test-app:security": "pnpm --dir examples/test-app security:test",
167
178
  "test-app:replay:ios": "pnpm ad test examples/test-app/replays --platform ios --artifacts-dir .tmp/test-app-replay/ios",
168
179
  "test-app:replay:android": "pnpm ad test examples/test-app/replays --platform android --artifacts-dir .tmp/test-app-replay/android",
169
180
  "test-app:maestro": "node scripts/run-test-app-maestro-suite.mjs",
170
181
  "test-app:maestro:ios": "pnpm test-app:maestro --platform ios",
171
182
  "test-app:maestro:android": "pnpm test-app:maestro --platform android",
172
183
  "test": "pnpm test:unit",
173
- "test:unit": "vitest run --project unit-core --project subprocess-stub",
184
+ "test:unit": "vitest run --project unit-core --project fuzz-worker",
174
185
  "test:maestro-compat": "vitest run --project unit-core packages/maestro src/daemon/adapters/maestro src/compat/__tests__/replay-input.test.ts",
175
- "test:coverage": "vitest run --coverage",
176
- "test:coverage:ci": "vitest run --coverage",
186
+ "test:coverage": "vitest run --coverage --project=!fuzz-worker && pnpm test:fuzz-worker",
187
+ "test:coverage:ci": "vitest run --coverage --project=!fuzz-worker && pnpm test:fuzz-worker",
188
+ "test:fuzz-worker": "vitest run --project fuzz-worker",
177
189
  "test:integration:provider": "vitest run --project provider-integration",
178
190
  "test:integration:progress": "node --experimental-strip-types scripts/integration-progress.ts",
179
191
  "test:integration:progress:check": "node --experimental-strip-types scripts/integration-progress.ts --check",
@@ -183,19 +195,22 @@
183
195
  "test:smoke:web": "pnpm build && node --experimental-strip-types scripts/node-test-tmpdir.ts --test test/integration/smoke-web-platform.test.ts",
184
196
  "test:smoke": "node --experimental-strip-types scripts/node-test-tmpdir.ts --test test/integration/smoke-*.test.ts",
185
197
  "test:integration:node": "node --experimental-strip-types scripts/node-test-tmpdir.ts --test --experimental-test-isolation=none test/integration/*.test.ts",
198
+ "test:integration:macos-coverage": "node --experimental-strip-types scripts/node-test-tmpdir.ts --test test/integration/smoke-macos-coverage.test.ts",
186
199
  "test:integration": "pnpm test:integration:node && pnpm test:integration:provider",
187
200
  "test:concurrency-torture": "node --experimental-strip-types scripts/node-test-tmpdir.ts --test test/integration/nightly/concurrency-torture.test.ts",
188
201
  "test:replay:ios": "node --experimental-strip-types src/bin.ts test test/integration/replays/ios/simulator",
189
202
  "test:replay:ios-device": "node --experimental-strip-types src/bin.ts test test/integration/replays/ios/device",
190
203
  "test:replay:android": "node --experimental-strip-types src/bin.ts test test/integration/replays/android/emulator",
191
204
  "test:replay:macos": "node --experimental-strip-types src/bin.ts test test/integration/replays/macos",
192
- "test:replay:linux": "node --experimental-strip-types src/bin.ts test test/integration/replays/linux"
205
+ "test:replay:linux": "node --experimental-strip-types src/bin.ts test test/integration/replays/linux",
206
+ "test:linux:command-evidence": "node --experimental-strip-types test/integration/linux-e2e/live-runner.ts"
193
207
  },
194
208
  "files": [
195
209
  "bin",
196
210
  "dist",
197
211
  "apple/macos-helper",
198
212
  "!apple/macos-helper/**/.build",
213
+ "apple/snapshot-bridge",
199
214
  "android/snapshot-helper/dist",
200
215
  "!android/snapshot-helper/dist/*.idsig",
201
216
  "!android/snapshot-helper/README.md",
@@ -251,14 +266,6 @@
251
266
  "maestro",
252
267
  "detox"
253
268
  ],
254
- "dependencies": {
255
- "@limrun/api": "^0.24.5",
256
- "ipaddr.js": "^2.5.0",
257
- "tar-stream": "^3.2.0",
258
- "undici": "7.29.0",
259
- "yaml": "^2.9.0",
260
- "yauzl": "^3.4.0"
261
- },
262
269
  "peerDependencies": {
263
270
  "ai": "^6.0.0 || ^7.0.0"
264
271
  },
@@ -271,8 +278,12 @@
271
278
  "@agent-device/ad-replay": "workspace:*",
272
279
  "@agent-device/ad-script": "workspace:*",
273
280
  "@agent-device/capture-kit": "workspace:*",
281
+ "@agent-device/command-registry": "workspace:*",
274
282
  "@agent-device/contracts": "workspace:*",
283
+ "@agent-device/device-selection": "workspace:*",
284
+ "@agent-device/host-kit": "workspace:*",
275
285
  "@agent-device/kernel": "workspace:*",
286
+ "@agent-device/managed-allocation": "workspace:*",
276
287
  "@agent-device/maestro": "workspace:*",
277
288
  "@agent-device/platform-android": "workspace:*",
278
289
  "@agent-device/platform-apple": "workspace:*",
@@ -282,30 +293,42 @@
282
293
  "@agent-device/platform-web": "workspace:*",
283
294
  "@agent-device/provider-limrun": "workspace:*",
284
295
  "@agent-device/provider-webdriver": "workspace:*",
296
+ "@agent-device/provision-kit": "workspace:*",
285
297
  "@agent-device/replay-test": "workspace:*",
286
298
  "@agent-device/selectors": "workspace:*",
299
+ "@agent-device/session-journal": "workspace:*",
287
300
  "@agent-device/xml": "workspace:*",
288
301
  "@arethetypeswrong/cli": "^0.18.5",
289
- "@chenglou/freerange": "^0.0.1",
290
- "@stryker-mutator/core": "9.6.1",
291
- "@stryker-mutator/vitest-runner": "9.6.1",
302
+ "@chenglou/freerange": "^0.0.4",
303
+ "@limrun/api": "^0.24.5",
304
+ "@nkzw/eslint-plugin": "^2.0.0",
305
+ "@nkzw/oxlint-config": "^1.3.0",
306
+ "@stryker-mutator/core": "10.0.0",
307
+ "@stryker-mutator/vitest-runner": "10.0.0",
292
308
  "@types/json-schema": "^7.0.15",
293
- "@types/node": "^22.19.21",
309
+ "@types/node": "^22.20.1",
294
310
  "@types/pngjs": "^6.0.5",
295
311
  "@types/tar-stream": "^3.1.4",
296
- "@types/yauzl": "^2.10.3",
297
- "@vitest/coverage-v8": "4.1.8",
298
- "ai": "^7.0.66",
299
- "fallow": "^2.95.0",
312
+ "@types/yauzl": "^3.4.0",
313
+ "@vitest/coverage-v8": "4.1.11",
314
+ "ai": "^7.0.68",
315
+ "eslint-plugin-no-only-tests": "^3.4.0",
316
+ "eslint-plugin-perfectionist": "^5.10.1",
317
+ "fallow": "^2.104.0",
300
318
  "fast-check": "^4.9.0",
301
- "oxc-parser": "^0.138.0",
302
- "oxfmt": "^0.42.0",
303
- "oxlint": "^1.69.0",
319
+ "ipaddr.js": "^2.5.0",
320
+ "oxc-parser": "^0.146.0",
321
+ "oxfmt": "^0.64.0",
322
+ "oxlint": "^1.79.0",
304
323
  "pngjs": "^7.0.0",
305
- "publint": "^0.3.22",
306
- "tsdown": "^0.22.4",
324
+ "publint": "^0.3.24",
325
+ "tar-stream": "^3.2.0",
326
+ "tsdown": "^0.22.14",
307
327
  "typescript": "^7.0.2",
308
- "vite": "^8.0.16",
309
- "vitest": "^4.1.8"
328
+ "undici": "7.29.0",
329
+ "vite": "^8.2.1",
330
+ "vitest": "^4.1.11",
331
+ "yaml": "^2.9.0",
332
+ "yauzl": "^3.4.0"
310
333
  }
311
334
  }
package/server.json CHANGED
@@ -7,15 +7,21 @@
7
7
  "url": "https://github.com/callstack/agent-device",
8
8
  "source": "github"
9
9
  },
10
- "version": "0.20.10",
10
+ "version": "0.21.1",
11
11
  "packages": [
12
12
  {
13
13
  "registryType": "npm",
14
14
  "identifier": "agent-device",
15
- "version": "0.20.10",
15
+ "version": "0.21.1",
16
16
  "transport": {
17
17
  "type": "stdio"
18
- }
18
+ },
19
+ "packageArguments": [
20
+ {
21
+ "type": "positional",
22
+ "value": "mcp"
23
+ }
24
+ ]
19
25
  }
20
26
  ]
21
27
  }
@@ -1 +0,0 @@
1
- 37cfdc9733315068659a6a4c1da8e65cd403e382401194f989f510fb0f320ba5 agent-device-android-ime-helper-0.20.10.apk
@@ -1 +0,0 @@
1
- a5e8c39ef8dc5ca6fc1959dfcd52b00bd7845ce584abc0930f8d4a517bd784cc agent-device-android-snapshot-helper-0.20.10.apk