agent-device 0.18.0 → 0.18.2

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 (159) hide show
  1. package/README.md +3 -2
  2. package/android-multitouch-helper/dist/{agent-device-android-multitouch-helper-0.18.0.apk → agent-device-android-multitouch-helper-0.18.2.apk} +0 -0
  3. package/android-multitouch-helper/dist/agent-device-android-multitouch-helper-0.18.2.apk.sha256 +1 -0
  4. package/android-multitouch-helper/dist/{agent-device-android-multitouch-helper-0.18.0.manifest.json → agent-device-android-multitouch-helper-0.18.2.manifest.json} +4 -4
  5. package/android-snapshot-helper/dist/{agent-device-android-snapshot-helper-0.18.0.apk → agent-device-android-snapshot-helper-0.18.2.apk} +0 -0
  6. package/android-snapshot-helper/dist/agent-device-android-snapshot-helper-0.18.2.apk.sha256 +1 -0
  7. package/android-snapshot-helper/dist/{agent-device-android-snapshot-helper-0.18.0.manifest.json → agent-device-android-snapshot-helper-0.18.2.manifest.json} +6 -6
  8. package/apple-runner/AgentDeviceRunner/AgentDeviceRunner/AgentDeviceRunnerApp.m +156 -0
  9. package/{ios-runner → apple-runner}/AgentDeviceRunner/AgentDeviceRunner.xcodeproj/project.pbxproj +10 -16
  10. package/{ios-runner → apple-runner}/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+AXSnapshotFallback.swift +2 -0
  11. package/{ios-runner → apple-runner}/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift +3 -1
  12. package/{ios-runner → apple-runner}/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandJournal.swift +2 -0
  13. package/{ios-runner → apple-runner}/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+FlatSnapshotFiltering.swift +2 -4
  14. package/{ios-runner → apple-runner}/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Interaction.swift +9 -36
  15. package/{ios-runner → apple-runner}/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+ScrollGesture.swift +2 -0
  16. package/{ios-runner → apple-runner}/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SequenceExecution.swift +2 -0
  17. package/{ios-runner → apple-runner}/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Snapshot.swift +2 -0
  18. package/{ios-runner → apple-runner}/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotCapturePlan.swift +2 -0
  19. package/{ios-runner → apple-runner}/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntry.swift +0 -1
  20. package/{ios-runner → apple-runner}/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests.swift +2 -1
  21. package/dist/src/1986.js +1 -0
  22. package/dist/src/2748.js +1 -1
  23. package/dist/src/2948.js +21 -21
  24. package/dist/src/314.js +1 -1
  25. package/dist/src/3340.js +8 -7
  26. package/dist/src/4418.js +1 -1
  27. package/dist/src/4428.js +3 -3
  28. package/dist/src/485.js +1 -0
  29. package/dist/src/495.js +5 -0
  30. package/dist/src/5484.js +1 -1
  31. package/dist/src/587.js +1 -1
  32. package/dist/src/5913.js +4 -0
  33. package/dist/src/6849.js +1 -0
  34. package/dist/src/6918.js +1 -1
  35. package/dist/src/6967.js +1 -0
  36. package/dist/src/760.js +1 -0
  37. package/dist/src/7871.js +1 -0
  38. package/dist/src/8184.js +1 -1
  39. package/dist/src/8225.js +1 -1
  40. package/dist/src/8391.js +1 -0
  41. package/dist/src/8404.js +2 -0
  42. package/dist/src/8414.js +2 -0
  43. package/dist/src/8875.js +4 -1
  44. package/dist/src/8936.js +1 -1
  45. package/dist/src/9581.js +3 -3
  46. package/dist/src/9624.js +1 -1
  47. package/dist/src/9722.js +37 -32
  48. package/dist/src/android-adb.d.ts +19 -54
  49. package/dist/src/android-adb.js +1 -1
  50. package/dist/src/android.js +5 -5
  51. package/dist/src/apps.js +9 -11
  52. package/dist/src/audio-probe.js +1 -0
  53. package/dist/src/batch.d.ts +34 -26
  54. package/dist/src/batch.js +1 -1
  55. package/dist/src/cli-help.js +61 -9
  56. package/dist/src/cli.js +34 -22
  57. package/dist/src/contracts.d.ts +33 -123
  58. package/dist/src/contracts.js +1 -1
  59. package/dist/src/debug-symbols.js +3 -0
  60. package/dist/src/devices.js +1 -1
  61. package/dist/src/devices~1.js +1 -1
  62. package/dist/src/devices~2.js +1 -1
  63. package/dist/src/find.js +1 -1
  64. package/dist/src/finders.d.ts +2 -6
  65. package/dist/src/finders.js +1 -1
  66. package/dist/src/generic.js +1 -9
  67. package/dist/src/handler-utils.js +1 -0
  68. package/dist/src/index.d.ts +474 -180
  69. package/dist/src/index.js +1 -1
  70. package/dist/src/input-actions.js +1 -1
  71. package/dist/src/input-actions~1.js +1 -1
  72. package/dist/src/install-source.d.ts +0 -26
  73. package/dist/src/install-source.js +1 -1
  74. package/dist/src/interaction.js +1 -1
  75. package/dist/src/interactor.js +1 -0
  76. package/dist/src/internal/bin.js +1 -1
  77. package/dist/src/internal/companion-tunnel.js +1 -1
  78. package/dist/src/internal/png-worker.js +1 -1
  79. package/dist/src/lease.js +1 -1
  80. package/dist/src/linux.js +1 -1
  81. package/dist/src/metro.d.ts +10 -134
  82. package/dist/src/metro.js +1 -1
  83. package/dist/src/notifications.js +1 -1
  84. package/dist/src/react-native.js +1 -1
  85. package/dist/src/record-trace-recording.js +3 -3
  86. package/dist/src/record-trace.js +1 -1
  87. package/dist/src/remote-config.d.ts +15 -17
  88. package/dist/src/remote-config.js +1 -1
  89. package/dist/src/runner-sequence.js +1 -0
  90. package/dist/src/selector-runtime.js +1 -1
  91. package/dist/src/selectors.d.ts +15 -7
  92. package/dist/src/selectors.js +1 -1
  93. package/dist/src/server.js +2 -2
  94. package/dist/src/session.js +11 -11
  95. package/dist/src/simulator.js +2 -2
  96. package/dist/src/snapshot.js +2 -2
  97. package/dist/src/web.js +1 -1
  98. package/macos-helper/Sources/AgentDeviceMacOSHelper/AudioProbe.swift +297 -0
  99. package/macos-helper/Sources/AgentDeviceMacOSHelper/main.swift +30 -0
  100. package/package.json +15 -11
  101. package/server.json +2 -2
  102. package/android-multitouch-helper/README.md +0 -41
  103. package/android-multitouch-helper/dist/agent-device-android-multitouch-helper-0.18.0.apk.sha256 +0 -1
  104. package/android-snapshot-helper/README.md +0 -88
  105. package/android-snapshot-helper/dist/agent-device-android-snapshot-helper-0.18.0.apk.sha256 +0 -1
  106. package/dist/src/1848.js +0 -4
  107. package/dist/src/2577.js +0 -1
  108. package/dist/src/2954.js +0 -2
  109. package/dist/src/4291.js +0 -1
  110. package/dist/src/432.js +0 -4
  111. package/dist/src/4723.js +0 -1
  112. package/dist/src/5341.js +0 -1
  113. package/dist/src/5910.js +0 -2
  114. package/dist/src/6024.js +0 -1
  115. package/dist/src/733.js +0 -1
  116. package/dist/src/7394.js +0 -6
  117. package/dist/src/8275.js +0 -2
  118. package/dist/src/9919.js +0 -6
  119. package/dist/src/android-snapshot-helper.d.ts +0 -359
  120. package/dist/src/android-snapshot-helper.js +0 -1
  121. package/dist/src/apple.js +0 -1
  122. package/dist/src/device-ready.js +0 -2
  123. package/ios-runner/AgentDeviceRunner/AgentDeviceRunner/AgentDeviceRunnerApp.swift +0 -17
  124. package/ios-runner/AgentDeviceRunner/AgentDeviceRunner/Assets.xcassets/AccentColor.colorset/Contents.json +0 -11
  125. package/ios-runner/AgentDeviceRunner/AgentDeviceRunner/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -36
  126. package/ios-runner/AgentDeviceRunner/AgentDeviceRunner/Assets.xcassets/AppIcon.appiconset/logo.jpg +0 -0
  127. package/ios-runner/AgentDeviceRunner/AgentDeviceRunner/Assets.xcassets/Contents.json +0 -6
  128. package/ios-runner/AgentDeviceRunner/AgentDeviceRunner/Assets.xcassets/Logo.imageset/Contents.json +0 -21
  129. package/ios-runner/AgentDeviceRunner/AgentDeviceRunner/Assets.xcassets/Logo.imageset/logo.jpg +0 -0
  130. package/ios-runner/AgentDeviceRunner/AgentDeviceRunner/Assets.xcassets/PoweredBy.imageset/Contents.json +0 -21
  131. package/ios-runner/AgentDeviceRunner/AgentDeviceRunner/Assets.xcassets/PoweredBy.imageset/powered-by.png +0 -0
  132. package/ios-runner/AgentDeviceRunner/AgentDeviceRunner/ContentView.swift +0 -34
  133. package/ios-runner/README.md +0 -53
  134. package/ios-runner/RUNNER_PROTOCOL.md +0 -76
  135. /package/{ios-runner → apple-runner}/AgentDeviceRunner/AgentDeviceRunner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -0
  136. /package/{ios-runner → apple-runner}/AgentDeviceRunner/AgentDeviceRunner.xcodeproj/xcshareddata/xcschemes/AgentDeviceRunner.xcscheme +0 -0
  137. /package/{ios-runner → apple-runner}/AgentDeviceRunner/AgentDeviceRunnerUITests/AgentDeviceRunnerUITests-Bridging-Header.h +0 -0
  138. /package/{ios-runner → apple-runner}/AgentDeviceRunner/AgentDeviceRunnerUITests/AgentDeviceRunnerUITests.entitlements +0 -0
  139. /package/{ios-runner → apple-runner}/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerAXSnapshotBridge.h +0 -0
  140. /package/{ios-runner → apple-runner}/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerAXSnapshotBridge.m +0 -0
  141. /package/{ios-runner → apple-runner}/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerObjCExceptionCatcher.h +0 -0
  142. /package/{ios-runner → apple-runner}/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerObjCExceptionCatcher.m +0 -0
  143. /package/{ios-runner → apple-runner}/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSynthesizedGesture.h +0 -0
  144. /package/{ios-runner → apple-runner}/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSynthesizedGesture.m +0 -0
  145. /package/{ios-runner → apple-runner}/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Alert.swift +0 -0
  146. /package/{ios-runner → apple-runner}/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Environment.swift +0 -0
  147. /package/{ios-runner → apple-runner}/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Exceptions.swift +0 -0
  148. /package/{ios-runner → apple-runner}/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Lifecycle.swift +0 -0
  149. /package/{ios-runner → apple-runner}/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Models.swift +0 -0
  150. /package/{ios-runner → apple-runner}/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+ScreenRecorder.swift +0 -0
  151. /package/{ios-runner → apple-runner}/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SystemModal.swift +0 -0
  152. /package/{ios-runner → apple-runner}/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Transport.swift +0 -0
  153. /package/{ios-runner → apple-runner}/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TvRemote.swift +0 -0
  154. /package/{ios-runner → apple-runner}/AgentDeviceRunner/AgentDeviceRunnerUITests.xctestplan +0 -0
  155. /package/{ios-runner → apple-runner}/AgentDeviceRunner/RecordingScripts/recording-overlay.swift +0 -0
  156. /package/{ios-runner → apple-runner}/AgentDeviceRunner/RecordingScripts/recording-resize.swift +0 -0
  157. /package/{ios-runner → apple-runner}/AgentDeviceRunner/RecordingScripts/recording-trim.swift +0 -0
  158. /package/dist/src/{4069.js → 4917.js} +0 -0
  159. /package/dist/src/{9836.js → 893.js} +0 -0
@@ -1,9 +1,9 @@
1
- export declare type AgentDeviceClient = {
1
+ declare type AgentDeviceClient = {
2
2
  command: AgentDeviceCommandClient;
3
3
  devices: {
4
4
  list: (options?: AgentDeviceRequestOverrides & AgentDeviceSelectionOptions) => Promise<AgentDeviceDevice[]>;
5
- boot: (options?: DeviceBootOptions) => Promise<CommandRequestResult>;
6
- shutdown: (options?: DeviceShutdownOptions) => Promise<CommandRequestResult>;
5
+ boot: (options?: DeviceBootOptions) => Promise<CommandResult<'boot'>>;
6
+ shutdown: (options?: DeviceShutdownOptions) => Promise<CommandResult<'shutdown'>>;
7
7
  };
8
8
  sessions: {
9
9
  list: (options?: AgentDeviceRequestOverrides) => Promise<AgentDeviceSession[]>;
@@ -11,9 +11,10 @@ export declare type AgentDeviceClient = {
11
11
  close: (options?: AgentDeviceRequestOverrides & {
12
12
  shutdown?: boolean;
13
13
  }) => Promise<SessionCloseResult>;
14
+ artifacts: (options?: CloudArtifactsOptions) => Promise<CloudArtifactsResult>;
14
15
  };
15
16
  apps: {
16
- install: (options: AppDeployOptions) => Promise<AppDeployResult>;
17
+ install: (options: AppInstallOptions) => Promise<AppDeployResult>;
17
18
  reinstall: (options: AppDeployOptions) => Promise<AppDeployResult>;
18
19
  installFromSource: (options: AppInstallFromSourceOptions) => Promise<AppInstallFromSourceResult>;
19
20
  list: (options?: AppListOptions) => Promise<string[]>;
@@ -30,6 +31,7 @@ export declare type AgentDeviceClient = {
30
31
  heartbeat: (options: LeaseScopedOptions) => Promise<Lease>;
31
32
  release: (options: LeaseScopedOptions) => Promise<{
32
33
  released: boolean;
34
+ provider?: CloudProviderSessionResult;
33
35
  }>;
34
36
  };
35
37
  metro: {
@@ -71,6 +73,7 @@ export declare type AgentDeviceClient = {
71
73
  perf: (options?: PerfOptions) => Promise<CommandRequestResult>;
72
74
  logs: (options?: LogsOptions) => Promise<CommandRequestResult>;
73
75
  network: (options?: NetworkOptions) => Promise<CommandRequestResult>;
76
+ audio: (options?: AudioOptions) => Promise<CommandRequestResult>;
74
77
  };
75
78
  debug: {
76
79
  symbols: (options: DebugSymbolsOptions) => Promise<DebugSymbolsResult>;
@@ -84,7 +87,7 @@ export declare type AgentDeviceClient = {
84
87
  };
85
88
  };
86
89
 
87
- export declare type AgentDeviceClientConfig = RemoteConnectionProfileFields & {
90
+ declare type AgentDeviceClientConfig = RemoteConnectionProfileFields & CloudProviderProfileFields & {
88
91
  session?: string;
89
92
  lockPolicy?: DaemonLockPolicy;
90
93
  lockPlatform?: PlatformSelector;
@@ -95,35 +98,43 @@ export declare type AgentDeviceClientConfig = RemoteConnectionProfileFields & {
95
98
  runtime?: SessionRuntimeHints;
96
99
  cwd?: string;
97
100
  debug?: boolean;
101
+ cost?: boolean;
102
+ responseLevel?: ResponseLevel;
98
103
  iosXctestrunFile?: string;
99
104
  iosXctestDerivedDataPath?: string;
100
105
  iosXctestEnvDir?: string;
101
106
  };
102
107
 
103
- export declare type AgentDeviceCommandClient = {
104
- wait: (options: WaitCommandOptions) => Promise<WaitCommandResult>;
105
- alert: (options?: AlertCommandOptions) => Promise<AlertCommandResult>;
106
- appState: (options?: AppStateCommandOptions) => Promise<AppStateCommandResult>;
107
- back: (options?: BackCommandOptions) => Promise<BackCommandResult>;
108
- home: (options?: HomeCommandOptions) => Promise<HomeCommandResult>;
109
- rotate: (options: RotateCommandOptions) => Promise<RotateCommandResult>;
110
- appSwitcher: (options?: AppSwitcherCommandOptions) => Promise<AppSwitcherCommandResult>;
111
- keyboard: (options?: KeyboardCommandOptions) => Promise<KeyboardCommandResult>;
112
- clipboard: (options: ClipboardCommandOptions) => Promise<ClipboardCommandResult>;
108
+ declare type AgentDeviceCommandClient = {
109
+ wait: (options: WaitCommandOptions) => Promise<CommandRequestResult>;
110
+ alert: (options?: AlertCommandOptions) => Promise<CommandRequestResult>;
111
+ appState: (options?: AppStateCommandOptions) => Promise<CommandResult<'appstate'>>;
112
+ back: (options?: BackCommandOptions) => Promise<CommandResult<'back'>>;
113
+ home: (options?: HomeCommandOptions) => Promise<CommandResult<'home'>>;
114
+ rotate: (options: RotateCommandOptions) => Promise<CommandResult<'rotate'>>;
115
+ appSwitcher: (options?: AppSwitcherCommandOptions) => Promise<CommandResult<'app-switcher'>>;
116
+ keyboard: (options?: KeyboardCommandOptions) => Promise<CommandResult<'keyboard'>>;
117
+ clipboard: (options: ClipboardCommandOptions) => Promise<CommandResult<'clipboard'>>;
113
118
  reactNative: (options: ReactNativeCommandOptions) => Promise<CommandRequestResult>;
119
+ doctor: (options?: DoctorCommandOptions) => Promise<CommandRequestResult>;
114
120
  prepare: (options: PrepareCommandOptions) => Promise<CommandRequestResult>;
115
- viewport: (options: ViewportCommandOptions) => Promise<ViewportCommandResult>;
121
+ viewport: (options: ViewportCommandOptions) => Promise<CommandResult<'viewport'>>;
116
122
  };
117
123
 
118
- export declare type AgentDeviceDaemonTransport = (req: Omit<DaemonRequest, 'token'>) => Promise<DaemonResponse>;
124
+ declare type AgentDeviceDaemonTransport = (req: Omit<DaemonRequest, 'token'>) => Promise<DaemonResponse>;
119
125
 
120
- export declare type AgentDeviceDevice = {
121
- platform: Platform;
126
+ declare type AgentDeviceDevice = {
127
+ platform: PublicPlatform;
122
128
  target: DeviceTarget;
123
129
  kind: DeviceKind;
124
130
  id: string;
125
131
  name: string;
126
132
  booted?: boolean;
133
+ /**
134
+ * Additive Apple-OS discriminant (iPhone/iPad/tvOS/visionOS/macOS). Present only for
135
+ * Apple devices; `platform` still carries the leaf (`ios`/`macos`).
136
+ */
137
+ appleOs?: AppleOS;
127
138
  identifiers: AgentDeviceIdentifiers;
128
139
  ios?: {
129
140
  udid: string;
@@ -133,7 +144,7 @@ export declare type AgentDeviceDevice = {
133
144
  };
134
145
  };
135
146
 
136
- export declare type AgentDeviceIdentifiers = {
147
+ declare type AgentDeviceIdentifiers = {
137
148
  session?: string;
138
149
  deviceId?: string;
139
150
  deviceName?: string;
@@ -144,9 +155,9 @@ export declare type AgentDeviceIdentifiers = {
144
155
  package?: string;
145
156
  };
146
157
 
147
- export declare type AgentDeviceRequestOverrides = Pick<AgentDeviceClientConfig, 'session' | 'lockPolicy' | 'lockPlatform' | 'requestId' | 'daemonBaseUrl' | 'daemonAuthToken' | 'daemonTransport' | 'daemonServerMode' | 'tenant' | 'sessionIsolation' | 'runId' | 'leaseId' | 'leaseBackend' | 'leaseProvider' | 'deviceKey' | 'clientId' | 'leaseTtlMs' | 'cwd' | 'debug' | 'iosXctestrunFile' | 'iosXctestDerivedDataPath' | 'iosXctestEnvDir'>;
158
+ declare type AgentDeviceRequestOverrides = Pick<AgentDeviceClientConfig, 'session' | 'lockPolicy' | 'lockPlatform' | 'requestId' | 'daemonBaseUrl' | 'daemonAuthToken' | 'daemonTransport' | 'daemonServerMode' | 'tenant' | 'sessionIsolation' | 'runId' | 'leaseId' | 'leaseBackend' | 'leaseProvider' | 'deviceKey' | 'clientId' | 'providerApp' | 'providerOsVersion' | 'providerProject' | 'providerBuild' | 'providerSessionName' | 'awsProjectArn' | 'awsDeviceArn' | 'awsAppArn' | 'awsRegion' | 'awsInteractionMode' | 'leaseTtlMs' | 'cwd' | 'debug' | 'cost' | 'responseLevel' | 'iosXctestrunFile' | 'iosXctestDerivedDataPath' | 'iosXctestEnvDir'>;
148
159
 
149
- export declare type AgentDeviceSelectionOptions = {
160
+ declare type AgentDeviceSelectionOptions = {
150
161
  platform?: PlatformSelector;
151
162
  target?: DeviceTarget;
152
163
  device?: string;
@@ -156,7 +167,7 @@ export declare type AgentDeviceSelectionOptions = {
156
167
  androidDeviceAllowlist?: string;
157
168
  };
158
169
 
159
- export declare type AgentDeviceSession = {
170
+ declare type AgentDeviceSession = {
160
171
  name: string;
161
172
  createdAt: number;
162
173
  sessionStateDir?: string;
@@ -165,11 +176,16 @@ export declare type AgentDeviceSession = {
165
176
  identifiers: AgentDeviceIdentifiers;
166
177
  };
167
178
 
168
- export declare type AgentDeviceSessionDevice = {
169
- platform: Platform;
179
+ declare type AgentDeviceSessionDevice = {
180
+ platform: PublicPlatform;
170
181
  target: DeviceTarget;
171
182
  id: string;
172
183
  name: string;
184
+ /**
185
+ * Additive Apple-OS discriminant (iPhone/iPad/tvOS/visionOS/macOS). Present only for
186
+ * Apple devices; `platform` still carries the leaf (`ios`/`macos`).
187
+ */
188
+ appleOs?: AppleOS;
173
189
  identifiers: AgentDeviceIdentifiers;
174
190
  ios?: {
175
191
  udid: string;
@@ -182,40 +198,13 @@ export declare type AgentDeviceSessionDevice = {
182
198
 
183
199
  declare const ALERT_ACTIONS: readonly ['get', 'accept', 'dismiss', 'wait'];
184
200
 
185
- export declare type AlertAction = (typeof ALERT_ACTIONS)[number];
201
+ declare type AlertAction = (typeof ALERT_ACTIONS)[number];
186
202
 
187
- export declare type AlertCommandOptions = DeviceCommandBaseOptions & {
203
+ declare type AlertCommandOptions = DeviceCommandBaseOptions & {
188
204
  action?: AlertAction;
189
205
  timeoutMs?: number;
190
206
  };
191
207
 
192
- export declare type AlertCommandResult = DaemonResponseData & {
193
- kind?: 'alertStatus' | 'alertHandled' | 'alertWait';
194
- action?: AlertCommandOptions['action'];
195
- alert?: AlertInfo | null;
196
- handled?: boolean;
197
- button?: string;
198
- waitedMs?: number;
199
- timedOut?: boolean;
200
- platform?: AlertInfo['platform'];
201
- accepted?: boolean;
202
- dismissed?: boolean;
203
- items?: string[];
204
- };
205
-
206
- export declare type AlertInfo = {
207
- title?: string;
208
- message?: string;
209
- buttons?: string[];
210
- platform?: AlertPlatform;
211
- source?: AlertSource;
212
- packageName?: string;
213
- };
214
-
215
- export declare type AlertPlatform = 'android' | 'ios' | 'macos';
216
-
217
- export declare type AlertSource = 'permission' | 'native-dialog' | 'system-dialog';
218
-
219
208
  declare type AndroidSnapshotBackendMetadata = {
220
209
  backend: 'android-helper' | 'uiautomator-dump';
221
210
  helperVersion?: string;
@@ -243,27 +232,27 @@ declare type AndroidSnapshotHelperInstallReason = 'missing' | 'outdated' | 'forc
243
232
 
244
233
  declare type AndroidSnapshotHelperTransport = 'instrumentation' | 'persistent-session';
245
234
 
246
- export declare type AppCloseOptions = AgentDeviceRequestOverrides & {
235
+ declare type AppCloseOptions = AgentDeviceRequestOverrides & {
247
236
  app?: string;
248
237
  shutdown?: boolean;
249
238
  };
250
239
 
251
- export declare type AppCloseResult = {
240
+ declare type AppCloseResult = {
252
241
  session: string;
253
242
  closedApp?: string;
254
243
  shutdown?: TargetShutdownResult;
255
244
  identifiers: AgentDeviceIdentifiers;
256
245
  };
257
246
 
258
- export declare type AppDeployOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
247
+ declare type AppDeployOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
259
248
  app: string;
260
249
  appPath: string;
261
250
  };
262
251
 
263
- export declare type AppDeployResult = {
252
+ declare type AppDeployResult = {
264
253
  app: string;
265
254
  appPath: string;
266
- platform: Platform;
255
+ platform: PublicPlatform;
267
256
  appId?: string;
268
257
  bundleId?: string;
269
258
  package?: string;
@@ -277,7 +266,7 @@ export declare class AppError extends Error {
277
266
  constructor(code: AppErrorCode, message: string, details?: AppErrorDetails, cause?: unknown);
278
267
  }
279
268
 
280
- export declare type AppErrorCode = KnownAppErrorCode | (string & {});
269
+ declare type AppErrorCode = KnownAppErrorCode | (string & {});
281
270
 
282
271
  declare type AppErrorDetails = Record<string, unknown> & {
283
272
  hint?: string;
@@ -285,13 +274,13 @@ declare type AppErrorDetails = Record<string, unknown> & {
285
274
  logPath?: string;
286
275
  };
287
276
 
288
- export declare type AppInstallFromSourceOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
277
+ declare type AppInstallFromSourceOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
289
278
  source: DaemonInstallSource;
290
279
  retainPaths?: boolean;
291
280
  retentionMs?: number;
292
281
  };
293
282
 
294
- export declare type AppInstallFromSourceResult = {
283
+ declare type AppInstallFromSourceResult = {
295
284
  appName?: string;
296
285
  appId?: string;
297
286
  bundleId?: string;
@@ -304,11 +293,20 @@ export declare type AppInstallFromSourceResult = {
304
293
  identifiers: AgentDeviceIdentifiers;
305
294
  };
306
295
 
307
- export declare type AppListOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
296
+ declare type AppInstallOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
297
+ app?: string;
298
+ appPath: string;
299
+ };
300
+
301
+ declare const APPLE_OS_VALUES: readonly ['ios', 'ipados', 'tvos', 'watchos', 'visionos', 'macos'];
302
+
303
+ declare type AppleOS = (typeof APPLE_OS_VALUES)[number];
304
+
305
+ declare type AppListOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
308
306
  appsFilter?: AppsFilter;
309
307
  };
310
308
 
311
- export declare type AppOpenOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
309
+ declare type AppOpenOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
312
310
  app?: string;
313
311
  url?: string;
314
312
  surface?: SessionSurface;
@@ -322,7 +320,7 @@ export declare type AppOpenOptions = AgentDeviceRequestOverrides & AgentDeviceSe
322
320
  runtime?: SessionRuntimeHints;
323
321
  };
324
322
 
325
- export declare type AppOpenResult = {
323
+ declare type AppOpenResult = {
326
324
  session: string;
327
325
  sessionStateDir?: string;
328
326
  runnerLogPath?: string;
@@ -336,41 +334,62 @@ export declare type AppOpenResult = {
336
334
  identifiers: AgentDeviceIdentifiers;
337
335
  };
338
336
 
339
- export declare type AppPushOptions = DeviceCommandBaseOptions & {
337
+ declare type AppPushOptions = DeviceCommandBaseOptions & {
340
338
  app: string;
341
339
  payload: string | Record<string, unknown>;
342
340
  };
343
341
 
344
342
  declare type AppsFilter = 'user-installed' | 'all';
345
343
 
346
- export declare type AppStateCommandOptions = DeviceCommandBaseOptions;
344
+ declare type AppStateCommandOptions = DeviceCommandBaseOptions;
347
345
 
348
- export declare type AppStateCommandResult = DaemonResponseData & {
349
- platform?: Platform;
350
- appName?: string;
346
+ /**
347
+ * Closed result of the `appstate` command, grounded in the daemon handler's
348
+ * success returns (src/daemon/handlers/session-state.ts `handleAppStateCommand`).
349
+ * A discriminated union on `platform`:
350
+ * - Apple (`ios` / `macos`) session state, with iOS-only device locators that
351
+ * the previous hand-written mirror omitted; and
352
+ * - Android foreground `package` / `activity`.
353
+ *
354
+ * The handler returns one of these fixed objects (errors take the `ok: false`
355
+ * path), so each branch is closed.
356
+ */
357
+ declare type AppStateCommandResult = {
358
+ platform: 'ios' | 'macos';
359
+ appName: string;
351
360
  appBundleId?: string;
352
- package?: string;
353
- activity?: string;
354
- source?: 'session';
355
- surface?: SessionSurface;
361
+ source: 'session';
362
+ surface: SessionSurface;
363
+ /** iOS only — the session device's UDID. */
364
+ device_udid?: string;
365
+ /** iOS only — the simulator set path, or `null` when unknown. */
366
+ ios_simulator_device_set?: string | null;
367
+ } | {
368
+ platform: 'android';
369
+ package: string;
370
+ activity: string;
356
371
  };
357
372
 
358
- export declare type AppSwitcherCommandOptions = DeviceCommandBaseOptions;
373
+ declare type AppSwitcherCommandOptions = DeviceCommandBaseOptions;
359
374
 
360
- export declare type AppSwitcherCommandResult = CommandActionResult<'app-switcher'>;
375
+ /** `app-switcher` `{ action: 'app-switcher', message: 'Opened app switcher' }`. */
376
+ declare type AppSwitcherCommandResult = {
377
+ action: 'app-switcher';
378
+ message: string;
379
+ };
361
380
 
362
- export declare type AppTriggerEventOptions = DeviceCommandBaseOptions & {
381
+ declare type AppTriggerEventOptions = DeviceCommandBaseOptions & {
363
382
  event: string;
364
383
  payload?: Record<string, unknown>;
365
384
  };
366
385
 
367
- export declare type ArtifactAdapter = {
386
+ declare type ArtifactAdapter = {
368
387
  resolveInput(ref: FileInputRef, options: ResolveInputOptions): Promise<ResolvedInputFile>;
369
388
  reserveOutput(ref: FileOutputRef | undefined, options: ReserveOutputOptions): Promise<ReservedOutputFile>;
370
389
  createTempFile(options: CreateTempFileOptions): Promise<TemporaryFile>;
371
390
  };
372
391
 
373
- export declare type ArtifactDescriptor = {
392
+ declare type ArtifactDescriptor = {
374
393
  kind: 'localPath';
375
394
  field: string;
376
395
  path: string;
@@ -386,33 +405,43 @@ export declare type ArtifactDescriptor = {
386
405
  metadata?: Record<string, unknown>;
387
406
  };
388
407
 
408
+ declare type AudioOptions = AgentDeviceRequestOverrides & {
409
+ action?: 'probe';
410
+ probeAction?: 'start' | 'status' | 'stop';
411
+ durationMs?: number;
412
+ bucketMs?: number;
413
+ };
414
+
389
415
  declare const BACK_MODES: readonly ['in-app', 'system'];
390
416
 
391
- export declare type BackCommandOptions = DeviceCommandBaseOptions & {
417
+ declare type BackCommandOptions = DeviceCommandBaseOptions & {
392
418
  mode?: BackMode;
393
419
  };
394
420
 
395
- export declare type BackCommandResult = CommandActionResult<'back'> & {
396
- mode?: BackMode;
421
+ /** `back` `{ action: 'back', mode, message: 'Back' }`; `mode` defaults to `'in-app'`. */
422
+ declare type BackCommandResult = {
423
+ action: 'back';
424
+ mode: BackMode;
425
+ message: string;
397
426
  };
398
427
 
399
428
  declare type BackMode = (typeof BACK_MODES)[number];
400
429
 
401
- export declare type BatchRunOptions = AgentDeviceRequestOverrides & {
430
+ declare type BatchRunOptions = AgentDeviceRequestOverrides & {
402
431
  steps: BatchStep[];
403
432
  onError?: 'stop';
404
433
  maxSteps?: number;
405
434
  out?: string;
406
435
  };
407
436
 
408
- export declare type BatchRunResult = Record<string, unknown> & {
437
+ declare type BatchRunResult = Record<string, unknown> & {
409
438
  total: number;
410
439
  executed: number;
411
440
  totalDurationMs: number;
412
441
  results: BatchStepResult[];
413
442
  };
414
443
 
415
- export declare type BatchStep = {
444
+ declare type BatchStep = {
416
445
  command: string;
417
446
  input: Record<string, unknown>;
418
447
  runtime?: SessionRuntimeHints;
@@ -426,26 +455,51 @@ declare type BatchStepResult = {
426
455
  durationMs: number;
427
456
  };
428
457
 
429
- export declare type CaptureDiffOptions = DeviceCommandBaseOptions & Pick<CaptureSnapshotOptions, 'interactiveOnly' | 'depth' | 'scope' | 'raw'> & {
458
+ /**
459
+ * Closed result of the `boot` command. Mirrors the daemon handler's only
460
+ * success return EXACTLY (src/daemon/handlers/session-state.ts) — the fixed
461
+ * object literal `{ platform, target, device, id, kind, booted }` plus the
462
+ * additive `appleOs` discriminant, emitted only for Apple devices.
463
+ */
464
+ declare type BootCommandResult = {
465
+ platform: PublicPlatform;
466
+ target: DeviceTarget;
467
+ /** Human-readable device name (`device.name`). */
468
+ device: string;
469
+ /** Stable device id (`device.id`). */
470
+ id: string;
471
+ kind: DeviceKind;
472
+ /** Always `true` on the success path. */
473
+ booted: true;
474
+ /**
475
+ * Additive Apple-OS discriminant (`device.appleOs`): iPhone/iPad/tvOS/visionOS/macOS.
476
+ * Present only for Apple devices; absent for non-Apple platforms. `platform` stays the
477
+ * leaf (`ios`/`macos`) — this is an extra field, not a replacement.
478
+ */
479
+ appleOs?: AppleOS;
480
+ };
481
+
482
+ declare type CaptureDiffOptions = DeviceCommandBaseOptions & Pick<CaptureSnapshotOptions, 'interactiveOnly' | 'depth' | 'scope' | 'raw'> & {
430
483
  kind: 'snapshot';
431
484
  out?: string;
432
485
  };
433
486
 
434
- export declare type CaptureScreenshotOptions = AgentDeviceRequestOverrides & {
487
+ declare type CaptureScreenshotOptions = AgentDeviceRequestOverrides & {
435
488
  path?: string;
436
489
  overlayRefs?: boolean;
437
490
  fullscreen?: boolean;
438
491
  maxSize?: number;
439
492
  stabilize?: boolean;
493
+ normalizeStatusBar?: boolean;
440
494
  surface?: SessionSurface;
441
495
  };
442
496
 
443
- export declare type CaptureScreenshotResult = ScreenshotResultData & {
497
+ declare type CaptureScreenshotResult = ScreenshotResultData & {
444
498
  path: string;
445
499
  identifiers: AgentDeviceIdentifiers;
446
500
  };
447
501
 
448
- export declare type CaptureSnapshotOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
502
+ declare type CaptureSnapshotOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
449
503
  interactiveOnly?: boolean;
450
504
  depth?: number;
451
505
  scope?: string;
@@ -454,7 +508,7 @@ export declare type CaptureSnapshotOptions = AgentDeviceRequestOverrides & Agent
454
508
  timeoutMs?: number;
455
509
  };
456
510
 
457
- export declare type CaptureSnapshotResult = {
511
+ declare type CaptureSnapshotResult = {
458
512
  nodes: SnapshotNode[];
459
513
  truncated: boolean;
460
514
  appName?: string;
@@ -471,30 +525,130 @@ declare const CLICK_BUTTONS: readonly ['primary', 'secondary', 'middle'];
471
525
 
472
526
  declare type ClickButton = (typeof CLICK_BUTTONS)[number];
473
527
 
474
- export declare type ClickOptions = DeviceCommandBaseOptions & SelectorSnapshotCommandOptions & InteractionTarget & RepeatedPressOptions & {
528
+ declare type ClickOptions = DeviceCommandBaseOptions & SelectorSnapshotCommandOptions & InteractionTarget & RepeatedPressOptions & {
475
529
  button?: ClickButton;
476
530
  };
477
531
 
478
- export declare type ClipboardCommandOptions = (DeviceCommandBaseOptions & {
532
+ declare type ClipboardCommandOptions = (DeviceCommandBaseOptions & {
479
533
  action: 'read';
480
534
  }) | (DeviceCommandBaseOptions & {
481
535
  action: 'write';
482
536
  text: string;
483
537
  });
484
538
 
485
- export declare type ClipboardCommandResult = (DaemonResponseData & {
539
+ /**
540
+ * Closed result of the `clipboard` command. Mirrors the dispatch handler's
541
+ * literal return EXACTLY (src/core/dispatch.ts `handleClipboardCommand`): a
542
+ * discriminated union on `action`. `read` returns the clipboard `text`; `write`
543
+ * reports the written `textLength` plus the `successText` message. The handler
544
+ * spreads nothing else, so each branch is closed.
545
+ */
546
+ declare type ClipboardCommandResult = {
486
547
  action: 'read';
487
548
  text: string;
488
- }) | (DaemonResponseData & {
549
+ } | {
489
550
  action: 'write';
490
551
  textLength: number;
491
- });
552
+ message: string;
553
+ };
554
+
555
+ declare const CLOUD_ARTIFACT_KINDS: readonly ['video', 'appium-log', 'device-log', 'automation-log', 'provider-session', 'raw'];
556
+
557
+ declare type CloudArtifact = {
558
+ provider: string;
559
+ kind: CloudArtifactKind;
560
+ name: string;
561
+ url?: string;
562
+ providerSessionId?: string;
563
+ providerArtifactId?: string;
564
+ contentType?: string;
565
+ extension?: string;
566
+ availability?: CloudArtifactAvailability;
567
+ metadata?: Record<string, unknown>;
568
+ };
569
+
570
+ declare type CloudArtifactAvailability = 'ready' | 'pending' | 'unavailable' | 'expired';
571
+
572
+ declare type CloudArtifactKind = (typeof CLOUD_ARTIFACT_KINDS)[number];
492
573
 
493
- declare type CommandActionResult<T extends string> = DaemonResponseData & {
494
- action?: T;
574
+ declare type CloudArtifactsOptions = AgentDeviceRequestOverrides & {
575
+ provider?: string;
576
+ providerSessionId?: string;
577
+ };
578
+
579
+ declare type CloudArtifactsResult = {
580
+ provider: string;
581
+ status: CloudArtifactsStatus;
582
+ cloudArtifacts: CloudArtifact[];
583
+ providerSessionId?: string;
584
+ message?: string;
495
585
  };
496
586
 
497
- export declare type CommandRequestResult = DaemonResponseData;
587
+ declare type CloudArtifactsStatus = 'ready' | 'pending' | 'unavailable';
588
+
589
+ declare type CloudProviderProfileFields = {
590
+ providerApp?: string;
591
+ providerOsVersion?: string;
592
+ providerProject?: string;
593
+ providerBuild?: string;
594
+ providerSessionName?: string;
595
+ awsProjectArn?: string;
596
+ awsDeviceArn?: string;
597
+ awsAppArn?: string;
598
+ awsRegion?: string;
599
+ awsInteractionMode?: 'INTERACTIVE' | 'NO_VIDEO' | 'VIDEO_ONLY';
600
+ };
601
+
602
+ declare type CloudProviderSessionResult = {
603
+ provider?: string;
604
+ providerSessionId?: string;
605
+ cloudArtifacts?: CloudArtifactsResult;
606
+ } & Record<string, unknown>;
607
+
608
+ declare type CommandRequestResult = DaemonResponseData;
609
+
610
+ /**
611
+ * The typed result for a command named `N`. Seeded commands resolve to their
612
+ * contract result type from {@link CommandResultMap}; every other (unmigrated)
613
+ * command falls back to the untyped `Record<string, unknown>` bag. That default
614
+ * branch is what keeps the mapping total over every command name, so consumers
615
+ * can switch to `CommandResult<Name>` without first migrating every command.
616
+ */
617
+ declare type CommandResult<N extends string> = N extends keyof CommandResultMap ? CommandResultMap[N] : Record<string, unknown>;
618
+
619
+ /**
620
+ * The additive typed-result spine (ADR-0008, Phase 1 step 6).
621
+ *
622
+ * Maps a command name to the per-command result type from `src/contracts/*`. It
623
+ * is SEEDED, not exhaustive: a command is listed here only once its accurate,
624
+ * closed result shape lives in the contracts layer. Commands whose daemon
625
+ * handler spreads dynamic/Record data (screenshot overlays, gesture
626
+ * visualization, perf, logs, …) are deliberately omitted rather than given an
627
+ * invented shape.
628
+ *
629
+ * Batches 1-2 wired `boot` / `shutdown` / `viewport` and the navigation/action
630
+ * commands `home` / `back` / `rotate` / `app-switcher` alongside the seed
631
+ * interaction trio. Batch 3 adds `clipboard` (a closed `read`/`write` union) and
632
+ * `appstate` (a closed `platform` union — Apple session state with the iOS-only
633
+ * device locators, or Android package/activity). Batch 4 adds `keyboard` (a
634
+ * closed flat shape). Each entry is grounded in a
635
+ * re-read of the handler's literal return; see the per-type docstrings.
636
+ */
637
+ declare interface CommandResultMap {
638
+ press: PressCommandResult;
639
+ fill: FillCommandResult;
640
+ longpress: LongPressCommandResult;
641
+ boot: BootCommandResult;
642
+ shutdown: ShutdownCommandResult;
643
+ viewport: ViewportCommandResult;
644
+ home: HomeCommandResult;
645
+ back: BackCommandResult;
646
+ rotate: RotateCommandResult;
647
+ 'app-switcher': AppSwitcherCommandResult;
648
+ clipboard: ClipboardCommandResult;
649
+ appstate: AppStateCommandResult;
650
+ keyboard: KeyboardCommandResult;
651
+ }
498
652
 
499
653
  declare type CompanionTunnelScope = {
500
654
  tenantId: string;
@@ -508,7 +662,7 @@ export declare function createAgentDeviceClient(config?: AgentDeviceClientConfig
508
662
 
509
663
  export declare function createLocalArtifactAdapter(options?: LocalArtifactAdapterOptions): ArtifactAdapter;
510
664
 
511
- export declare type CreateTempFileOptions = {
665
+ declare type CreateTempFileOptions = {
512
666
  prefix: string;
513
667
  ext: string;
514
668
  };
@@ -534,6 +688,18 @@ declare type DaemonError = {
534
688
  diagnosticId?: string;
535
689
  logPath?: string;
536
690
  details?: Record<string, unknown>;
691
+ /**
692
+ * Machine-readable typed-error signals (Phase 2). Additive: present only when
693
+ * derivable, so the default error wire shape is unchanged.
694
+ *
695
+ * `retriable` flags a transient failure an agent should retry (vs. a
696
+ * deterministic one where a retry is wasted). `supportedOn` lists the platform
697
+ * families that DO support the command (derived from the capability matrix),
698
+ * surfaced on platform-mismatch errors so an agent self-corrects without a
699
+ * wasted round-trip.
700
+ */
701
+ retriable?: boolean;
702
+ supportedOn?: string;
537
703
  };
538
704
 
539
705
  declare type DaemonInstallSource = {
@@ -571,6 +737,8 @@ declare type DaemonRequest = {
571
737
  declare type DaemonRequestMeta = {
572
738
  requestId?: string;
573
739
  debug?: boolean;
740
+ includeCost?: boolean;
741
+ responseLevel?: ResponseLevel;
574
742
  cwd?: string;
575
743
  sessionExplicit?: boolean;
576
744
  tenantId?: string;
@@ -590,7 +758,7 @@ declare type DaemonRequestMeta = {
590
758
  materializationId?: string;
591
759
  lockPolicy?: DaemonLockPolicy;
592
760
  lockPlatform?: PlatformSelector;
593
- requestProgress?: 'replay-test';
761
+ requestProgress?: 'replay-test' | 'command';
594
762
  };
595
763
 
596
764
  declare type DaemonResponse = {
@@ -603,6 +771,7 @@ declare type DaemonResponse = {
603
771
 
604
772
  declare type DaemonResponseData = Record<string, unknown> & {
605
773
  artifacts?: DaemonArtifact[];
774
+ cost?: ResponseCost;
606
775
  };
607
776
 
608
777
  declare type DaemonServerMode = (typeof DAEMON_SERVER_MODES)[number];
@@ -667,7 +836,7 @@ declare const DEVICE_ROTATIONS: readonly ['portrait', 'portrait-upside-down', 'l
667
836
 
668
837
  declare const DEVICE_TARGETS: readonly ['mobile', 'tv', 'desktop'];
669
838
 
670
- export declare type DeviceBootOptions = DeviceCommandBaseOptions & {
839
+ declare type DeviceBootOptions = DeviceCommandBaseOptions & {
671
840
  headless?: boolean;
672
841
  };
673
842
 
@@ -677,13 +846,18 @@ declare type DeviceKind = (typeof DEVICE_KINDS)[number];
677
846
 
678
847
  declare type DeviceRotation = (typeof DEVICE_ROTATIONS)[number];
679
848
 
680
- export declare type DeviceShutdownOptions = DeviceCommandBaseOptions;
849
+ declare type DeviceShutdownOptions = DeviceCommandBaseOptions;
681
850
 
682
851
  declare type DeviceTarget = (typeof DEVICE_TARGETS)[number];
683
852
 
684
- export declare type ElementTarget = RefTarget | SelectorTarget;
853
+ declare type DoctorCommandOptions = DeviceCommandBaseOptions & {
854
+ targetApp?: string;
855
+ remote?: boolean;
856
+ };
857
+
858
+ declare type ElementTarget = RefTarget | SelectorTarget;
685
859
 
686
- export declare type FileInputRef = {
860
+ declare type FileInputRef = {
687
861
  kind: 'path';
688
862
  path: string;
689
863
  } | {
@@ -691,7 +865,7 @@ export declare type FileInputRef = {
691
865
  id: string;
692
866
  };
693
867
 
694
- export declare type FileOutputRef = {
868
+ declare type FileOutputRef = {
695
869
  kind: 'path';
696
870
  path: string;
697
871
  } | {
@@ -700,7 +874,14 @@ export declare type FileOutputRef = {
700
874
  fileName?: string;
701
875
  };
702
876
 
703
- export declare type FillOptions = DeviceCommandBaseOptions & SelectorSnapshotCommandOptions & InteractionTarget & {
877
+ declare type FillCommandResult = ResolvedInteractionTarget & {
878
+ text: string;
879
+ warning?: string;
880
+ backendResult?: Record<string, unknown>;
881
+ message?: string;
882
+ };
883
+
884
+ declare type FillOptions = DeviceCommandBaseOptions & SelectorSnapshotCommandOptions & InteractionTarget & {
704
885
  text: string;
705
886
  delayMs?: number;
706
887
  };
@@ -714,9 +895,9 @@ declare type FindBaseOptions = DeviceCommandBaseOptions & FindSnapshotCommandOpt
714
895
  last?: boolean;
715
896
  };
716
897
 
717
- export declare type FindLocator = (typeof FIND_LOCATORS)[number];
898
+ declare type FindLocator = (typeof FIND_LOCATORS)[number];
718
899
 
719
- export declare type FindOptions = (FindBaseOptions & {
900
+ declare type FindOptions = (FindBaseOptions & {
720
901
  action?: 'click' | 'focus' | 'exists' | 'getText' | 'getAttrs';
721
902
  }) | (FindBaseOptions & {
722
903
  action: 'wait';
@@ -740,21 +921,33 @@ declare type FocusOptions_2 = DeviceCommandBaseOptions & {
740
921
  x: number;
741
922
  y: number;
742
923
  };
743
- export { FocusOptions_2 as FocusOptions }
744
924
 
745
- export declare type GetOptions = DeviceCommandBaseOptions & SelectorSnapshotCommandOptions & ElementTarget & {
925
+ declare type GetOptions = DeviceCommandBaseOptions & SelectorSnapshotCommandOptions & ElementTarget & {
746
926
  format: 'text' | 'attrs';
747
927
  };
748
928
 
749
- export declare type HomeCommandOptions = DeviceCommandBaseOptions;
929
+ declare type HomeCommandOptions = DeviceCommandBaseOptions;
750
930
 
751
- export declare type HomeCommandResult = CommandActionResult<'home'>;
931
+ /**
932
+ * Closed results of the navigation/global action commands. Each mirrors the
933
+ * dispatch handler's literal return EXACTLY (src/core/dispatch.ts
934
+ * `DISPATCH_HANDLERS`): a fixed `action` discriminant plus the always-present
935
+ * `successText` message (the handlers always pass a non-empty message, so it is
936
+ * required here). The handlers spread nothing else, so the shapes are closed —
937
+ * consistent with the `viewport` contract, the generic-dispatch Android
938
+ * dialog-recovery `warning` annotation is intentionally not part of the contract.
939
+ */
940
+ /** `home` — `{ action: 'home', message: 'Home' }`. */
941
+ declare type HomeCommandResult = {
942
+ action: 'home';
943
+ message: string;
944
+ };
752
945
 
753
- export declare type InteractionTarget = PointTarget | RefTarget | SelectorTarget;
946
+ declare type InteractionTarget = PointTarget | RefTarget | SelectorTarget;
754
947
 
755
948
  export declare function isAgentDeviceError(err: unknown): err is AppError;
756
949
 
757
- export declare type IsOptions = IsTextPredicateOptions | IsStatePredicateOptions;
950
+ declare type IsOptions = IsTextPredicateOptions | IsStatePredicateOptions;
758
951
 
759
952
  declare type IsStatePredicateOptions = DeviceCommandBaseOptions & SelectorSnapshotCommandOptions & {
760
953
  predicate: 'visible' | 'hidden' | 'exists' | 'editable' | 'selected';
@@ -768,23 +961,38 @@ declare type IsTextPredicateOptions = DeviceCommandBaseOptions & SelectorSnapsho
768
961
  value: string;
769
962
  };
770
963
 
771
- export declare type KeyboardCommandOptions = DeviceCommandBaseOptions & {
964
+ declare type KeyboardCommandOptions = DeviceCommandBaseOptions & {
772
965
  action?: 'status' | 'dismiss' | 'enter' | 'return';
773
966
  };
774
967
 
775
- export declare type KeyboardCommandResult = DaemonResponseData & {
776
- platform?: 'android' | 'ios';
777
- action?: 'status' | 'dismiss' | 'enter';
968
+ /**
969
+ * Closed result of the `keyboard` command, grounded in the dispatch handlers'
970
+ * literal returns (src/core/dispatch.ts `handleAndroidKeyboardCommand` /
971
+ * `handleIosKeyboardCommand`).
972
+ *
973
+ * `platform` and `action` are always present; the remaining fields appear per
974
+ * branch (Android `status`/`dismiss` carry the keyboard-state fields; `enter`
975
+ * and iOS `dismiss` carry a `message`). It is kept as a flat closed shape rather
976
+ * than a five-way `platform`×`action` union because the per-branch field sets
977
+ * overlap heavily and the underlying Android keyboard-state types live in the
978
+ * platform layer (below the public contract). The `Record` index signature of
979
+ * the previous hand-written mirror is dropped, and the spurious `| null`s are
980
+ * removed (the handler never returns `null` for these).
981
+ */
982
+ declare type KeyboardCommandResult = {
983
+ platform: 'android' | 'ios';
984
+ action: 'status' | 'dismiss' | 'enter';
778
985
  visible?: boolean;
779
- inputType?: string | null;
780
- inputMethodPackage?: string | null;
781
- type?: string | null;
782
- focusedPackage?: string | null;
783
- focusedResourceId?: string | null;
784
- inputOwner?: 'app' | 'ime' | 'unknown';
785
986
  wasVisible?: boolean;
786
987
  dismissed?: boolean;
787
988
  attempts?: number;
989
+ inputType?: string;
990
+ type?: 'text' | 'number' | 'email' | 'phone' | 'password' | 'datetime' | 'unknown';
991
+ inputMethodPackage?: string;
992
+ focusedPackage?: string;
993
+ focusedResourceId?: string;
994
+ inputOwner?: 'app' | 'ime' | 'unknown';
995
+ message?: string;
788
996
  };
789
997
 
790
998
  declare type KnownAppErrorCode = 'INVALID_ARGS' | 'DEVICE_NOT_FOUND' | 'DEVICE_IN_USE' | 'TOOL_MISSING' | 'APP_NOT_INSTALLED' | 'UNSUPPORTED_PLATFORM' | 'UNSUPPORTED_OPERATION' | 'NOT_IMPLEMENTED' | 'COMMAND_FAILED' | 'SESSION_NOT_FOUND' | 'UNAUTHORIZED' | 'AMBIGUOUS_MATCH' | 'UNKNOWN';
@@ -816,7 +1024,7 @@ declare type LeaseAllocateOptions = LeaseOptions & {
816
1024
 
817
1025
  declare type LeaseBackend = (typeof LEASE_BACKENDS)[number];
818
1026
 
819
- declare type LeaseOptions = AgentDeviceRequestOverrides & {
1027
+ declare type LeaseOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
820
1028
  ttlMs?: number;
821
1029
  };
822
1030
 
@@ -831,7 +1039,7 @@ declare type LeaseScopedOptions = LeaseOptions & {
831
1039
  clientId?: string;
832
1040
  };
833
1041
 
834
- export declare type LocalArtifactAdapterOptions = {
1042
+ declare type LocalArtifactAdapterOptions = {
835
1043
  cwd?: string;
836
1044
  tempDir?: string;
837
1045
  rootDir?: string;
@@ -841,21 +1049,27 @@ declare const LOG_ACTION_VALUES: readonly ['path', 'start', 'stop', 'doctor', 'm
841
1049
 
842
1050
  declare type LogAction = (typeof LOG_ACTION_VALUES)[number];
843
1051
 
844
- export declare type LogsOptions = AgentDeviceRequestOverrides & {
1052
+ declare type LogsOptions = AgentDeviceRequestOverrides & {
845
1053
  action?: LogAction;
846
1054
  message?: string;
847
1055
  restart?: boolean;
848
1056
  };
849
1057
 
850
- export declare type LongPressOptions = DeviceCommandBaseOptions & SelectorSnapshotCommandOptions & InteractionTarget & {
1058
+ declare type LongPressCommandResult = ResolvedInteractionTarget & {
851
1059
  durationMs?: number;
1060
+ backendResult?: Record<string, unknown>;
1061
+ message?: string;
852
1062
  };
853
1063
 
854
- export declare type MaterializationReleaseOptions = AgentDeviceRequestOverrides & {
1064
+ declare type LongPressOptions = DeviceCommandBaseOptions & SelectorSnapshotCommandOptions & InteractionTarget & {
1065
+ durationMs?: number;
1066
+ };
1067
+
1068
+ declare type MaterializationReleaseOptions = AgentDeviceRequestOverrides & {
855
1069
  materializationId: string;
856
1070
  };
857
1071
 
858
- export declare type MaterializationReleaseResult = {
1072
+ declare type MaterializationReleaseResult = {
859
1073
  released: boolean;
860
1074
  materializationId: string;
861
1075
  identifiers: AgentDeviceIdentifiers;
@@ -886,7 +1100,7 @@ declare type MetroBridgeScope = CompanionTunnelScope;
886
1100
 
887
1101
  declare type MetroPrepareKind = 'auto' | 'react-native' | 'expo';
888
1102
 
889
- export declare type MetroPrepareOptions = {
1103
+ declare type MetroPrepareOptions = {
890
1104
  projectRoot?: string;
891
1105
  kind?: MetroPrepareKind;
892
1106
  publicBaseUrl?: string;
@@ -907,16 +1121,16 @@ export declare type MetroPrepareOptions = {
907
1121
  logPath?: string;
908
1122
  };
909
1123
 
910
- export declare type MetroPrepareResult = PrepareMetroRuntimeResult;
1124
+ declare type MetroPrepareResult = PrepareMetroRuntimeResult;
911
1125
 
912
- export declare type MetroReloadOptions = {
1126
+ declare type MetroReloadOptions = {
913
1127
  metroHost?: string;
914
1128
  metroPort?: number;
915
1129
  bundleUrl?: string;
916
1130
  timeoutMs?: number;
917
1131
  };
918
1132
 
919
- export declare type MetroReloadResult = ReloadMetroResult;
1133
+ declare type MetroReloadResult = ReloadMetroResult;
920
1134
 
921
1135
  /** Re-export of {@link SessionRuntimeHints} under the Metro-specific alias used by public API consumers. */
922
1136
  declare type MetroRuntimeHints = SessionRuntimeHints;
@@ -925,7 +1139,7 @@ declare const NETWORK_INCLUDE_MODES: readonly ['summary', 'headers', 'body', 'al
925
1139
 
926
1140
  declare type NetworkIncludeMode = (typeof NETWORK_INCLUDE_MODES)[number];
927
1141
 
928
- export declare type NetworkOptions = AgentDeviceRequestOverrides & {
1142
+ declare type NetworkOptions = AgentDeviceRequestOverrides & {
929
1143
  action?: 'dump' | 'log';
930
1144
  limit?: number;
931
1145
  include?: NetworkIncludeMode;
@@ -936,7 +1150,7 @@ export declare function normalizeAgentDeviceError(err: unknown, context?: {
936
1150
  logPath?: string;
937
1151
  }): NormalizedError;
938
1152
 
939
- export declare type NormalizedError = {
1153
+ declare type NormalizedError = {
940
1154
  code: string;
941
1155
  message: string;
942
1156
  hint?: string;
@@ -945,7 +1159,7 @@ export declare type NormalizedError = {
945
1159
  details?: Record<string, unknown>;
946
1160
  };
947
1161
 
948
- export declare type OutputVisibility = 'client-visible' | 'internal';
1162
+ declare type OutputVisibility = 'client-visible' | 'internal';
949
1163
 
950
1164
  declare type PanOptions = DeviceCommandBaseOptions & {
951
1165
  x: number;
@@ -969,7 +1183,7 @@ declare type PerfArea = (typeof PERF_AREA_VALUES)[number];
969
1183
 
970
1184
  declare type PerfKind = (typeof PERF_KIND_VALUES)[number];
971
1185
 
972
- export declare type PerfOptions = DeviceCommandBaseOptions & {
1186
+ declare type PerfOptions = DeviceCommandBaseOptions & {
973
1187
  area?: PerfArea;
974
1188
  subject?: PerfSubject;
975
1189
  action?: PerfAction;
@@ -981,23 +1195,19 @@ export declare type PerfOptions = DeviceCommandBaseOptions & {
981
1195
 
982
1196
  declare type PerfSubject = (typeof PERF_SUBJECT_VALUES)[number];
983
1197
 
984
- export declare type PermissionTarget = 'camera' | 'microphone' | 'photos' | 'contacts' | 'contacts-limited' | 'notifications' | 'calendar' | 'location' | 'location-always' | 'media-library' | 'motion' | 'reminders' | 'siri' | 'accessibility' | 'screen-recording' | 'input-monitoring';
1198
+ declare type PermissionTarget = 'camera' | 'microphone' | 'photos' | 'contacts' | 'contacts-limited' | 'notifications' | 'calendar' | 'location' | 'location-always' | 'media-library' | 'motion' | 'reminders' | 'siri' | 'accessibility' | 'screen-recording' | 'input-monitoring';
985
1199
 
986
- export declare type PinchOptions = DeviceCommandBaseOptions & {
1200
+ declare type PinchOptions = DeviceCommandBaseOptions & {
987
1201
  scale: number;
988
1202
  x?: number;
989
1203
  y?: number;
990
1204
  };
991
1205
 
992
- declare type Platform = (typeof PLATFORMS)[number];
993
-
994
- declare const PLATFORM_SELECTORS: readonly ["ios", "macos", "android", "linux", "web", "apple"];
995
-
996
- declare const PLATFORMS: readonly ['ios', 'macos', 'android', 'linux', 'web'];
1206
+ declare const PLATFORM_SELECTORS: readonly ["apple", "android", "linux", "web", "ios", "macos"];
997
1207
 
998
1208
  declare type PlatformSelector = (typeof PLATFORM_SELECTORS)[number];
999
1209
 
1000
- export declare type Point = {
1210
+ declare type Point = {
1001
1211
  x: number;
1002
1212
  y: number;
1003
1213
  };
@@ -1031,7 +1241,16 @@ declare type PrepareMetroRuntimeResult = {
1031
1241
  bridge: MetroBridgeResult | null;
1032
1242
  };
1033
1243
 
1034
- export declare type PressOptions = DeviceCommandBaseOptions & SelectorSnapshotCommandOptions & InteractionTarget & RepeatedPressOptions;
1244
+ declare type PressCommandResult = ResolvedInteractionTarget & {
1245
+ backendResult?: Record<string, unknown>;
1246
+ message?: string;
1247
+ };
1248
+
1249
+ declare type PressOptions = DeviceCommandBaseOptions & SelectorSnapshotCommandOptions & InteractionTarget & RepeatedPressOptions;
1250
+
1251
+ declare const PUBLIC_PLATFORMS: readonly ['ios', 'macos', 'android', 'linux', 'web'];
1252
+
1253
+ declare type PublicPlatform = (typeof PUBLIC_PLATFORMS)[number];
1035
1254
 
1036
1255
  declare type PublicSnapshotCaptureAnnotations = Pick<SnapshotCaptureAnnotations, 'androidSnapshot' | 'warnings'> & {
1037
1256
  snapshotQuality?: SnapshotQualityVerdict;
@@ -1072,7 +1291,7 @@ declare const RECORDING_EXPORT_QUALITIES: readonly ['medium', 'high'];
1072
1291
 
1073
1292
  declare type RecordingExportQuality = (typeof RECORDING_EXPORT_QUALITIES)[number];
1074
1293
 
1075
- export declare type RecordOptions = AgentDeviceRequestOverrides & {
1294
+ declare type RecordOptions = AgentDeviceRequestOverrides & {
1076
1295
  action: 'start' | 'stop';
1077
1296
  path?: string;
1078
1297
  fps?: number;
@@ -1081,7 +1300,7 @@ export declare type RecordOptions = AgentDeviceRequestOverrides & {
1081
1300
  hideTouches?: boolean;
1082
1301
  };
1083
1302
 
1084
- export declare type Rect = {
1303
+ declare type Rect = {
1085
1304
  x: number;
1086
1305
  y: number;
1087
1306
  width: number;
@@ -1127,7 +1346,7 @@ declare type RepeatedPressOptions = {
1127
1346
  doubleTap?: boolean;
1128
1347
  };
1129
1348
 
1130
- export declare type ReplayRunOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
1349
+ declare type ReplayRunOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
1131
1350
  path: string;
1132
1351
  update?: boolean;
1133
1352
  /** @deprecated Use backend: 'maestro'. */
@@ -1137,7 +1356,7 @@ export declare type ReplayRunOptions = AgentDeviceRequestOverrides & AgentDevice
1137
1356
  timeoutMs?: number;
1138
1357
  };
1139
1358
 
1140
- export declare type ReplayTestOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
1359
+ declare type ReplayTestOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
1141
1360
  paths: string[];
1142
1361
  update?: boolean;
1143
1362
  /** @deprecated Use backend: 'maestro'. */
@@ -1149,43 +1368,88 @@ export declare type ReplayTestOptions = AgentDeviceRequestOverrides & AgentDevic
1149
1368
  retries?: number;
1150
1369
  recordVideo?: boolean;
1151
1370
  artifactsDir?: string;
1371
+ /** @deprecated Use the CLI --reporter junit:<path> or --report-junit <path>. */
1152
1372
  reportJunit?: string;
1153
1373
  shardAll?: number;
1154
1374
  shardSplit?: number;
1155
1375
  };
1156
1376
 
1157
- export declare type ReservedOutputFile = {
1377
+ declare type ReservedOutputFile = {
1158
1378
  path: string;
1159
1379
  visibility: OutputVisibility;
1160
1380
  publish: () => Promise<ArtifactDescriptor | undefined>;
1161
1381
  cleanup?: () => Promise<void>;
1162
1382
  };
1163
1383
 
1164
- export declare type ReserveOutputOptions = {
1384
+ declare type ReserveOutputOptions = {
1165
1385
  field: string;
1166
1386
  ext: string;
1167
1387
  requestedClientPath?: string;
1168
1388
  visibility?: OutputVisibility;
1169
1389
  };
1170
1390
 
1171
- export declare type ResolvedInputFile = {
1391
+ declare type ResolvedInputFile = {
1172
1392
  path: string;
1173
1393
  cleanup?: () => Promise<void>;
1174
1394
  };
1175
1395
 
1396
+ declare type ResolvedInteractionTarget = {
1397
+ kind: 'point';
1398
+ point: Point;
1399
+ } | {
1400
+ kind: 'ref';
1401
+ point?: Point;
1402
+ target: Extract<ResolvedTarget, {
1403
+ kind: 'ref';
1404
+ }>;
1405
+ node?: SnapshotNode;
1406
+ selectorChain?: string[];
1407
+ refLabel?: string;
1408
+ } | {
1409
+ kind: 'selector';
1410
+ point: Point;
1411
+ target: Extract<ResolvedTarget, {
1412
+ kind: 'selector';
1413
+ }>;
1414
+ node: SnapshotNode;
1415
+ selectorChain: string[];
1416
+ refLabel?: string;
1417
+ };
1418
+
1176
1419
  declare type ResolvedMetroKind = Exclude<MetroPrepareKind, 'auto'>;
1177
1420
 
1178
- export declare type ResolveInputOptions = {
1421
+ declare type ResolvedTarget = {
1422
+ kind: 'selector';
1423
+ selector: string;
1424
+ } | {
1425
+ kind: 'ref';
1426
+ ref: string;
1427
+ };
1428
+
1429
+ declare type ResolveInputOptions = {
1179
1430
  usage: string;
1180
1431
  field?: string;
1181
1432
  };
1182
1433
 
1183
- export declare type RotateCommandOptions = DeviceCommandBaseOptions & {
1434
+ declare const RESPONSE_LEVELS: readonly ['digest', 'default', 'full'];
1435
+
1436
+ declare type ResponseCost = {
1437
+ wallClockMs: number;
1438
+ runnerRoundTrips: number;
1439
+ nodeCount?: number;
1440
+ };
1441
+
1442
+ declare type ResponseLevel = (typeof RESPONSE_LEVELS)[number];
1443
+
1444
+ declare type RotateCommandOptions = DeviceCommandBaseOptions & {
1184
1445
  orientation: DeviceRotation;
1185
1446
  };
1186
1447
 
1187
- export declare type RotateCommandResult = CommandActionResult<'rotate'> & {
1188
- orientation?: RotateCommandOptions['orientation'];
1448
+ /** `rotate` `{ action: 'rotate', orientation, message: 'Rotated to <orientation>' }`. */
1449
+ declare type RotateCommandResult = {
1450
+ action: 'rotate';
1451
+ orientation: DeviceRotation;
1452
+ message: string;
1189
1453
  };
1190
1454
 
1191
1455
  declare type RotateGestureOptions = DeviceCommandBaseOptions & {
@@ -1195,7 +1459,7 @@ declare type RotateGestureOptions = DeviceCommandBaseOptions & {
1195
1459
  velocity?: number;
1196
1460
  };
1197
1461
 
1198
- export declare type ScreenshotOverlayRef = {
1462
+ declare type ScreenshotOverlayRef = {
1199
1463
  ref: string;
1200
1464
  label?: string;
1201
1465
  rect: Rect;
@@ -1222,7 +1486,6 @@ declare type ScrollOptions_2 = DeviceCommandBaseOptions & {
1222
1486
  pixels?: number;
1223
1487
  durationMs?: number;
1224
1488
  };
1225
- export { ScrollOptions_2 as ScrollOptions }
1226
1489
 
1227
1490
  declare type SelectorSnapshotCommandOptions = Pick<CaptureSnapshotOptions, 'depth' | 'scope' | 'raw'>;
1228
1491
 
@@ -1238,9 +1501,10 @@ declare const SESSION_ISOLATION_MODES: readonly ['none', 'tenant'];
1238
1501
 
1239
1502
  declare const SESSION_SURFACES: readonly ['app', 'frontmost-app', 'desktop', 'menubar'];
1240
1503
 
1241
- export declare type SessionCloseResult = {
1504
+ declare type SessionCloseResult = {
1242
1505
  session: string;
1243
1506
  shutdown?: TargetShutdownResult;
1507
+ provider?: CloudProviderSessionResult;
1244
1508
  identifiers: AgentDeviceIdentifiers;
1245
1509
  };
1246
1510
 
@@ -1256,7 +1520,7 @@ declare type SessionRuntimeHints = {
1256
1520
 
1257
1521
  declare type SessionSurface = (typeof SESSION_SURFACES)[number];
1258
1522
 
1259
- export declare type SettingsUpdateOptions = (DeviceCommandBaseOptions & {
1523
+ declare type SettingsUpdateOptions = (DeviceCommandBaseOptions & {
1260
1524
  setting: 'clear-app-state';
1261
1525
  state: 'clear';
1262
1526
  app?: string;
@@ -1287,6 +1551,30 @@ export declare type SettingsUpdateOptions = (DeviceCommandBaseOptions & {
1287
1551
  mode?: 'full' | 'limited';
1288
1552
  });
1289
1553
 
1554
+ /**
1555
+ * Closed result of the `shutdown` command. Mirrors the daemon handler's success
1556
+ * return EXACTLY (src/daemon/handlers/session-state.ts) — the fixed object
1557
+ * literal `{ platform, target, device, id, kind, shutdown }` plus the additive
1558
+ * `appleOs` discriminant (Apple devices only). The `shutdown` field is the raw
1559
+ * {@link TargetShutdownResult} from `shutdownDeviceTarget`.
1560
+ */
1561
+ declare type ShutdownCommandResult = {
1562
+ platform: PublicPlatform;
1563
+ target: DeviceTarget;
1564
+ /** Human-readable device name (`device.name`). */
1565
+ device: string;
1566
+ /** Stable device id (`device.id`). */
1567
+ id: string;
1568
+ kind: DeviceKind;
1569
+ shutdown: TargetShutdownResult;
1570
+ /**
1571
+ * Additive Apple-OS discriminant (`device.appleOs`): iPhone/iPad/tvOS/visionOS/macOS.
1572
+ * Present only for Apple devices; absent for non-Apple platforms. `platform` stays the
1573
+ * leaf (`ios`/`macos`) — this is an extra field, not a replacement.
1574
+ */
1575
+ appleOs?: AppleOS;
1576
+ };
1577
+
1290
1578
  declare type SnapshotCaptureAnalysis = {
1291
1579
  rawNodeCount: number;
1292
1580
  maxDepth: number;
@@ -1312,13 +1600,17 @@ declare type SnapshotDiagnosticsSummary = {
1312
1600
  warning?: string;
1313
1601
  };
1314
1602
 
1315
- export declare type SnapshotNode = RawSnapshotNode & {
1603
+ declare type SnapshotNode = RawSnapshotNode & {
1316
1604
  ref: string;
1317
1605
  };
1318
1606
 
1319
1607
  /**
1320
1608
  * Structured quality verdict computed once by the iOS runner's snapshot capture plan.
1321
1609
  * The daemon renders it; it never re-derives degradation from node shapes.
1610
+ *
1611
+ * Defined here (the foundational snapshot type module) rather than in
1612
+ * snapshot-quality.ts so SnapshotNode can reference it without a cyclic import;
1613
+ * snapshot-quality.ts (the validation logic) re-exports it for existing callers.
1322
1614
  */
1323
1615
  declare type SnapshotQualityVerdict = {
1324
1616
  state: 'healthy' | 'recovered' | 'sparse';
@@ -1335,7 +1627,7 @@ declare type SnapshotTimingStats = {
1335
1627
  p95Ms: number;
1336
1628
  maxMs: number;
1337
1629
  slowThresholdMs: number;
1338
- platform?: Platform;
1630
+ platform?: PublicPlatform;
1339
1631
  backends?: Record<string, number>;
1340
1632
  };
1341
1633
 
@@ -1346,16 +1638,16 @@ declare type SnapshotUnchanged = {
1346
1638
  scope?: string;
1347
1639
  };
1348
1640
 
1349
- export declare type SnapshotVisibility = {
1641
+ declare type SnapshotVisibility = {
1350
1642
  partial: boolean;
1351
1643
  visibleNodeCount: number;
1352
1644
  totalNodeCount: number;
1353
1645
  reasons: SnapshotVisibilityReason[];
1354
1646
  };
1355
1647
 
1356
- export declare type SnapshotVisibilityReason = 'offscreen-nodes' | 'scroll-hidden-above' | 'scroll-hidden-below';
1648
+ declare type SnapshotVisibilityReason = 'offscreen-nodes' | 'scroll-hidden-above' | 'scroll-hidden-below';
1357
1649
 
1358
- export declare type StartupPerfSample = {
1650
+ declare type StartupPerfSample = {
1359
1651
  durationMs: number;
1360
1652
  measuredAt: string;
1361
1653
  method: string;
@@ -1372,7 +1664,7 @@ declare type SwipeGestureOptions = DeviceCommandBaseOptions & {
1372
1664
  durationMs?: number;
1373
1665
  };
1374
1666
 
1375
- export declare type SwipeOptions = DeviceCommandBaseOptions & {
1667
+ declare type SwipeOptions = DeviceCommandBaseOptions & {
1376
1668
  from: {
1377
1669
  x: number;
1378
1670
  y: number;
@@ -1391,7 +1683,7 @@ declare type SwipePattern = (typeof SWIPE_PATTERNS)[number];
1391
1683
 
1392
1684
  declare type SwipePreset = (typeof SWIPE_PRESETS)[number];
1393
1685
 
1394
- export declare type TargetShutdownResult = {
1686
+ declare type TargetShutdownResult = {
1395
1687
  success: boolean;
1396
1688
  exitCode: number;
1397
1689
  stdout: string;
@@ -1399,13 +1691,13 @@ export declare type TargetShutdownResult = {
1399
1691
  error?: NormalizedError;
1400
1692
  };
1401
1693
 
1402
- export declare type TemporaryFile = {
1694
+ declare type TemporaryFile = {
1403
1695
  path: string;
1404
1696
  visibility: 'internal';
1405
1697
  cleanup: () => Promise<void>;
1406
1698
  };
1407
1699
 
1408
- export declare type TraceOptions = AgentDeviceRequestOverrides & {
1700
+ declare type TraceOptions = AgentDeviceRequestOverrides & {
1409
1701
  action: 'start' | 'stop';
1410
1702
  path?: string;
1411
1703
  };
@@ -1422,7 +1714,7 @@ declare type TransformGestureParams = {
1422
1714
  durationMs?: number;
1423
1715
  };
1424
1716
 
1425
- export declare type TypeTextOptions = DeviceCommandBaseOptions & {
1717
+ declare type TypeTextOptions = DeviceCommandBaseOptions & {
1426
1718
  text: string;
1427
1719
  delayMs?: number;
1428
1720
  };
@@ -1432,18 +1724,20 @@ declare type ViewportCommandOptions = DeviceCommandBaseOptions & {
1432
1724
  height: number;
1433
1725
  };
1434
1726
 
1435
- declare type ViewportCommandResult = CommandRequestResult & {
1727
+ /**
1728
+ * Closed result of the `viewport` command. Mirrors the dispatch handler's return
1729
+ * EXACTLY (src/core/dispatch.ts `handleViewportCommand`) — `{ width, height }`
1730
+ * plus the always-present `successText` message. The generic dispatch path
1731
+ * returns this object unchanged (viewport has no Android dialog guard, so no
1732
+ * `warning` is ever appended), so the shape is intentionally closed.
1733
+ */
1734
+ declare type ViewportCommandResult = {
1436
1735
  width: number;
1437
1736
  height: number;
1737
+ message: string;
1438
1738
  };
1439
1739
 
1440
- export declare type WaitCommandOptions = DeviceCommandBaseOptions & WaitCommandTarget;
1441
-
1442
- export declare type WaitCommandResult = DaemonResponseData & {
1443
- waitedMs?: number;
1444
- text?: string;
1445
- selector?: string;
1446
- };
1740
+ declare type WaitCommandOptions = DeviceCommandBaseOptions & WaitCommandTarget;
1447
1741
 
1448
1742
  declare type WaitCommandTarget = {
1449
1743
  durationMs: number;