@e2e-dev/mobile 0.12.2 → 0.12.3-nightly-20261016073603

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/.build.json CHANGED
@@ -1 +1 @@
1
- {"version":"0.12.2"}
1
+ {"version":"0.12.3-nightly-20261016073603"}
package/dist/errors.d.ts CHANGED
@@ -43,6 +43,12 @@ export declare function isRunnerFailure(error: unknown): boolean;
43
43
  * is safe and usually enough.
44
44
  */
45
45
  export declare function isSnapshotPresentationFailure(error: unknown): boolean;
46
+ /**
47
+ * True for a translated snapshot agent-device took on Android but found too
48
+ * little foreground content in to read. The screen is still arriving, so a
49
+ * caller that polls may read it as nothing there yet.
50
+ */
51
+ export declare function isUnreadableCapture(error: unknown): boolean;
46
52
  /**
47
53
  * Runs one agent-device command under an abort signal and translates its
48
54
  * failure onto the engine taxonomy: the one boundary every command crosses.
package/dist/errors.js CHANGED
@@ -135,6 +135,19 @@ const PRESENTATION = {
135
135
  headline: 'the iOS automation runner could not present the accessibility snapshot',
136
136
  firstMove: 'Rerun.',
137
137
  };
138
+ /**
139
+ * The `details.androidSnapshotHelperFailureReason` values agent-device gives
140
+ * up on a capture with when the foreground holds too little to read: the
141
+ * helper returned nothing, only a system window, or an app window with almost
142
+ * no content. A cold-starting app on a slow emulator does this until it
143
+ * renders. Mirrors agent-device's `isUnreadableCaptureContentError`, which
144
+ * its root entry does not export (0.21.25).
145
+ */
146
+ const UNREADABLE_CAPTURE_REASONS = new Set([
147
+ 'empty-helper-output',
148
+ 'system-window-only',
149
+ 'content-poor-app-window',
150
+ ]);
138
151
  const RUNNER_RECOVERY = 'If the next run meets it again, stop the daemon (`npx agent-device daemon stop`) and reboot the simulator (`xcrun simctl shutdown <udid>`, then `boot`).';
139
152
  /** The runner-state entry for a failure, by top-level code or the folded runner wire code. */
140
153
  function runnerState(cause) {
@@ -204,6 +217,17 @@ export function isRunnerFailure(error) {
204
217
  export function isSnapshotPresentationFailure(error) {
205
218
  return error instanceof Error && isPresentationFailure(error.cause);
206
219
  }
220
+ /**
221
+ * True for a translated snapshot agent-device took on Android but found too
222
+ * little foreground content in to read. The screen is still arriving, so a
223
+ * caller that polls may read it as nothing there yet.
224
+ */
225
+ export function isUnreadableCapture(error) {
226
+ if (!(error instanceof Error))
227
+ return false;
228
+ const reason = details(error.cause).androidSnapshotHelperFailureReason;
229
+ return typeof reason === 'string' && UNREADABLE_CAPTURE_REASONS.has(reason);
230
+ }
207
231
  /**
208
232
  * Runs one agent-device command under an abort signal and translates its
209
233
  * failure onto the engine taxonomy: the one boundary every command crosses.
package/dist/surface.d.ts CHANGED
@@ -263,6 +263,14 @@ export declare class AgentDeviceSurface {
263
263
  * move is the open tool, and failing the step would take that move away.
264
264
  */
265
265
  private snapshotOrEmpty;
266
+ /**
267
+ * Snapshot for a locate; undefined for a screen agent-device could not read
268
+ * yet (an app still on its splash). The harness polls a locate until its
269
+ * deadline, so that screen matches nothing and the poll waits for it to
270
+ * render. A capture that leaves no budget for another poll fails with the
271
+ * reason instead, so a wait that ends on an unreadable screen says so.
272
+ */
273
+ private locateSnapshot;
266
274
  private project;
267
275
  /**
268
276
  * The viewport of a snapshot: its own geometry, else the last one this
package/dist/surface.js CHANGED
@@ -15,7 +15,7 @@ import { existsSync, mkdirSync, mkdtempSync, readFileSync, renameSync, rmSync, w
15
15
  import { tmpdir } from 'node:os';
16
16
  import path from 'node:path';
17
17
  import { EngineError, KEY_NAMES, parseKey, raceAbort, rejectUnknownKeys, stopProviderRecording, withinCleanupBudget, ConfigurationError, TestError, } from 'e2e/engine';
18
- import { isSnapshotPresentationFailure, runCommand, staleOr } from './errors.js';
18
+ import { isSnapshotPresentationFailure, isUnreadableCapture, runCommand, staleOr } from './errors.js';
19
19
  import { pointerInteraction, DEFAULT_LONG_PRESS_MS } from './actions.js';
20
20
  import { resolveExpression } from './locate.js';
21
21
  import { isWithin, normalizeKind, projectSnapshot, ROOT_ID, screenRoot, screenTitle, } from './nodes.js';
@@ -675,6 +675,24 @@ export class AgentDeviceSurface {
675
675
  throw cause;
676
676
  }
677
677
  }
678
+ /**
679
+ * Snapshot for a locate; undefined for a screen agent-device could not read
680
+ * yet (an app still on its splash). The harness polls a locate until its
681
+ * deadline, so that screen matches nothing and the poll waits for it to
682
+ * render. A capture that leaves no budget for another poll fails with the
683
+ * reason instead, so a wait that ends on an unreadable screen says so.
684
+ */
685
+ async locateSnapshot(operation) {
686
+ const startedMs = Date.now();
687
+ try {
688
+ return await this.snapshotOrEmpty(operation, false);
689
+ }
690
+ catch (cause) {
691
+ if (operation.signal.aborted || !isUnreadableCapture(cause) || Date.now() - startedMs >= operation.timeoutMs)
692
+ throw cause;
693
+ return undefined;
694
+ }
695
+ }
678
696
  project(raw) {
679
697
  const projected = projectSnapshot(raw.nodes ?? [], {
680
698
  mintId: () => {
@@ -730,7 +748,9 @@ export class AgentDeviceSurface {
730
748
  }
731
749
  /** Retains only action bindings for matches, independently of the observation generation. */
732
750
  async locate(expression, operation) {
733
- const raw = await this.snapshotOrEmpty(operation, false);
751
+ const raw = await this.locateSnapshot(operation);
752
+ if (raw === undefined)
753
+ return [];
734
754
  const projected = this.project(raw);
735
755
  this.traceScreen(raw, projected);
736
756
  const matches = resolveExpression(expression, projected.index, this.options.platform);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e2e-dev/mobile",
3
- "version": "0.12.2",
3
+ "version": "0.12.3-nightly-20261016073603",
4
4
  "description": "Mobile engine (iOS and Android) for e2e agentic end-to-end testing, built on agent-device",
5
5
  "keywords": [
6
6
  "e2e",
@@ -51,13 +51,13 @@
51
51
  "NOTICE"
52
52
  ],
53
53
  "dependencies": {
54
- "agent-device": "0.21.25",
54
+ "agent-device": "0.21.28",
55
55
  "pngjs": "7.0.0",
56
56
  "zod": "4.6.1"
57
57
  },
58
58
  "peerDependencies": {
59
59
  "ai": "^7.0.0",
60
- "e2e": ">=0.15.0 <1"
60
+ "e2e": "0.21.2-nightly-20261016073603"
61
61
  },
62
62
  "peerDependenciesMeta": {
63
63
  "ai": {
@@ -68,7 +68,7 @@
68
68
  "@types/node": "26.6.2",
69
69
  "@types/pngjs": "6.0.5",
70
70
  "ai": "7.0.107",
71
- "e2e": "0.21.1",
71
+ "e2e": "0.21.2-nightly-20261016073603",
72
72
  "typescript": "7.0.2",
73
73
  "vitest": "5.0.1"
74
74
  },