agent-device 0.21.23 → 0.21.24

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 (258) hide show
  1. package/README.md +6 -6
  2. package/android/ime-helper/dist/{agent-device-android-ime-helper-0.21.23.apk → agent-device-android-ime-helper-0.21.24.apk} +0 -0
  3. package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.24.apk.sha256 +1 -0
  4. package/android/ime-helper/dist/{agent-device-android-ime-helper-0.21.23.manifest.json → agent-device-android-ime-helper-0.21.24.manifest.json} +4 -4
  5. package/android/snapshot-helper/dist/{agent-device-android-snapshot-helper-0.21.23.apk → agent-device-android-snapshot-helper-0.21.24.apk} +0 -0
  6. package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.24.apk.sha256 +1 -0
  7. package/android/snapshot-helper/dist/{agent-device-android-snapshot-helper-0.21.23.manifest.json → agent-device-android-snapshot-helper-0.21.24.manifest.json} +6 -6
  8. package/apple/macos-helper/Sources/AgentDeviceMacOSHelper/SnapshotTraversal.swift +12 -6
  9. package/apple/macos-helper/Tests/AgentDeviceMacOSHelperTests/RectResponseTests.swift +21 -0
  10. package/apple/snapshot-bridge/README.md +9 -7
  11. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandDispatch.swift +56 -0
  12. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift +14 -5
  13. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Lifecycle.swift +8 -0
  14. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Models.swift +12 -0
  15. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotCaptureTarget.swift +1 -1
  16. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotExecution.swift +29 -5
  17. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntry.swift +34 -10
  18. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryFocus.swift +19 -5
  19. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextTyping.swift +3 -3
  20. package/dist/src/adapter.js +1 -1
  21. package/dist/src/adb.js +1 -1
  22. package/dist/src/agent-browser-lifecycle.js +1 -1
  23. package/dist/src/agent-browser-process-record.js +1 -1
  24. package/dist/src/agent-browser-provider.js +1 -1
  25. package/dist/src/agent-device-client.js +2 -2
  26. package/dist/src/alert-runtime.js +1 -1
  27. package/dist/src/alert.js +1 -1
  28. package/dist/src/android-adb.d.ts +3 -2
  29. package/dist/src/android-input-ownership.js +1 -1
  30. package/dist/src/app-backend.js +1 -1
  31. package/dist/src/app-inventory.d.ts +4 -0
  32. package/dist/src/app-launch.js +1 -1
  33. package/dist/src/app-lifecycle.js +1 -1
  34. package/dist/src/app-log-runtime2.js +3 -3
  35. package/dist/src/app-resolution.js +2 -2
  36. package/dist/src/app-state-runtime.d.ts +15 -0
  37. package/dist/src/apple-runner-platform.js +1 -1
  38. package/dist/src/application-lifecycle-interaction.js +1 -1
  39. package/dist/src/aws-device-farm-connection.js +1 -0
  40. package/dist/src/back-mode.js +1 -1
  41. package/dist/src/backend-snapshot-options.js +1 -1
  42. package/dist/src/browserstack-connection.js +1 -0
  43. package/dist/src/browserstack-device-features.js +1 -0
  44. package/dist/src/browserstack.js +1 -0
  45. package/dist/src/cache.js +1 -1
  46. package/dist/src/cli-config.js +1 -1
  47. package/dist/src/cli-help.js +35 -19
  48. package/dist/src/cli-runner.js +1 -1
  49. package/dist/src/cli.js +3 -4
  50. package/dist/src/client-companion-tunnel.js +1 -0
  51. package/dist/src/client-metro-companion.js +1 -1
  52. package/dist/src/client-metro.js +1 -1
  53. package/dist/src/client-types.d.ts +7 -5
  54. package/dist/src/cloud-artifacts.d.ts +3 -2
  55. package/dist/src/command-metadata.js +1 -1
  56. package/dist/src/command-schema.js +1 -1
  57. package/dist/src/command-tools.js +2 -2
  58. package/dist/src/connection-runtime.js +1 -1
  59. package/dist/src/connection-verification.js +1 -0
  60. package/dist/src/connection.js +5 -5
  61. package/dist/src/contracts.d.ts +1 -1
  62. package/dist/src/daemon-client-lease-beat.js +1 -1
  63. package/dist/src/daemon-client-lifecycle.js +1 -1
  64. package/dist/src/daemon-client-transport.js +1 -1
  65. package/dist/src/daemon-http.js +1 -1
  66. package/dist/src/daemon-policy-file.js +1 -1
  67. package/dist/src/daemon-registration-owner.js +1 -1
  68. package/dist/src/device-claim-inspection.js +1 -1
  69. package/dist/src/device-input-state.d.ts +2 -15
  70. package/dist/src/device-readiness-runtime.js +1 -1
  71. package/dist/src/device-selection-resolver.js +1 -1
  72. package/dist/src/device.js +1 -1
  73. package/dist/src/device2.js +1 -1
  74. package/dist/src/device3.js +1 -1
  75. package/dist/src/dispatch-resolve.js +3 -3
  76. package/dist/src/doctor-facade.js +1 -1
  77. package/dist/src/durable-capture-resource.js +1 -1
  78. package/dist/src/durable-resource.js +1 -1
  79. package/dist/src/exec.js +1 -1
  80. package/dist/src/file.js +1 -1
  81. package/dist/src/find.js +1 -1
  82. package/dist/src/finders.js +1 -1
  83. package/dist/src/format.js +2 -1
  84. package/dist/src/gesture-admission.js +1 -1
  85. package/dist/src/gesture-plan-types.d.ts +2 -5
  86. package/dist/src/gesture-runtime.js +1 -1
  87. package/dist/src/human-control.js +1 -1
  88. package/dist/src/ime-rebind.js +1 -1
  89. package/dist/src/ime-settings-record.js +1 -0
  90. package/dist/src/ime-state.js +1 -1
  91. package/dist/src/index.d.ts +3 -3
  92. package/dist/src/input-actions.js +1 -1
  93. package/dist/src/input-actions2.js +1 -1
  94. package/dist/src/install-source2.js +1 -1
  95. package/dist/src/interaction-positionals.js +1 -1
  96. package/dist/src/interaction-ref-policy.js +1 -1
  97. package/dist/src/interaction.js +1 -1
  98. package/dist/src/interaction2.js +1 -1
  99. package/dist/src/interactor.js +5 -5
  100. package/dist/src/interactors.js +1 -1
  101. package/dist/src/internal/bin.js +1 -1
  102. package/dist/src/internal/daemon.js +1 -1
  103. package/dist/src/inventory2.js +1 -1
  104. package/dist/src/ios-snapshot-acquisition.js +1 -1
  105. package/dist/src/ios-snapshot-engine.js +1 -1
  106. package/dist/src/ios-snapshot-runtime.js +1 -1
  107. package/dist/src/launch-confirmation.js +1 -1
  108. package/dist/src/lease-scope.js +1 -1
  109. package/dist/src/lease.js +1 -1
  110. package/dist/src/limrun.d.ts +4 -555
  111. package/dist/src/load.js +1 -1
  112. package/dist/src/local-interactor-operation-set.js +1 -1
  113. package/dist/src/managed-device-scope.js +1 -1
  114. package/dist/src/manifest.js +1 -0
  115. package/dist/src/mechanics.js +16 -16
  116. package/dist/src/mobile-snapshot-semantics.js +1 -1
  117. package/dist/src/observation.js +1 -2
  118. package/dist/src/overlay.js +3 -3
  119. package/dist/src/owner-identity.js +3 -3
  120. package/dist/src/perf-facade.js +1 -1
  121. package/dist/src/perf-runtime-plan.js +1 -1
  122. package/dist/src/perf-target.js +1 -1
  123. package/dist/src/physical-device-control.js +1 -1
  124. package/dist/src/platform-request-scope.js +1 -1
  125. package/dist/src/platform-runtime-open-target.js +1 -1
  126. package/dist/src/platform-runtime-operation-host.js +4 -4
  127. package/dist/src/platform-runtime-runtime-hints.js +1 -1
  128. package/dist/src/platform-runtime-screen-recording-finalizer-host.js +1 -1
  129. package/dist/src/platform-runtime-unavailable.js +1 -1
  130. package/dist/src/platform-runtime.js +1 -1
  131. package/dist/src/platform-runtime2.js +1 -1
  132. package/dist/src/plugin.js +1 -0
  133. package/dist/src/plugins/webdriver.d.ts +111 -0
  134. package/dist/src/plugins/webdriver.js +1 -0
  135. package/dist/src/plugins.d.ts +2 -1
  136. package/dist/src/plugins2.js +1 -1
  137. package/dist/src/process-exit.js +1 -1
  138. package/dist/src/process.js +1 -1
  139. package/dist/src/provider-credential-fingerprint.js +1 -1
  140. package/dist/src/provider-device-admission.js +1 -1
  141. package/dist/src/provider-device-runtime.d.ts +556 -0
  142. package/dist/src/provider-policy.js +1 -0
  143. package/dist/src/provider-profile-fields.js +1 -1
  144. package/dist/src/provider-webdriver.js +1 -2
  145. package/dist/src/providers.js +1 -1
  146. package/dist/src/react-devtools.js +2 -0
  147. package/dist/src/react-native.js +1 -1
  148. package/dist/src/record-runtime.js +1 -1
  149. package/dist/src/record-trace.js +1 -1
  150. package/dist/src/recording.js +1 -1
  151. package/dist/src/registry.js +24 -24
  152. package/dist/src/remote-bridge.js +1 -0
  153. package/dist/src/remote-config-core.js +1 -0
  154. package/dist/src/remote-config.js +1 -1
  155. package/dist/src/remote-config2.js +1 -1
  156. package/dist/src/remote-connection-state.js +1 -0
  157. package/dist/src/replay.js +2 -2
  158. package/dist/src/request-admission.js +1 -1
  159. package/dist/src/request-runtime-binding.js +1 -1
  160. package/dist/src/result-serialization.js +1 -1
  161. package/dist/src/retry.js +1 -1
  162. package/dist/src/retry2.js +1 -0
  163. package/dist/src/runner-artifact-manifest.js +1 -1
  164. package/dist/src/runner-cache-metadata.js +2 -3
  165. package/dist/src/runner-cache-retention.js +1 -0
  166. package/dist/src/runner-cache-trim.js +1 -0
  167. package/dist/src/runner-client.js +1 -1
  168. package/dist/src/runner-dev-tools-security.js +1 -1
  169. package/dist/src/runner-device-readiness.js +1 -1
  170. package/dist/src/runner-device-set.js +1 -0
  171. package/dist/src/runner-disposal.js +1 -1
  172. package/dist/src/runner-error-classification.js +1 -1
  173. package/dist/src/runner-exchange.js +1 -1
  174. package/dist/src/runner-lease.js +1 -0
  175. package/dist/src/runner-operations-facade.js +1 -1
  176. package/dist/src/runner-session-types.js +1 -1
  177. package/dist/src/runner-start-budget.js +1 -1
  178. package/dist/src/runner-toolchain-probe.js +2 -0
  179. package/dist/src/runner.js +1 -1
  180. package/dist/src/runtime-deployment.js +1 -0
  181. package/dist/src/runtime.js +1 -1
  182. package/dist/src/runtime10.js +1 -2
  183. package/dist/src/runtime11.js +2 -0
  184. package/dist/src/runtime2.js +2 -5
  185. package/dist/src/runtime3.js +5 -1
  186. package/dist/src/runtime4.js +1 -5
  187. package/dist/src/runtime5.js +5 -1
  188. package/dist/src/runtime6.js +1 -1
  189. package/dist/src/runtime7.js +1 -1
  190. package/dist/src/runtime8.js +1 -1
  191. package/dist/src/runtime9.js +1 -1
  192. package/dist/src/screen-recording-transport.js +1 -1
  193. package/dist/src/screenshot-density.js +1 -1
  194. package/dist/src/screenshot3.js +2 -2
  195. package/dist/src/script.js +1 -1
  196. package/dist/src/scroll-gesture.js +1 -1
  197. package/dist/src/sdk-batch.js +2 -2
  198. package/dist/src/sdk-contracts.d.ts +20 -29
  199. package/dist/src/sdk-contracts.js +2 -2
  200. package/dist/src/sdk-device.js +1 -1
  201. package/dist/src/sdk-finders.d.ts +1 -1
  202. package/dist/src/sdk-finders.js +1 -1
  203. package/dist/src/sdk-remote-config.d.ts +4 -0
  204. package/dist/src/sdk-remote-config.js +1 -1
  205. package/dist/src/sdk-selectors.d.ts +1 -1
  206. package/dist/src/sdk-selectors.js +1 -1
  207. package/dist/src/selection.js +0 -0
  208. package/dist/src/selector-pipeline-policy.js +1 -1
  209. package/dist/src/selector-runtime.js +1 -1
  210. package/dist/src/selectors.js +1 -1
  211. package/dist/src/server.js +2 -2
  212. package/dist/src/session-snapshot.js +1 -1
  213. package/dist/src/session2.js +5 -5
  214. package/dist/src/simctl.js +1 -1
  215. package/dist/src/simulator-boot.js +1 -1
  216. package/dist/src/simulator-state.js +1 -1
  217. package/dist/src/simulator.js +1 -1
  218. package/dist/src/snapshot-capture-annotations.js +1 -1
  219. package/dist/src/snapshot-desktop-projection.js +1 -1
  220. package/dist/src/snapshot-private-evidence.js +1 -0
  221. package/dist/src/snapshot-runtime-binding.js +1 -1
  222. package/dist/src/snapshot-runtime.js +1 -1
  223. package/dist/src/snapshot-state.js +1 -1
  224. package/dist/src/snapshot4.js +1 -1
  225. package/dist/src/src2.js +1 -1
  226. package/dist/src/src3.js +1 -1
  227. package/dist/src/src4.js +1 -1
  228. package/dist/src/src5.js +1 -1
  229. package/dist/src/src6.js +1 -1
  230. package/dist/src/src7.js +1 -1
  231. package/dist/src/src8.js +20 -20
  232. package/dist/src/store.js +1 -1
  233. package/dist/src/target-evidence.js +1 -1
  234. package/dist/src/text-entry-focus.js +1 -1
  235. package/dist/src/tool-provider2.js +1 -1
  236. package/dist/src/touch-runtime2.js +1 -1
  237. package/dist/src/tree.js +1 -1
  238. package/dist/src/type-text-runtime.js +1 -1
  239. package/dist/src/video.js +1 -1
  240. package/package.json +15 -10
  241. package/server.json +2 -2
  242. package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.23.apk.sha256 +0 -1
  243. package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.23.apk.sha256 +0 -1
  244. package/dist/src/capabilities.js +0 -1
  245. package/dist/src/compatibility-policy.js +0 -1
  246. package/dist/src/daemon-artifacts.js +0 -1
  247. package/dist/src/device-claim-rule.js +0 -1
  248. package/dist/src/human-control-contract.js +0 -1
  249. package/dist/src/prepare-kind.js +0 -1
  250. package/dist/src/provider-device-runtimes.js +0 -1
  251. package/dist/src/screen-recording-admission-ledger.js +0 -1
  252. package/dist/src/screenshot-runtime.js +0 -1
  253. package/dist/src/session-routing.js +0 -1
  254. package/dist/src/session-runtime-admission.js +0 -1
  255. package/dist/src/timeouts.js +0 -1
  256. package/dist/src/touch-reference-frame.js +0 -1
  257. package/dist/src/vars.js +0 -2
  258. package/dist/src/viewport.js +0 -1
@@ -1,558 +1,7 @@
1
- import { A as Rect, D as IosTargetActivation, F as SnapshotOptions$1, I as SnapshotProvenance, N as SnapshotKeyboardBandFact, O as Point, S as DeviceTarget, b as DeviceInfo, f as LeaseBackend, k as RawSnapshotNode, w as PlatformSelector, x as DeviceKind } from "./sdk-contracts.js";
2
- import { s as AppsFilter, t as GesturePlan } from "./gesture-plan-types.js";
3
- import { d as AndroidAdbProvider, m as AppStateRuntimeResult, n as AndroidKeyboardState, s as AndroidInputOwner, t as AndroidKeyboardDismissResult } from "./device-input-state.js";
4
- import { A as BackMode, E as DeviceRotation, a as BackendSnapshotResult, b as ScrollExecutionOptions, g as SettingOptions, h as ReadableSetting, l as SessionSurface, m as ReadSettingResult, n as CloudArtifactProvider, v as TvRemoteButton, x as ScrollDirection } from "./cloud-artifacts.js";
5
- //#region packages/contracts/src/device-inventory.d.ts
6
- type DeviceInventoryRequest = {
7
- platform?: PlatformSelector;
8
- target?: DeviceTarget;
9
- deviceName?: string;
10
- udid?: string;
11
- serial?: string;
12
- leaseId?: string;
13
- leaseProvider?: string;
14
- deviceKey?: string;
15
- clientId?: string;
16
- iosSimulatorSetPath?: string;
17
- androidSerialAllowlist?: string[];
18
- /** Internal local-inventory projection filters; not public command grammar. */
19
- kind?: DeviceKind;
20
- booted?: boolean;
21
- /** Internal target-resolution policy; ordinary inventory leaves this absent and lists all AVDs. */
22
- androidAvdSelection?: 'running-only' | 'include-stopped';
23
- };
24
- type ProviderDeviceInventoryRequest = Omit<DeviceInventoryRequest, 'booted' | 'kind'>;
25
- //#endregion
26
- //#region packages/contracts/src/ios-system-surface.d.ts
27
- /**
28
- * iOS out-of-process system surfaces that agent-device observes and drives IN PLACE, never by
29
- * activation: launching or activating the host cancels what it presents (issue #2438), so the
30
- * runner addresses the host process while it is foreground and the `open` path refuses it. The set
31
- * is deliberately closed and tiny; add a host only with live evidence that it presents out of
32
- * process and dies on activation. Rationale per host lives in the canonical fixture
33
- * `contracts/fixtures/ios-system-surface-hosts.json` (see also docs/adr/0004); this module and the
34
- * Swift `SystemSurfaceHostRegistry` both mirror it, each guarded by a parity test.
35
- */
36
- /** Why a system surface is served in place; carried at snapshot-response level as provenance. */
37
- type IosSystemSurfaceKind = 'web-auth' | 'payment';
38
- /**
39
- * Whole-snapshot provenance: the capture describes a system surface presented over the session app,
40
- * not the app itself. Carried at response level (it applies to the entire snapshot) and folded into
41
- * iOS snapshot lineage so `--verify`/`--settle` never compare an app baseline against a sheet
42
- * capture. Mirrors the Android system-chrome/system-surface provenance model.
43
- */
44
- type IosSystemSurfaceProvenance = Readonly<{
45
- bundleId: string;
46
- kind: IosSystemSurfaceKind;
47
- }>;
48
- //#endregion
49
- //#region packages/contracts/src/runner-lease-context.d.ts
50
- type RunnerLogicalLeaseContext = {
51
- leaseId?: string;
52
- clientId?: string;
53
- tenantId?: string;
54
- runId?: string;
55
- leaseProvider?: string;
56
- deviceKey?: string;
57
- };
58
- //#endregion
59
- //#region packages/contracts/src/ios-snapshot.d.ts
60
- type IosSnapshotProducer = 'apple-runner' | 'simulator-ax-bridge' | 'appium-source' | 'limrun-ios-tree';
61
- type IosAcquisitionProducer = Exclude<IosSnapshotProducer, 'apple-runner'>;
62
- type IosAcquisitionIntent = 'full' | 'surface-observation';
63
- type IosSnapshotProjection = 'regular' | 'raw';
64
- type IosSnapshotGeneration = string;
65
- type IosSnapshotLineage = Readonly<{
66
- targetId?: string;
67
- generation?: IosSnapshotGeneration;
68
- }>;
69
- type IosSnapshotPresentationKey = Readonly<{
70
- projection: IosSnapshotProjection;
71
- interactiveOnly: boolean;
72
- depth: number | null;
73
- scope: string | null;
74
- customActions: boolean;
75
- }>;
76
- type CaptureHint = Readonly<{
77
- projection: IosSnapshotProjection;
78
- rawTraversalDepth: number | null;
79
- regularPresentedDepth: number | null;
80
- interactiveOnly: boolean;
81
- customActions: boolean;
82
- acquisitionIntent: IosAcquisitionIntent;
83
- }>;
84
- type IosSnapshotFact = 'acquisition-depth' | 'scope' | 'interactive-query' | 'viewport' | 'hittability' | 'generation' | 'truncation';
85
- type IosViewportEvidence = Readonly<{
86
- kind: 'reported';
87
- rect: Rect;
88
- }> | Readonly<{
89
- kind: 'derived';
90
- rect: Rect;
91
- }> | Readonly<{
92
- kind: 'missing';
93
- reason: 'not-provided' | 'not-supported' | 'invalid';
94
- }>;
95
- type IosProviderPrunedField = 'nodes' | 'depth' | 'scope' | 'interactive-only';
96
- type IosAcquisitionResidue = Readonly<{
97
- kind: 'provider-pruned';
98
- fields: readonly IosProviderPrunedField[];
99
- }> | Readonly<{
100
- kind: 'missing-viewport';
101
- reason: 'not-provided' | 'not-supported' | 'invalid';
102
- }> | Readonly<{
103
- kind: 'truncated';
104
- }> | Readonly<{
105
- kind: 'stale-generation';
106
- expected?: IosSnapshotGeneration;
107
- observed?: IosSnapshotGeneration;
108
- }> | Readonly<{
109
- kind: 'unknown-generation';
110
- captureId: string;
111
- }> | Readonly<{
112
- kind: 'unavailable-fact';
113
- fact: IosSnapshotFact;
114
- }> | Readonly<{
115
- kind: 'fallback-source';
116
- producer: IosSnapshotProducer;
117
- }>;
118
- type IosSnapshotAcquisitionForIntent<Intent extends IosAcquisitionIntent> = Readonly<{
119
- producer: IosAcquisitionProducer;
120
- intent: Intent;
121
- hint: CaptureHint & Readonly<{
122
- acquisitionIntent: Intent;
123
- }>;
124
- nodes: readonly RawSnapshotNode[];
125
- truncated?: boolean;
126
- viewport: IosViewportEvidence;
127
- lineage: IosSnapshotLineage;
128
- residue: readonly IosAcquisitionResidue[];
129
- }>;
130
- type IosSnapshotAcquisition = IosSnapshotAcquisitionForIntent<'full'> | IosSnapshotAcquisitionForIntent<'surface-observation'>;
131
- type IosSnapshotAcquisitionFacts = Omit<IosSnapshotAcquisition, 'hint'>;
132
- type IosSnapshotComparisonIdentity = Readonly<{
133
- producer: IosSnapshotProducer;
134
- intent: IosAcquisitionIntent;
135
- lineage: IosSnapshotLineage;
136
- presentationKey: IosSnapshotPresentationKey;
137
- residue: readonly IosAcquisitionResidue[];
138
- }>;
139
- //#endregion
140
- //#region packages/contracts/src/interactor-types.d.ts
141
- type RunnerContext = {
142
- requestId?: string;
143
- signal?: AbortSignal;
144
- appBundleId?: string;
145
- verbose?: boolean;
146
- logPath?: string;
147
- traceLogPath?: string;
148
- iosXctestrunFile?: string;
149
- iosXctestDerivedDataPath?: string;
150
- iosXctestEnvDir?: string;
151
- runnerLeaseContext?: RunnerLogicalLeaseContext;
152
- };
153
- type ScreenshotOptions = {
154
- appBundleId?: string;
155
- pixelDensity?: number;
156
- fullscreen?: boolean;
157
- normalizeStatusBar?: boolean;
158
- stabilize?: boolean;
159
- surface?: SessionSurface;
160
- skipIosSimulatorBootCheck?: boolean;
161
- captureBackend?: 'runner';
162
- };
163
- /**
164
- * What the capture owner observed while writing the image. `displayRotation` is the rotation the display
165
- * rendered the pixels in, so a landscape value pairs with a landscape image; it is absent when the
166
- * owner has no rotation reading it can stand behind for this capture.
167
- */
168
- type ScreenshotCaptureFacts = Readonly<{
169
- displayRotation?: DeviceRotation;
170
- }>;
171
- type ElementSelectorKey = 'id' | 'label' | 'text' | 'value';
172
- type ElementSelectorTapOptions = {
173
- key: ElementSelectorKey;
174
- value: string;
175
- allowNonHittableCoordinateFallback?: boolean;
176
- expectedPoint?: Point;
177
- };
178
- type PressPointOptions = Readonly<{
179
- button: 'primary' | 'secondary' | 'middle';
180
- count: number;
181
- intervalMs: number;
182
- holdMs: number;
183
- jitterPx: number;
184
- doubleTap: boolean;
185
- surface?: SessionSurface;
186
- }>;
187
- /**
188
- * The channel the XCTest runner actually entered text through — the Swift
189
- * `TextEntryResult.textEntryRoute` (RunnerTests+TextTyping.swift,
190
- * RunnerTests+SynthesizedTextEntry.swift). Closed set, because the runner is
191
- * its only producer and the boundary that narrows it
192
- * (readTypeTextBackendResult, packages/platform-apple/src/interactions.ts) drops a
193
- * route it cannot name — so a Swift-side addition would silently vanish. The
194
- * route-parity test in packages/platform-apple/src/core/__tests__/interactions.test.ts
195
- * reads the Swift sources and fails instead.
196
- */
197
- declare const TEXT_ENTRY_ROUTES: readonly ['xctest-element', 'synthesized-first-responder', 'synthesized-first-responder-replacement', 'xctest-application-fallback'];
198
- type TextEntryRoute = (typeof TEXT_ENTRY_ROUTES)[number];
199
- /**
200
- * What `Interactor.type` reports back about the entry it performed. Only the
201
- * Apple runner populates it; every other platform types blind and returns void.
202
- */
203
- type TypeTextBackendResult = {
204
- textEntryRoute?: TextEntryRoute;
205
- };
206
- type SnapshotOptions = SnapshotOptions$1 & {
207
- appBundleId?: string;
208
- signal?: AbortSignal;
209
- includeRects?: boolean;
210
- includeHiddenContentHints?: boolean;
211
- surface?: SessionSurface;
212
- /** Internal capture purpose; action outcomes always require the full tree. */
213
- acquisitionIntent?: 'full' | 'surface-observation';
214
- /**
215
- * A one-off read, such as an open's launch observation. It may use a capture host the session
216
- * already keeps warm, but it never installs one or leaves running one that it started. It starts
217
- * no re-capture after `settleBy` (epoch ms); only `signal` cancels work already started.
218
- */
219
- transient?: Readonly<{
220
- settleBy: number;
221
- }>;
222
- };
223
- /**
224
- * Android's live IME status read. Optional on {@link Interactor}: parity with the retired leaf,
225
- * which refused `status`/`get` on every other family (no other platform's runner exposes one).
226
- * A single-member discriminated union rather than a bare object so the daemon can derive its wire
227
- * `platform` label from `kind` the same way it does for dismiss and enter — an owner can only ever
228
- * produce its own result shape.
229
- */
230
- type KeyboardStatusResult = Readonly<{
231
- kind: 'ime-probe';
232
- visible: boolean;
233
- inputType?: string;
234
- type?: string;
235
- inputMethodPackage?: string;
236
- focusedPackage?: string;
237
- focusedResourceId?: string;
238
- inputOwner?: string;
239
- }>;
240
- /**
241
- * Owner-shaped dismiss evidence, discriminated by which owner produced it: Android's IME probe
242
- * fields, or iOS's `mechanism` disclosure (#1598), or HarmonyOS's bare acknowledgment (its HDC
243
- * key press reports nothing beyond success). The daemon derives the wire `platform` label from
244
- * `kind` rather than re-deriving it from the device, so an owner can only ever produce its own
245
- * result shape — an android-probe result under an `ios` label is unrepresentable.
246
- */
247
- type KeyboardDismissResult = Readonly<{
248
- kind: 'ime-probe';
249
- attempts?: number;
250
- wasVisible?: boolean;
251
- dismissed?: boolean;
252
- visible?: boolean;
253
- inputType?: string;
254
- type?: string;
255
- inputMethodPackage?: string;
256
- focusedPackage?: string;
257
- focusedResourceId?: string;
258
- inputOwner?: string;
259
- }> | Readonly<{
260
- kind: 'mechanism';
261
- wasVisible?: boolean;
262
- dismissed?: boolean;
263
- visible?: boolean;
264
- mechanism?: string;
265
- }> | Readonly<{
266
- kind: 'acknowledged';
267
- }>;
268
- /**
269
- * Only the Apple runner echoes visibility around the return-key press; Android and HarmonyOS
270
- * acknowledge with no fields beyond success. Kind is owner-specific, not just content-shaped —
271
- * Android's and HarmonyOS's acknowledgments are structurally identical, so only the discriminant
272
- * itself tells the daemon which owner actually pressed enter.
273
- */
274
- type KeyboardEnterResult = Readonly<{
275
- kind: 'visibility-echo';
276
- visible?: boolean;
277
- wasVisible?: boolean;
278
- }> | Readonly<{
279
- kind: 'android-acknowledged';
280
- }> | Readonly<{
281
- kind: 'harmonyos-acknowledged';
282
- }>;
283
- /**
284
- * Every acquisition carries its provenance pair atomically: the channel alone cannot say who
285
- * acquired the tree or which guarantees it carries, and `SnapshotProvenance`
286
- * (`@agent-device/kernel/snapshot`) makes a cross-channel `backend`/`producer` combination
287
- * fail to compile.
288
- */
289
- type SnapshotResult = Omit<BackendSnapshotResult, 'backend' | 'nodes'> & {
290
- nodes?: RawSnapshotNode[];
291
- comparisonIdentity?: IosSnapshotComparisonIdentity;
292
- /**
293
- * Set when the capture describes an in-place iOS system surface (a web sign-in sheet) presented
294
- * over the session app rather than the app itself (#2438).
295
- */
296
- systemSurface?: IosSystemSurfaceProvenance;
297
- /**
298
- * The keyboard band the producer measured while capturing, when it can measure one (#2660). A
299
- * producer that publishes nothing measured nothing, so the tap-path guard keeps deriving the band
300
- * from `nodes`; see {@link SnapshotKeyboardBandFact}.
301
- */
302
- keyboard?: SnapshotKeyboardBandFact;
303
- /**
304
- * Set when this capture's own command had to bring the session app back to the foreground, i.e.
305
- * something else held it and an earlier observation described that instead (#2682).
306
- */
307
- targetActivation?: IosTargetActivation;
308
- } & SnapshotProvenance;
309
- type SnapshotRuntimeAcquiredResult = Readonly<{
310
- stage: 'acquired';
311
- acquisition: IosSnapshotAcquisitionFacts & Readonly<{
312
- producer: IosAcquisitionProducer;
313
- }>;
314
- }>;
315
- type SnapshotRuntimeResult = SnapshotResult | SnapshotRuntimeAcquiredResult;
316
- type Interactor = {
317
- open(app: string, options?: {
318
- activity?: string;
319
- appBundleId?: string;
320
- launchConsole?: string;
321
- launchArgs?: string[];
322
- terminateRunningApp?: boolean;
323
- url?: string;
324
- }): Promise<void>;
325
- openDevice(): Promise<void>;
326
- close(app: string): Promise<void>;
327
- tap(x: number, y: number): Promise<Record<string, unknown> | void>;
328
- /** Complete point-press semantics for owners with fused series, alternate buttons, or surfaces. */
329
- pressPoint?(point: Point, options: PressPointOptions): Promise<Record<string, unknown> | void>;
330
- /** Alternate mouse buttons for owners that otherwise use the shared point-press series. */
331
- alternateClick?(point: Point, button: 'secondary' | 'middle'): Promise<Record<string, unknown> | void>;
332
- /** Owner-native ref routes; currently the managed web runtime is their only local owner. */
333
- tapRef?(ref: string): Promise<Record<string, unknown> | void>;
334
- tapElementSelector?(selector: ElementSelectorTapOptions): Promise<Record<string, unknown> | void>;
335
- /**
336
- * Fused double-click for owners that have one. The shared `--count` series cannot stand in for it —
337
- * it spaces and jitters independent presses rather than firing one pair the target reads as a
338
- * double — so an owner with no such mechanic leaves this undefined and `press --double` reports the
339
- * gap instead of resolving a denial.
340
- */
341
- doubleTap?(x: number, y: number): Promise<Record<string, unknown> | void>;
342
- longPress(x: number, y: number, durationMs?: number): Promise<Record<string, unknown> | void>;
343
- /**
344
- * How the app the runner context names is running, as the platform reports it. The Apple runner
345
- * reads `XCUIApplication.state`; owners that read the foreground elsewhere leave it undefined.
346
- */
347
- appState?(): Promise<AppStateRuntimeResult>;
348
- /**
349
- * Move the pointer to a point without pressing. Only pointer-driven
350
- * platforms (web today) implement it; touch platforms have no hover state
351
- * and leave it undefined, which the `hover` command reports as unsupported.
352
- */
353
- hover?(x: number, y: number): Promise<Record<string, unknown> | void>;
354
- hoverRef?(ref: string): Promise<Record<string, unknown> | void>;
355
- focus(x: number, y: number): Promise<Record<string, unknown> | void>;
356
- type(text: string, delayMs?: number): Promise<TypeTextBackendResult | void>;
357
- /**
358
- * Replace the target's text with `text`. The empty string is the clear request (#2063), not a
359
- * no-op: an implementation must empty the field or fail — never report success over an
360
- * untouched value. A backend with no clear mechanism refuses the empty text up front (see the
361
- * webdriver interactor).
362
- */
363
- fill(x: number, y: number, text: string, delayMs?: number, options?: {
364
- allowNonHittableCoordinateFallback?: boolean;
365
- }): Promise<Record<string, unknown> | void>;
366
- fillRef?(ref: string, text: string, delayMs?: number): Promise<Record<string, unknown> | void>;
367
- scroll(direction: ScrollDirection, options?: ScrollExecutionOptions): Promise<Record<string, unknown> | void>;
368
- screenshot(outPath: string, options?: ScreenshotOptions): Promise<ScreenshotCaptureFacts | void>;
369
- setViewport?(width: number, height: number): Promise<Record<string, unknown> | void>;
370
- snapshot(options?: SnapshotOptions): Promise<SnapshotRuntimeResult>;
371
- /**
372
- * Native reading of the live text at a point, when the backend has one. Answers the text the
373
- * owner can see right now, which can exceed what an already-captured node carries (an editable
374
- * field whose value is longer than its label). Optional: a backend without it leaves the
375
- * captured tree as the complete answer.
376
- */
377
- readTextAtPoint?(point: Point, options?: {
378
- appBundleId?: string;
379
- surface?: SessionSurface;
380
- signal?: AbortSignal;
381
- }): Promise<string | undefined>;
382
- /**
383
- * Native text-presence reading, when the backend has one that does not require a tree capture.
384
- * A `true` answer is authoritative; anything else means "not proven here" and the caller
385
- * consults the canonical tree (see `FindTextResult`).
386
- */
387
- findText?(text: string, options?: {
388
- appBundleId?: string;
389
- signal?: AbortSignal;
390
- }): Promise<{
391
- found: boolean;
392
- }>;
393
- gestureViewport?(): Promise<Rect>;
394
- back(mode?: BackMode): Promise<void>;
395
- /**
396
- * Optional (parity with `actionButton`): opens the springboard, a control not every owner
397
- * carries. An owner without it leaves it undefined; its fact refuses the press before binding,
398
- * and the system-button binder fails closed rather than resolving an absent member as a
399
- * successful no-op.
400
- */
401
- home?(): Promise<void>;
402
- setOrientation(orientation: DeviceRotation): Promise<{
403
- orientation?: DeviceRotation;
404
- } | void>;
405
- performGesture?(plan: GesturePlan): Promise<Record<string, unknown> | void>;
406
- /**
407
- * Optional (parity with `home`): opens the recents surface, a control not every owner carries.
408
- * An owner without it leaves it undefined; its fact refuses the press before binding, and the
409
- * system-button binder fails closed rather than resolving an absent member as a successful
410
- * no-op.
411
- */
412
- appSwitcher?(): Promise<void>;
413
- /**
414
- * Optional (parity with `home`): presses one TV remote key, a control only TV-capable owners
415
- * carry. An owner without it leaves it undefined; its fact refuses the press before binding,
416
- * and the TV remote binder fails closed rather than resolving an absent member as a silent
417
- * no-op.
418
- */
419
- tvRemote?(button: TvRemoteButton, durationMs?: number): Promise<void>;
420
- /**
421
- * Optional (parity with `keyboardDismiss`): presses the iPhone/iPad Action Button, hardware only
422
- * the Apple owner carries. An owner without the button leaves it undefined; its fact refuses the
423
- * press before binding, and the system-button binder fails closed rather than resolving an
424
- * absent member as a successful no-op.
425
- */
426
- actionButton?(): Promise<void>;
427
- /** Optional: only Android implements a live status read (see {@link KeyboardStatusResult}). */
428
- keyboardStatus?(): Promise<KeyboardStatusResult>;
429
- /** Optional: platforms with no keyboard-dismiss concept leave it undefined. */
430
- keyboardDismiss?(): Promise<KeyboardDismissResult>;
431
- /** Optional: platforms with no keyboard-return concept leave it undefined. */
432
- keyboardEnter?(): Promise<KeyboardEnterResult>;
433
- /**
434
- * Optional (parity with `readSetting`): the owner's pasteboard read. An owner with no clipboard
435
- * surface leaves both halves undefined; its fact refuses the half before binding, and the
436
- * clipboard binder fails closed rather than resolving an absent member as an empty answer.
437
- */
438
- readClipboard?(): Promise<string>;
439
- /**
440
- * Optional (parity with `readClipboard`): the owner's pasteboard write, with the same
441
- * fact-then-guard contract as the read.
442
- */
443
- writeClipboard?(text: string): Promise<void>;
444
- setSetting(setting: string, state: string, appId?: string, options?: SettingOptions): Promise<Record<string, unknown> | void>;
445
- /**
446
- * Optional: reads back the value a device holds for one readable setting. The name is narrowed to
447
- * `READABLE_SETTINGS`, which is not every setting the write switch serves, and an owner's dispatch
448
- * is exhaustive over it — a setting joins the list only with an owner that answers it. An owner with
449
- * no read path leaves the member undefined; its fact refuses the read before binding, so an absent
450
- * method can never resolve into an empty answer.
451
- */
452
- readSetting?(setting: ReadableSetting): Promise<ReadSettingResult>;
453
- /**
454
- * The four alert legs. Each owner runs its own observation and, where it needs one, its own
455
- * poll: an alert is a transient device surface, and how long to look for it — and how to press
456
- * its buttons — is family mechanics, not something a caller can supply. `timeoutMs` is the
457
- * whole window the caller allows; the owner spends it however its backend requires.
458
- *
459
- * Optional: an owner with no alert surface leaves all four undefined. Its facts refuse every leg
460
- * before binding, so the absent members are never resolved, and a fact that admitted a leg the
461
- * interactor cannot serve fails closed instead of answering empty.
462
- */
463
- readAlert?(options?: AlertInteractorOptions): Promise<Record<string, unknown>>;
464
- awaitAlert?(options?: AlertInteractorOptions): Promise<Record<string, unknown>>;
465
- acceptAlert?(options?: AlertInteractorOptions): Promise<Record<string, unknown>>;
466
- dismissAlert?(options?: AlertInteractorOptions): Promise<Record<string, unknown>>;
467
- };
468
- /**
469
- * The session-derived target one alert leg acts on. `appBundleId` is separate from the runner
470
- * context's because the macOS helper reads a frontmost-app surface with no bundle at all, and
471
- * the two must not collapse into one field that means both.
472
- */
473
- type AlertInteractorOptions = {
474
- timeoutMs?: number;
475
- appBundleId?: string;
476
- surface?: SessionSurface;
477
- };
478
- //#endregion
479
- //#region packages/contracts/src/device-provider.d.ts
480
- type DeviceLease = {
481
- leaseId: string;
482
- tenantId: string;
483
- runId: string;
484
- backend: LeaseBackend;
485
- leaseProvider?: string;
486
- deviceKey?: string;
487
- clientId?: string;
488
- retainOnClose?: true;
489
- createdAt: number;
490
- heartbeatAt: number;
491
- expiresAt: number;
492
- };
493
- type LeaseLifecycleContext = {
494
- flags?: Readonly<Record<string, unknown>>;
495
- initialApp?: string;
496
- cwd?: string;
497
- publicNetworkOnly?: boolean;
498
- /** Request-bound cancellation (explicit cancel or client disconnect). */
499
- signal?: AbortSignal;
500
- /**
501
- * Epoch-ms deadline by which `allocate` must have settled; derived from the
502
- * same budget as the client's `lease_allocate` envelope, so a provider that
503
- * fits its remote phases within it is never abandoned by a client first.
504
- */
505
- deadline?: number;
506
- };
507
- type LeaseLifecycleProvider = {
508
- allocate?: (lease: DeviceLease, context?: LeaseLifecycleContext) => Promise<Record<string, unknown> | undefined>;
509
- heartbeat?: (lease: DeviceLease, context?: LeaseLifecycleContext) => Promise<Record<string, unknown> | undefined>;
510
- release?: (lease: DeviceLease, context?: LeaseLifecycleContext) => Promise<Record<string, unknown> | undefined>;
511
- };
512
- type DeviceInventoryProvider = (request: ProviderDeviceInventoryRequest, signal?: AbortSignal) => Promise<DeviceInfo[] | null | undefined>;
513
- type ProviderAppCatalogQuery = Readonly<{
514
- provider: string;
515
- platform: 'android' | 'ios';
516
- publicNetworkOnly?: boolean;
517
- }>;
518
- type ProviderAppCatalogHandler = (query: ProviderAppCatalogQuery, signal?: AbortSignal) => Promise<readonly string[]>;
519
- //#endregion
520
- //#region packages/contracts/src/provider-device-runtime.d.ts
521
- type ProviderDeviceInstallResult = {
522
- bundleId?: string;
523
- packageName?: string;
524
- appName?: string;
525
- launchTarget?: string;
526
- };
527
- type ProviderDeviceInstallOptions = {
528
- relaunch?: boolean;
529
- appIdentifierHint?: string;
530
- packageNameHint?: string;
531
- };
532
- type ProviderPortReverseOptions = {
533
- leaseId: string;
534
- provider?: string;
535
- devicePort: number;
536
- hostPort: number;
537
- name: string;
538
- };
539
- type ProviderExpiredLeaseRecovery = (lease: DeviceLease) => Promise<void>;
540
- /** Provider adapter contract; root owns active-runtime and request composition. */
541
- type ProviderDeviceRuntime = {
542
- provider: string;
543
- leaseLifecycle: LeaseLifecycleProvider;
544
- recoverExpiredLease?: ProviderExpiredLeaseRecovery;
545
- cloudArtifacts?: CloudArtifactProvider;
546
- appCatalog?: ProviderAppCatalogHandler;
547
- deviceInventoryProvider: DeviceInventoryProvider;
548
- ownsDevice(device: DeviceInfo): boolean;
549
- getInteractor(device: DeviceInfo, runnerContext?: RunnerContext): Interactor | undefined;
550
- installApp?(device: DeviceInfo, app: string, appPath: string, options?: ProviderDeviceInstallOptions): Promise<ProviderDeviceInstallResult | undefined>;
551
- installInstallablePath?(device: DeviceInfo, installablePath: string, options?: ProviderDeviceInstallOptions): Promise<ProviderDeviceInstallResult | undefined>;
552
- configurePortReverse?(options: ProviderPortReverseOptions): Promise<Record<string, unknown> | undefined>;
553
- shutdown(): Promise<void>;
554
- };
555
- //#endregion
1
+ import { b as DeviceInfo } from "./sdk-contracts.js";
2
+ import { t as AppsFilter } from "./app-inventory.js";
3
+ import { a as ProviderPortReverseOptions, i as ProviderExpiredLeaseRecovery, l as LeaseLifecycleProvider, n as ProviderDeviceInstallResult, o as DeviceInventoryProvider, r as ProviderDeviceRuntime, t as ProviderDeviceInstallOptions, u as Interactor } from "./provider-device-runtime.js";
4
+ import { d as AndroidAdbProvider, n as AndroidKeyboardState, s as AndroidInputOwner, t as AndroidKeyboardDismissResult } from "./device-input-state.js";
556
5
  //#region packages/provider-limrun/src/runtime-dependencies.d.ts
557
6
  type LimrunAdbCommandOptions = {
558
7
  allowFailure?: boolean;
package/dist/src/load.js CHANGED
@@ -1 +1 @@
1
- import{P as e}from"./sdk-contracts.js";import{a as t,i as n,n as r}from"./store.js";import{pathToFileURL as i}from"node:url";async function a(a,o){let s=r(a);n(s,o);let c=[];try{for(let n of s){let r=await import(i(t(n.directory,n.agentDevicePlugin.entry)).href);if(typeof r.default!=`function`)throw new e(`INVALID_ARGS`,`Plugin must export a default factory: ${n.name}`);let o=await r.default(Object.freeze({env:Object.freeze({...a}),options:Object.freeze({...n.selection.options}),createError:(t,n,r)=>new e(t,n,r)}));if(!o?.runtime||typeof o.runtime.shutdown!=`function`)throw new e(`INVALID_ARGS`,`Plugin must return a provider runtime: ${n.name}`);if(c.push(o),o.runtime.provider!==n.agentDevicePlugin.provider||typeof o.runtime.ownsDevice!=`function`||typeof o.runtime.getInteractor!=`function`||typeof o.runtime.deviceInventoryProvider!=`function`||!o.runtime.leaseLifecycle||typeof o.runtime.leaseLifecycle!=`object`||o.platformModule?.owner?.kind!==`provider-runtime`||o.platformModule.owner.provider!==o.runtime.provider||typeof o.platformModule.owner.instance!=`string`||o.platformModule.owner.instance.trim().length===0||typeof o.platformModule.loadRuntime!=`function`)throw new e(`INVALID_ARGS`,`Plugin runtime owner does not match its declaration: ${n.name}`)}return c}catch(e){throw await Promise.allSettled(c.map(async({runtime:e})=>await e.shutdown())),e}}export{a as loadProviderPlugins};
1
+ import{r as e}from"./rolldown-runtime.js";import{P as t}from"./sdk-contracts.js";import{a as n}from"./version.js";import{a as r,n as i,t as a}from"./manifest.js";import{n as o}from"./store.js";import{pathToFileURL as s}from"node:url";function c(e,r){return Object.freeze({env:Object.freeze({...e}),options:Object.freeze({...r}),clientVersion:n(),createError:(e,n,r)=>new t(e,n,r)})}var l=e({loadProviderPlugins:()=>u,withPluginConnection:()=>d});async function u(e,t,n){let r=o(e);i(r,t);let a=[];try{for(let t of r.filter(e=>n===void 0||e.agentDevicePlugin.provider===n)){let n=await f(t,e);a.push(n),m(n,t)}return a}catch(e){throw await Promise.allSettled(a.map(async({runtime:e})=>await e.shutdown())),e}}async function d(e,n,r){let i=await u(n,a,e);try{let n=i.find(t=>t.runtime.provider===e)?.connection;if(!n)throw new t(`INVALID_ARGS`,`Plugin does not register connect: ${e}`);return await r(n)}finally{await Promise.allSettled(i.map(async({runtime:e})=>await e.shutdown()))}}async function f(e,n){let i=await import(s(r(e.directory,e.agentDevicePlugin.entry)).href);if(typeof i.default!=`function`)throw new t(`INVALID_ARGS`,`Plugin must export a default factory: ${e.name}`);let a=c(n,e.selection.options),o=await i.default(a),l;if(p(o)){if(o.webDriver?.provider!==e.agentDevicePlugin.provider)throw new t(`INVALID_ARGS`,`WebDriver plugin provider does not match its declaration: ${e.name}`);let{createCloudWebDriverRuntime:n}=await import(`./plugin.js`),r=await n({...o.webDriver,clientVersion:a.clientVersion});l={runtime:r,platformModule:r.platformRuntimeModule,connection:o.connection}}else l=o;if(!l?.runtime||typeof l.runtime.shutdown!=`function`)throw new t(`INVALID_ARGS`,`Plugin must return a provider runtime: ${e.name}`);return l}function p(e){return typeof e==`object`&&!!e&&`webDriver`in e}function m(e,n){if(e.runtime.provider!==n.agentDevicePlugin.provider||!g(e.runtime)||!h(e)||n.agentDevicePlugin.connection&&(typeof e.connection?.resolve!=`function`||typeof e.connection?.verify!=`function`))throw new t(`INVALID_ARGS`,`Plugin runtime owner does not match its declaration: ${n.name}`)}function h(e){let t=e.platformModule?.owner;return t?.kind===`provider-runtime`&&t.provider===e.runtime.provider&&typeof t.instance==`string`&&t.instance.trim().length>0&&typeof e.platformModule.loadRuntime==`function`}function g(e){return e.leaseLifecycle!==null&&typeof e.leaseLifecycle==`object`&&[`ownsDevice`,`getInteractor`,`deviceInventoryProvider`].every(t=>typeof e[t]==`function`)}export{d as n,l as t};
@@ -1 +1 @@
1
- import{nn as e}from"./sdk-batch.js";import{E as t,K as n,L as r,O as i,P as a,j as o}from"./alert-runtime.js";import{t as s}from"./touch-runtime.js";import{t as c}from"./interactor-operation-catalog.js";function l(l){let{facts:u,pause:d}=l,f={device:l.device,signal:l.signal,resolveInteractor:l.resolveInteractor};return{...u.captureScreenshot.available?n(f):{},...u.focusPoint.available?r(f):{},...a({...f,facts:u}),...u.scrollDirection.available?o(f):{},...u.typeText.available?i(f):{},...u.readTextAtPoint.available?t(f):{},...e(u.tapPoint,()=>s({...f,facts:u,pause:d})),...c({...f,facts:u})}}export{l as t};
1
+ import{rn as e}from"./sdk-batch.js";import{E as t,K as n,L as r,O as i,P as a,j as o}from"./alert-runtime.js";import{t as s}from"./touch-runtime.js";import{t as c}from"./interactor-operation-catalog.js";function l(l){let{facts:u,pause:d}=l,f={device:l.device,signal:l.signal,resolveInteractor:l.resolveInteractor};return{...u.captureScreenshot.available?n(f):{},...u.focusPoint.available?r(f):{},...a({...f,facts:u}),...u.scrollDirection.available?o(f):{},...u.typeText.available?i(f):{},...u.readTextAtPoint.available?t(f):{},...e(u.tapPoint,()=>s({...f,facts:u,pause:d})),...c({...f,facts:u})}}export{l as t};
@@ -1 +1 @@
1
- import{P as e}from"./sdk-contracts.js";import{P as t,j as n}from"./sdk-device.js";import{t as r}from"./scoped-provider.js";const i=r(void 0);function a(){return i.resolve()}async function o(e,t){return await i.run(e,t)}function s(r,i){if(!t(n(r.device),n(i))||r.device.simulatorSetPath!==i.simulatorSetPath)throw new e(`COMMAND_FAILED`,`Managed automation cannot select another device.`,{reason:`managed-device-transport-mismatch`})}function c(){let e=a();if(e)return async t=>{s(e,t)}}async function l(e){let t=c();return t?(await t(e),!0):!1}export{o as a,c as i,a as n,l as r,s as t};
1
+ import{P as e}from"./sdk-contracts.js";import{I as t,N as n}from"./sdk-device.js";import{t as r}from"./scoped-provider.js";const i=r(void 0);function a(){return i.resolve()}async function o(e,t){return await i.run(e,t)}function s(r,i){if(!t(n(r.device),n(i))||r.device.simulatorSetPath!==i.simulatorSetPath)throw new e(`COMMAND_FAILED`,`Managed automation cannot select another device.`,{reason:`managed-device-transport-mismatch`})}function c(){let e=a();if(e)return async t=>{s(e,t)}}async function l(e){let t=c();return t?(await t(e),!0):!1}export{o as a,c as i,a as n,l as r,s as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime.js";import{P as t}from"./sdk-contracts.js";import{n}from"./providers.js";import r from"node:fs";import i from"node:path";var a=e({RESERVED_PLUGIN_PROVIDERS:()=>o,assertUniquePluginProviders:()=>s,readPluginManifest:()=>c,resolvePluginEntry:()=>d});const o=[`cloud`,`proxy`,...Object.values(n),`limrun`];function s(e,n){let r=new Set(n);for(let n of e){let e=n.agentDevicePlugin.provider;if(r.has(e))throw new t(`INVALID_ARGS`,`Duplicate provider plugin: ${e}`);r.add(e)}}function c(e){let n;try{let t=i.join(e,`package.json`);n=JSON.parse(r.readFileSync(t,`utf8`))}catch(n){throw new t(`INVALID_ARGS`,`Cannot read plugin manifest: ${e}`,{},n)}let a=n?.agentDevicePlugin;if(typeof n?.name!=`string`||typeof n?.version!=`string`||!a||a.apiVersion!==1||typeof a.provider!=`string`||!/^[a-z][a-z0-9-]*$/.test(a.provider)||typeof a.entry!=`string`||!a.entry.startsWith(`./`))throw new t(`INVALID_ARGS`,`Package does not declare a compatible provider plugin`,{reason:`incompatible_plugin`,apiVersion:1,hint:`Install a plugin release supporting agentDevicePlugin.apiVersion 1.`});return d(e,a.entry),l(a.connection),u(a.credentialVariables),n}function l(e){if(e!==void 0&&(!e||typeof e!=`object`||e.leaseKind!==`direct-device-provider`||[`requiresAppAttachment`,`requiresRemoteDaemon`,`supportsArtifacts`,`supportsDeferredAppSelection`,`supportsDirectPortReverse`,`usesCloudWebDriverLease`].some(t=>typeof e[t]!=`boolean`)||e.requiresRemoteDaemon))throw new t(`INVALID_ARGS`,`Plugin connection must declare local provider capabilities`)}function u(e){if(e!==void 0&&(!Array.isArray(e)||!e.every(e=>typeof e==`string`&&/^[A-Z_][A-Z0-9_]*$/.test(e))))throw new t(`INVALID_ARGS`,`Plugin credentialVariables must list environment variable names`)}function d(e,n){try{let t=r.realpathSync(e),a=r.realpathSync(i.resolve(e,n));if(a.startsWith(`${t}${i.sep}`)&&r.statSync(a).isFile())return a}catch{}throw new t(`INVALID_ARGS`,`Plugin entry must be a readable file inside its package`,{directory:e,entry:n})}export{d as a,c as i,s as n,a as r,o as t};