agent-device 0.16.13 → 0.17.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 (52) hide show
  1. package/android-multitouch-helper/dist/{agent-device-android-multitouch-helper-0.16.13.apk → agent-device-android-multitouch-helper-0.17.0.apk} +0 -0
  2. package/android-multitouch-helper/dist/agent-device-android-multitouch-helper-0.17.0.apk.sha256 +1 -0
  3. package/android-multitouch-helper/dist/{agent-device-android-multitouch-helper-0.16.13.manifest.json → agent-device-android-multitouch-helper-0.17.0.manifest.json} +4 -4
  4. package/android-snapshot-helper/dist/{agent-device-android-snapshot-helper-0.16.13.apk → agent-device-android-snapshot-helper-0.17.0.apk} +0 -0
  5. package/android-snapshot-helper/dist/agent-device-android-snapshot-helper-0.17.0.apk.sha256 +1 -0
  6. package/android-snapshot-helper/dist/{agent-device-android-snapshot-helper-0.16.13.manifest.json → agent-device-android-snapshot-helper-0.17.0.manifest.json} +6 -6
  7. package/dist/src/1352.js +1 -1
  8. package/dist/src/221.js +4 -4
  9. package/dist/src/2415.js +29 -29
  10. package/dist/src/2805.js +1 -1
  11. package/dist/src/5792.js +1 -1
  12. package/dist/src/6232.js +1 -1
  13. package/dist/src/7599.js +4 -3
  14. package/dist/src/8020.js +1 -0
  15. package/dist/src/8699.js +1 -1
  16. package/dist/src/940.js +1 -1
  17. package/dist/src/9533.js +1 -1
  18. package/dist/src/android-snapshot-helper.d.ts +1 -0
  19. package/dist/src/apple.js +1 -1
  20. package/dist/src/args.js +20 -14
  21. package/dist/src/cli.js +9 -9
  22. package/dist/src/command-metadata.js +1 -1
  23. package/dist/src/contracts.d.ts +1 -0
  24. package/dist/src/find.js +1 -1
  25. package/dist/src/finders.d.ts +1 -0
  26. package/dist/src/generic.js +9 -9
  27. package/dist/src/index.d.ts +19 -1
  28. package/dist/src/interaction.js +1 -1
  29. package/dist/src/lease.js +1 -1
  30. package/dist/src/react-native.js +1 -1
  31. package/dist/src/record-trace.js +3 -3
  32. package/dist/src/selectors.d.ts +1 -0
  33. package/dist/src/session.js +11 -11
  34. package/dist/src/snapshot.js +2 -2
  35. package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSynthesizedGesture.h +4 -0
  36. package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSynthesizedGesture.m +71 -0
  37. package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Alert.swift +41 -7
  38. package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift +154 -11
  39. package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandJournal.swift +11 -0
  40. package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Exceptions.swift +12 -4
  41. package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Interaction.swift +26 -0
  42. package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Lifecycle.swift +8 -0
  43. package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Models.swift +7 -1
  44. package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Snapshot.swift +571 -56
  45. package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Transport.swift +21 -0
  46. package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TvRemote.swift +11 -0
  47. package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests.swift +13 -2
  48. package/ios-runner/README.md +13 -0
  49. package/package.json +1 -1
  50. package/server.json +2 -2
  51. package/android-multitouch-helper/dist/agent-device-android-multitouch-helper-0.16.13.apk.sha256 +0 -1
  52. package/android-snapshot-helper/dist/agent-device-android-snapshot-helper-0.16.13.apk.sha256 +0 -1
@@ -112,12 +112,33 @@ extension RunnerTests {
112
112
  completion((jsonResponse(status: 200, response: executeStatus(command: command)), false))
113
113
  return
114
114
  }
115
+ if command.command == .uptime {
116
+ completion((jsonResponse(status: 200, response: executeUptime()), false))
117
+ return
118
+ }
119
+ NSLog(
120
+ "AGENT_DEVICE_RUNNER_COMMAND_ACCEPTED command=%@ commandId=%@",
121
+ command.command.rawValue,
122
+ command.commandId ?? ""
123
+ )
115
124
  commandJournal.accept(command: command)
116
125
  commandExecutionQueue.async {
117
126
  do {
118
127
  let response = try self.executeAccepted(command: command)
128
+ NSLog(
129
+ "AGENT_DEVICE_RUNNER_COMMAND_COMPLETED command=%@ commandId=%@ ok=%d",
130
+ command.command.rawValue,
131
+ command.commandId ?? "",
132
+ response.ok ? 1 : 0
133
+ )
119
134
  completion((self.jsonResponse(status: 200, response: response), command.command == .shutdown))
120
135
  } catch {
136
+ NSLog(
137
+ "AGENT_DEVICE_RUNNER_COMMAND_FAILED command=%@ commandId=%@ error=%@",
138
+ command.command.rawValue,
139
+ command.commandId ?? "",
140
+ String(describing: error)
141
+ )
121
142
  completion((
122
143
  self.jsonResponse(
123
144
  status: 500,
@@ -81,7 +81,18 @@ extension RunnerTests {
81
81
  if let outcome = selectFocusedTvElement(app: app, element: element, action: action) {
82
82
  return outcome
83
83
  }
84
+ #if os(tvOS)
84
85
  return performElementTap(element)
86
+ #else
87
+ let frame = element.frame
88
+ if !frame.isEmpty {
89
+ // XCUIElement.tap() can fail the whole XCTest after navigation because it
90
+ // re-resolves the tapped element even after the app removed it. Keep the
91
+ // selector target semantic, then activate its resolved stable screen point.
92
+ return tapAt(app: app, x: frame.midX, y: frame.midY)
93
+ }
94
+ return performElementTap(element)
95
+ #endif
85
96
  }
86
97
 
87
98
  func selectFocusedTvElement(app: XCUIApplication, point: CGPoint, action: String) -> RunnerInteractionOutcome? {
@@ -39,8 +39,6 @@ final class RunnerTests: XCTestCase {
39
39
  var currentApp: XCUIApplication?
40
40
  var currentBundleId: String?
41
41
  let maxRequestBytes = 2 * 1024 * 1024
42
- let maxSnapshotElements = 600
43
- let fastSnapshotLimit = 300
44
42
  let mainThreadExecutionTimeout: TimeInterval = 30
45
43
  let appExistenceTimeout: TimeInterval = 30
46
44
  let retryCooldown: TimeInterval = 0.2
@@ -48,6 +46,7 @@ final class RunnerTests: XCTestCase {
48
46
  let firstInteractionAfterActivateDelay: TimeInterval = 0.25
49
47
  let scrollInteractionIdleTimeoutDefault: TimeInterval = 1.0
50
48
  let tvRemoteDoublePressDelayDefault: TimeInterval = 0.0
49
+ let xctestIdleKeepaliveInterval: TimeInterval = 5.0
51
50
  let minRecordingFps = 1
52
51
  let maxRecordingFps = 120
53
52
  let minRecordingQuality = 5
@@ -119,6 +118,18 @@ final class RunnerTests: XCTestCase {
119
118
  self.handle(connection: conn)
120
119
  }
121
120
  listener?.start(queue: transportQueue)
121
+ let idleKeepaliveTimer = DispatchSource.makeTimerSource(queue: transportQueue)
122
+ idleKeepaliveTimer.schedule(
123
+ deadline: .now() + xctestIdleKeepaliveInterval,
124
+ repeating: xctestIdleKeepaliveInterval
125
+ )
126
+ idleKeepaliveTimer.setEventHandler {
127
+ NSLog("AGENT_DEVICE_RUNNER_IDLE_KEEPALIVE")
128
+ }
129
+ idleKeepaliveTimer.resume()
130
+ defer {
131
+ idleKeepaliveTimer.cancel()
132
+ }
122
133
 
123
134
  guard let expectation = doneExpectation else {
124
135
  XCTFail("runner expectation was not initialized")
@@ -33,6 +33,19 @@ Protocol and maintenance references:
33
33
  - `RunnerTests+SystemModal.swift`: SpringBoard/system modal detection and modal snapshot shaping.
34
34
  - `RunnerTests+ScreenRecorder.swift`: nested `ScreenRecorder` implementation.
35
35
 
36
+ ## Snapshot Strategy
37
+
38
+ iOS snapshots have two explicit capture modes:
39
+
40
+ - full/raw snapshots use recursive XCTest snapshots for rich hierarchy and diagnostics;
41
+ - compact interactive snapshots use a bounded flat XCTest query path for fast agent-facing refs.
42
+
43
+ Some simulator apps expose accessibility trees that lower-level AX services can inspect but XCTest
44
+ cannot serialize reliably. In those cases compact interactive snapshots may return a sparse root
45
+ quickly, while full snapshots preserve the XCTest error. See
46
+ [`../docs/adr/0004-ios-snapshot-backend-strategy.md`](../docs/adr/0004-ios-snapshot-backend-strategy.md)
47
+ for the backend boundary and the rationale for a future simulator AX-service backend.
48
+
36
49
  ## Protocol Notes
37
50
 
38
51
  - The daemon posts JSON commands to `POST /command` on the runner's local HTTP listener.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-device",
3
- "version": "0.16.13",
3
+ "version": "0.17.0",
4
4
  "description": "Agent-native CLI for AI mobile testing and app automation across iOS, Android, tvOS, Android TV, macOS, and Linux.",
5
5
  "mcpName": "io.github.callstackincubator/agent-device",
6
6
  "license": "MIT",
package/server.json CHANGED
@@ -7,12 +7,12 @@
7
7
  "url": "https://github.com/callstackincubator/agent-device",
8
8
  "source": "github"
9
9
  },
10
- "version": "0.16.13",
10
+ "version": "0.17.0",
11
11
  "packages": [
12
12
  {
13
13
  "registryType": "npm",
14
14
  "identifier": "agent-device",
15
- "version": "0.16.13",
15
+ "version": "0.17.0",
16
16
  "transport": {
17
17
  "type": "stdio"
18
18
  }
@@ -1 +0,0 @@
1
- 14f6601f1aa7584d5e51c165615c692ce7377e3ce8003b4a7a3f54b1f4bdddcf agent-device-android-multitouch-helper-0.16.13.apk
@@ -1 +0,0 @@
1
- ed457dc38126e5459f96de44b6a5ba70c8029b6fe26dfcc2dd1f96e30bae0835 agent-device-android-snapshot-helper-0.16.13.apk