agent-device 0.12.5 → 0.12.6
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/641.js +33 -33
- package/dist/src/backend.d.ts +326 -4
- package/dist/src/bin.js +32 -32
- package/dist/src/commands/index.d.ts +978 -6
- package/dist/src/commands/index.js +1 -1
- package/dist/src/daemon.js +15 -15
- package/dist/src/index.d.ts +977 -5
- package/dist/src/index.js +3 -3
- package/dist/src/testing/conformance.d.ts +341 -4
- package/dist/src/testing/conformance.js +1 -1
- package/package.json +1 -1
- package/skills/agent-device/references/macos-desktop.md +1 -1
- package/skills/agent-device/references/remote-tenancy.md +13 -5
package/dist/src/backend.d.ts
CHANGED
|
@@ -11,12 +11,44 @@ export declare type AgentDeviceBackend = {
|
|
|
11
11
|
typeText?(context: BackendCommandContext, text: string, options?: {
|
|
12
12
|
delayMs?: number;
|
|
13
13
|
}): Promise<BackendActionResult>;
|
|
14
|
+
focus?(context: BackendCommandContext, point: Point): Promise<BackendActionResult>;
|
|
15
|
+
longPress?(context: BackendCommandContext, point: Point, options?: BackendLongPressOptions): Promise<BackendActionResult>;
|
|
16
|
+
swipe?(context: BackendCommandContext, from: Point, to: Point, options?: BackendSwipeOptions): Promise<BackendActionResult>;
|
|
17
|
+
scroll?(context: BackendCommandContext, target: BackendScrollTarget, options: BackendScrollOptions): Promise<BackendActionResult>;
|
|
18
|
+
pinch?(context: BackendCommandContext, options: BackendPinchOptions): Promise<BackendActionResult>;
|
|
14
19
|
pressKey?(context: BackendCommandContext, key: string, options?: {
|
|
15
20
|
modifiers?: string[];
|
|
16
21
|
}): Promise<BackendActionResult>;
|
|
17
|
-
|
|
22
|
+
pressBack?(context: BackendCommandContext, options?: BackendBackOptions): Promise<BackendActionResult>;
|
|
23
|
+
pressHome?(context: BackendCommandContext): Promise<BackendActionResult>;
|
|
24
|
+
rotate?(context: BackendCommandContext, orientation: BackendDeviceOrientation): Promise<BackendActionResult>;
|
|
25
|
+
setKeyboard?(context: BackendCommandContext, options: BackendKeyboardOptions): Promise<BackendKeyboardResult | BackendActionResult>;
|
|
26
|
+
getClipboard?(context: BackendCommandContext): Promise<string | BackendClipboardTextResult>;
|
|
27
|
+
setClipboard?(context: BackendCommandContext, text: string): Promise<BackendActionResult>;
|
|
28
|
+
openSettings?(context: BackendCommandContext, target?: string): Promise<BackendActionResult>;
|
|
29
|
+
handleAlert?(context: BackendCommandContext, action: BackendAlertAction, options?: {
|
|
30
|
+
timeoutMs?: number;
|
|
31
|
+
}): Promise<BackendAlertResult>;
|
|
32
|
+
openAppSwitcher?(context: BackendCommandContext): Promise<BackendActionResult>;
|
|
33
|
+
openApp?(context: BackendCommandContext, target: BackendOpenTarget, options?: BackendOpenOptions): Promise<BackendActionResult>;
|
|
18
34
|
closeApp?(context: BackendCommandContext, app?: string): Promise<BackendActionResult>;
|
|
19
|
-
|
|
35
|
+
listApps?(context: BackendCommandContext, filter?: BackendAppListFilter): Promise<readonly BackendAppInfo[]>;
|
|
36
|
+
getAppState?(context: BackendCommandContext, app: string): Promise<BackendAppState>;
|
|
37
|
+
pushFile?(context: BackendCommandContext, input: BackendPushInput, target: string): Promise<BackendActionResult>;
|
|
38
|
+
triggerAppEvent?(context: BackendCommandContext, event: BackendAppEvent): Promise<BackendActionResult>;
|
|
39
|
+
listDevices?(context: BackendCommandContext, filter?: BackendDeviceFilter): Promise<readonly BackendDeviceInfo[]>;
|
|
40
|
+
bootDevice?(context: BackendCommandContext, target?: BackendDeviceTarget): Promise<BackendActionResult>;
|
|
41
|
+
ensureSimulator?(context: BackendCommandContext, options: BackendEnsureSimulatorOptions): Promise<BackendEnsureSimulatorResult>;
|
|
42
|
+
resolveInstallSource?(context: BackendCommandContext, source: BackendInstallSource): Promise<BackendInstallSource>;
|
|
43
|
+
installApp?(context: BackendCommandContext, target: BackendInstallTarget): Promise<BackendInstallResult>;
|
|
44
|
+
reinstallApp?(context: BackendCommandContext, target: BackendInstallTarget): Promise<BackendInstallResult>;
|
|
45
|
+
startRecording?(context: BackendCommandContext, options?: BackendRecordingOptions): Promise<BackendRecordingResult>;
|
|
46
|
+
stopRecording?(context: BackendCommandContext, options?: BackendRecordingOptions): Promise<BackendRecordingResult>;
|
|
47
|
+
startTrace?(context: BackendCommandContext, options?: BackendTraceOptions): Promise<BackendTraceResult>;
|
|
48
|
+
stopTrace?(context: BackendCommandContext, options?: BackendTraceOptions): Promise<BackendTraceResult>;
|
|
49
|
+
readLogs?(context: BackendCommandContext, options?: BackendReadLogsOptions): Promise<BackendReadLogsResult>;
|
|
50
|
+
dumpNetwork?(context: BackendCommandContext, options?: BackendDumpNetworkOptions): Promise<BackendDumpNetworkResult>;
|
|
51
|
+
measurePerf?(context: BackendCommandContext, options?: BackendMeasurePerfOptions): Promise<BackendMeasurePerfResult>;
|
|
20
52
|
};
|
|
21
53
|
|
|
22
54
|
export declare type AgentDeviceBackendPlatform = 'ios' | 'android' | 'macos' | 'linux';
|
|
@@ -31,10 +63,65 @@ export declare const BACKEND_CAPABILITY_NAMES: readonly ["android.shell", "ios.r
|
|
|
31
63
|
|
|
32
64
|
export declare type BackendActionResult = Record<string, unknown> | void;
|
|
33
65
|
|
|
66
|
+
export declare type BackendAlertAction = 'get' | 'accept' | 'dismiss' | 'wait';
|
|
67
|
+
|
|
68
|
+
export declare type BackendAlertInfo = {
|
|
69
|
+
title?: string;
|
|
70
|
+
message?: string;
|
|
71
|
+
buttons?: string[];
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export declare type BackendAlertResult = {
|
|
75
|
+
kind: 'alertStatus';
|
|
76
|
+
alert: BackendAlertInfo | null;
|
|
77
|
+
} | {
|
|
78
|
+
kind: 'alertHandled';
|
|
79
|
+
handled: boolean;
|
|
80
|
+
alert?: BackendAlertInfo;
|
|
81
|
+
button?: string;
|
|
82
|
+
} | {
|
|
83
|
+
kind: 'alertWait';
|
|
84
|
+
alert: BackendAlertInfo | null;
|
|
85
|
+
waitedMs?: number;
|
|
86
|
+
timedOut?: boolean;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export declare type BackendAppEvent = {
|
|
90
|
+
name: string;
|
|
91
|
+
payload?: Record<string, unknown>;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export declare type BackendAppInfo = {
|
|
95
|
+
id: string;
|
|
96
|
+
name?: string;
|
|
97
|
+
bundleId?: string;
|
|
98
|
+
packageName?: string;
|
|
99
|
+
activity?: string;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export declare type BackendAppListFilter = 'all' | 'user-installed';
|
|
103
|
+
|
|
104
|
+
export declare type BackendAppState = {
|
|
105
|
+
appId?: string;
|
|
106
|
+
bundleId?: string;
|
|
107
|
+
packageName?: string;
|
|
108
|
+
activity?: string;
|
|
109
|
+
state?: 'unknown' | 'notRunning' | 'running' | 'foreground' | 'background';
|
|
110
|
+
details?: Record<string, unknown>;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export declare type BackendBackOptions = {
|
|
114
|
+
mode?: 'in-app' | 'system';
|
|
115
|
+
};
|
|
116
|
+
|
|
34
117
|
export declare type BackendCapabilityName = (typeof BACKEND_CAPABILITY_NAMES)[number];
|
|
35
118
|
|
|
36
119
|
export declare type BackendCapabilitySet = readonly BackendCapabilityName[];
|
|
37
120
|
|
|
121
|
+
export declare type BackendClipboardTextResult = {
|
|
122
|
+
text: string;
|
|
123
|
+
};
|
|
124
|
+
|
|
38
125
|
export declare type BackendCommandContext = {
|
|
39
126
|
session?: string;
|
|
40
127
|
requestId?: string;
|
|
@@ -44,6 +131,71 @@ export declare type BackendCommandContext = {
|
|
|
44
131
|
metadata?: Record<string, unknown>;
|
|
45
132
|
};
|
|
46
133
|
|
|
134
|
+
export declare type BackendDeviceFilter = {
|
|
135
|
+
platform?: AgentDeviceBackendPlatform | 'apple';
|
|
136
|
+
target?: 'mobile' | 'tv' | 'desktop';
|
|
137
|
+
kind?: 'simulator' | 'emulator' | 'device' | 'desktop';
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export declare type BackendDeviceInfo = {
|
|
141
|
+
id: string;
|
|
142
|
+
name: string;
|
|
143
|
+
platform: AgentDeviceBackendPlatform;
|
|
144
|
+
target?: 'mobile' | 'tv' | 'desktop';
|
|
145
|
+
kind?: 'simulator' | 'emulator' | 'device' | 'desktop';
|
|
146
|
+
booted?: boolean;
|
|
147
|
+
details?: Record<string, unknown>;
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export declare type BackendDeviceOrientation = 'portrait' | 'portrait-upside-down' | 'landscape-left' | 'landscape-right';
|
|
151
|
+
|
|
152
|
+
export declare type BackendDeviceTarget = {
|
|
153
|
+
id?: string;
|
|
154
|
+
name?: string;
|
|
155
|
+
platform?: AgentDeviceBackendPlatform;
|
|
156
|
+
target?: 'mobile' | 'tv' | 'desktop';
|
|
157
|
+
headless?: boolean;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
export declare type BackendDiagnosticsPageOptions = BackendDiagnosticsTimeWindow & {
|
|
161
|
+
cursor?: string;
|
|
162
|
+
limit?: number;
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
export declare type BackendDiagnosticsTimeWindow = {
|
|
166
|
+
since?: string;
|
|
167
|
+
until?: string;
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
export declare type BackendDumpNetworkOptions = BackendDiagnosticsPageOptions & {
|
|
171
|
+
include?: BackendNetworkIncludeMode;
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
export declare type BackendDumpNetworkResult = {
|
|
175
|
+
entries: readonly BackendNetworkEntry[];
|
|
176
|
+
nextCursor?: string;
|
|
177
|
+
timeWindow?: BackendDiagnosticsTimeWindow;
|
|
178
|
+
backend?: string;
|
|
179
|
+
redacted?: boolean;
|
|
180
|
+
notes?: readonly string[];
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
export declare type BackendEnsureSimulatorOptions = {
|
|
184
|
+
device: string;
|
|
185
|
+
runtime?: string;
|
|
186
|
+
boot?: boolean;
|
|
187
|
+
reuseExisting?: boolean;
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
export declare type BackendEnsureSimulatorResult = {
|
|
191
|
+
udid: string;
|
|
192
|
+
device: string;
|
|
193
|
+
runtime: string;
|
|
194
|
+
created: boolean;
|
|
195
|
+
booted: boolean;
|
|
196
|
+
simulatorSetPath?: string | null;
|
|
197
|
+
};
|
|
198
|
+
|
|
47
199
|
export declare type BackendEscapeHatches = {
|
|
48
200
|
androidShell?(context: BackendCommandContext, args: readonly string[]): Promise<BackendShellResult>;
|
|
49
201
|
iosRunnerCommand?(context: BackendCommandContext, command: BackendRunnerCommand): Promise<BackendActionResult>;
|
|
@@ -58,21 +210,166 @@ export declare type BackendFindTextResult = {
|
|
|
58
210
|
found: boolean;
|
|
59
211
|
};
|
|
60
212
|
|
|
213
|
+
export declare type BackendInstallResult = Record<string, unknown> & {
|
|
214
|
+
appId?: string;
|
|
215
|
+
appName?: string;
|
|
216
|
+
bundleId?: string;
|
|
217
|
+
packageName?: string;
|
|
218
|
+
launchTarget?: string;
|
|
219
|
+
installablePath?: string;
|
|
220
|
+
archivePath?: string;
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
export declare type BackendInstallSource = {
|
|
224
|
+
kind: 'path';
|
|
225
|
+
path: string;
|
|
226
|
+
} | {
|
|
227
|
+
kind: 'uploadedArtifact';
|
|
228
|
+
id: string;
|
|
229
|
+
} | {
|
|
230
|
+
kind: 'url';
|
|
231
|
+
url: string;
|
|
232
|
+
};
|
|
233
|
+
|
|
61
234
|
export declare type BackendInstallTarget = {
|
|
62
|
-
app
|
|
63
|
-
|
|
235
|
+
app?: string;
|
|
236
|
+
source: BackendInstallSource;
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
export declare type BackendKeyboardOptions = {
|
|
240
|
+
action: 'status' | 'get' | 'dismiss';
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
export declare type BackendKeyboardResult = {
|
|
244
|
+
platform?: 'android' | 'ios' | 'macos' | 'linux';
|
|
245
|
+
action?: BackendKeyboardOptions['action'];
|
|
246
|
+
visible?: boolean;
|
|
247
|
+
inputType?: string | null;
|
|
248
|
+
type?: string | null;
|
|
249
|
+
wasVisible?: boolean;
|
|
250
|
+
dismissed?: boolean;
|
|
251
|
+
attempts?: number;
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
export declare type BackendLogEntry = {
|
|
255
|
+
timestamp?: string;
|
|
256
|
+
level?: 'debug' | 'info' | 'warn' | 'error' | string;
|
|
257
|
+
message: string;
|
|
258
|
+
source?: string;
|
|
259
|
+
metadata?: Record<string, unknown>;
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
export declare type BackendLongPressOptions = {
|
|
263
|
+
durationMs?: number;
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
export declare type BackendMeasurePerfOptions = BackendDiagnosticsTimeWindow & {
|
|
267
|
+
sampleMs?: number;
|
|
268
|
+
metrics?: readonly string[];
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
export declare type BackendMeasurePerfResult = {
|
|
272
|
+
metrics: readonly BackendPerfMetric[];
|
|
273
|
+
startedAt?: string;
|
|
274
|
+
endedAt?: string;
|
|
275
|
+
backend?: string;
|
|
276
|
+
redacted?: boolean;
|
|
277
|
+
notes?: readonly string[];
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
export declare type BackendNetworkEntry = {
|
|
281
|
+
timestamp?: string;
|
|
282
|
+
method?: string;
|
|
283
|
+
url?: string;
|
|
284
|
+
status?: number;
|
|
285
|
+
durationMs?: number;
|
|
286
|
+
requestHeaders?: Record<string, string>;
|
|
287
|
+
responseHeaders?: Record<string, string>;
|
|
288
|
+
requestBody?: string;
|
|
289
|
+
responseBody?: string;
|
|
290
|
+
metadata?: Record<string, unknown>;
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
export declare type BackendNetworkIncludeMode = 'summary' | 'headers' | 'body' | 'all';
|
|
294
|
+
|
|
295
|
+
export declare type BackendOpenOptions = {
|
|
296
|
+
relaunch?: boolean;
|
|
64
297
|
};
|
|
65
298
|
|
|
66
299
|
export declare type BackendOpenTarget = {
|
|
300
|
+
/**
|
|
301
|
+
* Generic app identifier accepted by the backend. Hosted adapters should
|
|
302
|
+
* prefer structured appId, bundleId, or packageName when available.
|
|
303
|
+
*/
|
|
67
304
|
app?: string;
|
|
305
|
+
appId?: string;
|
|
306
|
+
bundleId?: string;
|
|
307
|
+
packageName?: string;
|
|
308
|
+
/**
|
|
309
|
+
* URL may be used by itself for a deep link or with an app identifier when
|
|
310
|
+
* the backend supports opening a URL in a specific app context.
|
|
311
|
+
*/
|
|
68
312
|
url?: string;
|
|
313
|
+
/**
|
|
314
|
+
* Platform-specific activity override, primarily for Android app launches.
|
|
315
|
+
*/
|
|
69
316
|
activity?: string;
|
|
70
317
|
};
|
|
71
318
|
|
|
319
|
+
export declare type BackendPerfMetric = {
|
|
320
|
+
name: string;
|
|
321
|
+
value?: number;
|
|
322
|
+
unit?: string;
|
|
323
|
+
status?: 'ok' | 'unavailable' | 'error';
|
|
324
|
+
message?: string;
|
|
325
|
+
metadata?: Record<string, unknown>;
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
export declare type BackendPinchOptions = {
|
|
329
|
+
scale: number;
|
|
330
|
+
center?: Point;
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
export declare type BackendPushInput = {
|
|
334
|
+
kind: 'json';
|
|
335
|
+
payload: Record<string, unknown>;
|
|
336
|
+
} | {
|
|
337
|
+
kind: 'file';
|
|
338
|
+
path: string;
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
export declare type BackendReadLogsOptions = BackendDiagnosticsPageOptions & {
|
|
342
|
+
levels?: readonly string[];
|
|
343
|
+
search?: string;
|
|
344
|
+
source?: string;
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
export declare type BackendReadLogsResult = {
|
|
348
|
+
entries: readonly BackendLogEntry[];
|
|
349
|
+
nextCursor?: string;
|
|
350
|
+
timeWindow?: BackendDiagnosticsTimeWindow;
|
|
351
|
+
backend?: string;
|
|
352
|
+
redacted?: boolean;
|
|
353
|
+
notes?: readonly string[];
|
|
354
|
+
};
|
|
355
|
+
|
|
72
356
|
export declare type BackendReadTextResult = {
|
|
73
357
|
text: string;
|
|
74
358
|
};
|
|
75
359
|
|
|
360
|
+
export declare type BackendRecordingOptions = {
|
|
361
|
+
outPath?: string;
|
|
362
|
+
fps?: number;
|
|
363
|
+
quality?: number;
|
|
364
|
+
showTouches?: boolean;
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
export declare type BackendRecordingResult = Record<string, unknown> & {
|
|
368
|
+
path?: string;
|
|
369
|
+
telemetryPath?: string;
|
|
370
|
+
warning?: string;
|
|
371
|
+
};
|
|
372
|
+
|
|
76
373
|
export declare type BackendRunnerCommand = {
|
|
77
374
|
command: string;
|
|
78
375
|
args?: readonly string[];
|
|
@@ -90,6 +387,19 @@ export declare type BackendScreenshotResult = {
|
|
|
90
387
|
overlayRefs?: ScreenshotOverlayRef[];
|
|
91
388
|
};
|
|
92
389
|
|
|
390
|
+
export declare type BackendScrollOptions = {
|
|
391
|
+
direction: 'up' | 'down' | 'left' | 'right';
|
|
392
|
+
amount?: number;
|
|
393
|
+
pixels?: number;
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
export declare type BackendScrollTarget = {
|
|
397
|
+
kind: 'viewport';
|
|
398
|
+
} | {
|
|
399
|
+
kind: 'point';
|
|
400
|
+
point: Point;
|
|
401
|
+
};
|
|
402
|
+
|
|
93
403
|
export declare type BackendShellResult = {
|
|
94
404
|
exitCode: number;
|
|
95
405
|
stdout: string;
|
|
@@ -124,6 +434,10 @@ export declare type BackendSnapshotResult = {
|
|
|
124
434
|
appBundleId?: string;
|
|
125
435
|
};
|
|
126
436
|
|
|
437
|
+
export declare type BackendSwipeOptions = {
|
|
438
|
+
durationMs?: number;
|
|
439
|
+
};
|
|
440
|
+
|
|
127
441
|
export declare type BackendTapOptions = {
|
|
128
442
|
button?: 'primary' | 'secondary' | 'middle';
|
|
129
443
|
count?: number;
|
|
@@ -133,6 +447,14 @@ export declare type BackendTapOptions = {
|
|
|
133
447
|
doubleTap?: boolean;
|
|
134
448
|
};
|
|
135
449
|
|
|
450
|
+
export declare type BackendTraceOptions = {
|
|
451
|
+
outPath?: string;
|
|
452
|
+
};
|
|
453
|
+
|
|
454
|
+
export declare type BackendTraceResult = Record<string, unknown> & {
|
|
455
|
+
outPath?: string;
|
|
456
|
+
};
|
|
457
|
+
|
|
136
458
|
export declare function hasBackendCapability(backend: Pick<AgentDeviceBackend, 'platform' | 'capabilities'>, capability: BackendCapabilityName): boolean;
|
|
137
459
|
|
|
138
460
|
export declare function hasBackendEscapeHatch(backend: Pick<AgentDeviceBackend, 'escapeHatches'>, capability: BackendCapabilityName): boolean;
|