agent-device 0.10.2 → 0.10.3

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 (195) hide show
  1. package/dist/src/376.js +3 -0
  2. package/dist/src/bin.js +74 -73
  3. package/dist/src/daemon.js +37 -37
  4. package/dist/src/index.d.ts +559 -5
  5. package/dist/src/index.js +3 -1
  6. package/package.json +2 -1
  7. package/skills/agent-device/SKILL.md +35 -12
  8. package/skills/agent-device/references/bootstrap-install.md +55 -15
  9. package/skills/agent-device/references/exploration.md +49 -7
  10. package/skills/agent-device/references/macos-desktop.md +1 -2
  11. package/skills/agent-device/references/remote-tenancy.md +15 -2
  12. package/skills/agent-device/references/verification.md +2 -3
  13. package/dist/src/224.js +0 -2
  14. package/dist/src/331.js +0 -3
  15. package/dist/src/425.js +0 -1
  16. package/dist/src/bin.d.ts +0 -1
  17. package/dist/src/cli-client-commands.d.ts +0 -8
  18. package/dist/src/cli.d.ts +0 -6
  19. package/dist/src/client-metro.d.ts +0 -64
  20. package/dist/src/client-normalizers.d.ts +0 -20
  21. package/dist/src/client-shared.d.ts +0 -20
  22. package/dist/src/client-types.d.ts +0 -269
  23. package/dist/src/client.d.ts +0 -5
  24. package/dist/src/core/app-events.d.ts +0 -8
  25. package/dist/src/core/batch.d.ts +0 -17
  26. package/dist/src/core/capabilities.d.ts +0 -3
  27. package/dist/src/core/click-button.d.ts +0 -20
  28. package/dist/src/core/dispatch-payload.d.ts +0 -1
  29. package/dist/src/core/dispatch-resolve.d.ts +0 -29
  30. package/dist/src/core/dispatch-series.d.ts +0 -7
  31. package/dist/src/core/dispatch.d.ts +0 -37
  32. package/dist/src/core/open-target.d.ts +0 -4
  33. package/dist/src/core/session-surface.d.ts +0 -3
  34. package/dist/src/core/settings-contract.d.ts +0 -9
  35. package/dist/src/daemon/action-utils.d.ts +0 -3
  36. package/dist/src/daemon/android-system-dialog.d.ts +0 -11
  37. package/dist/src/daemon/app-log-android.d.ts +0 -4
  38. package/dist/src/daemon/app-log-ios.d.ts +0 -7
  39. package/dist/src/daemon/app-log-process.d.ts +0 -15
  40. package/dist/src/daemon/app-log-stream.d.ts +0 -19
  41. package/dist/src/daemon/app-log.d.ts +0 -28
  42. package/dist/src/daemon/artifact-archive.d.ts +0 -12
  43. package/dist/src/daemon/artifact-download.d.ts +0 -12
  44. package/dist/src/daemon/artifact-materialization.d.ts +0 -17
  45. package/dist/src/daemon/artifact-registry.d.ts +0 -12
  46. package/dist/src/daemon/config.d.ts +0 -16
  47. package/dist/src/daemon/context.d.ts +0 -25
  48. package/dist/src/daemon/device-ready.d.ts +0 -6
  49. package/dist/src/daemon/handlers/find.d.ts +0 -40
  50. package/dist/src/daemon/handlers/install-source.d.ts +0 -44
  51. package/dist/src/daemon/handlers/interaction-common.d.ts +0 -41
  52. package/dist/src/daemon/handlers/interaction-flags.d.ts +0 -4
  53. package/dist/src/daemon/handlers/interaction-get.d.ts +0 -3
  54. package/dist/src/daemon/handlers/interaction-is.d.ts +0 -3
  55. package/dist/src/daemon/handlers/interaction-read.d.ts +0 -14
  56. package/dist/src/daemon/handlers/interaction-scroll.d.ts +0 -3
  57. package/dist/src/daemon/handlers/interaction-selector.d.ts +0 -27
  58. package/dist/src/daemon/handlers/interaction-snapshot.d.ts +0 -8
  59. package/dist/src/daemon/handlers/interaction-targeting.d.ts +0 -28
  60. package/dist/src/daemon/handlers/interaction-touch.d.ts +0 -45
  61. package/dist/src/daemon/handlers/interaction.d.ts +0 -9
  62. package/dist/src/daemon/handlers/lease.d.ts +0 -8
  63. package/dist/src/daemon/handlers/parse-utils.d.ts +0 -3
  64. package/dist/src/daemon/handlers/record-trace-android.d.ts +0 -18
  65. package/dist/src/daemon/handlers/record-trace-ios.d.ts +0 -52
  66. package/dist/src/daemon/handlers/record-trace-recording.d.ts +0 -32
  67. package/dist/src/daemon/handlers/record-trace.d.ts +0 -10
  68. package/dist/src/daemon/handlers/session-batch.d.ts +0 -2
  69. package/dist/src/daemon/handlers/session-close.d.ts +0 -31
  70. package/dist/src/daemon/handlers/session-deploy.d.ts +0 -37
  71. package/dist/src/daemon/handlers/session-device-utils.d.ts +0 -26
  72. package/dist/src/daemon/handlers/session-open-target.d.ts +0 -3
  73. package/dist/src/daemon/handlers/session-open.d.ts +0 -22
  74. package/dist/src/daemon/handlers/session-perf.d.ts +0 -2
  75. package/dist/src/daemon/handlers/session-replay-heal.d.ts +0 -8
  76. package/dist/src/daemon/handlers/session-replay-script.d.ts +0 -3
  77. package/dist/src/daemon/handlers/session-runtime-command.d.ts +0 -9
  78. package/dist/src/daemon/handlers/session-runtime.d.ts +0 -36
  79. package/dist/src/daemon/handlers/session-startup-metrics.d.ts +0 -11
  80. package/dist/src/daemon/handlers/session.d.ts +0 -50
  81. package/dist/src/daemon/handlers/snapshot-alert.d.ts +0 -13
  82. package/dist/src/daemon/handlers/snapshot-capture.d.ts +0 -34
  83. package/dist/src/daemon/handlers/snapshot-session.d.ts +0 -15
  84. package/dist/src/daemon/handlers/snapshot-settings.d.ts +0 -24
  85. package/dist/src/daemon/handlers/snapshot-wait.d.ts +0 -37
  86. package/dist/src/daemon/handlers/snapshot.d.ts +0 -16
  87. package/dist/src/daemon/http-server.d.ts +0 -26
  88. package/dist/src/daemon/install-source-resolution.d.ts +0 -5
  89. package/dist/src/daemon/is-predicates.d.ts +0 -15
  90. package/dist/src/daemon/lease-context.d.ts +0 -9
  91. package/dist/src/daemon/lease-registry.d.ts +0 -63
  92. package/dist/src/daemon/materialized-path-registry.d.ts +0 -15
  93. package/dist/src/daemon/network-log.d.ts +0 -32
  94. package/dist/src/daemon/record-trace-errors.d.ts +0 -6
  95. package/dist/src/daemon/recording-gestures.d.ts +0 -3
  96. package/dist/src/daemon/recording-telemetry.d.ts +0 -20
  97. package/dist/src/daemon/recording-timing.d.ts +0 -24
  98. package/dist/src/daemon/request-cancel.d.ts +0 -9
  99. package/dist/src/daemon/request-lock-policy.d.ts +0 -2
  100. package/dist/src/daemon/request-router.d.ts +0 -23
  101. package/dist/src/daemon/runtime-hints.d.ts +0 -19
  102. package/dist/src/daemon/script-utils.d.ts +0 -28
  103. package/dist/src/daemon/scroll-planner.d.ts +0 -12
  104. package/dist/src/daemon/selectors-build.d.ts +0 -5
  105. package/dist/src/daemon/selectors-match.d.ts +0 -6
  106. package/dist/src/daemon/selectors-parse.d.ts +0 -29
  107. package/dist/src/daemon/selectors-resolve.d.ts +0 -33
  108. package/dist/src/daemon/selectors.d.ts +0 -5
  109. package/dist/src/daemon/server-lifecycle.d.ts +0 -23
  110. package/dist/src/daemon/session-open-script.d.ts +0 -7
  111. package/dist/src/daemon/session-routing.d.ts +0 -3
  112. package/dist/src/daemon/session-selector.d.ts +0 -10
  113. package/dist/src/daemon/session-store.d.ts +0 -33
  114. package/dist/src/daemon/snapshot-diff.d.ts +0 -20
  115. package/dist/src/daemon/snapshot-processing.d.ts +0 -10
  116. package/dist/src/daemon/touch-reference-frame.d.ts +0 -7
  117. package/dist/src/daemon/transport.d.ts +0 -6
  118. package/dist/src/daemon/types.d.ts +0 -173
  119. package/dist/src/daemon/upload-registry.d.ts +0 -7
  120. package/dist/src/daemon/upload.d.ts +0 -5
  121. package/dist/src/daemon-client.d.ts +0 -40
  122. package/dist/src/daemon.d.ts +0 -1
  123. package/dist/src/platforms/android/adb.d.ts +0 -5
  124. package/dist/src/platforms/android/app-lifecycle.d.ts +0 -31
  125. package/dist/src/platforms/android/device-input-state.d.ts +0 -19
  126. package/dist/src/platforms/android/devices.d.ts +0 -26
  127. package/dist/src/platforms/android/index.d.ts +0 -8
  128. package/dist/src/platforms/android/input-actions.d.ts +0 -17
  129. package/dist/src/platforms/android/install-artifact.d.ts +0 -11
  130. package/dist/src/platforms/android/manifest.d.ts +0 -1
  131. package/dist/src/platforms/android/notifications.d.ts +0 -11
  132. package/dist/src/platforms/android/open-target.d.ts +0 -4
  133. package/dist/src/platforms/android/screenshot.d.ts +0 -16
  134. package/dist/src/platforms/android/sdk.d.ts +0 -2
  135. package/dist/src/platforms/android/settings.d.ts +0 -3
  136. package/dist/src/platforms/android/snapshot.d.ts +0 -7
  137. package/dist/src/platforms/android/ui-hierarchy.d.ts +0 -21
  138. package/dist/src/platforms/appearance.d.ts +0 -2
  139. package/dist/src/platforms/boot-diagnostics.d.ts +0 -14
  140. package/dist/src/platforms/install-source.d.ts +0 -29
  141. package/dist/src/platforms/ios/app-filter.d.ts +0 -2
  142. package/dist/src/platforms/ios/apps.d.ts +0 -34
  143. package/dist/src/platforms/ios/config.d.ts +0 -10
  144. package/dist/src/platforms/ios/devicectl.d.ts +0 -13
  145. package/dist/src/platforms/ios/devices.d.ts +0 -40
  146. package/dist/src/platforms/ios/ensure-simulator.d.ts +0 -18
  147. package/dist/src/platforms/ios/index.d.ts +0 -3
  148. package/dist/src/platforms/ios/install-artifact.d.ts +0 -18
  149. package/dist/src/platforms/ios/launch-diagnostics.d.ts +0 -11
  150. package/dist/src/platforms/ios/macos-apps.d.ts +0 -12
  151. package/dist/src/platforms/ios/macos-helper.d.ts +0 -69
  152. package/dist/src/platforms/ios/plist.d.ts +0 -1
  153. package/dist/src/platforms/ios/runner-client.d.ts +0 -38
  154. package/dist/src/platforms/ios/runner-errors.d.ts +0 -20
  155. package/dist/src/platforms/ios/runner-macos-products.d.ts +0 -3
  156. package/dist/src/platforms/ios/runner-session.d.ts +0 -30
  157. package/dist/src/platforms/ios/runner-transport.d.ts +0 -10
  158. package/dist/src/platforms/ios/runner-xctestrun-products.d.ts +0 -2
  159. package/dist/src/platforms/ios/runner-xctestrun.d.ts +0 -38
  160. package/dist/src/platforms/ios/screenshot-status-bar.d.ts +0 -2
  161. package/dist/src/platforms/ios/screenshot.d.ts +0 -14
  162. package/dist/src/platforms/ios/simctl.d.ts +0 -7
  163. package/dist/src/platforms/ios/simulator.d.ts +0 -11
  164. package/dist/src/platforms/permission-utils.d.ts +0 -9
  165. package/dist/src/recording/overlay.d.ts +0 -10
  166. package/dist/src/upload-client.d.ts +0 -7
  167. package/dist/src/utils/args.d.ts +0 -27
  168. package/dist/src/utils/cli-config.d.ts +0 -10
  169. package/dist/src/utils/cli-option-schema.d.ts +0 -19
  170. package/dist/src/utils/cli-options.d.ts +0 -13
  171. package/dist/src/utils/command-schema.d.ts +0 -123
  172. package/dist/src/utils/device-isolation.d.ts +0 -3
  173. package/dist/src/utils/device.d.ts +0 -35
  174. package/dist/src/utils/diagnostics.d.ts +0 -30
  175. package/dist/src/utils/errors.d.ts +0 -26
  176. package/dist/src/utils/exec.d.ts +0 -32
  177. package/dist/src/utils/finders.d.ts +0 -12
  178. package/dist/src/utils/interactors.d.ts +0 -38
  179. package/dist/src/utils/json-input.d.ts +0 -1
  180. package/dist/src/utils/keyed-lock.d.ts +0 -1
  181. package/dist/src/utils/output.d.ts +0 -27
  182. package/dist/src/utils/path-resolution.d.ts +0 -8
  183. package/dist/src/utils/payload-input.d.ts +0 -12
  184. package/dist/src/utils/process-identity.d.ts +0 -11
  185. package/dist/src/utils/remote-config.d.ts +0 -15
  186. package/dist/src/utils/remote-open.d.ts +0 -9
  187. package/dist/src/utils/retry.d.ts +0 -54
  188. package/dist/src/utils/screenshot-diff.d.ts +0 -23
  189. package/dist/src/utils/session-binding.d.ts +0 -18
  190. package/dist/src/utils/snapshot-lines.d.ts +0 -15
  191. package/dist/src/utils/snapshot.d.ts +0 -49
  192. package/dist/src/utils/text-surface.d.ts +0 -19
  193. package/dist/src/utils/timeouts.d.ts +0 -3
  194. package/dist/src/utils/version.d.ts +0 -2
  195. package/dist/src/utils/video.d.ts +0 -9
@@ -1,6 +0,0 @@
1
- import type { DeviceInfo } from '../utils/device.ts';
2
- export declare function ensureDeviceReady(device: DeviceInfo): Promise<void>;
3
- export declare function parseIosReadyPayload(payload: unknown): {
4
- tunnelState?: string;
5
- };
6
- export declare function resolveIosReadyHint(stdout: string, stderr: string): string;
@@ -1,40 +0,0 @@
1
- import { dispatchCommand } from '../../core/dispatch.ts';
2
- import { type FindLocator } from '../../utils/finders.ts';
3
- import type { DaemonRequest, DaemonResponse } from '../types.ts';
4
- import { SessionStore } from '../session-store.ts';
5
- export declare function handleFindCommands(params: {
6
- req: DaemonRequest;
7
- sessionName: string;
8
- logPath: string;
9
- sessionStore: SessionStore;
10
- invoke: (req: DaemonRequest) => Promise<DaemonResponse>;
11
- dispatch?: typeof dispatchCommand;
12
- }): Promise<DaemonResponse | null>;
13
- type FindAction = {
14
- kind: 'click';
15
- } | {
16
- kind: 'focus';
17
- } | {
18
- kind: 'fill';
19
- value: string;
20
- } | {
21
- kind: 'type';
22
- value: string;
23
- } | {
24
- kind: 'get_text';
25
- } | {
26
- kind: 'get_attrs';
27
- } | {
28
- kind: 'exists';
29
- } | {
30
- kind: 'wait';
31
- timeoutMs?: number;
32
- };
33
- export declare function parseFindArgs(args: string[]): {
34
- locator: FindLocator;
35
- query: string;
36
- action: FindAction['kind'];
37
- value?: string;
38
- timeoutMs?: number;
39
- };
40
- export {};
@@ -1,44 +0,0 @@
1
- import { getRequestSignal } from '../request-cancel.ts';
2
- import { SessionStore } from '../session-store.ts';
3
- import type { DaemonRequest, DaemonResponse, SessionState } from '../types.ts';
4
- import type { MaterializeInstallSource } from '../../platforms/install-source.ts';
5
- type PreparedIosInstallArtifact = {
6
- archivePath?: string;
7
- installablePath: string;
8
- bundleId?: string;
9
- appName?: string;
10
- cleanup: () => Promise<void>;
11
- };
12
- type PreparedAndroidInstallArtifact = {
13
- archivePath?: string;
14
- installablePath: string;
15
- packageName?: string;
16
- cleanup: () => Promise<void>;
17
- };
18
- declare function resolveInstallDevice(params: {
19
- session: SessionState | undefined;
20
- flags: DaemonRequest['flags'] | undefined;
21
- }): Promise<SessionState['device']>;
22
- export declare function handleInstallFromSourceCommand(params: {
23
- req: DaemonRequest;
24
- sessionName: string;
25
- sessionStore: SessionStore;
26
- deps?: {
27
- resolveInstallDevice?: typeof resolveInstallDevice;
28
- getRequestSignal?: typeof getRequestSignal;
29
- prepareIosInstallArtifact?: (source: MaterializeInstallSource, options?: {
30
- signal?: AbortSignal;
31
- }) => Promise<PreparedIosInstallArtifact>;
32
- installIosInstallablePath?: (device: SessionState['device'], installablePath: string) => Promise<void>;
33
- prepareAndroidInstallArtifact?: (source: MaterializeInstallSource, options?: {
34
- signal?: AbortSignal;
35
- resolveIdentity?: boolean;
36
- }) => Promise<PreparedAndroidInstallArtifact>;
37
- installAndroidInstallablePathAndResolvePackageName?: (device: SessionState['device'], installablePath: string, packageNameHint?: string) => Promise<string | undefined>;
38
- inferAndroidAppName?: (packageName: string) => string;
39
- };
40
- }): Promise<DaemonResponse>;
41
- export declare function handleReleaseMaterializedPathsCommand(params: {
42
- req: DaemonRequest;
43
- }): Promise<DaemonResponse>;
44
- export {};
@@ -1,41 +0,0 @@
1
- import { dispatchCommand, type CommandFlags } from '../../core/dispatch.ts';
2
- import type { DaemonCommandContext } from '../context.ts';
3
- import type { DaemonRequest, DaemonResponse, SessionState } from '../types.ts';
4
- import { SessionStore } from '../session-store.ts';
5
- export type ContextFromFlags = (flags: CommandFlags | undefined, appBundleId?: string, traceLogPath?: string) => DaemonCommandContext;
6
- export type InteractionHandlerParams = {
7
- req: DaemonRequest;
8
- sessionName: string;
9
- sessionStore: SessionStore;
10
- contextFromFlags: ContextFromFlags;
11
- dispatch: typeof dispatchCommand;
12
- };
13
- export declare function buildTouchVisualizationResult(params: {
14
- data: Record<string, unknown> | undefined;
15
- fallbackX: number;
16
- fallbackY: number;
17
- referenceFrame?: {
18
- referenceWidth: number;
19
- referenceHeight: number;
20
- };
21
- extra?: Record<string, unknown>;
22
- }): Record<string, unknown>;
23
- export declare function dispatchRecordedTouchInteraction(params: {
24
- session: SessionState;
25
- sessionStore: SessionStore;
26
- requestCommand: string;
27
- requestPositionals: string[];
28
- flags: CommandFlags | undefined;
29
- contextFromFlags: ContextFromFlags;
30
- dispatch: typeof dispatchCommand;
31
- interactionCommand: string;
32
- interactionPositionals: string[];
33
- outPath: string | undefined;
34
- buildPayloads: (data: Record<string, unknown> | undefined) => {
35
- result: Record<string, unknown>;
36
- responseData?: Record<string, unknown>;
37
- } | Promise<{
38
- result: Record<string, unknown>;
39
- responseData?: Record<string, unknown>;
40
- }>;
41
- }): Promise<DaemonResponse>;
@@ -1,4 +0,0 @@
1
- import type { CommandFlags } from '../../core/dispatch.ts';
2
- import type { DaemonResponse } from '../types.ts';
3
- export declare function refSnapshotFlagGuardResponse(command: 'press' | 'fill' | 'get' | 'scrollintoview', flags: CommandFlags | undefined): DaemonResponse | null;
4
- export declare function unsupportedRefSnapshotFlags(flags: CommandFlags | undefined): string[];
@@ -1,3 +0,0 @@
1
- import type { DaemonResponse } from '../types.ts';
2
- import type { InteractionHandlerParams } from './interaction-common.ts';
3
- export declare function handleGetCommand(params: InteractionHandlerParams): Promise<DaemonResponse>;
@@ -1,3 +0,0 @@
1
- import type { DaemonResponse } from '../types.ts';
2
- import type { InteractionHandlerParams } from './interaction-common.ts';
3
- export declare function handleIsCommand(params: InteractionHandlerParams): Promise<DaemonResponse>;
@@ -1,14 +0,0 @@
1
- import { dispatchCommand, type CommandFlags } from '../../core/dispatch.ts';
2
- import type { SessionState } from '../types.ts';
3
- import type { SnapshotNode } from '../../utils/snapshot.ts';
4
- import type { ContextFromFlags } from './interaction-common.ts';
5
- export declare function readTextForNode(params: {
6
- device: SessionState['device'];
7
- node: SnapshotNode;
8
- flags: CommandFlags | undefined;
9
- appBundleId?: string;
10
- traceOutPath?: string;
11
- surface?: SessionState['surface'];
12
- contextFromFlags: ContextFromFlags;
13
- dispatch: typeof dispatchCommand;
14
- }): Promise<string>;
@@ -1,3 +0,0 @@
1
- import type { DaemonResponse } from '../types.ts';
2
- import type { InteractionHandlerParams } from './interaction-common.ts';
3
- export declare function handleScrollIntoViewCommand(params: InteractionHandlerParams): Promise<DaemonResponse | null>;
@@ -1,27 +0,0 @@
1
- import { parseSelectorChain, resolveSelectorChain } from '../selectors.ts';
2
- import type { DaemonResponse, SessionState } from '../types.ts';
3
- import type { SessionStore } from '../session-store.ts';
4
- import { captureSnapshotForSession } from './interaction-snapshot.ts';
5
- import type { ContextFromFlags } from './interaction-common.ts';
6
- import { dispatchCommand, type CommandFlags } from '../../core/dispatch.ts';
7
- export declare function resolveSelectorTarget(params: {
8
- command: string;
9
- selectorExpression: string;
10
- session: SessionState;
11
- flags: CommandFlags | undefined;
12
- sessionStore: SessionStore;
13
- contextFromFlags: ContextFromFlags;
14
- interactiveOnly: boolean;
15
- requireRect: boolean;
16
- requireUnique: boolean;
17
- disambiguateAmbiguous: boolean;
18
- dispatch: typeof dispatchCommand;
19
- }): Promise<{
20
- ok: true;
21
- chain: ReturnType<typeof parseSelectorChain>;
22
- snapshot: Awaited<ReturnType<typeof captureSnapshotForSession>>;
23
- resolved: NonNullable<Awaited<ReturnType<typeof resolveSelectorChain>>>;
24
- } | {
25
- ok: false;
26
- response: DaemonResponse;
27
- }>;
@@ -1,8 +0,0 @@
1
- import { dispatchCommand, type CommandFlags } from '../../core/dispatch.ts';
2
- import type { SessionStore } from '../session-store.ts';
3
- import type { SessionState } from '../types.ts';
4
- import type { SnapshotState } from '../../utils/snapshot.ts';
5
- import type { ContextFromFlags } from './interaction-common.ts';
6
- export declare function captureSnapshotForSession(session: SessionState, flags: CommandFlags | undefined, sessionStore: SessionStore, contextFromFlags: ContextFromFlags, options: {
7
- interactiveOnly: boolean;
8
- }, dispatch?: typeof dispatchCommand): Promise<SnapshotState>;
@@ -1,28 +0,0 @@
1
- import { type Rect, type SnapshotNode } from '../../utils/snapshot.ts';
2
- import type { DaemonResponse, SessionState } from '../types.ts';
3
- export declare function parseCoordinateTarget(positionals: string[]): {
4
- x: number;
5
- y: number;
6
- } | null;
7
- export declare function resolveRefTarget(params: {
8
- session: SessionState;
9
- refInput: string;
10
- fallbackLabel: string;
11
- requireRect: boolean;
12
- invalidRefMessage: string;
13
- notFoundMessage: string;
14
- }): {
15
- ok: true;
16
- target: {
17
- ref: string;
18
- node: SnapshotNode;
19
- snapshotNodes: SnapshotNode[];
20
- };
21
- } | {
22
- ok: false;
23
- response: DaemonResponse;
24
- };
25
- export declare function resolveRectCenter(rect: Rect | undefined): {
26
- x: number;
27
- y: number;
28
- } | null;
@@ -1,45 +0,0 @@
1
- import { dispatchCommand, type CommandFlags } from '../../core/dispatch.ts';
2
- import { type SnapshotNode } from '../../utils/snapshot.ts';
3
- import type { DaemonRequest, DaemonResponse, SessionState } from '../types.ts';
4
- import { SessionStore } from '../session-store.ts';
5
- import { getAndroidScreenSize } from '../../platforms/android/index.ts';
6
- import { type ContextFromFlags } from './interaction-common.ts';
7
- type CaptureSnapshotForSession = (session: SessionState, flags: CommandFlags | undefined, sessionStore: SessionStore, contextFromFlags: ContextFromFlags, options: {
8
- interactiveOnly: boolean;
9
- }, dispatch?: typeof dispatchCommand) => Promise<{
10
- nodes: SnapshotNode[];
11
- truncated?: boolean;
12
- createdAt: number;
13
- backend?: 'xctest' | 'android' | 'macos-helper';
14
- }>;
15
- type ResolveRefTarget = ((params: {
16
- session: SessionState;
17
- refInput: string;
18
- fallbackLabel: string;
19
- requireRect: boolean;
20
- invalidRefMessage: string;
21
- notFoundMessage: string;
22
- }) => {
23
- ok: true;
24
- target: {
25
- ref: string;
26
- node: SnapshotNode;
27
- snapshotNodes: SnapshotNode[];
28
- };
29
- } | {
30
- ok: false;
31
- response: DaemonResponse;
32
- }) | undefined;
33
- type RefSnapshotFlagGuardResponse = (command: 'press' | 'fill' | 'get' | 'scrollintoview', flags: CommandFlags | undefined) => DaemonResponse | null;
34
- export declare function handleTouchInteractionCommands(params: {
35
- req: DaemonRequest;
36
- sessionName: string;
37
- sessionStore: SessionStore;
38
- contextFromFlags: ContextFromFlags;
39
- dispatch?: typeof dispatchCommand;
40
- readAndroidScreenSize?: typeof getAndroidScreenSize;
41
- captureSnapshotForSession: CaptureSnapshotForSession;
42
- resolveRefTarget: NonNullable<ResolveRefTarget>;
43
- refSnapshotFlagGuardResponse: RefSnapshotFlagGuardResponse;
44
- }): Promise<DaemonResponse | null>;
45
- export {};
@@ -1,9 +0,0 @@
1
- import { dispatchCommand } from '../../core/dispatch.ts';
2
- import type { DaemonResponse } from '../types.ts';
3
- import { getAndroidScreenSize } from '../../platforms/android/index.ts';
4
- import type { InteractionHandlerParams } from './interaction-common.ts';
5
- export { unsupportedRefSnapshotFlags } from './interaction-flags.ts';
6
- export declare function handleInteractionCommands(params: Omit<InteractionHandlerParams, 'dispatch'> & {
7
- dispatch?: typeof dispatchCommand;
8
- readAndroidScreenSize?: typeof getAndroidScreenSize;
9
- }): Promise<DaemonResponse | null>;
@@ -1,8 +0,0 @@
1
- import type { DaemonRequest, DaemonResponse } from '../types.ts';
2
- import type { LeaseRegistry } from '../lease-registry.ts';
3
- type LeaseHandlerArgs = {
4
- req: DaemonRequest;
5
- leaseRegistry: LeaseRegistry;
6
- };
7
- export declare function handleLeaseCommands(args: LeaseHandlerArgs): Promise<DaemonResponse | null>;
8
- export {};
@@ -1,3 +0,0 @@
1
- export declare const POLL_INTERVAL_MS = 300;
2
- export declare const DEFAULT_TIMEOUT_MS = 10000;
3
- export declare function parseTimeout(value: string | undefined): number | null;
@@ -1,18 +0,0 @@
1
- import type { DaemonResponse, SessionState } from '../types.ts';
2
- import type { RecordTraceDeps } from './record-trace-recording.ts';
3
- type AndroidDevice = SessionState['device'];
4
- type AndroidRecording = Extract<NonNullable<SessionState['recording']>, {
5
- platform: 'android';
6
- }>;
7
- type AndroidRecordingBase = Pick<AndroidRecording, 'outPath' | 'clientOutPath' | 'telemetryPath' | 'startedAt' | 'showTouches' | 'gestureEvents'>;
8
- export declare function startAndroidRecording(params: {
9
- deps: RecordTraceDeps;
10
- device: AndroidDevice;
11
- recordingBase: AndroidRecordingBase;
12
- }): Promise<DaemonResponse | AndroidRecording>;
13
- export declare function stopAndroidRecording(params: {
14
- deps: RecordTraceDeps;
15
- device: AndroidDevice;
16
- recording: AndroidRecording;
17
- }): Promise<DaemonResponse | null>;
18
- export {};
@@ -1,52 +0,0 @@
1
- import { SessionStore } from '../session-store.ts';
2
- import type { DaemonRequest, DaemonResponse, SessionState } from '../types.ts';
3
- import type { RecordTraceDeps, RecordingBase } from './record-trace-recording.ts';
4
- export declare function normalizeAppBundleId(session: SessionState): string | undefined;
5
- export declare function warmIosSimulatorRunner(params: {
6
- req: DaemonRequest;
7
- activeSession: SessionState;
8
- device: SessionState['device'];
9
- logPath?: string;
10
- deps: RecordTraceDeps;
11
- }): Promise<void>;
12
- export declare function startIosDeviceRecording(params: {
13
- req: DaemonRequest;
14
- activeSession: SessionState;
15
- sessionStore: SessionStore;
16
- device: SessionState['device'];
17
- logPath?: string;
18
- deps: RecordTraceDeps;
19
- fpsFlag: number | undefined;
20
- recordingBase: RecordingBase;
21
- appBundleId: string;
22
- }): Promise<DaemonResponse | NonNullable<SessionState['recording']>>;
23
- export declare function startMacOsRecording(params: {
24
- req: DaemonRequest;
25
- activeSession: SessionState;
26
- device: SessionState['device'];
27
- logPath?: string;
28
- deps: RecordTraceDeps;
29
- fpsFlag: number | undefined;
30
- recordingBase: RecordingBase;
31
- appBundleId: string;
32
- }): Promise<DaemonResponse | NonNullable<SessionState['recording']>>;
33
- export declare function stopIosDeviceRecording(params: {
34
- req: DaemonRequest;
35
- activeSession: SessionState;
36
- device: SessionState['device'];
37
- logPath?: string;
38
- deps: RecordTraceDeps;
39
- recording: Extract<NonNullable<SessionState['recording']>, {
40
- platform: 'ios-device-runner';
41
- }>;
42
- }): Promise<DaemonResponse | null>;
43
- export declare function stopMacOsRecording(params: {
44
- req: DaemonRequest;
45
- activeSession: SessionState;
46
- device: SessionState['device'];
47
- logPath?: string;
48
- deps: RecordTraceDeps;
49
- recording: Extract<NonNullable<SessionState['recording']>, {
50
- platform: 'macos-runner';
51
- }>;
52
- }): Promise<DaemonResponse | null>;
@@ -1,32 +0,0 @@
1
- import { SessionStore } from '../session-store.ts';
2
- import type { DaemonRequest, DaemonResponse, RecordingGestureEvent } from '../types.ts';
3
- import { runCmd, runCmdBackground } from '../../utils/exec.ts';
4
- import { isPlayableVideo, waitForStableFile } from '../../utils/video.ts';
5
- import { writeRecordingTelemetry } from '../recording-telemetry.ts';
6
- import { runIosRunnerCommand } from '../../platforms/ios/runner-client.ts';
7
- import { overlayRecordingTouches, trimRecordingStart } from '../../recording/overlay.ts';
8
- export type RecordTraceDeps = {
9
- runCmd: typeof runCmd;
10
- runCmdBackground: typeof runCmdBackground;
11
- runIosRunnerCommand: typeof runIosRunnerCommand;
12
- waitForStableFile: typeof waitForStableFile;
13
- isPlayableVideo: typeof isPlayableVideo;
14
- writeRecordingTelemetry: typeof writeRecordingTelemetry;
15
- trimRecordingStart: typeof trimRecordingStart;
16
- overlayRecordingTouches: typeof overlayRecordingTouches;
17
- };
18
- export type RecordingBase = {
19
- outPath: string;
20
- clientOutPath?: string;
21
- startedAt: number;
22
- showTouches: boolean;
23
- gestureEvents: RecordingGestureEvent[];
24
- };
25
- export declare function buildRecordTraceDeps(overrides?: Partial<RecordTraceDeps>): RecordTraceDeps;
26
- export declare function handleRecordCommand(params: {
27
- req: DaemonRequest;
28
- sessionName: string;
29
- sessionStore: SessionStore;
30
- logPath?: string;
31
- deps?: Partial<RecordTraceDeps>;
32
- }): Promise<DaemonResponse>;
@@ -1,10 +0,0 @@
1
- import type { DaemonRequest, DaemonResponse } from '../types.ts';
2
- import { SessionStore } from '../session-store.ts';
3
- import { type RecordTraceDeps } from './record-trace-recording.ts';
4
- export declare function handleRecordTraceCommands(params: {
5
- req: DaemonRequest;
6
- sessionName: string;
7
- sessionStore: SessionStore;
8
- logPath?: string;
9
- deps?: Partial<RecordTraceDeps>;
10
- }): Promise<DaemonResponse | null>;
@@ -1,2 +0,0 @@
1
- import type { DaemonRequest, DaemonResponse } from '../types.ts';
2
- export declare function runBatchCommands(req: DaemonRequest, sessionName: string, invoke: (req: DaemonRequest) => Promise<DaemonResponse>): Promise<DaemonResponse>;
@@ -1,31 +0,0 @@
1
- import type { DeviceInfo } from '../../utils/device.ts';
2
- import type { DaemonRequest, DaemonResponse, SessionState } from '../types.ts';
3
- import { SessionStore } from '../session-store.ts';
4
- import { stopIosRunnerSession } from '../../platforms/ios/runner-client.ts';
5
- import { shutdownSimulator } from '../../platforms/ios/simulator.ts';
6
- import { clearRuntimeHintsFromApp } from '../runtime-hints.ts';
7
- import { settleIosSimulator } from './session-device-utils.ts';
8
- type AppLogStream = NonNullable<SessionState['appLog']>;
9
- declare function shutdownAndroidEmulator(device: DeviceInfo): Promise<{
10
- success: boolean;
11
- exitCode: number;
12
- stdout: string;
13
- stderr: string;
14
- }>;
15
- export type ShutdownAndroidEmulatorFn = typeof shutdownAndroidEmulator;
16
- export declare function handleCloseCommand(params: {
17
- req: DaemonRequest;
18
- sessionName: string;
19
- logPath: string;
20
- sessionStore: SessionStore;
21
- dispatch: (device: DeviceInfo, command: string, positionals: string[], out?: string, context?: Record<string, unknown>) => Promise<Record<string, unknown> | void>;
22
- stopIosRunner?: typeof stopIosRunnerSession;
23
- clearRuntimeHints?: typeof clearRuntimeHintsFromApp;
24
- settleSimulator?: typeof settleIosSimulator;
25
- shutdownSimulator?: typeof shutdownSimulator;
26
- shutdownAndroidEmulator?: ShutdownAndroidEmulatorFn;
27
- appLogOps: {
28
- stop: (stream: AppLogStream) => Promise<void>;
29
- };
30
- }): Promise<DaemonResponse>;
31
- export {};
@@ -1,37 +0,0 @@
1
- import { resolveTargetDevice } from '../../core/dispatch.ts';
2
- import { ensureDeviceReady } from '../device-ready.ts';
3
- import type { DeviceInfo } from '../../utils/device.ts';
4
- import type { DaemonRequest, DaemonResponse } from '../types.ts';
5
- import { SessionStore } from '../session-store.ts';
6
- export type ReinstallOps = {
7
- ios: (device: DeviceInfo, app: string, appPath: string) => Promise<{
8
- bundleId: string;
9
- }>;
10
- android: (device: DeviceInfo, app: string, appPath: string) => Promise<{
11
- package: string;
12
- }>;
13
- };
14
- export type AppDeployOps = {
15
- ios: (device: DeviceInfo, app: string, appPath: string) => Promise<{
16
- bundleId?: string;
17
- appName?: string;
18
- launchTarget?: string;
19
- }>;
20
- android: (device: DeviceInfo, app: string, appPath: string) => Promise<{
21
- package?: string;
22
- appName?: string;
23
- launchTarget?: string;
24
- }>;
25
- };
26
- export type InstallOps = AppDeployOps;
27
- export declare const defaultReinstallOps: ReinstallOps;
28
- export declare const defaultInstallOps: InstallOps;
29
- export declare function handleAppDeployCommand(params: {
30
- req: DaemonRequest;
31
- command: 'install' | 'reinstall';
32
- sessionName: string;
33
- sessionStore: SessionStore;
34
- ensureReady: typeof ensureDeviceReady;
35
- resolveDevice: typeof resolveTargetDevice;
36
- deployOps: AppDeployOps;
37
- }): Promise<DaemonResponse>;
@@ -1,26 +0,0 @@
1
- import { type DeviceInfo } from '../../utils/device.ts';
2
- import { ensureDeviceReady } from '../device-ready.ts';
3
- import { resolveTargetDevice } from '../../core/dispatch.ts';
4
- import type { DaemonRequest, DaemonResponse, SessionState } from '../types.ts';
5
- export declare const IOS_SIMULATOR_POST_CLOSE_SETTLE_MS: number;
6
- export declare const IOS_SIMULATOR_POST_OPEN_SETTLE_MS: number;
7
- export declare function requireSessionOrExplicitSelector(command: string, session: SessionState | undefined, flags: DaemonRequest['flags'] | undefined): DaemonResponse | null;
8
- export declare function hasExplicitDeviceSelector(flags: DaemonRequest['flags'] | undefined): boolean;
9
- export declare function hasExplicitSessionFlag(flags: DaemonRequest['flags'] | undefined): boolean;
10
- export declare function isIosSimulator(device: DeviceInfo): boolean;
11
- export declare function isAndroidEmulator(device: DeviceInfo): boolean;
12
- export declare function settleIosSimulator(device: DeviceInfo, delayMs: number): Promise<void>;
13
- export declare function resolveCommandDevice(params: {
14
- session: SessionState | undefined;
15
- flags: DaemonRequest['flags'] | undefined;
16
- ensureReadyFn: typeof ensureDeviceReady;
17
- resolveTargetDeviceFn: typeof resolveTargetDevice;
18
- ensureReady?: boolean;
19
- }): Promise<DeviceInfo>;
20
- export declare function refreshSessionDeviceIfNeeded(device: DeviceInfo, resolveTargetDeviceFn: typeof resolveTargetDevice): Promise<DeviceInfo>;
21
- export declare function resolveAndroidEmulatorAvdName(params: {
22
- flags: DaemonRequest['flags'] | undefined;
23
- sessionDevice?: DeviceInfo;
24
- resolvedDevice?: DeviceInfo;
25
- }): string | undefined;
26
- export declare function selectorTargetsSessionDevice(flags: DaemonRequest['flags'] | undefined, session: SessionState | undefined): boolean;
@@ -1,3 +0,0 @@
1
- import type { DeviceInfo } from '../../utils/device.ts';
2
- export declare function resolveAndroidPackageForOpen(device: DeviceInfo, openTarget: string | undefined): Promise<string | undefined>;
3
- export declare function resolveSessionAppBundleIdForTarget(device: DeviceInfo, openTarget: string | undefined, currentAppBundleId: string | undefined, resolveAndroidPackageForOpenFn: (device: DeviceInfo, openTarget: string | undefined) => Promise<string | undefined>): Promise<string | undefined>;
@@ -1,22 +0,0 @@
1
- import { dispatchCommand, resolveTargetDevice } from '../../core/dispatch.ts';
2
- import { ensureDeviceReady } from '../device-ready.ts';
3
- import { stopIosRunnerSession } from '../../platforms/ios/runner-client.ts';
4
- import { applyRuntimeHintsToApp, clearRuntimeHintsFromApp } from '../runtime-hints.ts';
5
- import type { DeviceInfo } from '../../utils/device.ts';
6
- import type { DaemonRequest, DaemonResponse } from '../types.ts';
7
- import { SessionStore } from '../session-store.ts';
8
- import { settleIosSimulator } from './session-device-utils.ts';
9
- export declare function handleOpenCommand(params: {
10
- req: DaemonRequest;
11
- sessionName: string;
12
- logPath: string;
13
- sessionStore: SessionStore;
14
- dispatch: typeof dispatchCommand;
15
- ensureReady: typeof ensureDeviceReady;
16
- resolveDevice: typeof resolveTargetDevice;
17
- applyRuntimeHints?: typeof applyRuntimeHintsToApp;
18
- clearRuntimeHints?: typeof clearRuntimeHintsFromApp;
19
- stopIosRunner?: typeof stopIosRunnerSession;
20
- settleSimulator?: typeof settleIosSimulator;
21
- resolveAndroidPackageForOpen?: (device: DeviceInfo, openTarget: string | undefined) => Promise<string | undefined>;
22
- }): Promise<DaemonResponse>;
@@ -1,2 +0,0 @@
1
- import type { SessionState } from '../types.ts';
2
- export declare function buildPerfResponseData(session: SessionState): Record<string, unknown>;
@@ -1,8 +0,0 @@
1
- import type { SessionAction, SessionState } from '../types.ts';
2
- import type { SnapshotState } from '../../utils/snapshot.ts';
3
- export declare function parseSelectorWaitPositionals(positionals: string[]): {
4
- selectorExpression: string | null;
5
- selectorTimeout: string | null;
6
- };
7
- export declare function collectReplaySelectorCandidates(action: SessionAction): string[];
8
- export declare function healNumericGetTextDrift(action: SessionAction, snapshot: SnapshotState, session: SessionState): SessionAction | null;
@@ -1,3 +0,0 @@
1
- import type { SessionAction, SessionState } from '../types.ts';
2
- export declare function parseReplayScript(script: string): SessionAction[];
3
- export declare function writeReplayScript(filePath: string, actions: SessionAction[], session?: SessionState): void;
@@ -1,9 +0,0 @@
1
- import type { DaemonRequest, DaemonResponse } from '../types.ts';
2
- import { SessionStore } from '../session-store.ts';
3
- import { clearRuntimeHintsFromApp } from '../runtime-hints.ts';
4
- export declare function handleRuntimeCommand(params: {
5
- req: DaemonRequest;
6
- sessionName: string;
7
- sessionStore: SessionStore;
8
- clearRuntimeHints?: typeof clearRuntimeHintsFromApp;
9
- }): Promise<DaemonResponse>;
@@ -1,36 +0,0 @@
1
- import type { DeviceInfo } from '../../utils/device.ts';
2
- import type { CommandFlags } from '../../core/dispatch.ts';
3
- import type { DaemonRequest, DaemonResponse, SessionRuntimeHints, SessionState } from '../types.ts';
4
- import { SessionStore } from '../session-store.ts';
5
- import { type clearRuntimeHintsFromApp } from '../runtime-hints.ts';
6
- type RuntimePlatform = NonNullable<SessionRuntimeHints['platform']>;
7
- export declare function countConfiguredRuntimeHints(runtime: SessionRuntimeHints | undefined): number;
8
- export declare function toRuntimePlatform(platform: CommandFlags['platform'] | DeviceInfo['platform'] | 'apple' | undefined): RuntimePlatform | undefined;
9
- export declare function buildRuntimeHints(flags: CommandFlags | undefined, platform?: RuntimePlatform): SessionRuntimeHints;
10
- export declare function mergeRuntimeHints(current: SessionRuntimeHints | undefined, next: SessionRuntimeHints): SessionRuntimeHints;
11
- export declare function setSessionRuntimeHintsForOpen(sessionStore: SessionStore, sessionName: string, runtime: SessionRuntimeHints | undefined): SessionRuntimeHints | undefined;
12
- declare function resolveOpenRuntimeHints(params: {
13
- req: DaemonRequest;
14
- sessionStore: SessionStore;
15
- sessionName: string;
16
- device: DeviceInfo;
17
- }): {
18
- runtime: SessionRuntimeHints | undefined;
19
- previousRuntime: SessionRuntimeHints | undefined;
20
- replacedStoredRuntime: boolean;
21
- };
22
- export declare function tryResolveOpenRuntimeHints(params: Parameters<typeof resolveOpenRuntimeHints>[0]): {
23
- ok: true;
24
- data: ReturnType<typeof resolveOpenRuntimeHints>;
25
- } | {
26
- ok: false;
27
- response: DaemonResponse;
28
- };
29
- export declare function maybeClearRemovedRuntimeTransportHints(params: {
30
- replacedStoredRuntime: boolean;
31
- previousRuntime: SessionRuntimeHints | undefined;
32
- runtime: SessionRuntimeHints | undefined;
33
- session: SessionState | undefined;
34
- clearRuntimeHints: typeof clearRuntimeHintsFromApp;
35
- }): Promise<void>;
36
- export {};
@@ -1,11 +0,0 @@
1
- export declare const STARTUP_SAMPLE_METHOD = "open-command-roundtrip";
2
- export declare const STARTUP_SAMPLE_DESCRIPTION = "Elapsed wall-clock time around dispatching the open command for the active session app target.";
3
- export declare const PERF_STARTUP_SAMPLE_LIMIT = 20;
4
- export declare const PERF_UNAVAILABLE_REASON = "Not implemented for this platform in this release.";
5
- export type StartupPerfSample = {
6
- durationMs: number;
7
- measuredAt: string;
8
- method: typeof STARTUP_SAMPLE_METHOD;
9
- appTarget?: string;
10
- appBundleId?: string;
11
- };