agent-device 0.21.19 → 0.21.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (369) hide show
  1. package/android/ime-helper/dist/{agent-device-android-ime-helper-0.21.19.apk → agent-device-android-ime-helper-0.21.21.apk} +0 -0
  2. package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.21.apk.sha256 +1 -0
  3. package/android/ime-helper/dist/{agent-device-android-ime-helper-0.21.19.manifest.json → agent-device-android-ime-helper-0.21.21.manifest.json} +4 -4
  4. package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.21.apk +0 -0
  5. package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.21.apk.sha256 +1 -0
  6. package/android/snapshot-helper/dist/{agent-device-android-snapshot-helper-0.21.19.manifest.json → agent-device-android-snapshot-helper-0.21.21.manifest.json} +6 -6
  7. package/apple/macos-helper/Sources/AgentDeviceMacOSHelper/AppWindowScreenshot.swift +73 -0
  8. package/apple/macos-helper/Sources/AgentDeviceMacOSHelper/BackgroundInteraction.swift +557 -0
  9. package/apple/macos-helper/Sources/AgentDeviceMacOSHelper/GhostCursor.swift +141 -0
  10. package/apple/macos-helper/Sources/AgentDeviceMacOSHelper/SnapshotTraversal.swift +107 -3
  11. package/apple/macos-helper/Sources/AgentDeviceMacOSHelper/main.swift +136 -22
  12. package/apple/macos-helper/Tests/AgentDeviceMacOSHelperTests/BackgroundInteractionTests.swift +88 -0
  13. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunner/AgentDeviceRunnerApp.m +133 -4
  14. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSynthesizedGesture.h +10 -2
  15. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSynthesizedGesture.m +36 -9
  16. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Alert.swift +28 -0
  17. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandJournal.swift +1 -14
  18. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Interaction.swift +14 -16
  19. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Models.swift +67 -14
  20. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedCommitDeadline.swift +6 -1
  21. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedGesturePolicy.swift +7 -2
  22. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedInteraction.swift +21 -7
  23. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedTextEntry.swift +121 -17
  24. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntry.swift +179 -6
  25. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryConfirmation.swift +119 -0
  26. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryFocus.swift +8 -1
  27. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryReadiness.swift +23 -11
  28. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextInputProbe.swift +59 -6
  29. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextTyping.swift +112 -23
  30. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TypeExecution.swift +25 -12
  31. package/dist/apple/runner/AgentDeviceRunner/RecordingScripts/RecordingExportSupport.swift +6 -1
  32. package/dist/apple/runner/AgentDeviceRunner/RecordingScripts/recording-overlay.swift +43 -13
  33. package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotModels.swift +20 -5
  34. package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotPresentationProjection.swift +2 -15
  35. package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotVisibilityFold.swift +10 -25
  36. package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotVisibilityFoldProjection.swift +1 -18
  37. package/dist/src/adapter.js +1 -1
  38. package/dist/src/adb-executor.js +2 -2
  39. package/dist/src/adb-failure.js +1 -1
  40. package/dist/src/adb-transport.js +1 -1
  41. package/dist/src/agent-browser-lifecycle.js +1 -1
  42. package/dist/src/agent-browser-process-record.js +1 -1
  43. package/dist/src/agent-browser-provider.js +1 -1
  44. package/dist/src/agent-browser-tool.js +1 -1
  45. package/dist/src/agent-device-client.js +2 -2
  46. package/dist/src/ai-sdk.js +1 -1
  47. package/dist/src/alert-runtime.js +1 -1
  48. package/dist/src/alert.js +1 -0
  49. package/dist/src/android-adb.d.ts +12 -0
  50. package/dist/src/android-input-ownership.js +1 -1
  51. package/dist/src/app-backend.js +1 -0
  52. package/dist/src/app-catalog.js +1 -1
  53. package/dist/src/app-deployment-resolution.js +1 -1
  54. package/dist/src/app-inventory.js +1 -1
  55. package/dist/src/app-launch.js +2 -2
  56. package/dist/src/app-lifecycle.js +2 -2
  57. package/dist/src/app-lifecycle2.js +1 -1
  58. package/dist/src/app-log-files.js +1 -1
  59. package/dist/src/app-log-reconnect.js +1 -1
  60. package/dist/src/app-log-runtime2.js +3 -3
  61. package/dist/src/app-log-session-resource.js +1 -0
  62. package/dist/src/app-resolution.js +2 -2
  63. package/dist/src/apple-runner-platform.js +1 -1
  64. package/dist/src/application-lifecycle-interaction.js +1 -1
  65. package/dist/src/archive.js +2 -2
  66. package/dist/src/artifact-download.js +1 -1
  67. package/dist/src/auth-session.js +1 -1
  68. package/dist/src/auth.js +1 -1
  69. package/dist/src/back-mode.js +1 -1
  70. package/dist/src/backend-snapshot-options.js +1 -1
  71. package/dist/src/boot-diagnostics.js +1 -1
  72. package/dist/src/browser-launch.js +1 -1
  73. package/dist/src/cache.js +1 -1
  74. package/dist/src/capabilities.js +1 -1
  75. package/dist/src/capture.js +1 -1
  76. package/dist/src/cli-config.js +1 -1
  77. package/dist/src/cli-help.js +317 -323
  78. package/dist/src/cli-runner.js +1 -1
  79. package/dist/src/cli.js +4 -4
  80. package/dist/src/click-button.js +1 -1
  81. package/dist/src/client-metro-companion.js +1 -1
  82. package/dist/src/client-metro.js +1 -1
  83. package/dist/src/client-options.js +3 -0
  84. package/dist/src/client-types.d.ts +101 -6
  85. package/dist/src/clipboard-shell-response.js +1 -1
  86. package/dist/src/{scroll-command.d.ts → cloud-artifacts.d.ts} +249 -240
  87. package/dist/src/code-signature-cache.js +1 -1
  88. package/dist/src/code-signature.js +1 -1
  89. package/dist/src/command-schema.js +3 -3
  90. package/dist/src/command-tools.js +2 -2
  91. package/dist/src/command.js +1 -1
  92. package/dist/src/config.js +1 -1
  93. package/dist/src/connection-runtime.js +1 -1
  94. package/dist/src/connection.js +5 -5
  95. package/dist/src/contracts.d.ts +1 -1
  96. package/dist/src/contracts.js +1 -1
  97. package/dist/src/daemon-artifacts.js +1 -0
  98. package/dist/src/daemon-client-lease-beat.js +1 -1
  99. package/dist/src/daemon-client-lifecycle.js +1 -1
  100. package/dist/src/daemon-client-liveness-probe.js +1 -0
  101. package/dist/src/daemon-client-transport.js +1 -1
  102. package/dist/src/daemon-http.js +1 -0
  103. package/dist/src/daemon-policy-file.js +1 -1
  104. package/dist/src/daemon-registration-owner.js +1 -0
  105. package/dist/src/daemon-registration.js +1 -1
  106. package/dist/src/daemon-resolution.js +1 -1
  107. package/dist/src/daemon-shutdown-report.js +1 -1
  108. package/dist/src/daemon.js +2 -2
  109. package/dist/src/debug-symbols-facade.js +3 -3
  110. package/dist/src/device-claim-inspection.js +1 -1
  111. package/dist/src/device-claim-rule.js +1 -1
  112. package/dist/src/device-inventory-context.js +1 -1
  113. package/dist/src/device-readiness-runtime.js +1 -1
  114. package/dist/src/device-release.js +1 -1
  115. package/dist/src/device-rotation.js +1 -1
  116. package/dist/src/device-selection-resolver.js +1 -1
  117. package/dist/src/device-session.js +1 -1
  118. package/dist/src/device-shell.js +1 -1
  119. package/dist/src/device.js +1 -1
  120. package/dist/src/device2.js +1 -3
  121. package/dist/src/device3.js +3 -0
  122. package/dist/src/devicectl.js +1 -1
  123. package/dist/src/diagnostics.js +3 -3
  124. package/dist/src/dispatch-resolve.js +4 -1
  125. package/dist/src/display-inventory.js +1 -1
  126. package/dist/src/doctor-facade.js +1 -1
  127. package/dist/src/doctor2.js +1 -1
  128. package/dist/src/durable-capture-resource.js +1 -0
  129. package/dist/src/engine-eval-script.js +1 -1
  130. package/dist/src/error.js +1 -1
  131. package/dist/src/exec.js +1 -1
  132. package/dist/src/file.js +1 -1
  133. package/dist/src/find.js +1 -1
  134. package/dist/src/generic-settle.js +1 -1
  135. package/dist/src/generic.js +1 -1
  136. package/dist/src/gesture-admission.js +1 -1
  137. package/dist/src/gesture-plan.js +1 -1
  138. package/dist/src/gesture-runtime.js +1 -1
  139. package/dist/src/harmonyos.js +1 -1
  140. package/dist/src/hdc.js +1 -1
  141. package/dist/src/helper.js +2 -2
  142. package/dist/src/host-file.js +1 -1
  143. package/dist/src/host.js +1 -1
  144. package/dist/src/human-control-contract.js +1 -1
  145. package/dist/src/human-control.js +1 -1
  146. package/dist/src/index.d.ts +2 -2
  147. package/dist/src/index.js +1 -1
  148. package/dist/src/input-actions.js +1 -1
  149. package/dist/src/input-actions2.js +2 -2
  150. package/dist/src/install-artifact-facade.js +1 -1
  151. package/dist/src/install-source-network-transport.js +1 -1
  152. package/dist/src/install-source.d.ts +5 -0
  153. package/dist/src/install-source2.js +1 -1
  154. package/dist/src/instance-client.js +1 -0
  155. package/dist/src/interaction-positionals.js +1 -1
  156. package/dist/src/interaction-ref-policy.js +1 -1
  157. package/dist/src/interaction.js +1 -1
  158. package/dist/src/interaction2.js +1 -1
  159. package/dist/src/interactor-operation-binding.js +1 -1
  160. package/dist/src/interactor.js +5 -5
  161. package/dist/src/interactor2.js +1 -1
  162. package/dist/src/interactors.js +1 -1
  163. package/dist/src/internal/bin.js +1 -1
  164. package/dist/src/internal/daemon.js +1 -2
  165. package/dist/src/internal/png-worker.js +1 -1
  166. package/dist/src/internal/run-script-http-child.js +1 -1
  167. package/dist/src/inventory.js +4 -4
  168. package/dist/src/inventory2.js +1 -1
  169. package/dist/src/inventory3.js +1 -1
  170. package/dist/src/inventory5.js +1 -1
  171. package/dist/src/ios-client.js +4 -30
  172. package/dist/src/ios-settings.js +1 -0
  173. package/dist/src/ios-snapshot-engine.js +1 -1
  174. package/dist/src/ios-snapshot-runtime.js +1 -1
  175. package/dist/src/launch-confirmation.js +1 -0
  176. package/dist/src/lease-context.js +1 -1
  177. package/dist/src/lease-registry-scope.js +1 -0
  178. package/dist/src/lease-scope.js +1 -1
  179. package/dist/src/lease.js +1 -1
  180. package/dist/src/legacy-xctest-device-set.js +1 -1
  181. package/dist/src/limrun-download-file.js +1 -1
  182. package/dist/src/limrun-runtime-dependencies.js +1 -1
  183. package/dist/src/limrun.d.ts +78 -44
  184. package/dist/src/limrun.js +1 -1
  185. package/dist/src/linux.js +1 -1
  186. package/dist/src/load.js +1 -0
  187. package/dist/src/location-coordinates.js +1 -1
  188. package/dist/src/macos-facade.js +1 -1
  189. package/dist/src/managed-device-scope.js +1 -1
  190. package/dist/src/mechanics.js +16 -16
  191. package/dist/src/observation.js +1 -1
  192. package/dist/src/observe-until.js +1 -1
  193. package/dist/src/overlay.js +2 -2
  194. package/dist/src/owner-identity.js +3 -3
  195. package/dist/src/path-resolution.js +1 -1
  196. package/dist/src/perf-facade.js +1 -1
  197. package/dist/src/perf-runtime-operation-builder.js +1 -1
  198. package/dist/src/perf-runtime-plan.js +1 -1
  199. package/dist/src/perf-target.js +1 -1
  200. package/dist/src/perf.js +1 -1
  201. package/dist/src/physical-device-control.js +1 -1
  202. package/dist/src/platform-request-scope.js +1 -1
  203. package/dist/src/platform-runtime-android-adb-host.js +1 -1
  204. package/dist/src/platform-runtime-app-log-process.js +1 -1
  205. package/dist/src/platform-runtime-host.js +1 -1
  206. package/dist/src/platform-runtime-managed-owner.js +1 -1
  207. package/dist/src/platform-runtime-open-target.js +1 -1
  208. package/dist/src/platform-runtime-operation-host.js +2 -2
  209. package/dist/src/platform-runtime-runtime-hints.js +2 -2
  210. package/dist/src/platform-runtime-screen-recording-android-host.js +1 -1
  211. package/dist/src/platform-runtime-screen-recording-apple-runner-transport.js +1 -1
  212. package/dist/src/platform-runtime-screen-recording-apple-simulator-host.js +1 -1
  213. package/dist/src/platform-runtime-screen-recording-finalizer-host.js +1 -1
  214. package/dist/src/platform-runtime-screen-recording-output-host.js +1 -1
  215. package/dist/src/platform-runtime-screen-recording-process-host.js +1 -1
  216. package/dist/src/platform-runtime-unavailable.js +1 -1
  217. package/dist/src/platform-runtime.js +1 -1
  218. package/dist/src/platform-runtime2.js +1 -1
  219. package/dist/src/plugins.d.ts +9 -0
  220. package/dist/src/plugins.js +1 -0
  221. package/dist/src/plugins2.js +2 -0
  222. package/dist/src/png-crop-bytes.js +1 -1
  223. package/dist/src/png-size.js +1 -1
  224. package/dist/src/png-worker-client.js +1 -1
  225. package/dist/src/png.js +1 -1
  226. package/dist/src/prepare-kind.js +1 -1
  227. package/dist/src/process.js +1 -1
  228. package/dist/src/project-runtime.js +1 -1
  229. package/dist/src/provider-credential-fingerprint.js +1 -0
  230. package/dist/src/provider-device-admission.js +1 -1
  231. package/dist/src/provider-device-runtimes.js +1 -0
  232. package/dist/src/provider-limrun-credentials.js +1 -0
  233. package/dist/src/provider-profile-fields.js +1 -0
  234. package/dist/src/provider-session-ownership.js +2 -2
  235. package/dist/src/provider-webdriver.js +2 -1
  236. package/dist/src/providers.js +1 -1
  237. package/dist/src/proxy.js +1 -1
  238. package/dist/src/quality-warnings.js +1 -1
  239. package/dist/src/react-native.js +1 -1
  240. package/dist/src/record-runtime.js +1 -1
  241. package/dist/src/record-trace.js +1 -1
  242. package/dist/src/recording.js +1 -1
  243. package/dist/src/rect-center.js +1 -1
  244. package/dist/src/register-builtins.js +1 -1
  245. package/dist/src/registry.js +52 -36
  246. package/dist/src/remote-config2.js +1 -1
  247. package/dist/src/replay-divergence.js +1 -1
  248. package/dist/src/replay.js +2 -2
  249. package/dist/src/reporting.js +5 -5
  250. package/dist/src/request-admission.js +1 -1
  251. package/dist/src/request-cancel.js +1 -1
  252. package/dist/src/request-cancellation.js +1 -1
  253. package/dist/src/request-runtime-binding.js +1 -1
  254. package/dist/src/result-serialization.js +1 -1
  255. package/dist/src/retry.js +1 -1
  256. package/dist/src/runner-artifact-manifest.js +1 -1
  257. package/dist/src/runner-cache-metadata.js +3 -3
  258. package/dist/src/runner-client.js +1 -1
  259. package/dist/src/runner-dev-tools-security.js +1 -1
  260. package/dist/src/runner-device-readiness.js +1 -1
  261. package/dist/src/runner-disposal.js +1 -1
  262. package/dist/src/runner-error-classification.js +2 -2
  263. package/dist/src/runner-exchange.js +1 -1
  264. package/dist/src/runner-operations-facade.js +1 -1
  265. package/dist/src/runner-session-types.js +1 -1
  266. package/dist/src/runner-start-budget.js +1 -1
  267. package/dist/src/runner.js +1 -1
  268. package/dist/src/runtime-admission.js +1 -1
  269. package/dist/src/runtime-transport-hints.js +1 -1
  270. package/dist/src/runtime.js +1 -1
  271. package/dist/src/runtime10.js +2 -2
  272. package/dist/src/runtime2.js +3 -3
  273. package/dist/src/runtime3.js +1 -1
  274. package/dist/src/runtime4.js +5 -5
  275. package/dist/src/runtime5.js +1 -1
  276. package/dist/src/runtime6.js +1 -1
  277. package/dist/src/runtime7.js +1 -1
  278. package/dist/src/runtime8.js +1 -1
  279. package/dist/src/runtime9.js +1 -1
  280. package/dist/src/screen-recording-admission-ledger.js +1 -1
  281. package/dist/src/screen-recording-completion.js +1 -1
  282. package/dist/src/screen-recording-options.js +1 -1
  283. package/dist/src/screen-recording-resource-recovery.js +1 -1
  284. package/dist/src/screen-recording-transport.js +1 -1
  285. package/dist/src/screenshot-density.js +1 -1
  286. package/dist/src/screenshot-image.js +1 -1
  287. package/dist/src/screenshot-result.js +1 -1
  288. package/dist/src/screenshot-runtime.js +1 -1
  289. package/dist/src/screenshot.js +1 -1
  290. package/dist/src/screenshot3.js +1 -1
  291. package/dist/src/script.js +1 -1
  292. package/dist/src/scroll-command.js +1 -1
  293. package/dist/src/scroll-gesture.js +1 -1
  294. package/dist/src/sdk-batch-runner.js +2 -2
  295. package/dist/src/sdk-batch.js +2 -2
  296. package/dist/src/sdk-contracts.d.ts +47 -2
  297. package/dist/src/sdk-contracts.js +2 -2
  298. package/dist/src/sdk-device.js +1 -1
  299. package/dist/src/sdk-io.js +1 -1
  300. package/dist/src/sdk-remote-config.js +1 -1
  301. package/dist/src/sdk-selectors.d.ts +37 -8
  302. package/dist/src/selection.js +0 -0
  303. package/dist/src/selector-runtime.js +1 -1
  304. package/dist/src/selectors.d.ts +2 -2
  305. package/dist/src/selectors.js +1 -1
  306. package/dist/src/server.js +1 -1
  307. package/dist/src/session-allocation.js +1 -1
  308. package/dist/src/session-artifact-paths.js +1 -1
  309. package/dist/src/session-repair-tombstone.js +1 -1
  310. package/dist/src/session-routing.js +1 -1
  311. package/dist/src/session-runtime-admission.js +1 -1
  312. package/dist/src/session-snapshot.js +1 -1
  313. package/dist/src/session-stream.js +27 -0
  314. package/dist/src/session.js +1 -1
  315. package/dist/src/session2.js +5 -5
  316. package/dist/src/settings.js +1 -1
  317. package/dist/src/settings2.js +1 -1
  318. package/dist/src/simctl-settings-facade.js +1 -0
  319. package/dist/src/simctl-settings.js +1 -0
  320. package/dist/src/simctl.js +1 -1
  321. package/dist/src/simulator-boot.js +1 -1
  322. package/dist/src/simulator.js +1 -1
  323. package/dist/src/snapshot-diagnostics.js +1 -1
  324. package/dist/src/snapshot-runtime-binding.js +1 -1
  325. package/dist/src/snapshot-runtime.js +1 -1
  326. package/dist/src/snapshot-state.js +1 -1
  327. package/dist/src/snapshot2.js +1 -1
  328. package/dist/src/snapshot3.js +1 -1
  329. package/dist/src/snapshot4.js +1 -1
  330. package/dist/src/src.js +1 -1
  331. package/dist/src/src7.js +1 -1
  332. package/dist/src/src8.js +2 -2
  333. package/dist/src/store.js +1 -0
  334. package/dist/src/string-enum.js +1 -1
  335. package/dist/src/surface-snapshot.js +1 -1
  336. package/dist/src/takeover.js +1 -1
  337. package/dist/src/target-evidence.js +1 -1
  338. package/dist/src/telemetry.js +1 -1
  339. package/dist/src/text-entry-focus.js +1 -1
  340. package/dist/src/tool-provider.js +3 -3
  341. package/dist/src/tool-provider2.js +1 -1
  342. package/dist/src/tool-provider3.js +1 -1
  343. package/dist/src/toolchain-probe.js +2 -2
  344. package/dist/src/touch-runtime.js +1 -1
  345. package/dist/src/touch-runtime2.js +1 -1
  346. package/dist/src/transport.js +2 -2
  347. package/dist/src/tv-remote.js +1 -1
  348. package/dist/src/type-text-runtime.js +1 -1
  349. package/dist/src/update-check.js +1 -1
  350. package/dist/src/vars.js +1 -1
  351. package/dist/src/verified-file.js +1 -1
  352. package/dist/src/version.js +1 -1
  353. package/dist/src/video.js +1 -1
  354. package/dist/src/viewport.js +1 -1
  355. package/dist/src/web.js +1 -1
  356. package/dist/src/web2.js +1 -1
  357. package/dist/src/webdriver-source.js +1 -1
  358. package/package.json +5 -1
  359. package/server.json +2 -2
  360. package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.19.apk.sha256 +0 -1
  361. package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.19.apk +0 -0
  362. package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.19.apk.sha256 +0 -1
  363. package/dist/src/api.js +0 -3
  364. package/dist/src/daemon-process.js +0 -1
  365. package/dist/src/multitouch-support.js +0 -1
  366. package/dist/src/parameterized-recorded-fill.js +0 -1
  367. package/dist/src/runner-startup-transport.js +0 -1
  368. package/dist/src/runner-xctestrun.js +0 -1
  369. package/dist/src/session-store.js +0 -4
@@ -1 +1 @@
1
- import{N as e}from"./sdk-contracts.js";import{t}from"./capture.js";import{i as n}from"./catalog.js";import{a as r,r as i}from"./back-mode.js";import{a,s as o}from"./sdk-remote-config.js";import{C as s,f as c}from"./registry.js";import{n as l,t as u}from"./path-resolution.js";import"./file.js";import{n as d}from"./command-schema.js";import f from"node:path";import p from"node:fs";const m=new Set([`config`,`remoteConfig`,`help`,`version`,`batchSteps`,`githubActionsArtifact`]),h=new Set([`appsFilter`,`iosSimulatorDeviceSet`]),g=S(),_=new Map(g.map(e=>[e.key,e]));function v(e){return _.get(e)}function y(e){return g.filter(t=>t.configurable&&t.supportsCommand(e))}function b(e,t){return v(e)?.supportsCommand(t)??!1}function x(e,t,n,r){return o(T(e),t,n,r)}function S(){let e=new Map;for(let t of i()){let n=e.get(t.key);n?n.push(t):e.set(t.key,[t])}let t=new Map;for(let e of s)t.set(e,new Set([`*`]));for(let e of n()){let n=d(e);for(let r of[...n.allowedFlags??[],...n.supportedFlags??[]]){let n=t.get(r);n&&n.has(`*`)||(n?n.add(e):t.set(r,new Set([e])))}}return[...e.entries()].map(([e,n])=>({key:e,flagDefinitions:n,configurable:!m.has(e),env:{names:h.has(e)?[]:[a(e)]},supportsCommand(n){let r=t.get(e);return r?r.has(`*`)?!0:n?r.has(n):!1:!1}})).sort((e,t)=>C(e.key,t.key))}function C(e,t){let n=e.toLowerCase(),r=t.toLowerCase();return n===r?e<t?-1:+(e>t):n<r?-1:1}function w(e){let t=e.flagDefinitions[0];if(!t)throw Error(`Missing flag definition for option ${e.key}`);return t}function T(e){let t=e.flagDefinitions.find(e=>e.setValue===void 0);if(t)return t;let n=w(e);if(n.type===`enum`){let t=n.enumValues??e.flagDefinitions.map(e=>e.setValue).filter(e=>e!==void 0);return{...n,setValue:void 0,enumValues:t}}return n}function E(e,t){for(let[n,r]of Object.entries(t))r!==void 0&&(e[n]=r);return e}function D(e){let t=e.env??process.env;return E(E({},M(k(e.cwd,e.cliFlags.config,t))),I(t,e.command))}const O=r();function k(e,t,n){let r=t??n.AGENT_DEVICE_CONFIG;return r?[{path:j(r,e,n),required:!0,source:`explicit`}]:[{path:A(n),required:!1,source:`user`},{path:f.resolve(e,`agent-device.json`),required:!1,source:`project`}]}function A(e){return f.join(u(`~`,{env:e}),`.agent-device`,`config.json`)}function j(e,t,n){return l(e,{cwd:t,env:n})}function M(e){let t={};for(let n of e)E(t,N(n));return t}function N(t){let{path:n,required:r}=t;if(!p.existsSync(n)){if(r)throw new e(`INVALID_ARGS`,`Config file not found: ${n}`);return{}}let i;try{i=p.readFileSync(n,`utf8`)}catch(t){throw new e(`INVALID_ARGS`,`Failed to read config file: ${n}`,{cause:t instanceof Error?t.message:String(t)})}let a;try{a=JSON.parse(i)}catch(t){throw new e(`INVALID_ARGS`,`Invalid JSON in config file: ${n}`,{cause:t instanceof Error?t.message:String(t)})}if(!a||typeof a!=`object`||Array.isArray(a))throw new e(`INVALID_ARGS`,`Config file must contain a JSON object: ${n}`);return P(a,{source:t.source,label:`${t.source===`project`?`project `:``}config file ${n}`})}function P(n,r){let i={};for(let[a,o]of Object.entries(n)){let n=a,s=v(n);if(!s)throw a===t.flagKey?new e(`INVALID_ARGS`,`Config key "${a}" in ${r.label} was removed; use "screenshotScale" (0.01-1) to downscale screenshots. Recordings capture at native resolution.`):new e(`INVALID_ARGS`,`Unknown config key "${a}" in ${r.label}.`);if(!s.configurable)throw new e(`INVALID_ARGS`,`Config key "${a}" is not allowed in ${r.label}. This key is not supported in config files.`);if(r.source===`project`&&!O.has(n))throw new e(`INVALID_ARGS`,`Config key "${a}" is not allowed in ${r.label}. Move it to ~/.agent-device/config.json, pass it with --config or AGENT_DEVICE_CONFIG, or provide it through CLI flags/environment variables.`);if(n===`installSource`){i.installSource=c(o,r.label);continue}i[n]=x(s,o,r.label,a)}return i}const F=new Set([`screenshot`,`record`]);function I(n,r){let i=n[t.envVar];if(r!==null&&F.has(r)&&typeof i==`string`&&i.trim().length>0)throw new e(`INVALID_ARGS`,`${t.envVar} was removed. ${t.migration[r===`record`?`record`:`screenshot`]}`);let a={};for(let e of y(r)){if(e.key===`installSource`)continue;let t=e.env.names.map(e=>({name:e,value:n[e]})).find(e=>typeof e.value==`string`&&e.value.trim().length>0);t&&(a[e.key]=x(e,t.value,`environment variable ${t.name}`,t.name))}return a}export{E as n,b as r,D as t};
1
+ import{P as e}from"./sdk-contracts.js";import{t}from"./capture.js";import{v as n}from"./sdk-batch-runner.js";import{i as r}from"./catalog.js";import{a as i,r as a}from"./back-mode.js";import{a as o,s}from"./sdk-remote-config.js";import{p as c,w as l}from"./registry.js";import{n as u,t as d}from"./path-resolution.js";import"./file.js";import{n as f}from"./command-schema.js";import p from"node:fs";import m from"node:path";const h=new Set([`config`,`remoteConfig`,`help`,`version`,`batchSteps`,`githubActionsArtifact`]),g=new Set([`appsFilter`,`iosSimulatorDeviceSet`]),_=C(),v=new Map(_.map(e=>[e.key,e]));function y(e){return v.get(e)}function b(e){return _.filter(t=>t.configurable&&t.supportsCommand(e))}function x(e,t){return y(e)?.supportsCommand(t)??!1}function S(e,t,n,r){return s(E(e),t,n,r)}function C(){let e=new Map;for(let t of a()){let n=e.get(t.key);n?n.push(t):e.set(t.key,[t])}let t=new Map;for(let e of l)t.set(e,new Set([`*`]));for(let e of r()){let n=f(e);for(let r of[...n.allowedFlags??[],...n.supportedFlags??[]]){let n=t.get(r);n&&n.has(`*`)||(n?n.add(e):t.set(r,new Set([e])))}}return[...e.entries()].map(([e,n])=>({key:e,flagDefinitions:n,configurable:!h.has(e),env:{names:g.has(e)?[]:[o(e)]},supportsCommand(n){let r=t.get(e);return r?r.has(`*`)?!0:n?r.has(n):!1:!1}})).sort((e,t)=>w(e.key,t.key))}function w(e,t){let n=e.toLowerCase(),r=t.toLowerCase();return n===r?e<t?-1:+(e>t):n<r?-1:1}function T(e){let t=e.flagDefinitions[0];if(!t)throw Error(`Missing flag definition for option ${e.key}`);return t}function E(e){let t=e.flagDefinitions.find(e=>e.setValue===void 0);if(t)return t;let n=T(e);if(n.type===`enum`){let t=n.enumValues??e.flagDefinitions.map(e=>e.setValue).filter(e=>e!==void 0);return{...n,setValue:void 0,enumValues:t}}return n}function D(e,t){for(let[n,r]of Object.entries(t))r!==void 0&&(e[n]=r);return e}function O(e){let t=e.env??process.env;return D(D({},N(A(e.cwd,e.cliFlags.config,t))),L(t,e.command))}const k=i();function A(e,t,n){let r=t??n.AGENT_DEVICE_CONFIG;return r?[{path:M(r,e,n),required:!0,source:`explicit`}]:[{path:j(n),required:!1,source:`user`},{path:m.resolve(e,`agent-device.json`),required:!1,source:`project`}]}function j(t){let n=t.AGENT_DEVICE_HOME?d(t.AGENT_DEVICE_HOME,{env:t}):m.join(d(`~`,{env:t}),`.agent-device`);if(!m.isAbsolute(n))throw new e(`INVALID_ARGS`,`AGENT_DEVICE_HOME must be absolute or ~/...`);return m.join(n,`config.json`)}function M(e,t,n){return u(e,{cwd:t,env:n})}function N(e){let t={};for(let n of e)D(t,P(n));return t}function P(t){let{path:r,required:i}=t;if(!p.existsSync(r)){if(i)throw new e(`INVALID_ARGS`,`Config file not found: ${r}`);return{}}let a;try{a=p.readFileSync(r,`utf8`)}catch(t){throw new e(`INVALID_ARGS`,`Failed to read config file: ${r}`,{cause:t instanceof Error?t.message:String(t)})}let o;try{o=JSON.parse(a)}catch(t){throw new e(`INVALID_ARGS`,`Invalid JSON in config file: ${r}`,{cause:t instanceof Error?t.message:String(t)})}if(!n(o))throw new e(`INVALID_ARGS`,`Config file must contain a JSON object: ${r}`);return F(o,{source:t.source,label:`${t.source===`project`?`project `:``}config file ${r}`})}function F(n,r){let i={},a=Object.entries(n).filter(([e])=>e!==`plugins`||r.source!==`user`);for(let[n,o]of a){let a=n,s=y(a);if(!s)throw n===t.flagKey?new e(`INVALID_ARGS`,`Config key "${n}" in ${r.label} was removed; use "screenshotScale" (0.01-1) to downscale screenshots. Recordings capture at native resolution.`):new e(`INVALID_ARGS`,`Unknown config key "${n}" in ${r.label}.`);if(!s.configurable)throw new e(`INVALID_ARGS`,`Config key "${n}" is not allowed in ${r.label}. This key is not supported in config files.`);if(r.source===`project`&&!k.has(a))throw new e(`INVALID_ARGS`,`Config key "${n}" is not allowed in ${r.label}. Move it to ~/.agent-device/config.json, pass it with --config or AGENT_DEVICE_CONFIG, or provide it through CLI flags/environment variables.`);if(a===`installSource`){i.installSource=c(o,r.label);continue}i[a]=S(s,o,r.label,n)}return i}const I=new Set([`screenshot`,`record`]);function L(n,r){let i=n[t.envVar];if(r!==null&&I.has(r)&&typeof i==`string`&&i.trim().length>0)throw new e(`INVALID_ARGS`,`${t.envVar} was removed. ${t.migration[r===`record`?`record`:`screenshot`]}`);let a={};for(let e of b(r)){if(e.key===`installSource`)continue;let t=e.env.names.map(e=>({name:e,value:n[e]})).find(e=>typeof e.value==`string`&&e.value.trim().length>0);t&&(a[e.key]=S(e,t.value,`environment variable ${t.name}`,t.name))}return a}export{x as i,j as n,D as r,O as t};