agent-device 0.10.1 → 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 (210) hide show
  1. package/README.md +4 -1
  2. package/dist/src/376.js +3 -0
  3. package/dist/src/bin.js +74 -73
  4. package/dist/src/daemon.js +39 -39
  5. package/dist/src/index.d.ts +559 -5
  6. package/dist/src/index.js +3 -1
  7. package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift +8 -0
  8. package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Interaction.swift +60 -0
  9. package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Lifecycle.swift +1 -1
  10. package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Models.swift +4 -0
  11. package/macos-helper/Package.swift +18 -0
  12. package/macos-helper/Sources/AgentDeviceMacOSHelper/SnapshotTraversal.swift +543 -0
  13. package/macos-helper/Sources/AgentDeviceMacOSHelper/main.swift +545 -0
  14. package/package.json +5 -1
  15. package/skills/agent-device/SKILL.md +57 -343
  16. package/skills/agent-device/references/bootstrap-install.md +207 -0
  17. package/skills/agent-device/references/coordinate-system.md +24 -4
  18. package/skills/agent-device/references/debugging.md +115 -0
  19. package/skills/agent-device/references/exploration.md +235 -0
  20. package/skills/agent-device/references/macos-desktop.md +55 -58
  21. package/skills/agent-device/references/remote-tenancy.md +69 -47
  22. package/skills/agent-device/references/verification.md +102 -0
  23. package/dist/src/224.js +0 -2
  24. package/dist/src/274.js +0 -1
  25. package/dist/src/331.js +0 -3
  26. package/dist/src/bin.d.ts +0 -1
  27. package/dist/src/cli-client-commands.d.ts +0 -8
  28. package/dist/src/cli.d.ts +0 -6
  29. package/dist/src/client-metro.d.ts +0 -64
  30. package/dist/src/client-normalizers.d.ts +0 -20
  31. package/dist/src/client-shared.d.ts +0 -20
  32. package/dist/src/client-types.d.ts +0 -269
  33. package/dist/src/client.d.ts +0 -5
  34. package/dist/src/core/app-events.d.ts +0 -8
  35. package/dist/src/core/batch.d.ts +0 -17
  36. package/dist/src/core/capabilities.d.ts +0 -3
  37. package/dist/src/core/click-button.d.ts +0 -20
  38. package/dist/src/core/dispatch-payload.d.ts +0 -1
  39. package/dist/src/core/dispatch-resolve.d.ts +0 -29
  40. package/dist/src/core/dispatch-series.d.ts +0 -7
  41. package/dist/src/core/dispatch.d.ts +0 -35
  42. package/dist/src/core/open-target.d.ts +0 -4
  43. package/dist/src/core/settings-contract.d.ts +0 -8
  44. package/dist/src/daemon/action-utils.d.ts +0 -3
  45. package/dist/src/daemon/android-system-dialog.d.ts +0 -11
  46. package/dist/src/daemon/app-log-android.d.ts +0 -4
  47. package/dist/src/daemon/app-log-ios.d.ts +0 -6
  48. package/dist/src/daemon/app-log-process.d.ts +0 -15
  49. package/dist/src/daemon/app-log-stream.d.ts +0 -19
  50. package/dist/src/daemon/app-log.d.ts +0 -28
  51. package/dist/src/daemon/artifact-archive.d.ts +0 -12
  52. package/dist/src/daemon/artifact-download.d.ts +0 -12
  53. package/dist/src/daemon/artifact-materialization.d.ts +0 -17
  54. package/dist/src/daemon/artifact-registry.d.ts +0 -12
  55. package/dist/src/daemon/config.d.ts +0 -16
  56. package/dist/src/daemon/context.d.ts +0 -23
  57. package/dist/src/daemon/device-ready.d.ts +0 -6
  58. package/dist/src/daemon/handlers/find.d.ts +0 -40
  59. package/dist/src/daemon/handlers/install-source.d.ts +0 -44
  60. package/dist/src/daemon/handlers/interaction-common.d.ts +0 -12
  61. package/dist/src/daemon/handlers/interaction-fill.d.ts +0 -3
  62. package/dist/src/daemon/handlers/interaction-flags.d.ts +0 -4
  63. package/dist/src/daemon/handlers/interaction-get.d.ts +0 -3
  64. package/dist/src/daemon/handlers/interaction-is.d.ts +0 -3
  65. package/dist/src/daemon/handlers/interaction-press.d.ts +0 -3
  66. package/dist/src/daemon/handlers/interaction-scroll.d.ts +0 -3
  67. package/dist/src/daemon/handlers/interaction-selector.d.ts +0 -27
  68. package/dist/src/daemon/handlers/interaction-snapshot.d.ts +0 -8
  69. package/dist/src/daemon/handlers/interaction-targeting.d.ts +0 -28
  70. package/dist/src/daemon/handlers/interaction-touch.d.ts +0 -46
  71. package/dist/src/daemon/handlers/interaction.d.ts +0 -16
  72. package/dist/src/daemon/handlers/lease.d.ts +0 -8
  73. package/dist/src/daemon/handlers/parse-utils.d.ts +0 -3
  74. package/dist/src/daemon/handlers/record-trace-android.d.ts +0 -18
  75. package/dist/src/daemon/handlers/record-trace-ios.d.ts +0 -52
  76. package/dist/src/daemon/handlers/record-trace-recording.d.ts +0 -32
  77. package/dist/src/daemon/handlers/record-trace.d.ts +0 -10
  78. package/dist/src/daemon/handlers/session-batch.d.ts +0 -2
  79. package/dist/src/daemon/handlers/session-close.d.ts +0 -31
  80. package/dist/src/daemon/handlers/session-deploy.d.ts +0 -37
  81. package/dist/src/daemon/handlers/session-device-utils.d.ts +0 -26
  82. package/dist/src/daemon/handlers/session-open-target.d.ts +0 -3
  83. package/dist/src/daemon/handlers/session-open.d.ts +0 -22
  84. package/dist/src/daemon/handlers/session-perf.d.ts +0 -2
  85. package/dist/src/daemon/handlers/session-replay-heal.d.ts +0 -8
  86. package/dist/src/daemon/handlers/session-replay-script.d.ts +0 -3
  87. package/dist/src/daemon/handlers/session-runtime-command.d.ts +0 -9
  88. package/dist/src/daemon/handlers/session-runtime.d.ts +0 -36
  89. package/dist/src/daemon/handlers/session-startup-metrics.d.ts +0 -11
  90. package/dist/src/daemon/handlers/session.d.ts +0 -50
  91. package/dist/src/daemon/handlers/snapshot-alert.d.ts +0 -13
  92. package/dist/src/daemon/handlers/snapshot-capture.d.ts +0 -27
  93. package/dist/src/daemon/handlers/snapshot-session.d.ts +0 -15
  94. package/dist/src/daemon/handlers/snapshot-settings.d.ts +0 -24
  95. package/dist/src/daemon/handlers/snapshot-wait.d.ts +0 -37
  96. package/dist/src/daemon/handlers/snapshot.d.ts +0 -16
  97. package/dist/src/daemon/http-server.d.ts +0 -26
  98. package/dist/src/daemon/install-source-resolution.d.ts +0 -5
  99. package/dist/src/daemon/is-predicates.d.ts +0 -15
  100. package/dist/src/daemon/lease-context.d.ts +0 -9
  101. package/dist/src/daemon/lease-registry.d.ts +0 -63
  102. package/dist/src/daemon/materialized-path-registry.d.ts +0 -15
  103. package/dist/src/daemon/network-log.d.ts +0 -32
  104. package/dist/src/daemon/record-trace-errors.d.ts +0 -6
  105. package/dist/src/daemon/recording-gestures.d.ts +0 -3
  106. package/dist/src/daemon/recording-telemetry.d.ts +0 -20
  107. package/dist/src/daemon/recording-timing.d.ts +0 -24
  108. package/dist/src/daemon/request-cancel.d.ts +0 -9
  109. package/dist/src/daemon/request-lock-policy.d.ts +0 -2
  110. package/dist/src/daemon/request-router.d.ts +0 -23
  111. package/dist/src/daemon/runtime-hints.d.ts +0 -19
  112. package/dist/src/daemon/script-utils.d.ts +0 -28
  113. package/dist/src/daemon/scroll-planner.d.ts +0 -12
  114. package/dist/src/daemon/selectors-build.d.ts +0 -5
  115. package/dist/src/daemon/selectors-match.d.ts +0 -6
  116. package/dist/src/daemon/selectors-parse.d.ts +0 -29
  117. package/dist/src/daemon/selectors-resolve.d.ts +0 -33
  118. package/dist/src/daemon/selectors.d.ts +0 -5
  119. package/dist/src/daemon/server-lifecycle.d.ts +0 -23
  120. package/dist/src/daemon/session-open-script.d.ts +0 -7
  121. package/dist/src/daemon/session-routing.d.ts +0 -3
  122. package/dist/src/daemon/session-selector.d.ts +0 -10
  123. package/dist/src/daemon/session-store.d.ts +0 -33
  124. package/dist/src/daemon/snapshot-diff.d.ts +0 -20
  125. package/dist/src/daemon/snapshot-processing.d.ts +0 -9
  126. package/dist/src/daemon/touch-reference-frame.d.ts +0 -7
  127. package/dist/src/daemon/transport.d.ts +0 -6
  128. package/dist/src/daemon/types.d.ts +0 -171
  129. package/dist/src/daemon/upload-registry.d.ts +0 -7
  130. package/dist/src/daemon/upload.d.ts +0 -5
  131. package/dist/src/daemon-client.d.ts +0 -40
  132. package/dist/src/daemon.d.ts +0 -1
  133. package/dist/src/platforms/android/adb.d.ts +0 -5
  134. package/dist/src/platforms/android/app-lifecycle.d.ts +0 -31
  135. package/dist/src/platforms/android/device-input-state.d.ts +0 -19
  136. package/dist/src/platforms/android/devices.d.ts +0 -26
  137. package/dist/src/platforms/android/index.d.ts +0 -8
  138. package/dist/src/platforms/android/input-actions.d.ts +0 -16
  139. package/dist/src/platforms/android/install-artifact.d.ts +0 -11
  140. package/dist/src/platforms/android/manifest.d.ts +0 -1
  141. package/dist/src/platforms/android/notifications.d.ts +0 -11
  142. package/dist/src/platforms/android/open-target.d.ts +0 -4
  143. package/dist/src/platforms/android/screenshot.d.ts +0 -16
  144. package/dist/src/platforms/android/sdk.d.ts +0 -2
  145. package/dist/src/platforms/android/settings.d.ts +0 -3
  146. package/dist/src/platforms/android/snapshot.d.ts +0 -7
  147. package/dist/src/platforms/android/ui-hierarchy.d.ts +0 -21
  148. package/dist/src/platforms/appearance.d.ts +0 -2
  149. package/dist/src/platforms/boot-diagnostics.d.ts +0 -14
  150. package/dist/src/platforms/install-source.d.ts +0 -29
  151. package/dist/src/platforms/ios/app-filter.d.ts +0 -2
  152. package/dist/src/platforms/ios/apps.d.ts +0 -34
  153. package/dist/src/platforms/ios/config.d.ts +0 -10
  154. package/dist/src/platforms/ios/devicectl.d.ts +0 -13
  155. package/dist/src/platforms/ios/devices.d.ts +0 -40
  156. package/dist/src/platforms/ios/ensure-simulator.d.ts +0 -18
  157. package/dist/src/platforms/ios/index.d.ts +0 -3
  158. package/dist/src/platforms/ios/install-artifact.d.ts +0 -18
  159. package/dist/src/platforms/ios/launch-diagnostics.d.ts +0 -11
  160. package/dist/src/platforms/ios/macos-apps.d.ts +0 -12
  161. package/dist/src/platforms/ios/plist.d.ts +0 -1
  162. package/dist/src/platforms/ios/runner-client.d.ts +0 -38
  163. package/dist/src/platforms/ios/runner-errors.d.ts +0 -20
  164. package/dist/src/platforms/ios/runner-macos-products.d.ts +0 -3
  165. package/dist/src/platforms/ios/runner-session.d.ts +0 -30
  166. package/dist/src/platforms/ios/runner-transport.d.ts +0 -10
  167. package/dist/src/platforms/ios/runner-xctestrun-products.d.ts +0 -2
  168. package/dist/src/platforms/ios/runner-xctestrun.d.ts +0 -38
  169. package/dist/src/platforms/ios/screenshot-status-bar.d.ts +0 -2
  170. package/dist/src/platforms/ios/screenshot.d.ts +0 -14
  171. package/dist/src/platforms/ios/simctl.d.ts +0 -7
  172. package/dist/src/platforms/ios/simulator.d.ts +0 -11
  173. package/dist/src/platforms/permission-utils.d.ts +0 -9
  174. package/dist/src/recording/overlay.d.ts +0 -10
  175. package/dist/src/upload-client.d.ts +0 -7
  176. package/dist/src/utils/args.d.ts +0 -27
  177. package/dist/src/utils/cli-config.d.ts +0 -10
  178. package/dist/src/utils/cli-option-schema.d.ts +0 -19
  179. package/dist/src/utils/cli-options.d.ts +0 -13
  180. package/dist/src/utils/command-schema.d.ts +0 -122
  181. package/dist/src/utils/device-isolation.d.ts +0 -3
  182. package/dist/src/utils/device.d.ts +0 -35
  183. package/dist/src/utils/diagnostics.d.ts +0 -30
  184. package/dist/src/utils/errors.d.ts +0 -26
  185. package/dist/src/utils/exec.d.ts +0 -32
  186. package/dist/src/utils/finders.d.ts +0 -12
  187. package/dist/src/utils/interactors.d.ts +0 -38
  188. package/dist/src/utils/json-input.d.ts +0 -1
  189. package/dist/src/utils/keyed-lock.d.ts +0 -1
  190. package/dist/src/utils/output.d.ts +0 -27
  191. package/dist/src/utils/path-resolution.d.ts +0 -8
  192. package/dist/src/utils/payload-input.d.ts +0 -12
  193. package/dist/src/utils/process-identity.d.ts +0 -11
  194. package/dist/src/utils/remote-config.d.ts +0 -15
  195. package/dist/src/utils/remote-open.d.ts +0 -9
  196. package/dist/src/utils/retry.d.ts +0 -54
  197. package/dist/src/utils/screenshot-diff.d.ts +0 -23
  198. package/dist/src/utils/session-binding.d.ts +0 -18
  199. package/dist/src/utils/snapshot-lines.d.ts +0 -12
  200. package/dist/src/utils/snapshot.d.ts +0 -42
  201. package/dist/src/utils/timeouts.d.ts +0 -3
  202. package/dist/src/utils/version.d.ts +0 -2
  203. package/dist/src/utils/video.d.ts +0 -9
  204. package/skills/agent-device/references/batching.md +0 -79
  205. package/skills/agent-device/references/logs-and-debug.md +0 -113
  206. package/skills/agent-device/references/perf-metrics.md +0 -53
  207. package/skills/agent-device/references/permissions.md +0 -70
  208. package/skills/agent-device/references/session-management.md +0 -101
  209. package/skills/agent-device/references/snapshot-refs.md +0 -102
  210. package/skills/agent-device/references/video-recording.md +0 -49
@@ -1,8 +0,0 @@
1
- import type { DeviceInfo } from '../utils/device.ts';
2
- type AppEventPayload = Record<string, unknown> | undefined;
3
- export declare function parseTriggerAppEventArgs(positionals: string[]): {
4
- eventName: string;
5
- payload: AppEventPayload;
6
- };
7
- export declare function resolveAppEventUrl(platform: DeviceInfo['platform'], eventName: string, payload?: AppEventPayload): string;
8
- export {};
@@ -1,17 +0,0 @@
1
- import type { BatchStep, CommandFlags } from './dispatch.ts';
2
- export declare const DEFAULT_BATCH_MAX_STEPS = 100;
3
- export type NormalizedBatchStep = {
4
- command: string;
5
- positionals: string[];
6
- flags: Partial<CommandFlags>;
7
- runtime?: unknown;
8
- };
9
- export type BatchStepResult = {
10
- step: number;
11
- command: string;
12
- ok: true;
13
- data: Record<string, unknown>;
14
- durationMs: number;
15
- };
16
- export declare function parseBatchStepsJson(raw: string): BatchStep[];
17
- export declare function validateAndNormalizeBatchSteps(steps: CommandFlags['batchSteps'], maxSteps: number): NormalizedBatchStep[];
@@ -1,3 +0,0 @@
1
- import { type DeviceInfo } from '../utils/device.ts';
2
- export declare function isCommandSupportedOnDevice(command: string, device: DeviceInfo): boolean;
3
- export declare function listCapabilityCommands(): string[];
@@ -1,20 +0,0 @@
1
- import { AppError } from '../utils/errors.ts';
2
- export type ClickButton = 'primary' | 'secondary' | 'middle';
3
- type ClickButtonFlags = {
4
- clickButton?: ClickButton;
5
- };
6
- export declare function resolveClickButton(flags: ClickButtonFlags | undefined): ClickButton;
7
- export declare function getClickButtonValidationError(options: {
8
- commandLabel: string;
9
- platform: string;
10
- button: ClickButton;
11
- count?: number;
12
- intervalMs?: number;
13
- holdMs?: number;
14
- jitterPx?: number;
15
- doubleTap?: boolean;
16
- }): AppError | null;
17
- export declare function buttonTag(button: ClickButton): {} | {
18
- button: ClickButton;
19
- };
20
- export {};
@@ -1 +0,0 @@
1
- export declare function readNotificationPayload(payloadArg: string): Promise<Record<string, unknown>>;
@@ -1,29 +0,0 @@
1
- import { resolveDevice, type DeviceInfo, type PlatformSelector } from '../utils/device.ts';
2
- import { findBootableIosSimulator } from '../platforms/ios/devices.ts';
3
- import type { CliFlags } from '../utils/command-schema.ts';
4
- import type { DeviceTarget } from '../utils/device.ts';
5
- type ResolveDeviceFlags = Pick<CliFlags, 'platform' | 'target' | 'device' | 'udid' | 'serial' | 'iosSimulatorDeviceSet' | 'androidDeviceAllowlist'>;
6
- type AppleDeviceSelector = {
7
- platform?: Exclude<PlatformSelector, 'android'>;
8
- target?: DeviceTarget;
9
- deviceName?: string;
10
- udid?: string;
11
- serial?: string;
12
- };
13
- type ResolveAppleDeviceDeps = {
14
- resolveDevice: typeof resolveDevice;
15
- findBootableSimulator: typeof findBootableIosSimulator;
16
- };
17
- /**
18
- * Resolves the best iOS device given pre-fetched candidates. When no explicit
19
- * device selector was used, physical devices are rejected in favour of a
20
- * bootable simulator discovered via `findBootableSimulator`.
21
- *
22
- * Exported for testing; production callers should use `resolveTargetDevice`.
23
- */
24
- export declare function resolveAppleDevice(devices: DeviceInfo[], selector: AppleDeviceSelector, context: {
25
- simulatorSetPath?: string;
26
- }, deps: ResolveAppleDeviceDeps): Promise<DeviceInfo>;
27
- export declare const resolveIosDevice: typeof resolveAppleDevice;
28
- export declare function resolveTargetDevice(flags: ResolveDeviceFlags): Promise<DeviceInfo>;
29
- export {};
@@ -1,7 +0,0 @@
1
- import type { DeviceInfo } from '../utils/device.ts';
2
- export declare function requireIntInRange(value: number, name: string, min: number, max: number): number;
3
- export declare function clampIosSwipeDuration(durationMs: number): number;
4
- export declare function shouldUseIosTapSeries(device: DeviceInfo, count: number, holdMs: number, jitterPx: number): boolean;
5
- export declare function shouldUseIosDragSeries(device: DeviceInfo, count: number): boolean;
6
- export declare function computeDeterministicJitter(index: number, jitterPx: number): [number, number];
7
- export declare function runRepeatedSeries(count: number, pauseMs: number, operation: (index: number) => Promise<void>): Promise<void>;
@@ -1,35 +0,0 @@
1
- import type { DeviceInfo } from '../utils/device.ts';
2
- import type { CliFlags } from '../utils/command-schema.ts';
3
- import { shouldUseIosTapSeries, shouldUseIosDragSeries } from './dispatch-series.ts';
4
- export { resolveTargetDevice } from './dispatch-resolve.ts';
5
- export { shouldUseIosTapSeries, shouldUseIosDragSeries };
6
- export type BatchStep = {
7
- command: string;
8
- positionals?: string[];
9
- flags?: Partial<CommandFlags>;
10
- runtime?: unknown;
11
- };
12
- export type CommandFlags = Omit<CliFlags, 'json' | 'help' | 'version' | 'batchSteps'> & {
13
- batchSteps?: BatchStep[];
14
- };
15
- export declare function dispatchCommand(device: DeviceInfo, command: string, positionals: string[], outPath?: string, context?: {
16
- requestId?: string;
17
- appBundleId?: string;
18
- activity?: string;
19
- verbose?: boolean;
20
- logPath?: string;
21
- traceLogPath?: string;
22
- snapshotInteractiveOnly?: boolean;
23
- snapshotCompact?: boolean;
24
- snapshotDepth?: number;
25
- snapshotScope?: string;
26
- snapshotRaw?: boolean;
27
- count?: number;
28
- intervalMs?: number;
29
- holdMs?: number;
30
- jitterPx?: number;
31
- doubleTap?: boolean;
32
- clickButton?: 'primary' | 'secondary' | 'middle';
33
- pauseMs?: number;
34
- pattern?: 'one-way' | 'ping-pong';
35
- }): Promise<Record<string, unknown> | void>;
@@ -1,4 +0,0 @@
1
- export declare function isDeepLinkTarget(input: string): boolean;
2
- export declare function isWebUrl(input: string): boolean;
3
- export declare const IOS_SAFARI_BUNDLE_ID = "com.apple.mobilesafari";
4
- export declare function resolveIosDeviceDeepLinkBundleId(appBundleId: string | undefined, url: string): string | undefined;
@@ -1,8 +0,0 @@
1
- export declare const SETTINGS_WIFI_USAGE = "<wifi|airplane|location> <on|off>";
2
- export declare const SETTINGS_APPEARANCE_USAGE = "appearance <light|dark|toggle>";
3
- export declare const SETTINGS_FACEID_USAGE = "faceid <match|nonmatch|enroll|unenroll>";
4
- export declare const SETTINGS_TOUCHID_USAGE = "touchid <match|nonmatch|enroll|unenroll>";
5
- export declare const SETTINGS_FINGERPRINT_USAGE = "fingerprint <match|nonmatch>";
6
- export declare const SETTINGS_PERMISSION_USAGE = "permission <grant|deny|reset> <camera|microphone|photos|contacts|contacts-limited|notifications|calendar|location|location-always|media-library|motion|reminders|siri> [full|limited]";
7
- export declare const SETTINGS_USAGE_OVERRIDE: string;
8
- export declare const SETTINGS_INVALID_ARGS_MESSAGE = "settings requires <wifi|airplane|location> <on|off>, appearance <light|dark|toggle>, faceid <match|nonmatch|enroll|unenroll>, touchid <match|nonmatch|enroll|unenroll>, fingerprint <match|nonmatch>, or permission <grant|deny|reset> <camera|microphone|photos|contacts|contacts-limited|notifications|calendar|location|location-always|media-library|motion|reminders|siri> [full|limited]";
@@ -1,3 +0,0 @@
1
- import type { SessionAction } from './types.ts';
2
- export declare function inferFillText(action: SessionAction): string;
3
- export declare function uniqueStrings(values: string[]): string[];
@@ -1,11 +0,0 @@
1
- import { openAndroidApp, snapshotAndroid, getAndroidAppState } from '../platforms/android/index.ts';
2
- import { runCmd } from '../utils/exec.ts';
3
- import type { SessionState } from './types.ts';
4
- export type AndroidBlockingDialogRecoveryResult = 'absent' | 'recovered' | 'failed';
5
- export declare function recoverAndroidBlockingSystemDialog(params: {
6
- session: SessionState;
7
- snapshotAndroidUi?: typeof snapshotAndroid;
8
- reopenAndroidApp?: typeof openAndroidApp;
9
- readAndroidAppState?: typeof getAndroidAppState;
10
- execCommand?: typeof runCmd;
11
- }): Promise<AndroidBlockingDialogRecoveryResult>;
@@ -1,4 +0,0 @@
1
- import fs from 'node:fs';
2
- import { type AppLogResult } from './app-log-process.ts';
3
- export declare function assertAndroidPackageArgSafe(appBundleId: string): void;
4
- export declare function startAndroidAppLog(deviceId: string, appBundleId: string, stream: fs.WriteStream, redactionPatterns: RegExp[], pidPath?: string): Promise<AppLogResult>;
@@ -1,6 +0,0 @@
1
- import fs from 'node:fs';
2
- import { type AppLogResult } from './app-log-process.ts';
3
- export declare function buildIosLogPredicate(appBundleId: string): string;
4
- export declare function buildIosDeviceLogStreamArgs(deviceId: string): string[];
5
- export declare function startIosSimulatorAppLog(appBundleId: string, stream: fs.WriteStream, redactionPatterns: RegExp[], pidPath?: string): Promise<AppLogResult>;
6
- export declare function startIosDeviceAppLog(deviceId: string, stream: fs.WriteStream, redactionPatterns: RegExp[], pidPath?: string): Promise<AppLogResult>;
@@ -1,15 +0,0 @@
1
- export declare const APP_LOG_PID_FILENAME = "app-log.pid";
2
- export type AppLogResult = {
3
- backend: 'ios-simulator' | 'ios-device' | 'android';
4
- getState: () => 'active' | 'failed';
5
- startedAt: number;
6
- stop: () => Promise<void>;
7
- wait: Promise<{
8
- stdout: string;
9
- stderr: string;
10
- exitCode: number;
11
- }>;
12
- };
13
- export declare function writePidFile(pidPath: string | undefined, pid: number): void;
14
- export declare function clearPidFile(pidPath: string | undefined): void;
15
- export declare function cleanupStaleAppLogProcesses(sessionsDir: string): void;
@@ -1,19 +0,0 @@
1
- import { spawn } from 'node:child_process';
2
- import fs from 'node:fs';
3
- import type { ExecResult } from '../utils/exec.ts';
4
- export declare function waitForChildExit(wait: Promise<ExecResult>, timeoutMs?: number): Promise<void>;
5
- export declare function sleep(ms: number): Promise<void>;
6
- export declare function createLineWriter(stream: fs.WriteStream, options: {
7
- redactionPatterns: RegExp[];
8
- includeTokens?: string[];
9
- }): {
10
- onChunk: (chunk: string) => void;
11
- flush: () => void;
12
- };
13
- export declare function attachChildToStream(child: ReturnType<typeof spawn>, stream: fs.WriteStream, options: {
14
- endStreamOnClose: boolean;
15
- writer: {
16
- onChunk: (chunk: string) => void;
17
- flush: () => void;
18
- };
19
- }): Promise<ExecResult>;
@@ -1,28 +0,0 @@
1
- import type { DeviceInfo } from '../utils/device.ts';
2
- import type { AppLogResult } from './app-log-process.ts';
3
- export type { AppLogResult } from './app-log-process.ts';
4
- export { APP_LOG_PID_FILENAME, cleanupStaleAppLogProcesses } from './app-log-process.ts';
5
- export { assertAndroidPackageArgSafe } from './app-log-android.ts';
6
- export { buildIosDeviceLogStreamArgs, buildIosLogPredicate } from './app-log-ios.ts';
7
- export type AppLogDoctorResult = {
8
- checks: Record<string, boolean>;
9
- notes: string[];
10
- };
11
- export declare function rotateAppLogIfNeeded(outPath: string, config: {
12
- maxBytes: number;
13
- maxRotatedFiles: number;
14
- }): void;
15
- export declare function getAppLogPathMetadata(outPath: string): {
16
- exists: boolean;
17
- sizeBytes: number;
18
- modifiedAt?: string;
19
- };
20
- export declare function startAppLog(device: DeviceInfo, appBundleId: string, outPath: string, pidPath?: string): Promise<AppLogResult>;
21
- export declare function stopAppLog(appLog: AppLogResult): Promise<void>;
22
- export declare function runAppLogDoctor(device: DeviceInfo, appBundleId?: string): Promise<AppLogDoctorResult>;
23
- export declare function appendAppLogMarker(outPath: string, marker: string): void;
24
- export declare function clearAppLogFiles(outPath: string): {
25
- path: string;
26
- cleared: boolean;
27
- removedRotatedFiles: number;
28
- };
@@ -1,12 +0,0 @@
1
- export declare function extractTarInstallableArtifact(params: {
2
- archivePath: string;
3
- tempDir: string;
4
- platform: 'ios' | 'android';
5
- expectedRootName?: string;
6
- }): Promise<string>;
7
- export declare function resolveTarArchiveRootName(params: {
8
- archivePath: string;
9
- platform: 'ios' | 'android';
10
- expectedRootName?: string;
11
- }): Promise<string>;
12
- export declare function readZipEntries(archivePath: string): Promise<string[] | null>;
@@ -1,12 +0,0 @@
1
- export declare function sanitizeArtifactFilename(raw: string): string;
2
- export declare function createArtifactTempDir(requestId?: string): string;
3
- export declare function validateArtifactContentLength(rawLength: string | number | undefined): void;
4
- export declare function streamReadableToFile(source: NodeJS.ReadableStream, destPath: string): Promise<void>;
5
- export declare function downloadArtifactToTempDir(params: {
6
- url: string;
7
- headers?: Record<string, string>;
8
- requestId?: string;
9
- tempDir: string;
10
- }): Promise<{
11
- archivePath: string;
12
- }>;
@@ -1,17 +0,0 @@
1
- export type MaterializeArtifactParams = {
2
- platform: 'ios' | 'android';
3
- url: string;
4
- headers?: Record<string, string>;
5
- requestId?: string;
6
- };
7
- export type MaterializedArtifact = {
8
- archivePath: string;
9
- installablePath: string;
10
- detected: {
11
- packageName?: string;
12
- bundleId?: string;
13
- appName?: string;
14
- };
15
- };
16
- export declare function cleanupMaterializedArtifact(result: MaterializedArtifact): void;
17
- export declare function materializeArtifact(params: MaterializeArtifactParams): Promise<MaterializedArtifact>;
@@ -1,12 +0,0 @@
1
- export declare function trackDownloadableArtifact(params: {
2
- artifactPath: string;
3
- tenantId?: string;
4
- fileName?: string;
5
- deleteAfterDownload?: boolean;
6
- }): string;
7
- export declare function prepareDownloadableArtifact(artifactId: string, tenantId?: string): {
8
- artifactPath: string;
9
- fileName?: string;
10
- deleteAfterDownload: boolean;
11
- };
12
- export declare function cleanupDownloadableArtifact(artifactId: string): void;
@@ -1,16 +0,0 @@
1
- export type DaemonServerMode = 'socket' | 'http' | 'dual';
2
- export type DaemonTransportPreference = 'auto' | 'socket' | 'http';
3
- export type SessionIsolationMode = 'none' | 'tenant';
4
- export type DaemonPaths = {
5
- baseDir: string;
6
- infoPath: string;
7
- lockPath: string;
8
- logPath: string;
9
- sessionsDir: string;
10
- };
11
- export declare function resolveDaemonPaths(stateDir: string | undefined): DaemonPaths;
12
- export declare function resolveStateDir(raw: string | undefined): string;
13
- export declare function resolveDaemonServerMode(raw: string | undefined): DaemonServerMode;
14
- export declare function resolveDaemonTransportPreference(raw: string | undefined): DaemonTransportPreference;
15
- export declare function resolveSessionIsolationMode(raw: string | undefined): SessionIsolationMode;
16
- export declare function normalizeTenantId(raw: string | undefined): string | undefined;
@@ -1,23 +0,0 @@
1
- import type { CommandFlags } from '../core/dispatch.ts';
2
- export type DaemonCommandContext = {
3
- requestId?: string;
4
- appBundleId?: string;
5
- activity?: string;
6
- verbose?: boolean;
7
- logPath?: string;
8
- traceLogPath?: string;
9
- snapshotInteractiveOnly?: boolean;
10
- snapshotCompact?: boolean;
11
- snapshotDepth?: number;
12
- snapshotScope?: string;
13
- snapshotRaw?: boolean;
14
- count?: number;
15
- intervalMs?: number;
16
- holdMs?: number;
17
- jitterPx?: number;
18
- doubleTap?: boolean;
19
- clickButton?: 'primary' | 'secondary' | 'middle';
20
- pauseMs?: number;
21
- pattern?: 'one-way' | 'ping-pong';
22
- };
23
- export declare function contextFromFlags(logPath: string, flags: CommandFlags | undefined, appBundleId?: string, traceLogPath?: string, requestId?: string): DaemonCommandContext;
@@ -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,12 +0,0 @@
1
- import { dispatchCommand, type CommandFlags } from '../../core/dispatch.ts';
2
- import type { DaemonCommandContext } from '../context.ts';
3
- import type { DaemonRequest } 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
- };
@@ -1,3 +0,0 @@
1
- import type { DaemonResponse } from '../types.ts';
2
- import type { InteractionHandlerParams } from './interaction-common.ts';
3
- export declare function handleFillCommand(params: InteractionHandlerParams): 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,3 +0,0 @@
1
- import type { DaemonResponse } from '../types.ts';
2
- import type { InteractionHandlerParams } from './interaction-common.ts';
3
- export declare function handlePressCommand(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 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,46 +0,0 @@
1
- import { dispatchCommand, type CommandFlags } from '../../core/dispatch.ts';
2
- import { type SnapshotNode } from '../../utils/snapshot.ts';
3
- import type { DaemonCommandContext } from '../context.ts';
4
- import type { DaemonRequest, DaemonResponse, SessionState } from '../types.ts';
5
- import { SessionStore } from '../session-store.ts';
6
- import { getAndroidScreenSize } from '../../platforms/android/index.ts';
7
- type ContextFromFlags = (flags: CommandFlags | undefined, appBundleId?: string, traceLogPath?: string) => DaemonCommandContext;
8
- type CaptureSnapshotForSession = (session: SessionState, flags: CommandFlags | undefined, sessionStore: SessionStore, contextFromFlags: ContextFromFlags, options: {
9
- interactiveOnly: boolean;
10
- }, dispatch?: typeof dispatchCommand) => Promise<{
11
- nodes: SnapshotNode[];
12
- truncated?: boolean;
13
- createdAt: number;
14
- backend?: 'xctest' | 'android';
15
- }>;
16
- type ResolveRefTarget = ((params: {
17
- session: SessionState;
18
- refInput: string;
19
- fallbackLabel: string;
20
- requireRect: boolean;
21
- invalidRefMessage: string;
22
- notFoundMessage: string;
23
- }) => {
24
- ok: true;
25
- target: {
26
- ref: string;
27
- node: SnapshotNode;
28
- snapshotNodes: SnapshotNode[];
29
- };
30
- } | {
31
- ok: false;
32
- response: DaemonResponse;
33
- }) | undefined;
34
- type RefSnapshotFlagGuardResponse = (command: 'press' | 'fill' | 'get' | 'scrollintoview', flags: CommandFlags | undefined) => DaemonResponse | null;
35
- export declare function handleTouchInteractionCommands(params: {
36
- req: DaemonRequest;
37
- sessionName: string;
38
- sessionStore: SessionStore;
39
- contextFromFlags: ContextFromFlags;
40
- dispatch?: typeof dispatchCommand;
41
- readAndroidScreenSize?: typeof getAndroidScreenSize;
42
- captureSnapshotForSession: CaptureSnapshotForSession;
43
- resolveRefTarget: NonNullable<ResolveRefTarget>;
44
- refSnapshotFlagGuardResponse: RefSnapshotFlagGuardResponse;
45
- }): Promise<DaemonResponse | null>;
46
- export {};
@@ -1,16 +0,0 @@
1
- import { dispatchCommand, type CommandFlags } from '../../core/dispatch.ts';
2
- import type { DaemonCommandContext } from '../context.ts';
3
- import type { DaemonRequest, DaemonResponse } from '../types.ts';
4
- import { SessionStore } from '../session-store.ts';
5
- import { getAndroidScreenSize } from '../../platforms/android/index.ts';
6
- type ContextFromFlags = (flags: CommandFlags | undefined, appBundleId?: string, traceLogPath?: string) => DaemonCommandContext;
7
- export declare function handleInteractionCommands(params: {
8
- req: DaemonRequest;
9
- sessionName: string;
10
- sessionStore: SessionStore;
11
- contextFromFlags: ContextFromFlags;
12
- dispatch?: typeof dispatchCommand;
13
- readAndroidScreenSize?: typeof getAndroidScreenSize;
14
- }): Promise<DaemonResponse | null>;
15
- export declare function unsupportedRefSnapshotFlags(flags: CommandFlags | undefined): string[];
16
- export {};
@@ -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;