agent-device 0.13.2 → 0.14.0

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 (65) hide show
  1. package/README.md +68 -63
  2. package/android-snapshot-helper/README.md +75 -0
  3. package/android-snapshot-helper/dist/agent-device-android-snapshot-helper-0.14.0.apk +0 -0
  4. package/android-snapshot-helper/dist/agent-device-android-snapshot-helper-0.14.0.apk.sha256 +1 -0
  5. package/android-snapshot-helper/dist/agent-device-android-snapshot-helper-0.14.0.manifest.json +17 -0
  6. package/bin/agent-device.mjs +6 -2
  7. package/dist/src/113.js +1 -1
  8. package/dist/src/1974.js +2 -2
  9. package/dist/src/221.js +4 -0
  10. package/dist/src/2301.js +1 -1
  11. package/dist/src/3918.js +29 -29
  12. package/dist/src/7847.js +1 -1
  13. package/dist/src/8161.js +3 -0
  14. package/dist/src/8656.js +1 -1
  15. package/dist/src/9152.js +1 -1
  16. package/dist/src/940.js +1 -0
  17. package/dist/src/9542.js +2 -2
  18. package/dist/src/9818.js +1 -1
  19. package/dist/src/989.js +1 -1
  20. package/dist/src/android-snapshot-helper.d.ts +181 -0
  21. package/dist/src/android-snapshot-helper.js +1 -0
  22. package/dist/src/index.d.ts +204 -1942
  23. package/dist/src/index.js +1 -1
  24. package/dist/src/internal/bin.js +440 -0
  25. package/dist/src/internal/companion-tunnel.js +1 -0
  26. package/dist/src/internal/daemon.js +45 -0
  27. package/dist/src/internal/update-check-entry.js +1 -0
  28. package/dist/src/metro.d.ts +5 -3
  29. package/dist/src/selectors.js +1 -1
  30. package/package.json +28 -24
  31. package/skills/agent-device/SKILL.md +20 -62
  32. package/skills/dogfood/SKILL.md +9 -168
  33. package/skills/react-devtools/SKILL.md +15 -31
  34. package/dist/src/4993.js +0 -1
  35. package/dist/src/5721.js +0 -1
  36. package/dist/src/7166.js +0 -1
  37. package/dist/src/8564.js +0 -3
  38. package/dist/src/9076.js +0 -1
  39. package/dist/src/backend.d.ts +0 -527
  40. package/dist/src/backend.js +0 -1
  41. package/dist/src/bin.js +0 -105
  42. package/dist/src/commands/index.d.ts +0 -1883
  43. package/dist/src/commands/index.js +0 -1
  44. package/dist/src/daemon.js +0 -43
  45. package/dist/src/metro-companion.js +0 -1
  46. package/dist/src/observability.d.ts +0 -91
  47. package/dist/src/observability.js +0 -1
  48. package/dist/src/testing/conformance.d.ts +0 -753
  49. package/dist/src/testing/conformance.js +0 -1
  50. package/dist/src/update-check-entry.js +0 -1
  51. package/skills/agent-device/references/bootstrap-install.md +0 -244
  52. package/skills/agent-device/references/coordinate-system.md +0 -28
  53. package/skills/agent-device/references/debugging.md +0 -138
  54. package/skills/agent-device/references/exploration.md +0 -362
  55. package/skills/agent-device/references/macos-desktop.md +0 -88
  56. package/skills/agent-device/references/remote-tenancy.md +0 -188
  57. package/skills/agent-device/references/verification.md +0 -134
  58. package/skills/dogfood/references/issue-taxonomy.md +0 -83
  59. package/skills/dogfood/templates/dogfood-report-template.md +0 -52
  60. package/skills/react-devtools/references/commands.md +0 -91
  61. package/skills/react-devtools/references/profiling.md +0 -74
  62. /package/dist/src/{bin.d.ts → internal/bin.d.ts} +0 -0
  63. /package/dist/src/{daemon.d.ts → internal/companion-tunnel.d.ts} +0 -0
  64. /package/dist/src/{metro-companion.d.ts → internal/daemon.d.ts} +0 -0
  65. /package/dist/src/{update-check-entry.d.ts → internal/update-check-entry.d.ts} +0 -0
@@ -1,113 +1,3 @@
1
- export declare type AdminBootCommandOptions = CommandContext & {
2
- target?: BackendDeviceTarget;
3
- };
4
-
5
- export declare type AdminBootCommandResult = {
6
- kind: 'deviceBooted';
7
- target?: BackendDeviceTarget;
8
- backendResult?: Record<string, unknown>;
9
- message?: string;
10
- };
11
-
12
- export declare type AdminDevicesCommandOptions = CommandContext & {
13
- filter?: BackendDeviceFilter;
14
- };
15
-
16
- export declare type AdminDevicesCommandResult = {
17
- kind: 'adminDevices';
18
- devices: readonly BackendDeviceInfo[];
19
- };
20
-
21
- export declare type AdminEnsureSimulatorCommandOptions = CommandContext & BackendEnsureSimulatorOptions;
22
-
23
- export declare type AdminEnsureSimulatorCommandResult = {
24
- kind: 'simulatorEnsured';
25
- } & BackendEnsureSimulatorResult;
26
-
27
- export declare type AdminInstallCommandOptions = CommandContext & {
28
- app: string;
29
- source: BackendInstallSource;
30
- };
31
-
32
- export declare type AdminInstallCommandResult = {
33
- kind: 'appInstalled' | 'appReinstalled' | 'appInstalledFromSource';
34
- app?: string;
35
- source: BackendInstallSource;
36
- appId?: string;
37
- appName?: string;
38
- bundleId?: string;
39
- packageName?: string;
40
- launchTarget?: string;
41
- installablePath?: string;
42
- archivePath?: string;
43
- backendResult?: Record<string, unknown>;
44
- message?: string;
45
- };
46
-
47
- export declare type AdminInstallFromSourceCommandOptions = CommandContext & {
48
- app?: string;
49
- source: BackendInstallSource;
50
- };
51
-
52
- export declare type AdminReinstallCommandOptions = AdminInstallCommandOptions;
53
-
54
- export declare type AgentDevice = AgentDeviceRuntime & BoundAgentDeviceCommands;
55
-
56
- export declare type AgentDeviceBackend = {
57
- platform: AgentDeviceBackendPlatform;
58
- capabilities?: BackendCapabilitySet;
59
- escapeHatches?: BackendEscapeHatches;
60
- captureSnapshot?(context: BackendCommandContext, options?: BackendSnapshotOptions): Promise<BackendSnapshotResult>;
61
- captureScreenshot?(context: BackendCommandContext, outPath: string, options?: BackendScreenshotOptions): Promise<BackendScreenshotResult | void>;
62
- readText?(context: BackendCommandContext, node: SnapshotNode): Promise<BackendReadTextResult>;
63
- findText?(context: BackendCommandContext, text: string): Promise<BackendFindTextResult>;
64
- tap?(context: BackendCommandContext, point: Point, options?: BackendTapOptions): Promise<BackendActionResult>;
65
- fill?(context: BackendCommandContext, point: Point, text: string, options?: BackendFillOptions): Promise<BackendActionResult>;
66
- typeText?(context: BackendCommandContext, text: string, options?: {
67
- delayMs?: number;
68
- }): Promise<BackendActionResult>;
69
- focus?(context: BackendCommandContext, point: Point): Promise<BackendActionResult>;
70
- longPress?(context: BackendCommandContext, point: Point, options?: BackendLongPressOptions): Promise<BackendActionResult>;
71
- swipe?(context: BackendCommandContext, from: Point, to: Point, options?: BackendSwipeOptions): Promise<BackendActionResult>;
72
- scroll?(context: BackendCommandContext, target: BackendScrollTarget, options: BackendScrollOptions): Promise<BackendActionResult>;
73
- pinch?(context: BackendCommandContext, options: BackendPinchOptions): Promise<BackendActionResult>;
74
- pressKey?(context: BackendCommandContext, key: string, options?: {
75
- modifiers?: string[];
76
- }): Promise<BackendActionResult>;
77
- pressBack?(context: BackendCommandContext, options?: BackendBackOptions): Promise<BackendActionResult>;
78
- pressHome?(context: BackendCommandContext): Promise<BackendActionResult>;
79
- rotate?(context: BackendCommandContext, orientation: BackendDeviceOrientation): Promise<BackendActionResult>;
80
- setKeyboard?(context: BackendCommandContext, options: BackendKeyboardOptions): Promise<BackendKeyboardResult | BackendActionResult>;
81
- getClipboard?(context: BackendCommandContext): Promise<string | BackendClipboardTextResult>;
82
- setClipboard?(context: BackendCommandContext, text: string): Promise<BackendActionResult>;
83
- openSettings?(context: BackendCommandContext, target?: string): Promise<BackendActionResult>;
84
- handleAlert?(context: BackendCommandContext, action: BackendAlertAction, options?: {
85
- timeoutMs?: number;
86
- }): Promise<BackendAlertResult>;
87
- openAppSwitcher?(context: BackendCommandContext): Promise<BackendActionResult>;
88
- openApp?(context: BackendCommandContext, target: BackendOpenTarget, options?: BackendOpenOptions): Promise<BackendActionResult>;
89
- closeApp?(context: BackendCommandContext, app?: string): Promise<BackendActionResult>;
90
- listApps?(context: BackendCommandContext, filter?: BackendAppListFilter): Promise<readonly BackendAppInfo[]>;
91
- getAppState?(context: BackendCommandContext, app: string): Promise<BackendAppState>;
92
- pushFile?(context: BackendCommandContext, input: BackendPushInput, target: string): Promise<BackendActionResult>;
93
- triggerAppEvent?(context: BackendCommandContext, event: BackendAppEvent): Promise<BackendActionResult>;
94
- listDevices?(context: BackendCommandContext, filter?: BackendDeviceFilter): Promise<readonly BackendDeviceInfo[]>;
95
- bootDevice?(context: BackendCommandContext, target?: BackendDeviceTarget): Promise<BackendActionResult>;
96
- ensureSimulator?(context: BackendCommandContext, options: BackendEnsureSimulatorOptions): Promise<BackendEnsureSimulatorResult>;
97
- resolveInstallSource?(context: BackendCommandContext, source: BackendInstallSource): Promise<BackendInstallSource>;
98
- installApp?(context: BackendCommandContext, target: BackendInstallTarget): Promise<BackendInstallResult>;
99
- reinstallApp?(context: BackendCommandContext, target: BackendInstallTarget): Promise<BackendInstallResult>;
100
- startRecording?(context: BackendCommandContext, options?: BackendRecordingOptions): Promise<BackendRecordingResult>;
101
- stopRecording?(context: BackendCommandContext, options?: BackendRecordingOptions): Promise<BackendRecordingResult>;
102
- startTrace?(context: BackendCommandContext, options?: BackendTraceOptions): Promise<BackendTraceResult>;
103
- stopTrace?(context: BackendCommandContext, options?: BackendTraceOptions): Promise<BackendTraceResult>;
104
- readLogs?(context: BackendCommandContext, options?: BackendReadLogsOptions): Promise<BackendReadLogsResult>;
105
- dumpNetwork?(context: BackendCommandContext, options?: BackendDumpNetworkOptions): Promise<BackendDumpNetworkResult>;
106
- measurePerf?(context: BackendCommandContext, options?: BackendMeasurePerfOptions): Promise<BackendMeasurePerfResult>;
107
- };
108
-
109
- export declare type AgentDeviceBackendPlatform = 'ios' | 'android' | 'macos' | 'linux';
110
-
111
1
  export declare type AgentDeviceClient = {
112
2
  command: AgentDeviceCommandClient;
113
3
  devices: {
@@ -219,78 +109,6 @@ export declare type AgentDeviceCommandClient = {
219
109
  clipboard: (options: ClipboardCommandOptions) => Promise<ClipboardCommandResult>;
220
110
  };
221
111
 
222
- declare type AgentDeviceCommands = {
223
- capture: {
224
- screenshot: RuntimeCommand<ScreenshotCommandOptions, ScreenshotCommandResult>;
225
- diffScreenshot: RuntimeCommand<DiffScreenshotCommandOptions, DiffScreenshotCommandResult>;
226
- snapshot: RuntimeCommand<SnapshotCommandOptions, SnapshotCommandResult>;
227
- diffSnapshot: RuntimeCommand<DiffSnapshotCommandOptions, DiffSnapshotCommandResult>;
228
- };
229
- selectors: {
230
- find: RuntimeCommand<FindReadCommandOptions, FindReadCommandResult>;
231
- get: RuntimeCommand<GetCommandOptions, GetCommandResult>;
232
- getText: RuntimeCommand<GetTextCommandOptions, Extract<GetCommandResult, {
233
- kind: 'text';
234
- }>>;
235
- getAttrs: RuntimeCommand<GetAttrsCommandOptions, Extract<GetCommandResult, {
236
- kind: 'attrs';
237
- }>>;
238
- is: RuntimeCommand<IsCommandOptions, IsCommandResult>;
239
- isVisible: RuntimeCommand<IsSelectorCommandOptions, IsCommandResult>;
240
- isHidden: RuntimeCommand<IsSelectorCommandOptions, IsCommandResult>;
241
- wait: RuntimeCommand<WaitCommandOptions_2, WaitCommandResult_2>;
242
- waitForText: RuntimeCommand<WaitForTextCommandOptions, Extract<WaitCommandResult_2, {
243
- kind: 'text';
244
- }>>;
245
- };
246
- interactions: {
247
- click: RuntimeCommand<ClickCommandOptions, PressCommandResult>;
248
- press: RuntimeCommand<PressCommandOptions, PressCommandResult>;
249
- fill: RuntimeCommand<FillCommandOptions, FillCommandResult>;
250
- typeText: RuntimeCommand<TypeTextCommandOptions, TypeTextCommandResult>;
251
- focus: RuntimeCommand<FocusCommandOptions, FocusCommandResult>;
252
- longPress: RuntimeCommand<LongPressCommandOptions, LongPressCommandResult>;
253
- swipe: RuntimeCommand<SwipeCommandOptions, SwipeCommandResult>;
254
- scroll: RuntimeCommand<ScrollCommandOptions, ScrollCommandResult>;
255
- pinch: RuntimeCommand<PinchCommandOptions, PinchCommandResult>;
256
- };
257
- system: {
258
- back: RuntimeCommand<SystemBackCommandOptions | undefined, SystemBackCommandResult>;
259
- home: RuntimeCommand<SystemHomeCommandOptions | undefined, SystemHomeCommandResult>;
260
- rotate: RuntimeCommand<SystemRotateCommandOptions, SystemRotateCommandResult>;
261
- keyboard: RuntimeCommand<SystemKeyboardCommandOptions | undefined, SystemKeyboardCommandResult>;
262
- clipboard: RuntimeCommand<SystemClipboardCommandOptions, SystemClipboardCommandResult>;
263
- settings: RuntimeCommand<SystemSettingsCommandOptions | undefined, SystemSettingsCommandResult>;
264
- alert: RuntimeCommand<SystemAlertCommandOptions | undefined, SystemAlertCommandResult>;
265
- appSwitcher: RuntimeCommand<SystemAppSwitcherCommandOptions | undefined, SystemAppSwitcherCommandResult>;
266
- };
267
- apps: {
268
- open: RuntimeCommand<OpenAppCommandOptions, OpenAppCommandResult>;
269
- close: RuntimeCommand<CloseAppCommandOptions | undefined, CloseAppCommandResult>;
270
- list: RuntimeCommand<ListAppsCommandOptions | undefined, ListAppsCommandResult>;
271
- state: RuntimeCommand<GetAppStateCommandOptions, GetAppStateCommandResult>;
272
- push: RuntimeCommand<PushAppCommandOptions, PushAppCommandResult>;
273
- triggerEvent: RuntimeCommand<TriggerAppEventCommandOptions, TriggerAppEventCommandResult>;
274
- };
275
- admin: {
276
- devices: RuntimeCommand<AdminDevicesCommandOptions | undefined, AdminDevicesCommandResult>;
277
- boot: RuntimeCommand<AdminBootCommandOptions | undefined, AdminBootCommandResult>;
278
- ensureSimulator: RuntimeCommand<AdminEnsureSimulatorCommandOptions, AdminEnsureSimulatorCommandResult>;
279
- install: RuntimeCommand<AdminInstallCommandOptions, AdminInstallCommandResult>;
280
- reinstall: RuntimeCommand<AdminReinstallCommandOptions, AdminInstallCommandResult>;
281
- installFromSource: RuntimeCommand<AdminInstallFromSourceCommandOptions, AdminInstallCommandResult>;
282
- };
283
- recording: {
284
- record: RuntimeCommand<RecordingRecordCommandOptions, RecordingRecordCommandResult>;
285
- trace: RuntimeCommand<RecordingTraceCommandOptions, RecordingTraceCommandResult>;
286
- };
287
- diagnostics: {
288
- logs: RuntimeCommand<DiagnosticsLogsCommandOptions | undefined, DiagnosticsLogsCommandResult>;
289
- network: RuntimeCommand<DiagnosticsNetworkCommandOptions | undefined, DiagnosticsNetworkCommandResult>;
290
- perf: RuntimeCommand<DiagnosticsPerfCommandOptions | undefined, DiagnosticsPerfCommandResult>;
291
- };
292
- };
293
-
294
112
  export declare type AgentDeviceDaemonTransport = (req: Omit<DaemonRequest, 'token'>) => Promise<DaemonResponse>;
295
113
 
296
114
  export declare type AgentDeviceDevice = {
@@ -322,26 +140,6 @@ export declare type AgentDeviceIdentifiers = {
322
140
 
323
141
  export declare type AgentDeviceRequestOverrides = Pick<AgentDeviceClientConfig, 'session' | 'lockPolicy' | 'lockPlatform' | 'requestId' | 'daemonBaseUrl' | 'daemonAuthToken' | 'daemonTransport' | 'daemonServerMode' | 'tenant' | 'sessionIsolation' | 'runId' | 'leaseId' | 'leaseBackend' | 'cwd' | 'debug'>;
324
142
 
325
- export declare type AgentDeviceRuntime = {
326
- backend: AgentDeviceBackend;
327
- artifacts: ArtifactAdapter;
328
- sessions: CommandSessionStore;
329
- policy: CommandPolicy;
330
- diagnostics?: DiagnosticsSink;
331
- clock?: CommandClock;
332
- signal?: AbortSignal;
333
- };
334
-
335
- export declare type AgentDeviceRuntimeConfig = {
336
- backend: AgentDeviceBackend;
337
- artifacts: ArtifactAdapter;
338
- sessions?: CommandSessionStore;
339
- policy?: CommandPolicy;
340
- diagnostics?: DiagnosticsSink;
341
- clock?: CommandClock;
342
- signal?: AbortSignal;
343
- };
344
-
345
143
  export declare type AgentDeviceSelectionOptions = {
346
144
  platform?: PlatformSelector;
347
145
  target?: DeviceTarget;
@@ -381,6 +179,24 @@ export declare type AlertCommandOptions = DeviceCommandBaseOptions & {
381
179
 
382
180
  export declare type AlertCommandResult = DaemonResponseData;
383
181
 
182
+ declare type AndroidSnapshotBackendMetadata = {
183
+ backend: 'android-helper' | 'uiautomator-dump';
184
+ helperVersion?: string;
185
+ helperApiVersion?: string;
186
+ fallbackReason?: string;
187
+ installReason?: 'missing' | 'outdated' | 'forced' | 'current' | 'skipped';
188
+ waitForIdleTimeoutMs?: number;
189
+ timeoutMs?: number;
190
+ maxDepth?: number;
191
+ maxNodes?: number;
192
+ rootPresent?: boolean;
193
+ captureMode?: 'interactive-windows' | 'active-window';
194
+ windowCount?: number;
195
+ nodeCount?: number;
196
+ helperTruncated?: boolean;
197
+ elapsedMs?: number;
198
+ };
199
+
384
200
  export declare type AppCloseOptions = AgentDeviceRequestOverrides & {
385
201
  app?: string;
386
202
  shutdown?: boolean;
@@ -470,11 +286,6 @@ export declare type AppOpenResult = {
470
286
  identifiers: AgentDeviceIdentifiers;
471
287
  };
472
288
 
473
- export declare type AppPushInput = {
474
- kind: 'json';
475
- payload: Record<string, unknown>;
476
- } | FileInputRef;
477
-
478
289
  export declare type AppPushOptions = ClientCommandBaseOptions & {
479
290
  app: string;
480
291
  payload: string | Record<string, unknown>;
@@ -523,8 +334,6 @@ export declare type ArtifactDescriptor = {
523
334
  metadata?: Record<string, unknown>;
524
335
  };
525
336
 
526
- export declare function assertBackendCapabilityAllowed(runtime: Pick<AgentDeviceRuntime, 'backend' | 'policy'>, capability: BackendCapabilityName): void;
527
-
528
337
  export declare type BackCommandOptions = DeviceCommandBaseOptions & {
529
338
  mode?: 'in-app' | 'system';
530
339
  };
@@ -533,1128 +342,238 @@ export declare type BackCommandResult = CommandActionResult<'back'> & {
533
342
  mode?: 'in-app' | 'system';
534
343
  };
535
344
 
536
- declare const BACKEND_CAPABILITY_NAMES: readonly ["android.shell", "ios.runnerCommand", "macos.desktopScreenshot"];
537
-
538
- export declare type BackendActionResult = Record<string, unknown> | void;
539
-
540
- export declare type BackendAlertAction = 'get' | 'accept' | 'dismiss' | 'wait';
345
+ export declare type BatchRunOptions = AgentDeviceRequestOverrides & {
346
+ steps: BatchStep[];
347
+ onError?: 'stop';
348
+ maxSteps?: number;
349
+ out?: string;
350
+ };
541
351
 
542
- export declare type BackendAlertInfo = {
543
- title?: string;
544
- message?: string;
545
- buttons?: string[];
352
+ export declare type BatchStep = {
353
+ command: string;
354
+ positionals?: string[];
355
+ flags?: Record<string, unknown>;
546
356
  };
547
357
 
548
- export declare type BackendAlertResult = {
549
- kind: 'alertStatus';
550
- alert: BackendAlertInfo | null;
551
- } | {
552
- kind: 'alertHandled';
553
- handled: boolean;
554
- alert?: BackendAlertInfo;
555
- button?: string;
556
- } | {
557
- kind: 'alertWait';
558
- alert: BackendAlertInfo | null;
559
- waitedMs?: number;
560
- timedOut?: boolean;
358
+ export declare type CaptureDiffOptions = ClientCommandBaseOptions & Pick<CaptureSnapshotOptions, 'interactiveOnly' | 'compact' | 'depth' | 'scope' | 'raw'> & {
359
+ kind: 'snapshot';
360
+ out?: string;
561
361
  };
562
362
 
563
- export declare type BackendAppEvent = {
564
- name: string;
565
- payload?: Record<string, unknown>;
363
+ export declare type CaptureScreenshotOptions = AgentDeviceRequestOverrides & {
364
+ path?: string;
365
+ overlayRefs?: boolean;
366
+ fullscreen?: boolean;
367
+ maxSize?: number;
368
+ surface?: 'app' | 'frontmost-app' | 'desktop' | 'menubar';
566
369
  };
567
370
 
568
- export declare type BackendAppInfo = {
569
- id: string;
570
- name?: string;
571
- bundleId?: string;
572
- packageName?: string;
573
- activity?: string;
371
+ export declare type CaptureScreenshotResult = {
372
+ path: string;
373
+ overlayRefs?: ScreenshotOverlayRef[];
374
+ identifiers: AgentDeviceIdentifiers;
574
375
  };
575
376
 
576
- export declare type BackendAppListFilter = 'all' | 'user-installed';
377
+ export declare type CaptureSnapshotOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
378
+ interactiveOnly?: boolean;
379
+ compact?: boolean;
380
+ depth?: number;
381
+ scope?: string;
382
+ raw?: boolean;
383
+ };
577
384
 
578
- export declare type BackendAppState = {
579
- appId?: string;
580
- bundleId?: string;
581
- packageName?: string;
582
- activity?: string;
583
- state?: 'unknown' | 'notRunning' | 'running' | 'foreground' | 'background';
584
- details?: Record<string, unknown>;
385
+ export declare type CaptureSnapshotResult = {
386
+ nodes: SnapshotNode[];
387
+ truncated: boolean;
388
+ appName?: string;
389
+ appBundleId?: string;
390
+ visibility?: SnapshotVisibility;
391
+ androidSnapshot?: AndroidSnapshotBackendMetadata;
392
+ warnings?: string[];
393
+ identifiers: AgentDeviceIdentifiers;
585
394
  };
586
395
 
587
- export declare type BackendBackOptions = {
588
- mode?: 'in-app' | 'system';
396
+ export declare function centerOfRect(rect: Rect): Point;
397
+
398
+ export declare type ClickOptions = ClientCommandBaseOptions & SelectorSnapshotCommandOptions & InteractionTarget & RepeatedPressOptions & {
399
+ button?: 'primary' | 'secondary' | 'middle';
589
400
  };
590
401
 
591
- export declare type BackendCapabilityName = (typeof BACKEND_CAPABILITY_NAMES)[number];
402
+ declare type ClientCommandBaseOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions;
592
403
 
593
- export declare type BackendCapabilitySet = readonly BackendCapabilityName[];
404
+ export declare type ClipboardCommandOptions = (DeviceCommandBaseOptions & {
405
+ action: 'read';
406
+ }) | (DeviceCommandBaseOptions & {
407
+ action: 'write';
408
+ text: string;
409
+ });
594
410
 
595
- export declare type BackendClipboardTextResult = {
411
+ export declare type ClipboardCommandResult = (DaemonResponseData & {
412
+ action: 'read';
596
413
  text: string;
414
+ }) | (DaemonResponseData & {
415
+ action: 'write';
416
+ textLength: number;
417
+ });
418
+
419
+ declare type CommandActionResult<T extends string> = DaemonResponseData & {
420
+ action?: T;
597
421
  };
598
422
 
599
- export declare type BackendCommandContext = {
600
- session?: string;
601
- requestId?: string;
602
- appId?: string;
603
- appBundleId?: string;
604
- signal?: AbortSignal;
605
- metadata?: Record<string, unknown>;
423
+ export declare type CommandRequestResult = DaemonResponseData;
424
+
425
+ declare type CompanionTunnelScope = {
426
+ tenantId: string;
427
+ runId: string;
428
+ leaseId: string;
429
+ };
430
+
431
+ export declare function createAgentDeviceClient(config?: AgentDeviceClientConfig, deps?: {
432
+ transport?: AgentDeviceDaemonTransport;
433
+ }): AgentDeviceClient;
434
+
435
+ export declare function createLocalArtifactAdapter(options?: LocalArtifactAdapterOptions): ArtifactAdapter;
436
+
437
+ export declare type CreateTempFileOptions = {
438
+ prefix: string;
439
+ ext: string;
606
440
  };
607
441
 
608
- export declare type BackendDeviceFilter = {
609
- platform?: AgentDeviceBackendPlatform | 'apple';
610
- target?: 'mobile' | 'tv' | 'desktop';
611
- kind?: 'simulator' | 'emulator' | 'device' | 'desktop';
442
+ declare type DaemonArtifact = {
443
+ field: string;
444
+ artifactId?: string;
445
+ fileName?: string;
446
+ localPath?: string;
447
+ path?: string;
612
448
  };
613
449
 
614
- export declare type BackendDeviceInfo = {
615
- id: string;
616
- name: string;
617
- platform: AgentDeviceBackendPlatform;
618
- target?: 'mobile' | 'tv' | 'desktop';
619
- kind?: 'simulator' | 'emulator' | 'device' | 'desktop';
620
- booted?: boolean;
450
+ declare type DaemonError = {
451
+ code: string;
452
+ message: string;
453
+ hint?: string;
454
+ diagnosticId?: string;
455
+ logPath?: string;
621
456
  details?: Record<string, unknown>;
622
457
  };
623
458
 
624
- export declare type BackendDeviceOrientation = 'portrait' | 'portrait-upside-down' | 'landscape-left' | 'landscape-right';
459
+ declare type DaemonInstallSource = {
460
+ kind: 'url';
461
+ url: string;
462
+ headers?: Record<string, string>;
463
+ } | {
464
+ kind: 'path';
465
+ path: string;
466
+ } | ({
467
+ kind: 'github-actions-artifact';
468
+ owner: string;
469
+ repo: string;
470
+ } & ({
471
+ artifactId: number;
472
+ } | {
473
+ runId: number;
474
+ artifactName: string;
475
+ } | {
476
+ artifactName: string;
477
+ }));
478
+
479
+ declare type DaemonLockPolicy = 'reject' | 'strip';
625
480
 
626
- export declare type BackendDeviceTarget = {
627
- id?: string;
628
- name?: string;
629
- platform?: AgentDeviceBackendPlatform;
630
- target?: 'mobile' | 'tv' | 'desktop';
631
- headless?: boolean;
481
+ declare type DaemonRequest = {
482
+ token?: string;
483
+ session?: string;
484
+ command: string;
485
+ positionals: string[];
486
+ flags?: Record<string, unknown>;
487
+ runtime?: SessionRuntimeHints;
488
+ meta?: DaemonRequestMeta;
632
489
  };
633
490
 
634
- export declare type BackendDiagnosticsPageOptions = BackendDiagnosticsTimeWindow & {
635
- cursor?: string;
636
- limit?: number;
491
+ declare type DaemonRequestMeta = {
492
+ requestId?: string;
493
+ debug?: boolean;
494
+ cwd?: string;
495
+ tenantId?: string;
496
+ runId?: string;
497
+ leaseId?: string;
498
+ leaseTtlMs?: number;
499
+ leaseBackend?: LeaseBackend;
500
+ sessionIsolation?: 'none' | 'tenant';
501
+ uploadedArtifactId?: string;
502
+ clientArtifactPaths?: Record<string, string>;
503
+ installSource?: DaemonInstallSource;
504
+ retainMaterializedPaths?: boolean;
505
+ materializedPathRetentionMs?: number;
506
+ materializationId?: string;
507
+ lockPolicy?: DaemonLockPolicy;
508
+ lockPlatform?: 'ios' | 'macos' | 'android' | 'linux' | 'apple';
637
509
  };
638
510
 
639
- export declare type BackendDiagnosticsTimeWindow = {
640
- since?: string;
641
- until?: string;
511
+ declare type DaemonResponse = {
512
+ ok: true;
513
+ data?: DaemonResponseData;
514
+ } | {
515
+ ok: false;
516
+ error: DaemonError;
642
517
  };
643
518
 
644
- export declare type BackendDumpNetworkOptions = BackendDiagnosticsPageOptions & {
645
- include?: BackendNetworkIncludeMode;
519
+ declare type DaemonResponseData = Record<string, unknown> & {
520
+ artifacts?: DaemonArtifact[];
646
521
  };
647
522
 
648
- export declare type BackendDumpNetworkResult = {
649
- entries: readonly BackendNetworkEntry[];
650
- nextCursor?: string;
651
- timeWindow?: BackendDiagnosticsTimeWindow;
652
- backend?: string;
653
- redacted?: boolean;
654
- notes?: readonly string[];
523
+ declare type DaemonServerMode = 'socket' | 'http' | 'dual';
524
+
525
+ declare type DaemonTransportMode = 'auto' | 'socket' | 'http';
526
+
527
+ export declare type DeviceBootOptions = ClientCommandBaseOptions & {
528
+ headless?: boolean;
655
529
  };
656
530
 
657
- export declare type BackendEnsureSimulatorOptions = {
531
+ declare type DeviceCommandBaseOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions;
532
+
533
+ declare type DeviceKind = 'simulator' | 'emulator' | 'device';
534
+
535
+ declare type DeviceTarget = 'mobile' | 'tv' | 'desktop';
536
+
537
+ export declare type ElementTarget = RefTarget | SelectorTarget;
538
+
539
+ export declare type EnsureSimulatorOptions = AgentDeviceRequestOverrides & {
658
540
  device: string;
659
541
  runtime?: string;
660
542
  boot?: boolean;
661
543
  reuseExisting?: boolean;
544
+ iosSimulatorDeviceSet?: string;
662
545
  };
663
546
 
664
- export declare type BackendEnsureSimulatorResult = {
547
+ export declare type EnsureSimulatorResult = {
665
548
  udid: string;
666
549
  device: string;
667
550
  runtime: string;
668
551
  created: boolean;
669
552
  booted: boolean;
670
- simulatorSetPath?: string | null;
553
+ iosSimulatorDeviceSet?: string | null;
554
+ identifiers: AgentDeviceIdentifiers;
671
555
  };
672
556
 
673
- export declare type BackendEscapeHatches = {
674
- androidShell?(context: BackendCommandContext, args: readonly string[]): Promise<BackendShellResult>;
675
- iosRunnerCommand?(context: BackendCommandContext, command: BackendRunnerCommand): Promise<BackendActionResult>;
676
- macosDesktopScreenshot?(context: BackendCommandContext, outPath: string, options?: BackendScreenshotOptions): Promise<BackendScreenshotResult | void>;
557
+ export declare type FileInputRef = {
558
+ kind: 'path';
559
+ path: string;
560
+ } | {
561
+ kind: 'uploadedArtifact';
562
+ id: string;
677
563
  };
678
564
 
679
- export declare type BackendFillOptions = {
680
- delayMs?: number;
565
+ export declare type FileOutputRef = {
566
+ kind: 'path';
567
+ path: string;
568
+ } | {
569
+ kind: 'downloadableArtifact';
570
+ clientPath?: string;
571
+ fileName?: string;
681
572
  };
682
573
 
683
- export declare type BackendFindTextResult = {
684
- found: boolean;
685
- };
686
-
687
- export declare type BackendInstallResult = Record<string, unknown> & {
688
- appId?: string;
689
- appName?: string;
690
- bundleId?: string;
691
- packageName?: string;
692
- launchTarget?: string;
693
- installablePath?: string;
694
- archivePath?: string;
695
- };
696
-
697
- export declare type BackendInstallSource = {
698
- kind: 'path';
699
- path: string;
700
- } | {
701
- kind: 'uploadedArtifact';
702
- id: string;
703
- } | {
704
- kind: 'url';
705
- url: string;
706
- };
707
-
708
- export declare type BackendInstallTarget = {
709
- app?: string;
710
- source: BackendInstallSource;
711
- };
712
-
713
- export declare type BackendKeyboardOptions = {
714
- action: 'status' | 'get' | 'dismiss';
715
- };
716
-
717
- export declare type BackendKeyboardResult = {
718
- platform?: 'android' | 'ios' | 'macos' | 'linux';
719
- action?: BackendKeyboardOptions['action'];
720
- visible?: boolean;
721
- inputType?: string | null;
722
- type?: string | null;
723
- wasVisible?: boolean;
724
- dismissed?: boolean;
725
- attempts?: number;
726
- };
727
-
728
- export declare type BackendLogEntry = {
729
- timestamp?: string;
730
- level?: 'debug' | 'info' | 'warn' | 'error' | string;
731
- message: string;
732
- source?: string;
733
- metadata?: Record<string, unknown>;
734
- };
735
-
736
- export declare type BackendLongPressOptions = {
737
- durationMs?: number;
738
- };
739
-
740
- export declare type BackendMeasurePerfOptions = BackendDiagnosticsTimeWindow & {
741
- sampleMs?: number;
742
- metrics?: readonly string[];
743
- };
744
-
745
- export declare type BackendMeasurePerfResult = {
746
- metrics: readonly BackendPerfMetric[];
747
- startedAt?: string;
748
- endedAt?: string;
749
- backend?: string;
750
- redacted?: boolean;
751
- notes?: readonly string[];
752
- };
753
-
754
- export declare type BackendNetworkEntry = {
755
- timestamp?: string;
756
- method?: string;
757
- url?: string;
758
- status?: number;
759
- durationMs?: number;
760
- requestHeaders?: Record<string, string>;
761
- responseHeaders?: Record<string, string>;
762
- requestBody?: string;
763
- responseBody?: string;
764
- metadata?: Record<string, unknown>;
765
- };
766
-
767
- export declare type BackendNetworkIncludeMode = 'summary' | 'headers' | 'body' | 'all';
768
-
769
- export declare type BackendOpenOptions = {
770
- relaunch?: boolean;
771
- };
772
-
773
- export declare type BackendOpenTarget = {
774
- /**
775
- * Generic app identifier accepted by the backend. Hosted adapters should
776
- * prefer structured appId, bundleId, or packageName when available.
777
- */
778
- app?: string;
779
- appId?: string;
780
- bundleId?: string;
781
- packageName?: string;
782
- /**
783
- * URL may be used by itself for a deep link or with an app identifier when
784
- * the backend supports opening a URL in a specific app context.
785
- */
786
- url?: string;
787
- /**
788
- * Platform-specific activity override, primarily for Android app launches.
789
- */
790
- activity?: string;
791
- };
792
-
793
- export declare type BackendPerfMetric = {
794
- name: string;
795
- value?: number;
796
- unit?: string;
797
- status?: 'ok' | 'unavailable' | 'error';
798
- message?: string;
799
- metadata?: Record<string, unknown>;
800
- };
801
-
802
- export declare type BackendPinchOptions = {
803
- scale: number;
804
- center?: Point;
805
- };
806
-
807
- export declare type BackendPushInput = {
808
- kind: 'json';
809
- payload: Record<string, unknown>;
810
- } | {
811
- kind: 'file';
812
- path: string;
813
- };
814
-
815
- export declare type BackendReadLogsOptions = BackendDiagnosticsPageOptions & {
816
- levels?: readonly string[];
817
- search?: string;
818
- source?: string;
819
- };
820
-
821
- export declare type BackendReadLogsResult = {
822
- entries: readonly BackendLogEntry[];
823
- nextCursor?: string;
824
- timeWindow?: BackendDiagnosticsTimeWindow;
825
- backend?: string;
826
- redacted?: boolean;
827
- notes?: readonly string[];
828
- };
829
-
830
- export declare type BackendReadTextResult = {
831
- text: string;
832
- };
833
-
834
- export declare type BackendRecordingOptions = {
835
- outPath?: string;
836
- fps?: number;
837
- quality?: number;
838
- showTouches?: boolean;
839
- };
840
-
841
- export declare type BackendRecordingResult = Record<string, unknown> & {
842
- path?: string;
843
- telemetryPath?: string;
844
- warning?: string;
845
- };
846
-
847
- export declare type BackendRunnerCommand = {
848
- command: string;
849
- args?: readonly string[];
850
- payload?: Record<string, unknown>;
851
- };
852
-
853
- export declare type BackendScreenshotOptions = {
854
- fullscreen?: boolean;
855
- overlayRefs?: boolean;
856
- surface?: 'app' | 'frontmost-app' | 'desktop' | 'menubar';
857
- };
858
-
859
- export declare type BackendScreenshotResult = {
860
- path?: string;
861
- overlayRefs?: ScreenshotOverlayRef[];
862
- };
863
-
864
- export declare type BackendScrollOptions = {
865
- direction: 'up' | 'down' | 'left' | 'right';
866
- amount?: number;
867
- pixels?: number;
868
- };
869
-
870
- export declare type BackendScrollTarget = {
871
- kind: 'viewport';
872
- } | {
873
- kind: 'point';
874
- point: Point;
875
- };
876
-
877
- export declare type BackendShellResult = {
878
- exitCode: number;
879
- stdout: string;
880
- stderr: string;
881
- };
882
-
883
- export declare type BackendSnapshotAnalysis = {
884
- rawNodeCount?: number;
885
- maxDepth?: number;
886
- };
887
-
888
- export declare type BackendSnapshotFreshness = {
889
- action: string;
890
- retryCount: number;
891
- staleAfterRetries: boolean;
892
- reason?: 'empty-interactive' | 'sharp-drop' | 'stuck-route';
893
- };
894
-
895
- export declare type BackendSnapshotOptions = SnapshotOptions & {
896
- outPath?: string;
897
- };
898
-
899
- export declare type BackendSnapshotResult = {
900
- nodes?: SnapshotNode[];
901
- truncated?: boolean;
902
- backend?: string;
903
- snapshot?: SnapshotState;
904
- analysis?: BackendSnapshotAnalysis;
905
- freshness?: BackendSnapshotFreshness;
906
- warnings?: string[];
907
- appName?: string;
908
- appBundleId?: string;
909
- };
910
-
911
- export declare type BackendSwipeOptions = {
912
- durationMs?: number;
913
- };
914
-
915
- export declare type BackendTapOptions = {
916
- button?: 'primary' | 'secondary' | 'middle';
917
- count?: number;
918
- intervalMs?: number;
919
- holdMs?: number;
920
- jitterPx?: number;
921
- doubleTap?: boolean;
922
- };
923
-
924
- export declare type BackendTraceOptions = {
925
- outPath?: string;
926
- };
927
-
928
- export declare type BackendTraceResult = Record<string, unknown> & {
929
- outPath?: string;
930
- };
931
-
932
- export declare type BatchCommandOptions<TContext = unknown> = CommandContext & {
933
- steps: readonly CommandRouterRequest<TContext>[];
934
- stopOnError?: boolean;
935
- maxSteps?: number;
936
- };
937
-
938
- export declare type BatchCommandResult = {
939
- kind: 'batch';
940
- total: number;
941
- executed: number;
942
- failed: number;
943
- totalDurationMs: number;
944
- results: readonly BatchCommandStepResult[];
945
- };
946
-
947
- export declare type BatchCommandStepResult = {
948
- step: number;
949
- command: string;
950
- ok: true;
951
- data: CommandRouterResult;
952
- durationMs: number;
953
- } | {
954
- step: number;
955
- command: string;
956
- ok: false;
957
- error: NormalizedError;
958
- durationMs: number;
959
- };
960
-
961
- export declare type BatchRunOptions = AgentDeviceRequestOverrides & {
962
- steps: BatchStep[];
963
- onError?: 'stop';
964
- maxSteps?: number;
965
- out?: string;
966
- };
967
-
968
- export declare type BatchStep = {
969
- command: string;
970
- positionals?: string[];
971
- flags?: Record<string, unknown>;
972
- };
973
-
974
- export declare type BoundAgentDeviceCommands = {
975
- capture: {
976
- screenshot: BoundRuntimeCommand<ScreenshotCommandOptions, ScreenshotCommandResult>;
977
- diffScreenshot: BoundRuntimeCommand<DiffScreenshotCommandOptions, DiffScreenshotCommandResult>;
978
- snapshot: BoundRuntimeCommand<SnapshotCommandOptions, SnapshotCommandResult>;
979
- diffSnapshot: BoundRuntimeCommand<DiffSnapshotCommandOptions, DiffSnapshotCommandResult>;
980
- };
981
- selectors: {
982
- find: BoundRuntimeCommand<FindReadCommandOptions, FindReadCommandResult>;
983
- get: BoundRuntimeCommand<GetCommandOptions, GetCommandResult>;
984
- getText: (target: ElementTarget_2, options?: Omit<GetTextCommandOptions, 'target'>) => Promise<Extract<GetCommandResult, {
985
- kind: 'text';
986
- }>>;
987
- getAttrs: (target: ElementTarget_2, options?: Omit<GetAttrsCommandOptions, 'target'>) => Promise<Extract<GetCommandResult, {
988
- kind: 'attrs';
989
- }>>;
990
- is: BoundRuntimeCommand<IsCommandOptions, IsCommandResult>;
991
- isVisible: (target: SelectorTarget, options?: Omit<IsSelectorCommandOptions, 'target'>) => Promise<IsCommandResult>;
992
- isHidden: (target: SelectorTarget, options?: Omit<IsSelectorCommandOptions, 'target'>) => Promise<IsCommandResult>;
993
- wait: BoundRuntimeCommand<WaitCommandOptions_2, WaitCommandResult_2>;
994
- waitForText: (text: string, options?: Omit<WaitForTextCommandOptions, 'text'>) => Promise<Extract<WaitCommandResult_2, {
995
- kind: 'text';
996
- }>>;
997
- };
998
- interactions: {
999
- click: (target: InteractionTarget_2, options?: Omit<ClickCommandOptions, 'target'>) => Promise<PressCommandResult>;
1000
- press: (target: InteractionTarget_2, options?: Omit<PressCommandOptions, 'target'>) => Promise<PressCommandResult>;
1001
- fill: (target: InteractionTarget_2, text: string, options?: Omit<FillCommandOptions, 'target' | 'text'>) => Promise<FillCommandResult>;
1002
- typeText: (text: string, options?: Omit<TypeTextCommandOptions, 'text'>) => Promise<TypeTextCommandResult>;
1003
- focus: (target: InteractionTarget_2, options?: Omit<FocusCommandOptions, 'target'>) => Promise<FocusCommandResult>;
1004
- longPress: (target: InteractionTarget_2, options?: Omit<LongPressCommandOptions, 'target'>) => Promise<LongPressCommandResult>;
1005
- swipe: BoundRuntimeCommand<SwipeCommandOptions, SwipeCommandResult>;
1006
- scroll: BoundRuntimeCommand<ScrollCommandOptions, ScrollCommandResult>;
1007
- pinch: BoundRuntimeCommand<PinchCommandOptions, PinchCommandResult>;
1008
- };
1009
- system: {
1010
- back: (options?: SystemBackCommandOptions) => Promise<SystemBackCommandResult>;
1011
- home: (options?: SystemHomeCommandOptions) => Promise<SystemHomeCommandResult>;
1012
- rotate: BoundRuntimeCommand<SystemRotateCommandOptions, SystemRotateCommandResult>;
1013
- keyboard: (options?: SystemKeyboardCommandOptions) => Promise<SystemKeyboardCommandResult>;
1014
- clipboard: BoundRuntimeCommand<SystemClipboardCommandOptions, SystemClipboardCommandResult>;
1015
- settings: (options?: SystemSettingsCommandOptions) => Promise<SystemSettingsCommandResult>;
1016
- alert: (options?: SystemAlertCommandOptions) => Promise<SystemAlertCommandResult>;
1017
- appSwitcher: (options?: SystemAppSwitcherCommandOptions) => Promise<SystemAppSwitcherCommandResult>;
1018
- };
1019
- apps: {
1020
- open: BoundRuntimeCommand<OpenAppCommandOptions, OpenAppCommandResult>;
1021
- close: (options?: CloseAppCommandOptions) => Promise<CloseAppCommandResult>;
1022
- list: (options?: ListAppsCommandOptions) => Promise<ListAppsCommandResult>;
1023
- state: BoundRuntimeCommand<GetAppStateCommandOptions, GetAppStateCommandResult>;
1024
- push: BoundRuntimeCommand<PushAppCommandOptions, PushAppCommandResult>;
1025
- triggerEvent: BoundRuntimeCommand<TriggerAppEventCommandOptions, TriggerAppEventCommandResult>;
1026
- };
1027
- admin: {
1028
- devices: (options?: AdminDevicesCommandOptions) => Promise<AdminDevicesCommandResult>;
1029
- boot: (options?: AdminBootCommandOptions) => Promise<AdminBootCommandResult>;
1030
- ensureSimulator: BoundRuntimeCommand<AdminEnsureSimulatorCommandOptions, AdminEnsureSimulatorCommandResult>;
1031
- install: BoundRuntimeCommand<AdminInstallCommandOptions, AdminInstallCommandResult>;
1032
- reinstall: BoundRuntimeCommand<AdminReinstallCommandOptions, AdminInstallCommandResult>;
1033
- installFromSource: BoundRuntimeCommand<AdminInstallFromSourceCommandOptions, AdminInstallCommandResult>;
1034
- };
1035
- recording: {
1036
- record: BoundRuntimeCommand<RecordingRecordCommandOptions, RecordingRecordCommandResult>;
1037
- trace: BoundRuntimeCommand<RecordingTraceCommandOptions, RecordingTraceCommandResult>;
1038
- };
1039
- observability: {
1040
- logs: (options?: DiagnosticsLogsCommandOptions) => Promise<DiagnosticsLogsCommandResult>;
1041
- network: (options?: DiagnosticsNetworkCommandOptions) => Promise<DiagnosticsNetworkCommandResult>;
1042
- perf: (options?: DiagnosticsPerfCommandOptions) => Promise<DiagnosticsPerfCommandResult>;
1043
- };
1044
- };
1045
-
1046
- export declare type BoundRuntimeCommand<TOptions = Record<string, unknown>, TResult = CommandResult> = (options: TOptions) => Promise<TResult>;
1047
-
1048
- export declare type CaptureDiffOptions = ClientCommandBaseOptions & Pick<CaptureSnapshotOptions, 'interactiveOnly' | 'compact' | 'depth' | 'scope' | 'raw'> & {
1049
- kind: 'snapshot';
1050
- out?: string;
1051
- };
1052
-
1053
- export declare type CaptureScreenshotOptions = AgentDeviceRequestOverrides & {
1054
- path?: string;
1055
- overlayRefs?: boolean;
1056
- fullscreen?: boolean;
1057
- maxSize?: number;
1058
- surface?: 'app' | 'frontmost-app' | 'desktop' | 'menubar';
1059
- };
1060
-
1061
- export declare type CaptureScreenshotResult = {
1062
- path: string;
1063
- overlayRefs?: ScreenshotOverlayRef[];
1064
- identifiers: AgentDeviceIdentifiers;
1065
- };
1066
-
1067
- export declare type CaptureSnapshotOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions & {
1068
- interactiveOnly?: boolean;
1069
- compact?: boolean;
1070
- depth?: number;
1071
- scope?: string;
1072
- raw?: boolean;
1073
- };
1074
-
1075
- export declare type CaptureSnapshotResult = {
1076
- nodes: SnapshotNode[];
1077
- truncated: boolean;
1078
- appName?: string;
1079
- appBundleId?: string;
1080
- visibility?: SnapshotVisibility;
1081
- warnings?: string[];
1082
- identifiers: AgentDeviceIdentifiers;
1083
- };
1084
-
1085
- export declare function centerOfRect(rect: Rect): Point;
1086
-
1087
- declare type ClickButton = 'primary' | 'secondary' | 'middle';
1088
-
1089
- declare type ClickCommandOptions = PressCommandOptions;
1090
-
1091
- export declare type ClickOptions = ClientCommandBaseOptions & SelectorSnapshotCommandOptions & InteractionTarget & RepeatedPressOptions & {
1092
- button?: 'primary' | 'secondary' | 'middle';
1093
- };
1094
-
1095
- declare type ClientCommandBaseOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions;
1096
-
1097
- export declare type ClipboardCommandOptions = (DeviceCommandBaseOptions & {
1098
- action: 'read';
1099
- }) | (DeviceCommandBaseOptions & {
1100
- action: 'write';
1101
- text: string;
1102
- });
1103
-
1104
- export declare type ClipboardCommandResult = (DaemonResponseData & {
1105
- action: 'read';
1106
- text: string;
1107
- }) | (DaemonResponseData & {
1108
- action: 'write';
1109
- textLength: number;
1110
- });
1111
-
1112
- export declare type CloseAppCommandOptions = CommandContext & {
1113
- app?: string;
1114
- };
1115
-
1116
- export declare type CloseAppCommandResult = {
1117
- kind: 'appClosed';
1118
- app?: string;
1119
- backendResult?: Record<string, unknown>;
1120
- message?: string;
1121
- };
1122
-
1123
- declare type CommandActionResult<T extends string> = DaemonResponseData & {
1124
- action?: T;
1125
- };
1126
-
1127
- export declare const commandCatalog: readonly CommandCatalogEntry[];
1128
-
1129
- export declare type CommandCatalogEntry = {
1130
- /**
1131
- * CLI command names track daemon compatibility migration. Namespaced entries
1132
- * track runtime router/API commands that are available independently.
1133
- */
1134
- command: string;
1135
- category: 'portable-runtime' | 'backend-admin' | 'transport-session' | 'environment' | 'capability-gated';
1136
- status: 'implemented' | 'planned';
1137
- };
1138
-
1139
- export declare type CommandClock = {
1140
- now(): number;
1141
- sleep(ms: number): Promise<void>;
1142
- };
1143
-
1144
- export declare type CommandContext = {
1145
- session?: string;
1146
- requestId?: string;
1147
- signal?: AbortSignal;
1148
- metadata?: Record<string, unknown>;
1149
- };
1150
-
1151
- export declare type CommandPolicy = {
1152
- allowLocalInputPaths: boolean;
1153
- allowLocalOutputPaths: boolean;
1154
- maxImagePixels: number;
1155
- allowNamedBackendCapabilities: readonly BackendCapabilityName[];
1156
- };
1157
-
1158
- export declare type CommandRequestResult = DaemonResponseData;
1159
-
1160
- export declare type CommandResult = Record<string, unknown>;
1161
-
1162
- export declare type CommandRouter<TContext = unknown> = {
1163
- dispatch(request: CommandRouterRequest<TContext>): Promise<CommandRouterResponse>;
1164
- };
1165
-
1166
- export declare type CommandRouterConfig<TContext = unknown> = {
1167
- createRuntime(request: CommandRouterRequest<TContext>): AgentDeviceRuntime | Promise<AgentDeviceRuntime>;
1168
- beforeDispatch?(request: CommandRouterRequest<TContext>): void | Promise<void>;
1169
- formatError?(error: unknown, request: CommandRouterRequest<TContext>): NormalizedError;
1170
- };
1171
-
1172
- export declare type CommandRouterRequest<TContext = unknown> = {
1173
- command: 'capture.screenshot';
1174
- options: ScreenshotCommandOptions;
1175
- context?: TContext;
1176
- } | {
1177
- command: 'capture.diffScreenshot';
1178
- options: DiffScreenshotCommandOptions;
1179
- context?: TContext;
1180
- } | {
1181
- command: 'capture.snapshot';
1182
- options: SnapshotCommandOptions;
1183
- context?: TContext;
1184
- } | {
1185
- command: 'capture.diffSnapshot';
1186
- options: DiffSnapshotCommandOptions;
1187
- context?: TContext;
1188
- } | {
1189
- command: 'selectors.find';
1190
- options: FindReadCommandOptions;
1191
- context?: TContext;
1192
- } | {
1193
- command: 'selectors.get';
1194
- options: GetCommandOptions;
1195
- context?: TContext;
1196
- } | {
1197
- command: 'selectors.is';
1198
- options: IsCommandOptions;
1199
- context?: TContext;
1200
- } | {
1201
- command: 'selectors.wait';
1202
- options: WaitCommandOptions_2;
1203
- context?: TContext;
1204
- } | {
1205
- command: 'interactions.click';
1206
- options: ClickCommandOptions;
1207
- context?: TContext;
1208
- } | {
1209
- command: 'interactions.press';
1210
- options: PressCommandOptions;
1211
- context?: TContext;
1212
- } | {
1213
- command: 'interactions.fill';
1214
- options: FillCommandOptions;
1215
- context?: TContext;
1216
- } | {
1217
- command: 'interactions.typeText';
1218
- options: TypeTextCommandOptions;
1219
- context?: TContext;
1220
- } | {
1221
- command: 'interactions.focus';
1222
- options: FocusCommandOptions;
1223
- context?: TContext;
1224
- } | {
1225
- command: 'interactions.longPress';
1226
- options: LongPressCommandOptions;
1227
- context?: TContext;
1228
- } | {
1229
- command: 'interactions.swipe';
1230
- options: SwipeCommandOptions;
1231
- context?: TContext;
1232
- } | {
1233
- command: 'interactions.scroll';
1234
- options: ScrollCommandOptions;
1235
- context?: TContext;
1236
- } | {
1237
- command: 'interactions.pinch';
1238
- options: PinchCommandOptions;
1239
- context?: TContext;
1240
- } | {
1241
- command: 'system.back';
1242
- options?: SystemBackCommandOptions;
1243
- context?: TContext;
1244
- } | {
1245
- command: 'system.home';
1246
- options?: SystemHomeCommandOptions;
1247
- context?: TContext;
1248
- } | {
1249
- command: 'system.rotate';
1250
- options: SystemRotateCommandOptions;
1251
- context?: TContext;
1252
- } | {
1253
- command: 'system.keyboard';
1254
- options?: SystemKeyboardCommandOptions;
1255
- context?: TContext;
1256
- } | {
1257
- command: 'system.clipboard';
1258
- options: SystemClipboardCommandOptions;
1259
- context?: TContext;
1260
- } | {
1261
- command: 'system.settings';
1262
- options?: SystemSettingsCommandOptions;
1263
- context?: TContext;
1264
- } | {
1265
- command: 'system.alert';
1266
- options?: SystemAlertCommandOptions;
1267
- context?: TContext;
1268
- } | {
1269
- command: 'system.appSwitcher';
1270
- options?: SystemAppSwitcherCommandOptions;
1271
- context?: TContext;
1272
- } | {
1273
- command: 'apps.open';
1274
- options: OpenAppCommandOptions;
1275
- context?: TContext;
1276
- } | {
1277
- command: 'apps.close';
1278
- options?: CloseAppCommandOptions;
1279
- context?: TContext;
1280
- } | {
1281
- command: 'apps.list';
1282
- options?: ListAppsCommandOptions;
1283
- context?: TContext;
1284
- } | {
1285
- command: 'apps.state';
1286
- options: GetAppStateCommandOptions;
1287
- context?: TContext;
1288
- } | {
1289
- command: 'apps.push';
1290
- options: PushAppCommandOptions;
1291
- context?: TContext;
1292
- } | {
1293
- command: 'apps.triggerEvent';
1294
- options: TriggerAppEventCommandOptions;
1295
- context?: TContext;
1296
- } | {
1297
- command: 'admin.devices';
1298
- options?: AdminDevicesCommandOptions;
1299
- context?: TContext;
1300
- } | {
1301
- command: 'admin.boot';
1302
- options?: AdminBootCommandOptions;
1303
- context?: TContext;
1304
- } | {
1305
- command: 'admin.ensureSimulator';
1306
- options: AdminEnsureSimulatorCommandOptions;
1307
- context?: TContext;
1308
- } | {
1309
- command: 'admin.install';
1310
- options: AdminInstallCommandOptions;
1311
- context?: TContext;
1312
- } | {
1313
- command: 'admin.reinstall';
1314
- options: AdminReinstallCommandOptions;
1315
- context?: TContext;
1316
- } | {
1317
- command: 'admin.installFromSource';
1318
- options: AdminInstallFromSourceCommandOptions;
1319
- context?: TContext;
1320
- } | {
1321
- command: 'record';
1322
- options: RecordingRecordCommandOptions;
1323
- context?: TContext;
1324
- } | {
1325
- command: 'trace';
1326
- options: RecordingTraceCommandOptions;
1327
- context?: TContext;
1328
- } | {
1329
- command: 'diagnostics.logs';
1330
- options?: DiagnosticsLogsCommandOptions;
1331
- context?: TContext;
1332
- } | {
1333
- command: 'diagnostics.network';
1334
- options?: DiagnosticsNetworkCommandOptions;
1335
- context?: TContext;
1336
- } | {
1337
- command: 'diagnostics.perf';
1338
- options?: DiagnosticsPerfCommandOptions;
1339
- context?: TContext;
1340
- } | {
1341
- command: 'batch';
1342
- options: BatchCommandOptions<TContext>;
1343
- context?: TContext;
1344
- };
1345
-
1346
- export declare type CommandRouterResponse = {
1347
- ok: true;
1348
- data: CommandRouterResult;
1349
- } | {
1350
- ok: false;
1351
- error: NormalizedError;
1352
- };
1353
-
1354
- export declare type CommandRouterResult = ScreenshotCommandResult | DiffScreenshotCommandResult | SnapshotCommandResult | DiffSnapshotCommandResult | FindReadCommandResult | GetCommandResult | IsCommandResult | WaitCommandResult_2 | PressCommandResult | FillCommandResult | TypeTextCommandResult | FocusCommandResult | LongPressCommandResult | SwipeCommandResult | ScrollCommandResult | PinchCommandResult | SystemBackCommandResult | SystemHomeCommandResult | SystemRotateCommandResult | SystemKeyboardCommandResult | SystemClipboardCommandResult | SystemSettingsCommandResult | SystemAlertCommandResult | SystemAppSwitcherCommandResult | OpenAppCommandResult | CloseAppCommandResult | ListAppsCommandResult | GetAppStateCommandResult | PushAppCommandResult | TriggerAppEventCommandResult | AdminDevicesCommandResult | AdminBootCommandResult | AdminEnsureSimulatorCommandResult | AdminInstallCommandResult | RecordingRecordCommandResult | RecordingTraceCommandResult | DiagnosticsLogsCommandResult | DiagnosticsNetworkCommandResult | DiagnosticsPerfCommandResult | BatchCommandResult;
1355
-
1356
- export declare const commands: AgentDeviceCommands;
1357
-
1358
- export declare type CommandSessionRecord = {
1359
- name: string;
1360
- appId?: string;
1361
- appBundleId?: string;
1362
- appName?: string;
1363
- backendSessionId?: string;
1364
- snapshot?: SnapshotState;
1365
- metadata?: Record<string, unknown>;
1366
- };
1367
-
1368
- export declare type CommandSessionStore = {
1369
- get(name: string): CommandSessionRecord | undefined | Promise<CommandSessionRecord | undefined>;
1370
- set(record: CommandSessionRecord): void | Promise<void>;
1371
- delete?(name: string): void | Promise<void>;
1372
- list?(): readonly CommandSessionRecord[] | Promise<readonly CommandSessionRecord[]>;
1373
- };
1374
-
1375
- declare type CompanionTunnelScope = {
1376
- tenantId: string;
1377
- runId: string;
1378
- leaseId: string;
1379
- };
1380
-
1381
- export declare function createAgentDevice(config: AgentDeviceRuntimeConfig): AgentDevice;
1382
-
1383
- export declare function createAgentDeviceClient(config?: AgentDeviceClientConfig, deps?: {
1384
- transport?: AgentDeviceDaemonTransport;
1385
- }): AgentDeviceClient;
1386
-
1387
- export declare function createCommandRouter<TContext = unknown>(config: CommandRouterConfig<TContext>): CommandRouter<TContext>;
1388
-
1389
- export declare function createLocalArtifactAdapter(options?: LocalArtifactAdapterOptions): ArtifactAdapter;
1390
-
1391
- export declare function createMemorySessionStore(records?: readonly CommandSessionRecord[]): CommandSessionStore;
1392
-
1393
- export declare type CreateTempFileOptions = {
1394
- prefix: string;
1395
- ext: string;
1396
- };
1397
-
1398
- declare type DaemonArtifact = {
1399
- field: string;
1400
- artifactId?: string;
1401
- fileName?: string;
1402
- localPath?: string;
1403
- path?: string;
1404
- };
1405
-
1406
- declare type DaemonError = {
1407
- code: string;
1408
- message: string;
1409
- hint?: string;
1410
- diagnosticId?: string;
1411
- logPath?: string;
1412
- details?: Record<string, unknown>;
1413
- };
1414
-
1415
- declare type DaemonInstallSource = {
1416
- kind: 'url';
1417
- url: string;
1418
- headers?: Record<string, string>;
1419
- } | {
1420
- kind: 'path';
1421
- path: string;
1422
- } | ({
1423
- kind: 'github-actions-artifact';
1424
- owner: string;
1425
- repo: string;
1426
- } & ({
1427
- artifactId: number;
1428
- } | {
1429
- runId: number;
1430
- artifactName: string;
1431
- } | {
1432
- artifactName: string;
1433
- }));
1434
-
1435
- declare type DaemonLockPolicy = 'reject' | 'strip';
1436
-
1437
- declare type DaemonRequest = {
1438
- token?: string;
1439
- session?: string;
1440
- command: string;
1441
- positionals: string[];
1442
- flags?: Record<string, unknown>;
1443
- runtime?: SessionRuntimeHints;
1444
- meta?: DaemonRequestMeta;
1445
- };
1446
-
1447
- declare type DaemonRequestMeta = {
1448
- requestId?: string;
1449
- debug?: boolean;
1450
- cwd?: string;
1451
- tenantId?: string;
1452
- runId?: string;
1453
- leaseId?: string;
1454
- leaseTtlMs?: number;
1455
- leaseBackend?: LeaseBackend;
1456
- sessionIsolation?: 'none' | 'tenant';
1457
- uploadedArtifactId?: string;
1458
- clientArtifactPaths?: Record<string, string>;
1459
- installSource?: DaemonInstallSource;
1460
- retainMaterializedPaths?: boolean;
1461
- materializedPathRetentionMs?: number;
1462
- materializationId?: string;
1463
- lockPolicy?: DaemonLockPolicy;
1464
- lockPlatform?: 'ios' | 'macos' | 'android' | 'linux' | 'apple';
1465
- };
1466
-
1467
- declare type DaemonResponse = {
1468
- ok: true;
1469
- data?: DaemonResponseData;
1470
- } | {
1471
- ok: false;
1472
- error: DaemonError;
1473
- };
1474
-
1475
- declare type DaemonResponseData = Record<string, unknown> & {
1476
- artifacts?: DaemonArtifact[];
1477
- };
1478
-
1479
- declare type DaemonServerMode = 'socket' | 'http' | 'dual';
1480
-
1481
- declare type DaemonTransportMode = 'auto' | 'socket' | 'http';
1482
-
1483
- export declare type DeviceBootOptions = ClientCommandBaseOptions & {
1484
- headless?: boolean;
1485
- };
1486
-
1487
- declare type DeviceCommandBaseOptions = AgentDeviceRequestOverrides & AgentDeviceSelectionOptions;
1488
-
1489
- declare type DeviceKind = 'simulator' | 'emulator' | 'device';
1490
-
1491
- declare type DeviceTarget = 'mobile' | 'tv' | 'desktop';
1492
-
1493
- export declare type DiagnosticsLogsCommandOptions = DiagnosticsPageOptions & {
1494
- levels?: readonly string[];
1495
- search?: string;
1496
- source?: string;
1497
- };
1498
-
1499
- export declare type DiagnosticsLogsCommandResult = {
1500
- kind: 'diagnosticsLogs';
1501
- entries: readonly BackendLogEntry[];
1502
- nextCursor?: string;
1503
- timeWindow?: BackendDiagnosticsTimeWindow;
1504
- backend?: string;
1505
- redacted: boolean;
1506
- notes?: readonly string[];
1507
- };
1508
-
1509
- export declare type DiagnosticsNetworkCommandOptions = DiagnosticsPageOptions & {
1510
- include?: BackendNetworkIncludeMode;
1511
- };
1512
-
1513
- export declare type DiagnosticsNetworkCommandResult = {
1514
- kind: 'diagnosticsNetwork';
1515
- entries: readonly BackendNetworkEntry[];
1516
- nextCursor?: string;
1517
- timeWindow?: BackendDiagnosticsTimeWindow;
1518
- backend?: string;
1519
- redacted: boolean;
1520
- notes?: readonly string[];
1521
- };
1522
-
1523
- declare type DiagnosticsPageOptions = CommandContext & {
1524
- appId?: string;
1525
- appBundleId?: string;
1526
- since?: string;
1527
- until?: string;
1528
- cursor?: string;
1529
- limit?: number;
1530
- };
1531
-
1532
- export declare type DiagnosticsPerfCommandOptions = CommandContext & {
1533
- appId?: string;
1534
- appBundleId?: string;
1535
- since?: string;
1536
- until?: string;
1537
- sampleMs?: number;
1538
- metrics?: readonly string[];
1539
- };
1540
-
1541
- export declare type DiagnosticsPerfCommandResult = {
1542
- kind: 'diagnosticsPerf';
1543
- metrics: readonly BackendPerfMetric[];
1544
- startedAt?: string;
1545
- endedAt?: string;
1546
- backend?: string;
1547
- redacted: boolean;
1548
- notes?: readonly string[];
1549
- };
1550
-
1551
- export declare type DiagnosticsSink = {
1552
- emit(event: {
1553
- level: 'debug' | 'info' | 'warn' | 'error';
1554
- message: string;
1555
- data?: unknown;
1556
- }): void;
1557
- };
1558
-
1559
- declare type DiffScreenshotCommandOptions = CommandContext & {
1560
- baseline: FileInputRef;
1561
- current?: FileInputRef | LiveScreenshotInputRef;
1562
- out?: FileOutputRef;
1563
- currentOverlayOut?: FileOutputRef;
1564
- threshold?: number;
1565
- overlayRefs?: boolean;
1566
- surface?: BackendScreenshotOptions['surface'];
1567
- };
1568
-
1569
- declare type DiffScreenshotCommandResult = ScreenshotDiffResult & {
1570
- artifacts?: ArtifactDescriptor[];
1571
- };
1572
-
1573
- declare type DiffSnapshotCommandOptions = SnapshotCommandOptions;
1574
-
1575
- declare type DiffSnapshotCommandResult = {
1576
- mode: 'snapshot';
1577
- baselineInitialized: boolean;
1578
- summary: SnapshotDiffSummary;
1579
- lines: SnapshotDiffLine[];
1580
- warnings?: string[];
1581
- };
1582
-
1583
- export declare type ElementTarget = RefTarget_2 | SelectorTarget_2;
1584
-
1585
- declare type ElementTarget_2 = SelectorTarget | RefTarget;
1586
-
1587
- export declare type EnsureSimulatorOptions = AgentDeviceRequestOverrides & {
1588
- device: string;
1589
- runtime?: string;
1590
- boot?: boolean;
1591
- reuseExisting?: boolean;
1592
- iosSimulatorDeviceSet?: string;
1593
- };
1594
-
1595
- export declare type EnsureSimulatorResult = {
1596
- udid: string;
1597
- device: string;
1598
- runtime: string;
1599
- created: boolean;
1600
- booted: boolean;
1601
- iosSimulatorDeviceSet?: string | null;
1602
- identifiers: AgentDeviceIdentifiers;
1603
- };
1604
-
1605
- export declare type FileInputRef = {
1606
- kind: 'path';
1607
- path: string;
1608
- } | {
1609
- kind: 'uploadedArtifact';
1610
- id: string;
1611
- };
1612
-
1613
- export declare type FileOutputRef = {
1614
- kind: 'path';
1615
- path: string;
1616
- } | {
1617
- kind: 'downloadableArtifact';
1618
- clientPath?: string;
1619
- fileName?: string;
1620
- };
1621
-
1622
- declare type FillCommandOptions = CommandContext & {
1623
- target: InteractionTarget_2;
1624
- text: string;
1625
- delayMs?: number;
1626
- };
1627
-
1628
- declare type FillCommandResult = ResolvedInteractionTarget & {
1629
- text: string;
1630
- warning?: string;
1631
- backendResult?: Record<string, unknown>;
1632
- };
1633
-
1634
- export declare type FillOptions = ClientCommandBaseOptions & SelectorSnapshotCommandOptions & InteractionTarget & {
1635
- text: string;
1636
- delayMs?: number;
1637
- };
1638
-
1639
- declare type FindAction = {
1640
- kind: 'click';
1641
- } | {
1642
- kind: 'focus';
1643
- } | {
1644
- kind: 'fill';
1645
- value: string;
1646
- } | {
1647
- kind: 'type';
1648
- value: string;
1649
- } | {
1650
- kind: 'get_text';
1651
- } | {
1652
- kind: 'get_attrs';
1653
- } | {
1654
- kind: 'exists';
1655
- } | {
1656
- kind: 'wait';
1657
- timeoutMs?: number;
574
+ export declare type FillOptions = ClientCommandBaseOptions & SelectorSnapshotCommandOptions & InteractionTarget & {
575
+ text: string;
576
+ delayMs?: number;
1658
577
  };
1659
578
 
1660
579
  declare type FindBaseOptions = ClientCommandBaseOptions & FindSnapshotCommandOptions & {
@@ -1676,118 +595,28 @@ export declare type FindOptions = (FindBaseOptions & {
1676
595
  value: string;
1677
596
  });
1678
597
 
1679
- declare type FindReadCommandOptions = CommandContext & {
1680
- locator?: FindLocator;
1681
- query: string;
1682
- action: Extract<FindAction['kind'], 'exists' | 'wait' | 'get_text' | 'get_attrs'>;
1683
- timeoutMs?: number;
1684
- } & SelectorSnapshotOptions;
1685
-
1686
- declare type FindReadCommandResult = {
1687
- kind: 'found';
1688
- found: true;
1689
- waitedMs?: number;
1690
- } | {
1691
- kind: 'text';
1692
- ref: string;
1693
- text: string;
1694
- node: SnapshotNode;
1695
- } | {
1696
- kind: 'attrs';
1697
- ref: string;
1698
- node: SnapshotNode;
1699
- };
1700
-
1701
598
  declare type FindSnapshotCommandOptions = Pick<CaptureSnapshotOptions, 'depth' | 'raw'>;
1702
599
 
1703
- declare type FocusCommandOptions = CommandContext & {
1704
- target: InteractionTarget_2;
1705
- };
1706
-
1707
- declare type FocusCommandResult = ResolvedInteractionTarget & {
1708
- backendResult?: Record<string, unknown>;
1709
- message?: string;
1710
- };
1711
-
1712
600
  declare type FocusOptions_2 = ClientCommandBaseOptions & {
1713
601
  x: number;
1714
602
  y: number;
1715
603
  };
1716
604
  export { FocusOptions_2 as FocusOptions }
1717
605
 
1718
- declare type GestureDirection = 'up' | 'down' | 'left' | 'right';
1719
-
1720
- export declare type GetAppStateCommandOptions = CommandContext & {
1721
- app: string;
1722
- };
1723
-
1724
- export declare type GetAppStateCommandResult = {
1725
- kind: 'appState';
1726
- app: string;
1727
- state: BackendAppState;
1728
- };
1729
-
1730
- declare type GetAttrsCommandOptions = CommandContext & SelectorSnapshotOptions & {
1731
- target: ElementTarget_2;
1732
- };
1733
-
1734
- declare type GetCommandOptions = CommandContext & SelectorSnapshotOptions & {
1735
- property: 'text' | 'attrs';
1736
- target: ElementTarget_2;
1737
- };
1738
-
1739
- declare type GetCommandResult = {
1740
- kind: 'text';
1741
- target: ResolvedTarget;
1742
- text: string;
1743
- node: SnapshotNode;
1744
- selectorChain?: string[];
1745
- } | {
1746
- kind: 'attrs';
1747
- target: ResolvedTarget;
1748
- node: SnapshotNode;
1749
- selectorChain?: string[];
1750
- };
1751
-
1752
606
  export declare type GetOptions = ClientCommandBaseOptions & SelectorSnapshotCommandOptions & ElementTarget & {
1753
607
  format: 'text' | 'attrs';
1754
608
  };
1755
609
 
1756
- declare type GetTextCommandOptions = CommandContext & SelectorSnapshotOptions & {
1757
- target: ElementTarget_2;
1758
- };
1759
-
1760
610
  export declare type HomeCommandOptions = DeviceCommandBaseOptions;
1761
611
 
1762
612
  export declare type HomeCommandResult = CommandActionResult<'home'>;
1763
613
 
1764
- export declare type InteractionTarget = PointTarget_2 | RefTarget_2 | SelectorTarget_2;
1765
-
1766
- declare type InteractionTarget_2 = ElementTarget_2 | PointTarget;
614
+ export declare type InteractionTarget = PointTarget | RefTarget | SelectorTarget;
1767
615
 
1768
616
  export declare function isAgentDeviceError(err: unknown): err is AppError;
1769
617
 
1770
- declare type IsCommandOptions = CommandContext & SelectorSnapshotOptions & {
1771
- predicate: 'visible' | 'hidden' | 'exists' | 'editable' | 'selected' | 'text';
1772
- selector: string;
1773
- expectedText?: string;
1774
- };
1775
-
1776
- declare type IsCommandResult = {
1777
- predicate: IsCommandOptions['predicate'];
1778
- pass: true;
1779
- selector: string;
1780
- matches?: number;
1781
- text?: string;
1782
- selectorChain?: string[];
1783
- };
1784
-
1785
618
  export declare type IsOptions = IsTextPredicateOptions | IsStatePredicateOptions;
1786
619
 
1787
- declare type IsSelectorCommandOptions = CommandContext & SelectorSnapshotOptions & {
1788
- target: SelectorTarget;
1789
- };
1790
-
1791
620
  declare type IsStatePredicateOptions = ClientCommandBaseOptions & SelectorSnapshotCommandOptions & {
1792
621
  predicate: 'visible' | 'hidden' | 'exists' | 'editable' | 'selected';
1793
622
  selector: string;
@@ -1845,44 +674,18 @@ declare type LeaseScopedOptions = LeaseOptions & {
1845
674
  leaseId: string;
1846
675
  };
1847
676
 
1848
- export declare type ListAppsCommandOptions = CommandContext & {
1849
- filter?: BackendAppListFilter;
1850
- };
1851
-
1852
- export declare type ListAppsCommandResult = {
1853
- kind: 'appsList';
1854
- apps: readonly BackendAppInfo[];
1855
- };
1856
-
1857
- declare type LiveScreenshotInputRef = {
1858
- kind: 'live';
1859
- };
1860
-
1861
677
  export declare type LocalArtifactAdapterOptions = {
1862
678
  cwd?: string;
1863
679
  tempDir?: string;
1864
680
  rootDir?: string;
1865
681
  };
1866
682
 
1867
- export declare function localCommandPolicy(overrides?: Partial<CommandPolicy>): CommandPolicy;
1868
-
1869
683
  export declare type LogsOptions = AgentDeviceRequestOverrides & {
1870
684
  action?: 'path' | 'start' | 'stop' | 'doctor' | 'mark' | 'clear';
1871
685
  message?: string;
1872
686
  restart?: boolean;
1873
687
  };
1874
688
 
1875
- declare type LongPressCommandOptions = CommandContext & {
1876
- target: InteractionTarget_2;
1877
- durationMs?: number;
1878
- };
1879
-
1880
- declare type LongPressCommandResult = ResolvedInteractionTarget & {
1881
- durationMs?: number;
1882
- backendResult?: Record<string, unknown>;
1883
- message?: string;
1884
- };
1885
-
1886
689
  export declare type LongPressOptions = ClientCommandBaseOptions & {
1887
690
  x: number;
1888
691
  y: number;
@@ -1920,6 +723,8 @@ declare type MetroBridgeResult = {
1920
723
  };
1921
724
  };
1922
725
 
726
+ declare type MetroBridgeScope = CompanionTunnelScope;
727
+
1923
728
  declare type MetroPrepareKind = 'auto' | 'react-native' | 'expo';
1924
729
 
1925
730
  export declare type MetroPrepareOptions = {
@@ -1928,7 +733,7 @@ export declare type MetroPrepareOptions = {
1928
733
  publicBaseUrl?: string;
1929
734
  proxyBaseUrl?: string;
1930
735
  bearerToken?: string;
1931
- bridgeScope?: CompanionTunnelScope;
736
+ bridgeScope?: MetroBridgeScope;
1932
737
  launchUrl?: string;
1933
738
  companionProfileKey?: string;
1934
739
  companionConsumerKey?: string;
@@ -1971,22 +776,10 @@ export declare function normalizeAgentDeviceError(err: unknown, context?: {
1971
776
  export declare type NormalizedError = {
1972
777
  code: string;
1973
778
  message: string;
1974
- hint?: string;
1975
- diagnosticId?: string;
1976
- logPath?: string;
1977
- details?: Record<string, unknown>;
1978
- };
1979
-
1980
- export declare type OpenAppCommandOptions = CommandContext & BackendOpenTarget & {
1981
- relaunch?: boolean;
1982
- };
1983
-
1984
- export declare type OpenAppCommandResult = {
1985
- kind: 'appOpened';
1986
- target: BackendOpenTarget;
1987
- relaunch: boolean;
1988
- backendResult?: Record<string, unknown>;
1989
- message?: string;
779
+ hint?: string;
780
+ diagnosticId?: string;
781
+ logPath?: string;
782
+ details?: Record<string, unknown>;
1990
783
  };
1991
784
 
1992
785
  export declare type OutputVisibility = 'client-visible' | 'internal';
@@ -1995,20 +788,6 @@ export declare type PerfOptions = ClientCommandBaseOptions;
1995
788
 
1996
789
  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';
1997
790
 
1998
- declare type PinchCommandOptions = CommandContext & {
1999
- scale: number;
2000
- center?: InteractionTarget_2;
2001
- };
2002
-
2003
- declare type PinchCommandResult = {
2004
- kind: 'pinch';
2005
- scale: number;
2006
- center?: Point;
2007
- centerTarget?: ResolvedInteractionTarget;
2008
- backendResult?: Record<string, unknown>;
2009
- message?: string;
2010
- };
2011
-
2012
791
  export declare type PinchOptions = ClientCommandBaseOptions & {
2013
792
  scale: number;
2014
793
  x?: number;
@@ -2025,12 +804,6 @@ export declare type Point = {
2025
804
  };
2026
805
 
2027
806
  declare type PointTarget = {
2028
- kind: 'point';
2029
- x: number;
2030
- y: number;
2031
- };
2032
-
2033
- declare type PointTarget_2 = {
2034
807
  x: number;
2035
808
  y: number;
2036
809
  ref?: never;
@@ -2054,35 +827,8 @@ declare type PrepareMetroRuntimeResult = {
2054
827
  bridge: MetroBridgeResult | null;
2055
828
  };
2056
829
 
2057
- declare type PressCommandOptions = CommandContext & {
2058
- target: InteractionTarget_2;
2059
- button?: ClickButton;
2060
- count?: number;
2061
- intervalMs?: number;
2062
- holdMs?: number;
2063
- jitterPx?: number;
2064
- doubleTap?: boolean;
2065
- };
2066
-
2067
- declare type PressCommandResult = ResolvedInteractionTarget & {
2068
- backendResult?: Record<string, unknown>;
2069
- };
2070
-
2071
830
  export declare type PressOptions = ClientCommandBaseOptions & SelectorSnapshotCommandOptions & InteractionTarget & RepeatedPressOptions;
2072
831
 
2073
- export declare type PushAppCommandOptions = CommandContext & {
2074
- app: string;
2075
- input: AppPushInput;
2076
- };
2077
-
2078
- export declare type PushAppCommandResult = {
2079
- kind: 'appPushed';
2080
- app: string;
2081
- inputKind: 'json' | 'file';
2082
- backendResult?: Record<string, unknown>;
2083
- message?: string;
2084
- };
2085
-
2086
832
  declare type RawSnapshotNode = {
2087
833
  index: number;
2088
834
  type?: string;
@@ -2108,39 +854,6 @@ declare type RawSnapshotNode = {
2108
854
 
2109
855
  declare type RecordingQuality = 5 | 6 | 7 | 8 | 9 | 10;
2110
856
 
2111
- export declare type RecordingRecordCommandOptions = CommandContext & {
2112
- action: 'start' | 'stop';
2113
- out?: FileOutputRef;
2114
- fps?: number;
2115
- quality?: number;
2116
- hideTouches?: boolean;
2117
- };
2118
-
2119
- export declare type RecordingRecordCommandResult = {
2120
- kind: 'recordingStarted' | 'recordingStopped';
2121
- action: 'start' | 'stop';
2122
- path?: string;
2123
- telemetryPath?: string;
2124
- artifact?: ArtifactDescriptor;
2125
- backendResult?: Record<string, unknown>;
2126
- warning?: string;
2127
- message?: string;
2128
- };
2129
-
2130
- export declare type RecordingTraceCommandOptions = CommandContext & {
2131
- action: 'start' | 'stop';
2132
- out?: FileOutputRef;
2133
- };
2134
-
2135
- export declare type RecordingTraceCommandResult = {
2136
- kind: 'traceStarted' | 'traceStopped';
2137
- action: 'start' | 'stop';
2138
- outPath?: string;
2139
- artifact?: ArtifactDescriptor;
2140
- backendResult?: Record<string, unknown>;
2141
- message?: string;
2142
- };
2143
-
2144
857
  export declare type RecordOptions = AgentDeviceRequestOverrides & {
2145
858
  action: 'start' | 'stop';
2146
859
  path?: string;
@@ -2156,17 +869,7 @@ export declare type Rect = {
2156
869
  height: number;
2157
870
  };
2158
871
 
2159
- export declare function ref(refInput: string, options?: {
2160
- fallbackLabel?: string;
2161
- }): RefTarget;
2162
-
2163
872
  declare type RefTarget = {
2164
- kind: 'ref';
2165
- ref: string;
2166
- fallbackLabel?: string;
2167
- };
2168
-
2169
- declare type RefTarget_2 = {
2170
873
  ref: string;
2171
874
  label?: string;
2172
875
  x?: never;
@@ -2225,46 +928,13 @@ export declare type ResolvedInputFile = {
2225
928
  cleanup?: () => Promise<void>;
2226
929
  };
2227
930
 
2228
- declare type ResolvedInteractionTarget = {
2229
- kind: 'point';
2230
- point: Point;
2231
- } | {
2232
- kind: 'ref';
2233
- point: Point;
2234
- target: Extract<ResolvedTarget, {
2235
- kind: 'ref';
2236
- }>;
2237
- node: SnapshotNode;
2238
- selectorChain: string[];
2239
- refLabel?: string;
2240
- } | {
2241
- kind: 'selector';
2242
- point: Point;
2243
- target: Extract<ResolvedTarget, {
2244
- kind: 'selector';
2245
- }>;
2246
- node: SnapshotNode;
2247
- selectorChain: string[];
2248
- refLabel?: string;
2249
- };
2250
-
2251
931
  declare type ResolvedMetroKind = Exclude<MetroPrepareKind, 'auto'>;
2252
932
 
2253
- declare type ResolvedTarget = {
2254
- kind: 'selector';
2255
- selector: string;
2256
- } | {
2257
- kind: 'ref';
2258
- ref: string;
2259
- };
2260
-
2261
933
  export declare type ResolveInputOptions = {
2262
934
  usage: string;
2263
935
  field?: string;
2264
936
  };
2265
937
 
2266
- export declare function restrictedCommandPolicy(overrides?: Partial<CommandPolicy>): CommandPolicy;
2267
-
2268
938
  export declare type RotateCommandOptions = DeviceCommandBaseOptions & {
2269
939
  orientation: 'portrait' | 'portrait-upside-down' | 'landscape-left' | 'landscape-right';
2270
940
  };
@@ -2273,132 +943,6 @@ export declare type RotateCommandResult = CommandActionResult<'rotate'> & {
2273
943
  orientation?: RotateCommandOptions['orientation'];
2274
944
  };
2275
945
 
2276
- export declare type RuntimeCommand<TOptions = Record<string, unknown>, TResult = CommandResult> = (runtime: AgentDeviceRuntime, options: TOptions) => Promise<TResult>;
2277
-
2278
- declare type ScreenshotCommandOptions = CommandContext & {
2279
- out?: FileOutputRef;
2280
- fullscreen?: boolean;
2281
- overlayRefs?: boolean;
2282
- maxSize?: number;
2283
- appId?: string;
2284
- appBundleId?: string;
2285
- surface?: 'app' | 'frontmost-app' | 'desktop' | 'menubar';
2286
- };
2287
-
2288
- declare type ScreenshotCommandResult = {
2289
- path: string;
2290
- artifacts?: ArtifactDescriptor[];
2291
- message?: string;
2292
- };
2293
-
2294
- declare type ScreenshotDiffRegion = {
2295
- index: number;
2296
- rect: {
2297
- x: number;
2298
- y: number;
2299
- width: number;
2300
- height: number;
2301
- };
2302
- normalizedRect: {
2303
- x: number;
2304
- y: number;
2305
- width: number;
2306
- height: number;
2307
- };
2308
- differentPixels: number;
2309
- shareOfDiffPercentage: number;
2310
- densityPercentage: number;
2311
- shape: 'compact' | 'horizontal-band' | 'vertical-band' | 'large-area';
2312
- size: 'small' | 'medium' | 'large';
2313
- location: string;
2314
- averageBaselineColorHex: string;
2315
- averageCurrentColorHex: string;
2316
- baselineLuminance: number;
2317
- currentLuminance: number;
2318
- dominantChange: 'brighter' | 'darker' | 'color-shift' | 'mixed';
2319
- currentOverlayMatches?: ScreenshotDiffRegionOverlayMatch[];
2320
- };
2321
-
2322
- declare type ScreenshotDiffRegionOverlayMatch = {
2323
- ref: string;
2324
- label?: string;
2325
- regionCoveragePercentage: number;
2326
- rect: {
2327
- x: number;
2328
- y: number;
2329
- width: number;
2330
- height: number;
2331
- };
2332
- };
2333
-
2334
- declare type ScreenshotDiffResult = {
2335
- diffPath?: string;
2336
- totalPixels: number;
2337
- differentPixels: number;
2338
- mismatchPercentage: number;
2339
- match: boolean;
2340
- dimensionMismatch?: ScreenshotDimensionMismatch;
2341
- regions?: ScreenshotDiffRegion[];
2342
- currentOverlayPath?: string;
2343
- currentOverlayRefCount?: number;
2344
- ocr?: ScreenshotOcrSummary;
2345
- nonTextDeltas?: ScreenshotNonTextDelta[];
2346
- };
2347
-
2348
- declare type ScreenshotDimensionMismatch = {
2349
- expected: {
2350
- width: number;
2351
- height: number;
2352
- };
2353
- actual: {
2354
- width: number;
2355
- height: number;
2356
- };
2357
- };
2358
-
2359
- declare type ScreenshotNonTextDelta = {
2360
- index: number;
2361
- regionIndex?: number;
2362
- slot: 'leading' | 'trailing' | 'background' | 'separator' | 'unknown';
2363
- likelyKind: 'icon' | 'toggle' | 'chevron' | 'separator' | 'visual';
2364
- rect: Rect;
2365
- nearestText?: string;
2366
- };
2367
-
2368
- declare type ScreenshotOcrMovementCluster = {
2369
- texts: string[];
2370
- xRange: {
2371
- min: number;
2372
- max: number;
2373
- };
2374
- yRange: {
2375
- min: number;
2376
- max: number;
2377
- };
2378
- };
2379
-
2380
- declare type ScreenshotOcrSummary = {
2381
- provider: 'tesseract';
2382
- baselineBlocks: number;
2383
- currentBlocks: number;
2384
- matches: ScreenshotOcrTextMatch[];
2385
- movementClusters?: ScreenshotOcrMovementCluster[];
2386
- };
2387
-
2388
- declare type ScreenshotOcrTextMatch = {
2389
- text: string;
2390
- baselineRect: Rect;
2391
- currentRect: Rect;
2392
- delta: {
2393
- x: number;
2394
- y: number;
2395
- width: number;
2396
- height: number;
2397
- };
2398
- confidence: number;
2399
- possibleTextMetricMismatch: boolean;
2400
- };
2401
-
2402
946
  export declare type ScreenshotOverlayRef = {
2403
947
  ref: string;
2404
948
  label?: string;
@@ -2407,28 +951,6 @@ export declare type ScreenshotOverlayRef = {
2407
951
  center: Point;
2408
952
  };
2409
953
 
2410
- declare type ScrollCommandOptions = CommandContext & {
2411
- target?: ScrollTarget;
2412
- direction: GestureDirection;
2413
- amount?: number;
2414
- pixels?: number;
2415
- };
2416
-
2417
- declare type ScrollCommandResult = {
2418
- kind: 'viewport';
2419
- direction: GestureDirection;
2420
- amount?: number;
2421
- pixels?: number;
2422
- backendResult?: Record<string, unknown>;
2423
- message?: string;
2424
- } | (ResolvedInteractionTarget & {
2425
- direction: GestureDirection;
2426
- amount?: number;
2427
- pixels?: number;
2428
- backendResult?: Record<string, unknown>;
2429
- message?: string;
2430
- });
2431
-
2432
954
  declare type ScrollOptions_2 = ClientCommandBaseOptions & {
2433
955
  direction: 'up' | 'down' | 'left' | 'right';
2434
956
  amount?: number;
@@ -2436,26 +958,9 @@ declare type ScrollOptions_2 = ClientCommandBaseOptions & {
2436
958
  };
2437
959
  export { ScrollOptions_2 as ScrollOptions }
2438
960
 
2439
- declare type ScrollTarget = InteractionTarget_2 | {
2440
- kind: 'viewport';
2441
- };
2442
-
2443
- export declare function selector(expression: string): SelectorTarget;
2444
-
2445
961
  declare type SelectorSnapshotCommandOptions = Pick<CaptureSnapshotOptions, 'depth' | 'scope' | 'raw'>;
2446
962
 
2447
- export declare type SelectorSnapshotOptions = {
2448
- depth?: number;
2449
- scope?: string;
2450
- raw?: boolean;
2451
- };
2452
-
2453
963
  declare type SelectorTarget = {
2454
- kind: 'selector';
2455
- selector: string;
2456
- };
2457
-
2458
- declare type SelectorTarget_2 = {
2459
964
  selector: string;
2460
965
  x?: never;
2461
966
  y?: never;
@@ -2501,56 +1006,10 @@ export declare type SettingsUpdateOptions = (ClientCommandBaseOptions & {
2501
1006
  mode?: 'full' | 'limited';
2502
1007
  });
2503
1008
 
2504
- declare type SnapshotBackend = 'xctest' | 'android' | 'macos-helper' | 'linux-atspi';
2505
-
2506
- declare type SnapshotCommandOptions = CommandContext & {
2507
- interactiveOnly?: boolean;
2508
- compact?: boolean;
2509
- depth?: number;
2510
- scope?: string;
2511
- raw?: boolean;
2512
- };
2513
-
2514
- declare type SnapshotCommandResult = {
2515
- nodes: SnapshotNode[];
2516
- truncated: boolean;
2517
- appName?: string;
2518
- appBundleId?: string;
2519
- visibility?: SnapshotVisibility;
2520
- warnings?: string[];
2521
- };
2522
-
2523
- declare type SnapshotDiffLine = {
2524
- kind: 'added' | 'removed' | 'unchanged';
2525
- text: string;
2526
- };
2527
-
2528
- declare type SnapshotDiffSummary = {
2529
- additions: number;
2530
- removals: number;
2531
- unchanged: number;
2532
- };
2533
-
2534
1009
  export declare type SnapshotNode = RawSnapshotNode & {
2535
1010
  ref: string;
2536
1011
  };
2537
1012
 
2538
- declare type SnapshotOptions = {
2539
- interactiveOnly?: boolean;
2540
- compact?: boolean;
2541
- depth?: number;
2542
- scope?: string;
2543
- raw?: boolean;
2544
- };
2545
-
2546
- declare type SnapshotState = {
2547
- nodes: SnapshotNode[];
2548
- createdAt: number;
2549
- truncated?: boolean;
2550
- backend?: SnapshotBackend;
2551
- comparisonSafe?: boolean;
2552
- };
2553
-
2554
1013
  export declare type SnapshotVisibility = {
2555
1014
  partial: boolean;
2556
1015
  visibleNodeCount: number;
@@ -2568,22 +1027,6 @@ export declare type StartupPerfSample = {
2568
1027
  appBundleId?: string;
2569
1028
  };
2570
1029
 
2571
- declare type SwipeCommandOptions = CommandContext & SwipeOptions_2;
2572
-
2573
- declare type SwipeCommandResult = {
2574
- kind: 'swipe';
2575
- from: Point;
2576
- to: Point;
2577
- direction?: GestureDirection;
2578
- distance?: number;
2579
- durationMs?: number;
2580
- fromTarget?: ResolvedInteractionTarget | {
2581
- kind: 'viewport';
2582
- };
2583
- backendResult?: Record<string, unknown>;
2584
- message?: string;
2585
- };
2586
-
2587
1030
  export declare type SwipeOptions = ClientCommandBaseOptions & {
2588
1031
  from: {
2589
1032
  x: number;
@@ -2599,124 +1042,6 @@ export declare type SwipeOptions = ClientCommandBaseOptions & {
2599
1042
  pattern?: 'one-way' | 'ping-pong';
2600
1043
  };
2601
1044
 
2602
- declare type SwipeOptions_2 = {
2603
- from?: Point | InteractionTarget_2;
2604
- to?: Point;
2605
- direction?: GestureDirection;
2606
- distance?: number;
2607
- durationMs?: number;
2608
- };
2609
-
2610
- declare type SystemAlertCommandOptions = CommandContext & {
2611
- action?: BackendAlertAction;
2612
- timeoutMs?: number;
2613
- };
2614
-
2615
- declare type SystemAlertCommandResult = {
2616
- kind: 'alertStatus';
2617
- action: 'get';
2618
- alert: BackendAlertInfo | null;
2619
- } | {
2620
- kind: 'alertHandled';
2621
- action: 'accept' | 'dismiss';
2622
- handled: boolean;
2623
- alert?: BackendAlertInfo;
2624
- button?: string;
2625
- message?: string;
2626
- } | {
2627
- kind: 'alertWait';
2628
- action: 'wait';
2629
- alert: BackendAlertInfo | null;
2630
- waitedMs?: number;
2631
- timedOut?: boolean;
2632
- message?: string;
2633
- };
2634
-
2635
- declare type SystemAppSwitcherCommandOptions = CommandContext;
2636
-
2637
- declare type SystemAppSwitcherCommandResult = {
2638
- kind: 'appSwitcherOpened';
2639
- backendResult?: Record<string, unknown>;
2640
- message?: string;
2641
- };
2642
-
2643
- declare type SystemBackCommandOptions = CommandContext & {
2644
- mode?: 'in-app' | 'system';
2645
- };
2646
-
2647
- declare type SystemBackCommandResult = {
2648
- kind: 'systemBack';
2649
- mode: 'in-app' | 'system';
2650
- backendResult?: Record<string, unknown>;
2651
- message?: string;
2652
- };
2653
-
2654
- declare type SystemClipboardCommandOptions = (CommandContext & {
2655
- action: 'read';
2656
- }) | (CommandContext & {
2657
- action: 'write';
2658
- text: string;
2659
- });
2660
-
2661
- declare type SystemClipboardCommandResult = {
2662
- kind: 'clipboardText';
2663
- action: 'read';
2664
- text: string;
2665
- } | {
2666
- kind: 'clipboardUpdated';
2667
- action: 'write';
2668
- textLength: number;
2669
- backendResult?: Record<string, unknown>;
2670
- message?: string;
2671
- };
2672
-
2673
- declare type SystemHomeCommandOptions = CommandContext;
2674
-
2675
- declare type SystemHomeCommandResult = {
2676
- kind: 'systemHome';
2677
- backendResult?: Record<string, unknown>;
2678
- message?: string;
2679
- };
2680
-
2681
- declare type SystemKeyboardCommandOptions = CommandContext & {
2682
- action?: 'status' | 'get' | 'dismiss';
2683
- };
2684
-
2685
- declare type SystemKeyboardCommandResult = {
2686
- kind: 'keyboardState';
2687
- action: 'status' | 'get';
2688
- state: BackendKeyboardResult;
2689
- backendResult?: Record<string, unknown>;
2690
- } | {
2691
- kind: 'keyboardDismissed';
2692
- action: 'dismiss';
2693
- state: BackendKeyboardResult;
2694
- backendResult?: Record<string, unknown>;
2695
- message?: string;
2696
- };
2697
-
2698
- declare type SystemRotateCommandOptions = CommandContext & {
2699
- orientation: BackendDeviceOrientation;
2700
- };
2701
-
2702
- declare type SystemRotateCommandResult = {
2703
- kind: 'systemRotated';
2704
- orientation: BackendDeviceOrientation;
2705
- backendResult?: Record<string, unknown>;
2706
- message?: string;
2707
- };
2708
-
2709
- declare type SystemSettingsCommandOptions = CommandContext & {
2710
- target?: string;
2711
- };
2712
-
2713
- declare type SystemSettingsCommandResult = {
2714
- kind: 'settingsOpened';
2715
- target?: string;
2716
- backendResult?: Record<string, unknown>;
2717
- message?: string;
2718
- };
2719
-
2720
1045
  export declare type TemporaryFile = {
2721
1046
  path: string;
2722
1047
  visibility: 'internal';
@@ -2728,32 +1053,6 @@ export declare type TraceOptions = AgentDeviceRequestOverrides & {
2728
1053
  path?: string;
2729
1054
  };
2730
1055
 
2731
- export declare type TriggerAppEventCommandOptions = CommandContext & {
2732
- name: string;
2733
- payload?: Record<string, unknown>;
2734
- };
2735
-
2736
- export declare type TriggerAppEventCommandResult = {
2737
- kind: 'appEventTriggered';
2738
- name: string;
2739
- payload?: Record<string, unknown>;
2740
- backendResult?: Record<string, unknown>;
2741
- message?: string;
2742
- };
2743
-
2744
- export declare type TypeTextCommandOptions = CommandContext & {
2745
- text: string;
2746
- delayMs?: number;
2747
- };
2748
-
2749
- export declare type TypeTextCommandResult = {
2750
- kind: 'text';
2751
- text: string;
2752
- delayMs: number;
2753
- backendResult?: Record<string, unknown>;
2754
- message?: string;
2755
- };
2756
-
2757
1056
  export declare type TypeTextOptions = ClientCommandBaseOptions & {
2758
1057
  text: string;
2759
1058
  delayMs?: number;
@@ -2761,44 +1060,12 @@ export declare type TypeTextOptions = ClientCommandBaseOptions & {
2761
1060
 
2762
1061
  export declare type WaitCommandOptions = DeviceCommandBaseOptions & WaitCommandTarget;
2763
1062
 
2764
- declare type WaitCommandOptions_2 = CommandContext & SelectorSnapshotOptions & {
2765
- target: {
2766
- kind: 'sleep';
2767
- durationMs: number;
2768
- } | {
2769
- kind: 'text';
2770
- text: string;
2771
- timeoutMs?: number | null;
2772
- } | {
2773
- kind: 'ref';
2774
- ref: string;
2775
- timeoutMs?: number | null;
2776
- } | {
2777
- kind: 'selector';
2778
- selector: string;
2779
- timeoutMs?: number | null;
2780
- };
2781
- };
2782
-
2783
1063
  export declare type WaitCommandResult = DaemonResponseData & {
2784
1064
  waitedMs?: number;
2785
1065
  text?: string;
2786
1066
  selector?: string;
2787
1067
  };
2788
1068
 
2789
- declare type WaitCommandResult_2 = {
2790
- kind: 'sleep';
2791
- waitedMs: number;
2792
- } | {
2793
- kind: 'text';
2794
- waitedMs: number;
2795
- text: string;
2796
- } | {
2797
- kind: 'selector';
2798
- waitedMs: number;
2799
- selector: string;
2800
- };
2801
-
2802
1069
  declare type WaitCommandTarget = {
2803
1070
  durationMs: number;
2804
1071
  text?: never;
@@ -2825,11 +1092,6 @@ declare type WaitCommandTarget = {
2825
1092
  timeoutMs?: number;
2826
1093
  });
2827
1094
 
2828
- declare type WaitForTextCommandOptions = CommandContext & SelectorSnapshotOptions & {
2829
- text: string;
2830
- timeoutMs?: number | null;
2831
- };
2832
-
2833
1095
  declare type WaitSnapshotOptions = Pick<CaptureSnapshotOptions, 'depth' | 'scope' | 'raw'>;
2834
1096
 
2835
1097
  export { }