agent-device 0.11.13 → 0.11.15
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.
- package/dist/src/760.js +33 -0
- package/dist/src/924.js +1 -0
- package/dist/src/bin.js +67 -77
- package/dist/src/daemon.js +19 -51
- package/dist/src/index.d.ts +460 -40
- package/dist/src/index.js +2 -2
- package/dist/src/metro.d.ts +1 -0
- package/dist/src/remote-config.js +1 -1
- package/package.json +1 -1
- package/dist/src/995.js +0 -1
package/dist/src/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
declare type AgentDeviceClient = {
|
|
1
|
+
export declare type AgentDeviceClient = {
|
|
2
|
+
command: AgentDeviceCommandClient;
|
|
2
3
|
devices: {
|
|
3
4
|
list: (options?: AgentDeviceRequestOverrides & AgentDeviceSelectionOptions) => Promise<AgentDeviceDevice[]>;
|
|
5
|
+
boot: (options?: DeviceBootOptions) => Promise<CommandRequestResult>;
|
|
4
6
|
};
|
|
5
7
|
sessions: {
|
|
6
8
|
list: (options?: AgentDeviceRequestOverrides) => Promise<AgentDeviceSession[]>;
|
|
@@ -15,8 +17,11 @@ declare type AgentDeviceClient = {
|
|
|
15
17
|
install: (options: AppDeployOptions) => Promise<AppDeployResult>;
|
|
16
18
|
reinstall: (options: AppDeployOptions) => Promise<AppDeployResult>;
|
|
17
19
|
installFromSource: (options: AppInstallFromSourceOptions) => Promise<AppInstallFromSourceResult>;
|
|
20
|
+
list: (options?: AppListOptions) => Promise<string[]>;
|
|
18
21
|
open: (options: AppOpenOptions) => Promise<AppOpenResult>;
|
|
19
22
|
close: (options?: AppCloseOptions) => Promise<AppCloseResult>;
|
|
23
|
+
push: (options: AppPushOptions) => Promise<CommandRequestResult>;
|
|
24
|
+
triggerEvent: (options: AppTriggerEventOptions) => Promise<CommandRequestResult>;
|
|
20
25
|
};
|
|
21
26
|
materializations: {
|
|
22
27
|
release: (options: MaterializationReleaseOptions) => Promise<MaterializationReleaseResult>;
|
|
@@ -27,14 +32,50 @@ declare type AgentDeviceClient = {
|
|
|
27
32
|
capture: {
|
|
28
33
|
snapshot: (options?: CaptureSnapshotOptions) => Promise<CaptureSnapshotResult>;
|
|
29
34
|
screenshot: (options?: CaptureScreenshotOptions) => Promise<CaptureScreenshotResult>;
|
|
35
|
+
diff: (options: CaptureDiffOptions) => Promise<CommandRequestResult>;
|
|
36
|
+
};
|
|
37
|
+
interactions: {
|
|
38
|
+
click: (options: ClickOptions) => Promise<CommandRequestResult>;
|
|
39
|
+
press: (options: PressOptions) => Promise<CommandRequestResult>;
|
|
40
|
+
longPress: (options: LongPressOptions) => Promise<CommandRequestResult>;
|
|
41
|
+
swipe: (options: SwipeOptions) => Promise<CommandRequestResult>;
|
|
42
|
+
focus: (options: FocusOptions_2) => Promise<CommandRequestResult>;
|
|
43
|
+
type: (options: TypeTextOptions) => Promise<CommandRequestResult>;
|
|
44
|
+
fill: (options: FillOptions) => Promise<CommandRequestResult>;
|
|
45
|
+
scroll: (options: ScrollOptions_2) => Promise<CommandRequestResult>;
|
|
46
|
+
scrollIntoView: (options: ScrollIntoViewOptions_2) => Promise<CommandRequestResult>;
|
|
47
|
+
pinch: (options: PinchOptions) => Promise<CommandRequestResult>;
|
|
48
|
+
get: (options: GetOptions) => Promise<CommandRequestResult>;
|
|
49
|
+
is: (options: IsOptions) => Promise<CommandRequestResult>;
|
|
50
|
+
find: (options: FindOptions) => Promise<CommandRequestResult>;
|
|
51
|
+
};
|
|
52
|
+
replay: {
|
|
53
|
+
run: (options: ReplayRunOptions) => Promise<CommandRequestResult>;
|
|
54
|
+
test: (options: ReplayTestOptions) => Promise<CommandRequestResult>;
|
|
55
|
+
};
|
|
56
|
+
batch: {
|
|
57
|
+
run: (options: BatchRunOptions) => Promise<CommandRequestResult>;
|
|
58
|
+
};
|
|
59
|
+
observability: {
|
|
60
|
+
perf: (options?: PerfOptions) => Promise<CommandRequestResult>;
|
|
61
|
+
logs: (options?: LogsOptions) => Promise<CommandRequestResult>;
|
|
62
|
+
network: (options?: NetworkOptions) => Promise<CommandRequestResult>;
|
|
63
|
+
};
|
|
64
|
+
recording: {
|
|
65
|
+
record: (options: RecordOptions) => Promise<CommandRequestResult>;
|
|
66
|
+
trace: (options: TraceOptions) => Promise<CommandRequestResult>;
|
|
67
|
+
};
|
|
68
|
+
settings: {
|
|
69
|
+
update: (options: SettingsUpdateOptions) => Promise<CommandRequestResult>;
|
|
30
70
|
};
|
|
31
71
|
};
|
|
32
72
|
|
|
33
|
-
declare type AgentDeviceClientConfig = {
|
|
73
|
+
export declare type AgentDeviceClientConfig = {
|
|
34
74
|
session?: string;
|
|
35
75
|
lockPolicy?: DaemonLockPolicy;
|
|
36
76
|
lockPlatform?: PlatformSelector;
|
|
37
77
|
requestId?: string;
|
|
78
|
+
remoteConfig?: string;
|
|
38
79
|
stateDir?: string;
|
|
39
80
|
daemonBaseUrl?: string;
|
|
40
81
|
daemonAuthToken?: string;
|
|
@@ -48,9 +89,21 @@ declare type AgentDeviceClientConfig = {
|
|
|
48
89
|
debug?: boolean;
|
|
49
90
|
};
|
|
50
91
|
|
|
51
|
-
declare type
|
|
92
|
+
export declare type AgentDeviceCommandClient = {
|
|
93
|
+
wait: (options: WaitCommandOptions) => Promise<WaitCommandResult>;
|
|
94
|
+
alert: (options?: AlertCommandOptions) => Promise<AlertCommandResult>;
|
|
95
|
+
appState: (options?: AppStateCommandOptions) => Promise<AppStateCommandResult>;
|
|
96
|
+
back: (options?: BackCommandOptions) => Promise<BackCommandResult>;
|
|
97
|
+
home: (options?: HomeCommandOptions) => Promise<HomeCommandResult>;
|
|
98
|
+
rotate: (options: RotateCommandOptions) => Promise<RotateCommandResult>;
|
|
99
|
+
appSwitcher: (options?: AppSwitcherCommandOptions) => Promise<AppSwitcherCommandResult>;
|
|
100
|
+
keyboard: (options?: KeyboardCommandOptions) => Promise<KeyboardCommandResult>;
|
|
101
|
+
clipboard: (options: ClipboardCommandOptions) => Promise<ClipboardCommandResult>;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export declare type AgentDeviceDaemonTransport = (req: Omit<DaemonRequest, 'token'>) => Promise<DaemonResponse>;
|
|
52
105
|
|
|
53
|
-
declare type AgentDeviceDevice = {
|
|
106
|
+
export declare type AgentDeviceDevice = {
|
|
54
107
|
platform: Platform;
|
|
55
108
|
target: DeviceTarget;
|
|
56
109
|
kind: DeviceKind;
|
|
@@ -66,7 +119,7 @@ declare type AgentDeviceDevice = {
|
|
|
66
119
|
};
|
|
67
120
|
};
|
|
68
121
|
|
|
69
|
-
declare type AgentDeviceIdentifiers = {
|
|
122
|
+
export declare type AgentDeviceIdentifiers = {
|
|
70
123
|
session?: string;
|
|
71
124
|
deviceId?: string;
|
|
72
125
|
deviceName?: string;
|
|
@@ -77,9 +130,9 @@ declare type AgentDeviceIdentifiers = {
|
|
|
77
130
|
package?: string;
|
|
78
131
|
};
|
|
79
132
|
|
|
80
|
-
declare type AgentDeviceRequestOverrides = Pick<AgentDeviceClientConfig, 'session' | 'lockPolicy' | 'lockPlatform' | 'requestId' | 'tenant' | 'sessionIsolation' | 'runId' | 'leaseId' | 'cwd' | 'debug'>;
|
|
133
|
+
export declare type AgentDeviceRequestOverrides = Pick<AgentDeviceClientConfig, 'session' | 'lockPolicy' | 'lockPlatform' | 'requestId' | 'tenant' | 'sessionIsolation' | 'runId' | 'leaseId' | 'cwd' | 'debug'>;
|
|
81
134
|
|
|
82
|
-
declare type AgentDeviceSelectionOptions = {
|
|
135
|
+
export declare type AgentDeviceSelectionOptions = {
|
|
83
136
|
platform?: PlatformSelector;
|
|
84
137
|
target?: DeviceTarget;
|
|
85
138
|
device?: string;
|
|
@@ -89,14 +142,14 @@ declare type AgentDeviceSelectionOptions = {
|
|
|
89
142
|
androidDeviceAllowlist?: string;
|
|
90
143
|
};
|
|
91
144
|
|
|
92
|
-
declare type AgentDeviceSession = {
|
|
145
|
+
export declare type AgentDeviceSession = {
|
|
93
146
|
name: string;
|
|
94
147
|
createdAt: number;
|
|
95
148
|
device: AgentDeviceSessionDevice;
|
|
96
149
|
identifiers: AgentDeviceIdentifiers;
|
|
97
150
|
};
|
|
98
151
|
|
|
99
|
-
declare type AgentDeviceSessionDevice = {
|
|
152
|
+
export declare type AgentDeviceSessionDevice = {
|
|
100
153
|
platform: Platform;
|
|
101
154
|
target: DeviceTarget;
|
|
102
155
|
id: string;
|
|
@@ -111,24 +164,31 @@ declare type AgentDeviceSessionDevice = {
|
|
|
111
164
|
};
|
|
112
165
|
};
|
|
113
166
|
|
|
114
|
-
declare type
|
|
167
|
+
export declare type AlertCommandOptions = DeviceCommandBaseOptions & {
|
|
168
|
+
action?: 'get' | 'accept' | 'dismiss' | 'wait';
|
|
169
|
+
timeoutMs?: number;
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
export declare type AlertCommandResult = DaemonResponseData;
|
|
173
|
+
|
|
174
|
+
export declare type AppCloseOptions = AgentDeviceRequestOverrides & {
|
|
115
175
|
app?: string;
|
|
116
176
|
shutdown?: boolean;
|
|
117
177
|
};
|
|
118
178
|
|
|
119
|
-
declare type AppCloseResult = {
|
|
179
|
+
export declare type AppCloseResult = {
|
|
120
180
|
session: string;
|
|
121
181
|
closedApp?: string;
|
|
122
182
|
shutdown?: Record<string, unknown>;
|
|
123
183
|
identifiers: AgentDeviceIdentifiers;
|
|
124
184
|
};
|
|
125
185
|
|
|
126
|
-
declare type AppDeployOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
|
|
186
|
+
export declare type AppDeployOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
|
|
127
187
|
app: string;
|
|
128
188
|
appPath: string;
|
|
129
189
|
};
|
|
130
190
|
|
|
131
|
-
declare type AppDeployResult = {
|
|
191
|
+
export declare type AppDeployResult = {
|
|
132
192
|
app: string;
|
|
133
193
|
appPath: string;
|
|
134
194
|
platform: Platform;
|
|
@@ -151,13 +211,13 @@ declare type AppErrorDetails = Record<string, unknown> & {
|
|
|
151
211
|
logPath?: string;
|
|
152
212
|
};
|
|
153
213
|
|
|
154
|
-
declare type AppInstallFromSourceOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
|
|
214
|
+
export declare type AppInstallFromSourceOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
|
|
155
215
|
source: DaemonInstallSource;
|
|
156
216
|
retainPaths?: boolean;
|
|
157
217
|
retentionMs?: number;
|
|
158
218
|
};
|
|
159
219
|
|
|
160
|
-
declare type AppInstallFromSourceResult = {
|
|
220
|
+
export declare type AppInstallFromSourceResult = {
|
|
161
221
|
appName?: string;
|
|
162
222
|
appId?: string;
|
|
163
223
|
bundleId?: string;
|
|
@@ -172,8 +232,12 @@ declare type AppInstallFromSourceResult = {
|
|
|
172
232
|
|
|
173
233
|
declare type ApplePlatform = 'ios' | 'macos';
|
|
174
234
|
|
|
175
|
-
declare type
|
|
176
|
-
|
|
235
|
+
export declare type AppListOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
|
|
236
|
+
appsFilter?: 'all' | 'user-installed';
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
export declare type AppOpenOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
|
|
240
|
+
app?: string;
|
|
177
241
|
url?: string;
|
|
178
242
|
surface?: 'app' | 'frontmost-app' | 'desktop' | 'menubar';
|
|
179
243
|
activity?: string;
|
|
@@ -183,7 +247,7 @@ declare type AppOpenOptions = AgentDeviceRequestOverrides & AgentDeviceSelection
|
|
|
183
247
|
runtime?: SessionRuntimeHints;
|
|
184
248
|
};
|
|
185
249
|
|
|
186
|
-
declare type AppOpenResult = {
|
|
250
|
+
export declare type AppOpenResult = {
|
|
187
251
|
session: string;
|
|
188
252
|
appName?: string;
|
|
189
253
|
appBundleId?: string;
|
|
@@ -194,25 +258,78 @@ declare type AppOpenResult = {
|
|
|
194
258
|
identifiers: AgentDeviceIdentifiers;
|
|
195
259
|
};
|
|
196
260
|
|
|
197
|
-
declare type
|
|
261
|
+
export declare type AppPushOptions = ClientCommandBaseOptions & {
|
|
262
|
+
app: string;
|
|
263
|
+
payload: string | Record<string, unknown>;
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
export declare type AppStateCommandOptions = DeviceCommandBaseOptions;
|
|
267
|
+
|
|
268
|
+
export declare type AppStateCommandResult = DaemonResponseData & {
|
|
269
|
+
platform?: Platform;
|
|
270
|
+
appName?: string;
|
|
271
|
+
appBundleId?: string;
|
|
272
|
+
package?: string;
|
|
273
|
+
activity?: string;
|
|
274
|
+
source?: 'session';
|
|
275
|
+
surface?: 'app' | 'frontmost-app' | 'desktop' | 'menubar';
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
export declare type AppSwitcherCommandOptions = DeviceCommandBaseOptions;
|
|
279
|
+
|
|
280
|
+
export declare type AppSwitcherCommandResult = CommandActionResult<'app-switcher'>;
|
|
281
|
+
|
|
282
|
+
export declare type AppTriggerEventOptions = ClientCommandBaseOptions & {
|
|
283
|
+
event: string;
|
|
284
|
+
payload?: Record<string, unknown>;
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
export declare type BackCommandOptions = DeviceCommandBaseOptions & {
|
|
288
|
+
mode?: 'in-app' | 'system';
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
export declare type BackCommandResult = CommandActionResult<'back'> & {
|
|
292
|
+
mode?: 'in-app' | 'system';
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
export declare type BatchRunOptions = AgentDeviceRequestOverrides & {
|
|
296
|
+
steps: BatchStep[];
|
|
297
|
+
onError?: 'stop';
|
|
298
|
+
maxSteps?: number;
|
|
299
|
+
out?: string;
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
export declare type BatchStep = {
|
|
303
|
+
command: string;
|
|
304
|
+
positionals?: string[];
|
|
305
|
+
flags?: Record<string, unknown>;
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
declare type BatchStep_2 = {
|
|
198
309
|
command: string;
|
|
199
310
|
positionals?: string[];
|
|
200
311
|
flags?: Partial<CommandFlags>;
|
|
201
312
|
runtime?: unknown;
|
|
202
313
|
};
|
|
203
314
|
|
|
204
|
-
declare type
|
|
315
|
+
export declare type CaptureDiffOptions = ClientCommandBaseOptions & Pick<CaptureSnapshotOptions, 'interactiveOnly' | 'compact' | 'depth' | 'scope' | 'raw'> & {
|
|
316
|
+
kind: 'snapshot';
|
|
317
|
+
out?: string;
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
export declare type CaptureScreenshotOptions = AgentDeviceRequestOverrides & {
|
|
205
321
|
path?: string;
|
|
206
322
|
overlayRefs?: boolean;
|
|
323
|
+
fullscreen?: boolean;
|
|
207
324
|
};
|
|
208
325
|
|
|
209
|
-
declare type CaptureScreenshotResult = {
|
|
326
|
+
export declare type CaptureScreenshotResult = {
|
|
210
327
|
path: string;
|
|
211
328
|
overlayRefs?: ScreenshotOverlayRef[];
|
|
212
329
|
identifiers: AgentDeviceIdentifiers;
|
|
213
330
|
};
|
|
214
331
|
|
|
215
|
-
declare type CaptureSnapshotOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
|
|
332
|
+
export declare type CaptureSnapshotOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
|
|
216
333
|
interactiveOnly?: boolean;
|
|
217
334
|
compact?: boolean;
|
|
218
335
|
depth?: number;
|
|
@@ -220,7 +337,7 @@ declare type CaptureSnapshotOptions = AgentDeviceRequestOverrides & AgentDeviceS
|
|
|
220
337
|
raw?: boolean;
|
|
221
338
|
};
|
|
222
339
|
|
|
223
|
-
declare type CaptureSnapshotResult = {
|
|
340
|
+
export declare type CaptureSnapshotResult = {
|
|
224
341
|
nodes: SnapshotNode[];
|
|
225
342
|
truncated: boolean;
|
|
226
343
|
appName?: string;
|
|
@@ -230,6 +347,12 @@ declare type CaptureSnapshotResult = {
|
|
|
230
347
|
identifiers: AgentDeviceIdentifiers;
|
|
231
348
|
};
|
|
232
349
|
|
|
350
|
+
export declare type ClickOptions = ClientCommandBaseOptions & SelectorSnapshotCommandOptions & InteractionTarget & RepeatedPressOptions & {
|
|
351
|
+
button?: 'primary' | 'secondary' | 'middle';
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
declare type ClientCommandBaseOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions;
|
|
355
|
+
|
|
233
356
|
declare type CliFlags = {
|
|
234
357
|
json: boolean;
|
|
235
358
|
config?: string;
|
|
@@ -334,10 +457,31 @@ declare type CliFlags = {
|
|
|
334
457
|
version: boolean;
|
|
335
458
|
};
|
|
336
459
|
|
|
460
|
+
export declare type ClipboardCommandOptions = (DeviceCommandBaseOptions & {
|
|
461
|
+
action: 'read';
|
|
462
|
+
}) | (DeviceCommandBaseOptions & {
|
|
463
|
+
action: 'write';
|
|
464
|
+
text: string;
|
|
465
|
+
});
|
|
466
|
+
|
|
467
|
+
export declare type ClipboardCommandResult = (DaemonResponseData & {
|
|
468
|
+
action: 'read';
|
|
469
|
+
text: string;
|
|
470
|
+
}) | (DaemonResponseData & {
|
|
471
|
+
action: 'write';
|
|
472
|
+
textLength: number;
|
|
473
|
+
});
|
|
474
|
+
|
|
475
|
+
declare type CommandActionResult<T extends string> = DaemonResponseData & {
|
|
476
|
+
action?: T;
|
|
477
|
+
};
|
|
478
|
+
|
|
337
479
|
declare type CommandFlags = Omit<CliFlags, 'json' | 'help' | 'version' | 'batchSteps'> & {
|
|
338
|
-
batchSteps?:
|
|
480
|
+
batchSteps?: BatchStep_2[];
|
|
339
481
|
};
|
|
340
482
|
|
|
483
|
+
export declare type CommandRequestResult = DaemonResponseData;
|
|
484
|
+
|
|
341
485
|
export declare function createAgentDeviceClient(config?: AgentDeviceClientConfig, deps?: {
|
|
342
486
|
transport?: AgentDeviceDaemonTransport;
|
|
343
487
|
}): AgentDeviceClient;
|
|
@@ -419,13 +563,15 @@ declare type DaemonResponse = DaemonResponse_2;
|
|
|
419
563
|
|
|
420
564
|
declare type DaemonResponse_2 = {
|
|
421
565
|
ok: true;
|
|
422
|
-
data?:
|
|
566
|
+
data?: DaemonResponseData_2;
|
|
423
567
|
} | {
|
|
424
568
|
ok: false;
|
|
425
569
|
error: DaemonError;
|
|
426
570
|
};
|
|
427
571
|
|
|
428
|
-
declare type DaemonResponseData =
|
|
572
|
+
declare type DaemonResponseData = DaemonResponseData_2;
|
|
573
|
+
|
|
574
|
+
declare type DaemonResponseData_2 = Record<string, unknown> & {
|
|
429
575
|
artifacts?: DaemonArtifact[];
|
|
430
576
|
};
|
|
431
577
|
|
|
@@ -433,11 +579,19 @@ declare type DaemonServerMode = 'socket' | 'http' | 'dual';
|
|
|
433
579
|
|
|
434
580
|
declare type DaemonTransportMode = 'auto' | 'socket' | 'http';
|
|
435
581
|
|
|
582
|
+
export declare type DeviceBootOptions = ClientCommandBaseOptions & {
|
|
583
|
+
headless?: boolean;
|
|
584
|
+
};
|
|
585
|
+
|
|
586
|
+
declare type DeviceCommandBaseOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions;
|
|
587
|
+
|
|
436
588
|
declare type DeviceKind = 'simulator' | 'emulator' | 'device';
|
|
437
589
|
|
|
438
590
|
declare type DeviceTarget = 'mobile' | 'tv' | 'desktop';
|
|
439
591
|
|
|
440
|
-
declare type
|
|
592
|
+
export declare type ElementTarget = RefTarget | SelectorTarget;
|
|
593
|
+
|
|
594
|
+
export declare type EnsureSimulatorOptions = AgentDeviceRequestOverrides & {
|
|
441
595
|
device: string;
|
|
442
596
|
runtime?: string;
|
|
443
597
|
boot?: boolean;
|
|
@@ -445,7 +599,7 @@ declare type EnsureSimulatorOptions = AgentDeviceRequestOverrides & {
|
|
|
445
599
|
iosSimulatorDeviceSet?: string;
|
|
446
600
|
};
|
|
447
601
|
|
|
448
|
-
declare type EnsureSimulatorResult = {
|
|
602
|
+
export declare type EnsureSimulatorResult = {
|
|
449
603
|
udid: string;
|
|
450
604
|
device: string;
|
|
451
605
|
runtime: string;
|
|
@@ -457,13 +611,96 @@ declare type EnsureSimulatorResult = {
|
|
|
457
611
|
|
|
458
612
|
declare type ErrorCode = 'INVALID_ARGS' | 'DEVICE_NOT_FOUND' | 'TOOL_MISSING' | 'APP_NOT_INSTALLED' | 'UNSUPPORTED_PLATFORM' | 'UNSUPPORTED_OPERATION' | 'COMMAND_FAILED' | 'SESSION_NOT_FOUND' | 'UNAUTHORIZED' | 'UNKNOWN';
|
|
459
613
|
|
|
614
|
+
export declare type FillOptions = ClientCommandBaseOptions & SelectorSnapshotCommandOptions & InteractionTarget & {
|
|
615
|
+
text: string;
|
|
616
|
+
delayMs?: number;
|
|
617
|
+
};
|
|
618
|
+
|
|
619
|
+
declare type FindBaseOptions = ClientCommandBaseOptions & FindSnapshotCommandOptions & {
|
|
620
|
+
locator?: FindLocator;
|
|
621
|
+
query: string;
|
|
622
|
+
first?: boolean;
|
|
623
|
+
last?: boolean;
|
|
624
|
+
};
|
|
625
|
+
|
|
626
|
+
export declare type FindLocator = 'any' | 'text' | 'label' | 'value' | 'role' | 'id';
|
|
627
|
+
|
|
628
|
+
export declare type FindOptions = (FindBaseOptions & {
|
|
629
|
+
action?: 'click' | 'focus' | 'exists' | 'getText' | 'getAttrs';
|
|
630
|
+
}) | (FindBaseOptions & {
|
|
631
|
+
action: 'wait';
|
|
632
|
+
timeoutMs?: number;
|
|
633
|
+
}) | (FindBaseOptions & {
|
|
634
|
+
action: 'fill' | 'type';
|
|
635
|
+
value: string;
|
|
636
|
+
});
|
|
637
|
+
|
|
638
|
+
declare type FindSnapshotCommandOptions = Pick<CaptureSnapshotOptions, 'depth' | 'raw'>;
|
|
639
|
+
|
|
640
|
+
declare type FocusOptions_2 = ClientCommandBaseOptions & {
|
|
641
|
+
x: number;
|
|
642
|
+
y: number;
|
|
643
|
+
};
|
|
644
|
+
export { FocusOptions_2 as FocusOptions }
|
|
645
|
+
|
|
646
|
+
export declare type GetOptions = ClientCommandBaseOptions & SelectorSnapshotCommandOptions & ElementTarget & {
|
|
647
|
+
format: 'text' | 'attrs';
|
|
648
|
+
};
|
|
649
|
+
|
|
650
|
+
export declare type HomeCommandOptions = DeviceCommandBaseOptions;
|
|
651
|
+
|
|
652
|
+
export declare type HomeCommandResult = CommandActionResult<'home'>;
|
|
653
|
+
|
|
654
|
+
export declare type InteractionTarget = PointTarget | RefTarget | SelectorTarget;
|
|
655
|
+
|
|
656
|
+
export declare type IsOptions = IsTextPredicateOptions | IsStatePredicateOptions;
|
|
657
|
+
|
|
658
|
+
declare type IsStatePredicateOptions = ClientCommandBaseOptions & SelectorSnapshotCommandOptions & {
|
|
659
|
+
predicate: 'visible' | 'hidden' | 'exists' | 'editable' | 'selected';
|
|
660
|
+
selector: string;
|
|
661
|
+
value?: never;
|
|
662
|
+
};
|
|
663
|
+
|
|
664
|
+
declare type IsTextPredicateOptions = ClientCommandBaseOptions & SelectorSnapshotCommandOptions & {
|
|
665
|
+
predicate: 'text';
|
|
666
|
+
selector: string;
|
|
667
|
+
value: string;
|
|
668
|
+
};
|
|
669
|
+
|
|
670
|
+
export declare type KeyboardCommandOptions = DeviceCommandBaseOptions & {
|
|
671
|
+
action?: 'status' | 'dismiss';
|
|
672
|
+
};
|
|
673
|
+
|
|
674
|
+
export declare type KeyboardCommandResult = DaemonResponseData & {
|
|
675
|
+
platform?: 'android' | 'ios';
|
|
676
|
+
action?: 'status' | 'dismiss';
|
|
677
|
+
visible?: boolean;
|
|
678
|
+
inputType?: string | null;
|
|
679
|
+
type?: string | null;
|
|
680
|
+
wasVisible?: boolean;
|
|
681
|
+
dismissed?: boolean;
|
|
682
|
+
attempts?: number;
|
|
683
|
+
};
|
|
684
|
+
|
|
460
685
|
declare type LeaseBackend = 'ios-simulator' | 'ios-instance' | 'android-instance';
|
|
461
686
|
|
|
462
|
-
declare type
|
|
687
|
+
export declare type LogsOptions = AgentDeviceRequestOverrides & {
|
|
688
|
+
action?: 'path' | 'start' | 'stop' | 'doctor' | 'mark' | 'clear';
|
|
689
|
+
message?: string;
|
|
690
|
+
restart?: boolean;
|
|
691
|
+
};
|
|
692
|
+
|
|
693
|
+
export declare type LongPressOptions = ClientCommandBaseOptions & {
|
|
694
|
+
x: number;
|
|
695
|
+
y: number;
|
|
696
|
+
durationMs?: number;
|
|
697
|
+
};
|
|
698
|
+
|
|
699
|
+
export declare type MaterializationReleaseOptions = AgentDeviceRequestOverrides & {
|
|
463
700
|
materializationId: string;
|
|
464
701
|
};
|
|
465
702
|
|
|
466
|
-
declare type MaterializationReleaseResult = {
|
|
703
|
+
export declare type MaterializationReleaseResult = {
|
|
467
704
|
released: boolean;
|
|
468
705
|
materializationId: string;
|
|
469
706
|
identifiers: AgentDeviceIdentifiers;
|
|
@@ -501,7 +738,7 @@ declare type MetroBridgeResult = {
|
|
|
501
738
|
|
|
502
739
|
declare type MetroPrepareKind = 'auto' | 'react-native' | 'expo';
|
|
503
740
|
|
|
504
|
-
declare type MetroPrepareOptions = {
|
|
741
|
+
export declare type MetroPrepareOptions = {
|
|
505
742
|
projectRoot?: string;
|
|
506
743
|
kind?: MetroPrepareKind;
|
|
507
744
|
publicBaseUrl: string;
|
|
@@ -521,17 +758,42 @@ declare type MetroPrepareOptions = {
|
|
|
521
758
|
logPath?: string;
|
|
522
759
|
};
|
|
523
760
|
|
|
524
|
-
declare type MetroPrepareResult = PrepareMetroRuntimeResult;
|
|
761
|
+
export declare type MetroPrepareResult = PrepareMetroRuntimeResult;
|
|
525
762
|
|
|
763
|
+
/** Re-export of {@link SessionRuntimeHints} under the Metro-specific alias used by public API consumers. */
|
|
526
764
|
declare type MetroRuntimeHints = SessionRuntimeHints_2;
|
|
527
765
|
|
|
766
|
+
export declare type NetworkOptions = AgentDeviceRequestOverrides & {
|
|
767
|
+
action?: 'dump' | 'log';
|
|
768
|
+
limit?: number;
|
|
769
|
+
include?: 'summary' | 'headers' | 'body' | 'all';
|
|
770
|
+
};
|
|
771
|
+
|
|
772
|
+
export declare type PerfOptions = ClientCommandBaseOptions;
|
|
773
|
+
|
|
774
|
+
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';
|
|
775
|
+
|
|
776
|
+
export declare type PinchOptions = ClientCommandBaseOptions & {
|
|
777
|
+
scale: number;
|
|
778
|
+
x?: number;
|
|
779
|
+
y?: number;
|
|
780
|
+
};
|
|
781
|
+
|
|
528
782
|
declare type Platform = ApplePlatform | 'android' | 'linux';
|
|
529
783
|
|
|
530
784
|
declare type PlatformSelector = Platform | 'apple';
|
|
531
785
|
|
|
532
|
-
declare type Point = {
|
|
786
|
+
export declare type Point = {
|
|
787
|
+
x: number;
|
|
788
|
+
y: number;
|
|
789
|
+
};
|
|
790
|
+
|
|
791
|
+
declare type PointTarget = {
|
|
533
792
|
x: number;
|
|
534
793
|
y: number;
|
|
794
|
+
ref?: never;
|
|
795
|
+
selector?: never;
|
|
796
|
+
label?: never;
|
|
535
797
|
};
|
|
536
798
|
|
|
537
799
|
declare type PrepareMetroRuntimeResult = {
|
|
@@ -550,6 +812,8 @@ declare type PrepareMetroRuntimeResult = {
|
|
|
550
812
|
bridge: MetroBridgeResult | null;
|
|
551
813
|
};
|
|
552
814
|
|
|
815
|
+
export declare type PressOptions = ClientCommandBaseOptions & SelectorSnapshotCommandOptions & InteractionTarget & RepeatedPressOptions;
|
|
816
|
+
|
|
553
817
|
declare type RawSnapshotNode = {
|
|
554
818
|
index: number;
|
|
555
819
|
type?: string;
|
|
@@ -573,16 +837,62 @@ declare type RawSnapshotNode = {
|
|
|
573
837
|
hiddenContentBelow?: boolean;
|
|
574
838
|
};
|
|
575
839
|
|
|
576
|
-
declare type
|
|
840
|
+
export declare type RecordOptions = AgentDeviceRequestOverrides & {
|
|
841
|
+
action: 'start' | 'stop';
|
|
842
|
+
path?: string;
|
|
843
|
+
fps?: number;
|
|
844
|
+
hideTouches?: boolean;
|
|
845
|
+
};
|
|
846
|
+
|
|
847
|
+
export declare type Rect = {
|
|
577
848
|
x: number;
|
|
578
849
|
y: number;
|
|
579
850
|
width: number;
|
|
580
851
|
height: number;
|
|
581
852
|
};
|
|
582
853
|
|
|
854
|
+
declare type RefTarget = {
|
|
855
|
+
ref: string;
|
|
856
|
+
label?: string;
|
|
857
|
+
x?: never;
|
|
858
|
+
y?: never;
|
|
859
|
+
selector?: never;
|
|
860
|
+
};
|
|
861
|
+
|
|
862
|
+
declare type RepeatedPressOptions = {
|
|
863
|
+
count?: number;
|
|
864
|
+
intervalMs?: number;
|
|
865
|
+
holdMs?: number;
|
|
866
|
+
jitterPx?: number;
|
|
867
|
+
doubleTap?: boolean;
|
|
868
|
+
};
|
|
869
|
+
|
|
870
|
+
export declare type ReplayRunOptions = AgentDeviceRequestOverrides & {
|
|
871
|
+
path: string;
|
|
872
|
+
update?: boolean;
|
|
873
|
+
};
|
|
874
|
+
|
|
875
|
+
export declare type ReplayTestOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
|
|
876
|
+
paths: string[];
|
|
877
|
+
update?: boolean;
|
|
878
|
+
failFast?: boolean;
|
|
879
|
+
timeoutMs?: number;
|
|
880
|
+
retries?: number;
|
|
881
|
+
artifactsDir?: string;
|
|
882
|
+
reportJunit?: string;
|
|
883
|
+
};
|
|
884
|
+
|
|
583
885
|
declare type ResolvedMetroKind = Exclude<MetroPrepareKind, 'auto'>;
|
|
584
886
|
|
|
585
|
-
declare type
|
|
887
|
+
export declare type RotateCommandOptions = DeviceCommandBaseOptions & {
|
|
888
|
+
orientation: 'portrait' | 'portrait-upside-down' | 'landscape-left' | 'landscape-right';
|
|
889
|
+
};
|
|
890
|
+
|
|
891
|
+
export declare type RotateCommandResult = CommandActionResult<'rotate'> & {
|
|
892
|
+
orientation?: RotateCommandOptions['orientation'];
|
|
893
|
+
};
|
|
894
|
+
|
|
895
|
+
export declare type ScreenshotOverlayRef = {
|
|
586
896
|
ref: string;
|
|
587
897
|
label?: string;
|
|
588
898
|
rect: Rect;
|
|
@@ -590,7 +900,37 @@ declare type ScreenshotOverlayRef = {
|
|
|
590
900
|
center: Point;
|
|
591
901
|
};
|
|
592
902
|
|
|
593
|
-
declare type
|
|
903
|
+
declare type ScrollIntoViewOptions_2 = ClientCommandBaseOptions & ({
|
|
904
|
+
text: string;
|
|
905
|
+
ref?: never;
|
|
906
|
+
label?: never;
|
|
907
|
+
} | {
|
|
908
|
+
ref: string;
|
|
909
|
+
label?: string;
|
|
910
|
+
text?: never;
|
|
911
|
+
}) & {
|
|
912
|
+
maxScrolls?: number;
|
|
913
|
+
};
|
|
914
|
+
export { ScrollIntoViewOptions_2 as ScrollIntoViewOptions }
|
|
915
|
+
|
|
916
|
+
declare type ScrollOptions_2 = ClientCommandBaseOptions & {
|
|
917
|
+
direction: 'up' | 'down' | 'left' | 'right';
|
|
918
|
+
amount?: number;
|
|
919
|
+
pixels?: number;
|
|
920
|
+
};
|
|
921
|
+
export { ScrollOptions_2 as ScrollOptions }
|
|
922
|
+
|
|
923
|
+
declare type SelectorSnapshotCommandOptions = Pick<CaptureSnapshotOptions, 'depth' | 'scope' | 'raw'>;
|
|
924
|
+
|
|
925
|
+
declare type SelectorTarget = {
|
|
926
|
+
selector: string;
|
|
927
|
+
x?: never;
|
|
928
|
+
y?: never;
|
|
929
|
+
ref?: never;
|
|
930
|
+
label?: never;
|
|
931
|
+
};
|
|
932
|
+
|
|
933
|
+
export declare type SessionCloseResult = {
|
|
594
934
|
session: string;
|
|
595
935
|
shutdown?: Record<string, unknown>;
|
|
596
936
|
identifiers: AgentDeviceIdentifiers;
|
|
@@ -608,20 +948,39 @@ declare type SessionRuntimeHints_2 = {
|
|
|
608
948
|
launchUrl?: string;
|
|
609
949
|
};
|
|
610
950
|
|
|
611
|
-
declare type
|
|
951
|
+
export declare type SettingsUpdateOptions = (ClientCommandBaseOptions & {
|
|
952
|
+
setting: 'wifi' | 'airplane' | 'location';
|
|
953
|
+
state: 'on' | 'off';
|
|
954
|
+
}) | (ClientCommandBaseOptions & {
|
|
955
|
+
setting: 'appearance';
|
|
956
|
+
state: 'light' | 'dark' | 'toggle';
|
|
957
|
+
}) | (ClientCommandBaseOptions & {
|
|
958
|
+
setting: 'faceid' | 'touchid';
|
|
959
|
+
state: 'match' | 'nonmatch' | 'enroll' | 'unenroll';
|
|
960
|
+
}) | (ClientCommandBaseOptions & {
|
|
961
|
+
setting: 'fingerprint';
|
|
962
|
+
state: 'match' | 'nonmatch';
|
|
963
|
+
}) | (ClientCommandBaseOptions & {
|
|
964
|
+
setting: 'permission';
|
|
965
|
+
state: 'grant' | 'deny' | 'reset';
|
|
966
|
+
permission: PermissionTarget;
|
|
967
|
+
mode?: 'full' | 'limited';
|
|
968
|
+
});
|
|
969
|
+
|
|
970
|
+
export declare type SnapshotNode = RawSnapshotNode & {
|
|
612
971
|
ref: string;
|
|
613
972
|
};
|
|
614
973
|
|
|
615
|
-
declare type SnapshotVisibility = {
|
|
974
|
+
export declare type SnapshotVisibility = {
|
|
616
975
|
partial: boolean;
|
|
617
976
|
visibleNodeCount: number;
|
|
618
977
|
totalNodeCount: number;
|
|
619
978
|
reasons: SnapshotVisibilityReason[];
|
|
620
979
|
};
|
|
621
980
|
|
|
622
|
-
declare type SnapshotVisibilityReason = 'offscreen-nodes' | 'scroll-hidden-above' | 'scroll-hidden-below';
|
|
981
|
+
export declare type SnapshotVisibilityReason = 'offscreen-nodes' | 'scroll-hidden-above' | 'scroll-hidden-below';
|
|
623
982
|
|
|
624
|
-
declare type StartupPerfSample = {
|
|
983
|
+
export declare type StartupPerfSample = {
|
|
625
984
|
durationMs: number;
|
|
626
985
|
measuredAt: string;
|
|
627
986
|
method: string;
|
|
@@ -629,4 +988,65 @@ declare type StartupPerfSample = {
|
|
|
629
988
|
appBundleId?: string;
|
|
630
989
|
};
|
|
631
990
|
|
|
991
|
+
export declare type SwipeOptions = ClientCommandBaseOptions & {
|
|
992
|
+
from: {
|
|
993
|
+
x: number;
|
|
994
|
+
y: number;
|
|
995
|
+
};
|
|
996
|
+
to: {
|
|
997
|
+
x: number;
|
|
998
|
+
y: number;
|
|
999
|
+
};
|
|
1000
|
+
durationMs?: number;
|
|
1001
|
+
count?: number;
|
|
1002
|
+
pauseMs?: number;
|
|
1003
|
+
pattern?: 'one-way' | 'ping-pong';
|
|
1004
|
+
};
|
|
1005
|
+
|
|
1006
|
+
export declare type TraceOptions = AgentDeviceRequestOverrides & {
|
|
1007
|
+
action: 'start' | 'stop';
|
|
1008
|
+
path?: string;
|
|
1009
|
+
};
|
|
1010
|
+
|
|
1011
|
+
export declare type TypeTextOptions = ClientCommandBaseOptions & {
|
|
1012
|
+
text: string;
|
|
1013
|
+
delayMs?: number;
|
|
1014
|
+
};
|
|
1015
|
+
|
|
1016
|
+
export declare type WaitCommandOptions = DeviceCommandBaseOptions & WaitCommandTarget;
|
|
1017
|
+
|
|
1018
|
+
export declare type WaitCommandResult = DaemonResponseData & {
|
|
1019
|
+
waitedMs?: number;
|
|
1020
|
+
text?: string;
|
|
1021
|
+
selector?: string;
|
|
1022
|
+
};
|
|
1023
|
+
|
|
1024
|
+
declare type WaitCommandTarget = {
|
|
1025
|
+
durationMs: number;
|
|
1026
|
+
text?: never;
|
|
1027
|
+
ref?: never;
|
|
1028
|
+
selector?: never;
|
|
1029
|
+
timeoutMs?: never;
|
|
1030
|
+
} | (WaitSnapshotOptions & {
|
|
1031
|
+
text: string;
|
|
1032
|
+
durationMs?: never;
|
|
1033
|
+
ref?: never;
|
|
1034
|
+
selector?: never;
|
|
1035
|
+
timeoutMs?: number;
|
|
1036
|
+
}) | (WaitSnapshotOptions & {
|
|
1037
|
+
ref: string;
|
|
1038
|
+
durationMs?: never;
|
|
1039
|
+
text?: never;
|
|
1040
|
+
selector?: never;
|
|
1041
|
+
timeoutMs?: number;
|
|
1042
|
+
}) | (WaitSnapshotOptions & {
|
|
1043
|
+
selector: string;
|
|
1044
|
+
durationMs?: never;
|
|
1045
|
+
text?: never;
|
|
1046
|
+
ref?: never;
|
|
1047
|
+
timeoutMs?: number;
|
|
1048
|
+
});
|
|
1049
|
+
|
|
1050
|
+
declare type WaitSnapshotOptions = Pick<CaptureSnapshotOptions, 'depth' | 'scope' | 'raw'>;
|
|
1051
|
+
|
|
632
1052
|
export { }
|