peachsim 0.1.761 → 0.1.763

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 (73) hide show
  1. package/README.md +5 -0
  2. package/cli/bridge-flow-runner.ts +3 -4
  3. package/cli/commands/inspect/settling.ts +193 -162
  4. package/dist-lib/agent-daemon-client.cjs +1 -1
  5. package/dist-lib/agent-events.cjs +1 -1
  6. package/dist-lib/agent-identity.cjs +1 -1
  7. package/dist-lib/agent-sessions.cjs +1 -1
  8. package/dist-lib/attached-projects.cjs +1 -1
  9. package/dist-lib/auth/shared-session.cjs +1 -1
  10. package/dist-lib/backend-origin.cjs +1 -1
  11. package/dist-lib/beta.cjs +1 -1
  12. package/dist-lib/beta.mjs +1 -1
  13. package/dist-lib/bridge-constants.cjs +1 -1
  14. package/dist-lib/bridge-contract-input.cjs +1 -1
  15. package/dist-lib/bridge-contract-input.mjs +1 -1
  16. package/dist-lib/bridge-contract.cjs +1 -1
  17. package/dist-lib/bridge-contract.mjs +1 -1
  18. package/dist-lib/capture-contract.cjs +1 -1
  19. package/dist-lib/capture-contract.mjs +1 -1
  20. package/dist-lib/cli-constants.cjs +1 -1
  21. package/dist-lib/cloud-contract.cjs +1 -1
  22. package/dist-lib/cloud-contract.mjs +1 -1
  23. package/dist-lib/cloud-test-args.cjs +1 -1
  24. package/dist-lib/cloud-test-args.mjs +1 -1
  25. package/dist-lib/cloud.cjs +1 -1
  26. package/dist-lib/cloud.mjs +1 -1
  27. package/dist-lib/config.cjs +1 -1
  28. package/dist-lib/detox/index.cjs +1 -1
  29. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  30. package/dist-lib/home-paths.cjs +1 -1
  31. package/dist-lib/host/bridge-host.cjs +44 -37
  32. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  33. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  34. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  35. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  36. package/dist-lib/host/websocket-proxy.cjs +1 -1
  37. package/dist-lib/index.cjs +191 -159
  38. package/dist-lib/jump-to-source-babel.cjs +1 -1
  39. package/dist-lib/jump-to-source-native.cjs +1 -1
  40. package/dist-lib/kotlin-host.cjs +1 -1
  41. package/dist-lib/menu.cjs +1 -1
  42. package/dist-lib/menu.mjs +1 -1
  43. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  44. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  45. package/dist-lib/metro-production-bundle.cjs +1 -1
  46. package/dist-lib/metro-production-bundle.mjs +1 -1
  47. package/dist-lib/metro.cjs +1 -1
  48. package/dist-lib/native-app-identity.cjs +1 -1
  49. package/dist-lib/native-app-identity.mjs +1 -1
  50. package/dist-lib/native-firebase-metadata.cjs +1 -1
  51. package/dist-lib/native-firebase-metadata.mjs +1 -1
  52. package/dist-lib/plist.cjs +1 -1
  53. package/dist-lib/plist.mjs +1 -1
  54. package/dist-lib/profiles.cjs +1 -1
  55. package/dist-lib/public-brand.cjs +1 -1
  56. package/dist-lib/react-native-host-modules.cjs +1 -1
  57. package/dist-lib/react-native-host-modules.mjs +1 -1
  58. package/dist-lib/render-mode.cjs +1 -1
  59. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  60. package/dist-lib/sdk.cjs +191 -159
  61. package/dist-lib/sdk.mjs +191 -159
  62. package/dist-lib/skills.cjs +240 -202
  63. package/dist-lib/swift-compile.cjs +1 -1
  64. package/dist-lib/swift-compile.mjs +1 -1
  65. package/dist-lib/swift-package.cjs +1 -1
  66. package/dist-lib/swift-package.mjs +1 -1
  67. package/dist-lib/swift-submit.cjs +1 -1
  68. package/dist-lib/swift-submit.mjs +1 -1
  69. package/dist-lib/swift-toolchain.cjs +1 -1
  70. package/dist-lib/swift.cjs +1 -1
  71. package/dist-lib/vite-swift.cjs +1 -1
  72. package/dist-lib/vite.cjs +1 -1
  73. package/package.json +1 -1
package/README.md CHANGED
@@ -509,6 +509,11 @@ peach maestro generate "verify login"
509
509
  peach maestro --list-compat # see the verb support matrix
510
510
  ```
511
511
 
512
+ Tap settling compares consecutive full-screen pixels within Maestro's iOS
513
+ three-second budget, while also draining screen transitions, native motion and
514
+ image loads. Periodic caret paints do not require a continuous stillness window,
515
+ matching [Maestro's screen comparison](https://github.com/mobile-dev-inc/Maestro/blob/main/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Handlers/ScreenDiffHandler.swift).
516
+
512
517
  Most Maestro verbs work out of the box (`tapOn`, `assertVisible`, `inputText`,
513
518
  `scrollUntilVisible`, `launchApp`, `when:`, `repeat`, `runFlow`, …). Verbs that
514
519
  need real device hardware (GPS, radio, photo library) throw a clear error. See
@@ -2798,9 +2798,9 @@ export class SootSimBridgeFlowRunner {
2798
2798
  // maestro waits around taps for the screen to stop changing, up to
2799
2799
  // its ios driver's 3 s settle budget, comparing screenshots, so an action
2800
2800
  // still in flight (a submit spinner, a sheet closing) finishes before the
2801
- // next command resolves its target. an app can take a few hundred ms to
2802
- // react to a press, so stillness must hold about half a second, and it
2803
- // counts painted frames because a spinner repaints without moving layout.
2801
+ // next command resolves its target. compare consecutive screen pixels,
2802
+ // rather than requiring frame publications to stop for half a second:
2803
+ // a focused input keeps repainting its native blinking caret.
2804
2804
  // a screen that never stops proceeds when the budget runs out, as there,
2805
2805
  // and names what kept it moving: every such step pays the whole budget.
2806
2806
  private async waitForAppToSettle() {
@@ -2809,7 +2809,6 @@ export class SootSimBridgeFlowRunner {
2809
2809
  simId: this.opts.simId,
2810
2810
  maxMs: 3000,
2811
2811
  pollMs: 32,
2812
- stablePolls: 16,
2813
2812
  strict: true,
2814
2813
  paintStill: true,
2815
2814
  })
@@ -11,14 +11,13 @@ export type WaitForSootsimIdleOptions = {
11
11
  simId?: string
12
12
  maxMs: number
13
13
  pollMs?: number
14
- // stillness must hold for stablePolls * pollMs. it is measured in time, so
14
+ // layout stillness must hold for stablePolls * pollMs. it is measured in time, so
15
15
  // a host where each poll costs more than pollMs proves the same stillness
16
16
  // in fewer polls instead of paying the count at its slower rate.
17
17
  stablePolls?: number
18
18
  strict?: boolean
19
- // also require no newly painted frame across the window, the way maestro
20
- // compares screenshots: a spinner or a rotation repaints without moving
21
- // layout or registering as a driven animation.
19
+ // compare consecutive full-screen pixels, as maestro's ios driver does.
20
+ // frame publications and caret blinks do not require a continuous window.
22
21
  paintStill?: boolean
23
22
  }
24
23
 
@@ -48,179 +47,211 @@ export async function waitForSootsimIdle({
48
47
  const start = Date.now()
49
48
  const deadline = start + ${Math.max(0, Math.round(maxMs))}
50
49
  const pollMs = ${Math.max(1, Math.round(pollMs))}
51
- const requiredStillMs = ${Math.max(1, Math.round(stablePolls)) * Math.max(1, Math.round(pollMs))}
52
- const minimumStablePolls = ${Math.min(2, Math.max(1, Math.round(stablePolls)))}
53
50
  const strict = ${strict ? 'true' : 'false'}
54
51
  const paintStill = ${paintStill ? 'true' : 'false'}
52
+ const requiredStillMs = paintStill ? 0 : ${Math.max(1, Math.round(stablePolls)) * Math.max(1, Math.round(pollMs))}
53
+ const minimumStablePolls = paintStill ? 1 : ${Math.min(2, Math.max(1, Math.round(stablePolls)))}
55
54
  const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms))
56
-
57
- // route-aware settle: a tap that pushes/pops a screen is async — the
58
- // old screen still renders for a moment, then the new one mounts and
59
- // its content loads. a pure layout-hash check reports "idle" on the
60
- // outgoing screen or on the incoming skeleton, so a driver re-taps
61
- // and stacks duplicate navigations. drain any in-flight screen
62
- // transition FIRST, bounded by the overall budget. when no
63
- // transition is happening this returns in ~80ms (startWindowMs), so
64
- // a plain button tap barely pays for it.
55
+ const composite = paintStill ? window.SootSim?.bridges?.liveComposite : null
56
+ if (paintStill && !composite) {
57
+ return { settled: false, elapsed: Date.now() - start, blockedBy: 'screen pixels unavailable' }
58
+ }
59
+ // subscribe to presented frames; authoritative screenshots force a
60
+ // worker render, which changes the very counter we used to inspect.
61
+ const unsubscribe = composite?.subscribe(() => {})
62
+ let pixelFrameToken = -1
63
+ let screenPixels = null
65
64
  try {
66
- const wfst = window.__sootsimTest?.waitForScreenTransitions
67
- if (typeof wfst === 'function') {
68
- const remaining = deadline - Date.now()
69
- if (remaining > 120) {
70
- await wfst({
71
- timeoutMs: Math.min(remaining - 80, 4000),
72
- settleMs: 64,
73
- startWindowMs: 80,
74
- })
65
+
66
+ // route-aware settle: a tap that pushes/pops a screen is async — the
67
+ // old screen still renders for a moment, then the new one mounts and
68
+ // its content loads. a pure layout-hash check reports "idle" on the
69
+ // outgoing screen or on the incoming skeleton, so a driver re-taps
70
+ // and stacks duplicate navigations. drain any in-flight screen
71
+ // transition FIRST, bounded by the overall budget. when no
72
+ // transition is happening this returns in ~80ms (startWindowMs), so
73
+ // a plain button tap barely pays for it.
74
+ try {
75
+ const wfst = window.__sootsimTest?.waitForScreenTransitions
76
+ if (typeof wfst === 'function') {
77
+ const remaining = deadline - Date.now()
78
+ if (remaining > 120) {
79
+ await wfst({
80
+ timeoutMs: Math.min(remaining - 80, 4000),
81
+ settleMs: 64,
82
+ startWindowMs: 80,
83
+ })
84
+ }
75
85
  }
76
- }
77
- } catch {}
86
+ } catch {}
78
87
 
79
- const readSnapshot = async () => {
80
- let animating = false
81
- let layoutDirty = false
82
- let pendingFetches = 0
83
- let requestTotal = 0
84
- let requestInFlight = 0
85
- let renderStatsAvailable = false
86
- let frameCount = -1
87
- let shellAnimating = false
88
- // strict also waits out shell motion: a system alert, sheet or menu
89
- // animates in the shell worker while the app's own stats read still,
90
- // so its presentation is complete only once the shell's list empties.
91
- if (strict) {
88
+ const readSnapshot = async () => {
89
+ let animating = false
90
+ let layoutDirty = false
91
+ let pendingFetches = 0
92
+ let requestTotal = 0
93
+ let requestInFlight = 0
94
+ let renderStatsAvailable = false
95
+ let shellAnimating = false
96
+ // strict also waits out shell motion: a system alert, sheet or menu
97
+ // animates in the shell worker while the app's own stats read still,
98
+ // so its presentation is complete only once the shell's list empties.
99
+ if (strict) {
100
+ try {
101
+ const motion = await window.__sootsimTest?.listAnimations?.()
102
+ shellAnimating = Array.isArray(motion) && motion.some((anim) => anim.realm === 'shell')
103
+ } catch {}
104
+ }
92
105
  try {
93
- const motion = await window.__sootsimTest?.listAnimations?.()
94
- shellAnimating = Array.isArray(motion) && motion.some((anim) => anim.realm === 'shell')
106
+ const stats = await window.__sootsimRenderHost?.queryStats?.()
107
+ if (stats) {
108
+ renderStatsAvailable = true
109
+ animating =
110
+ stats.hasActiveAnims === true ||
111
+ stats.hasActiveNativeAnimations === true ||
112
+ stats.hasPendingAnimationFrames === true
113
+ layoutDirty =
114
+ stats.layoutDirty === true && stats.renderRequested === true
115
+ // a freshly-pushed screen showing a skeleton is layout-stable
116
+ // but not actually settled — its data/images are still in
117
+ // flight. treat bounded image-loader fetches as not-idle so
118
+ // settle waits for real content, capped by the budget.
119
+ const pf = stats.memory && stats.memory.imageLoader
120
+ ? stats.memory.imageLoader.pendingFetches
121
+ : 0
122
+ pendingFetches = typeof pf === 'number' ? pf : 0
123
+ }
95
124
  } catch {}
96
- }
97
- try {
98
- const stats = await window.__sootsimRenderHost?.queryStats?.()
99
- if (stats) {
100
- renderStatsAvailable = true
101
- frameCount = typeof stats.frameCount === 'number' ? stats.frameCount : -1
102
- animating =
103
- stats.hasActiveAnims === true ||
104
- stats.hasActiveNativeAnimations === true ||
105
- stats.hasPendingAnimationFrames === true
106
- layoutDirty =
107
- stats.layoutDirty === true && stats.renderRequested === true
108
- // a freshly-pushed screen showing a skeleton is layout-stable
109
- // but not actually settled — its data/images are still in
110
- // flight. treat bounded image-loader fetches as not-idle so
111
- // settle waits for real content, capped by the budget.
112
- const pf = stats.memory && stats.memory.imageLoader
113
- ? stats.memory.imageLoader.pendingFetches
114
- : 0
115
- pendingFetches = typeof pf === 'number' ? pf : 0
125
+ try {
126
+ const counts = await window.__sootsimTest?.getRequestCounts?.()
127
+ requestTotal = typeof counts?.total === 'number' ? counts.total : 0
128
+ requestInFlight = typeof counts?.inFlight === 'number' ? counts.inFlight : 0
129
+ } catch {}
130
+ const root = window.__sootsimRoot
131
+ const nodes = []
132
+ if (root) {
133
+ const walk = (n) => {
134
+ if (n.layout && n.layout.width > 0) {
135
+ nodes.push(Math.round(n.layout.x) + ',' + Math.round(n.layout.y) + ',' + Math.round(n.layout.width))
136
+ }
137
+ for (const c of n.children || []) walk(c)
138
+ }
139
+ walk(root)
116
140
  }
117
- } catch {}
118
- try {
119
- const counts = await window.__sootsimTest?.getRequestCounts?.()
120
- requestTotal = typeof counts?.total === 'number' ? counts.total : 0
121
- requestInFlight = typeof counts?.inFlight === 'number' ? counts.inFlight : 0
122
- } catch {}
123
- const root = window.__sootsimRoot
124
- const nodes = []
125
- if (root) {
126
- const walk = (n) => {
127
- if (n.layout && n.layout.width > 0) {
128
- nodes.push(Math.round(n.layout.x) + ',' + Math.round(n.layout.y) + ',' + Math.round(n.layout.width))
141
+ if (paintStill) {
142
+ const canvas = composite.getCanvas()
143
+ const token = composite.getFrameToken()
144
+ if (!canvas || canvas.width <= 1 || canvas.height <= 1) {
145
+ screenPixels = null
146
+ } else if (token !== pixelFrameToken || canvas.width !== screenPixels?.width || canvas.height !== screenPixels?.height) {
147
+ const context = canvas.getContext('2d')
148
+ const image = context?.getImageData(0, 0, canvas.width, canvas.height)
149
+ screenPixels = image ? { width: image.width, height: image.height, data: new Uint32Array(image.data.buffer) } : null
150
+ pixelFrameToken = token
129
151
  }
130
- for (const c of n.children || []) walk(c)
131
152
  }
132
- walk(root)
153
+ return { layout: nodes.join(';'), screenPixels, animating, shellAnimating, layoutDirty, pendingFetches, renderStatsAvailable, requestTotal, requestInFlight }
133
154
  }
134
- return { layout: nodes.join(';'), frameCount, animating, shellAnimating, layoutDirty, pendingFetches, renderStatsAvailable, requestTotal, requestInFlight }
135
- }
136
155
 
137
- // how long generic background network is allowed to keep us waiting AFTER
138
- // the screen is otherwise visually settled. apps with continuous traffic
139
- // (polling, realtime sockets, a tap that fires 20-50 fetches) never reach
140
- // requestInFlight===0 / a stable requestTotal, so requiring full network
141
- // quiet burns the ENTIRE budget on every command — the leading idle that
142
- // failed PR-preview recordings for network-heavy apps (3pc fight-pulse).
143
- // layout-stability + the image-loader already prove visible content
144
- // loaded (a data load changes layout; an image load shows in the loader),
145
- // so the generic request counters are a courtesy, not a gate: honor them
146
- // only within this grace once the screen is visually still.
147
- const networkQuietGraceMs = 1200
148
- let lastLayout = ''
149
- let lastFrameCount = -2
150
- let paintedPolls = 0
151
- let lastRequestTotal = -1
152
- let stable = 0
153
- let visuallyStillSince = 0
154
- // counts across the whole budget: a flag that is true on every poll is a
155
- // different bug from one that is true intermittently, and the two need
156
- // opposite fixes (engine vs budget).
157
- let polls = 0
158
- let dirtyPolls = 0
159
- let animatingPolls = 0
160
- let layoutChangedPolls = 0
161
- while (Date.now() < deadline) {
162
- const snapshot = await readSnapshot()
163
- polls++
164
- if (snapshot.layoutDirty) dirtyPolls++
165
- if (snapshot.animating || snapshot.shellAnimating) animatingPolls++
166
- if (polls > 1 && snapshot.layout !== lastLayout) layoutChangedPolls++
167
- const painted = paintStill && snapshot.frameCount !== lastFrameCount
168
- if (polls > 1 && painted) paintedPolls++
169
- const strictOk =
170
- !strict ||
171
- (snapshot.renderStatsAvailable &&
172
- !snapshot.animating &&
173
- !snapshot.shellAnimating &&
174
- !snapshot.layoutDirty)
175
- // visually settled: no animations, no image content loading, layout
176
- // unchanged since the last poll.
177
- const visuallyStill =
178
- strictOk &&
179
- !painted &&
180
- snapshot.pendingFetches === 0 &&
181
- snapshot.layout === lastLayout
182
- // generic network quiet: nothing in flight and no new requests issued.
183
- const networkQuiet =
184
- snapshot.requestInFlight === 0 && snapshot.requestTotal === lastRequestTotal
185
- if (visuallyStill) {
186
- stable++
187
- if (visuallyStillSince === 0) visuallyStillSince = Date.now()
188
- // settle once the screen has held still long enough AND either the
189
- // network is genuinely quiet OR it has refused to quiet within the
190
- // grace (continuous background traffic must not block forever).
191
- if (
192
- stable >= minimumStablePolls &&
193
- Date.now() - visuallyStillSince >= requiredStillMs &&
194
- (networkQuiet || Date.now() - visuallyStillSince >= networkQuietGraceMs)
195
- ) {
196
- return { settled: true, elapsed: Date.now() - start, blockedBy: '' }
156
+ // how long generic background network is allowed to keep us waiting AFTER
157
+ // the screen is otherwise visually settled. apps with continuous traffic
158
+ // (polling, realtime sockets, a tap that fires 20-50 fetches) never reach
159
+ // requestInFlight===0 / a stable requestTotal, so requiring full network
160
+ // quiet burns the ENTIRE budget on every command — the leading idle that
161
+ // failed PR-preview recordings for network-heavy apps (3pc fight-pulse).
162
+ // layout-stability + the image-loader already prove visible content
163
+ // loaded (a data load changes layout; an image load shows in the loader),
164
+ // so the generic request counters are a courtesy, not a gate: honor them
165
+ // only within this grace once the screen is visually still.
166
+ const networkQuietGraceMs = 1200
167
+ let lastLayout = ''
168
+ let lastScreenPixels = null
169
+ let screenChangedPolls = 0
170
+ let lastRequestTotal = -1
171
+ let stable = 0
172
+ let visuallyStillSince = 0
173
+ // counts across the whole budget: a flag that is true on every poll is a
174
+ // different bug from one that is true intermittently, and the two need
175
+ // opposite fixes (engine vs budget).
176
+ let polls = 0
177
+ let dirtyPolls = 0
178
+ let animatingPolls = 0
179
+ let layoutChangedPolls = 0
180
+ const screenUnchanged = (pixels) => {
181
+ if (!pixels || !lastScreenPixels || pixels.width !== lastScreenPixels.width || pixels.height !== lastScreenPixels.height) return false
182
+ if (pixels === lastScreenPixels) return true
183
+ for (let i = 0; i < pixels.data.length; i++) {
184
+ if (pixels.data[i] !== lastScreenPixels.data[i]) return false
197
185
  }
198
- } else {
199
- stable = 0
200
- visuallyStillSince = 0
186
+ return true
201
187
  }
202
- lastLayout = snapshot.layout
203
- lastFrameCount = snapshot.frameCount
204
- lastRequestTotal = snapshot.requestTotal
205
- await sleep(pollMs)
206
- }
207
- const last = await readSnapshot()
208
- const blockers = []
209
- if (strict && !last.renderStatsAvailable) blockers.push('render stats unavailable')
210
- if (last.animating) blockers.push('animations still running')
211
- if (last.shellAnimating) blockers.push('shell animations still running')
212
- if (last.layoutDirty) blockers.push('layout still dirty')
213
- if (last.pendingFetches > 0) blockers.push(last.pendingFetches + ' image fetches pending')
214
- if (last.layout !== lastLayout) blockers.push('layout still changing')
215
- if (paintStill && last.frameCount !== lastFrameCount) blockers.push('still painting')
216
- if (last.requestInFlight > 0) blockers.push(last.requestInFlight + ' requests in flight')
217
- return {
218
- settled: false,
219
- elapsed: Date.now() - start,
220
- blockedBy:
221
- (blockers.length ? blockers.join(', ') : 'unknown') +
222
- ' over ' + polls + ' polls (layout changed ' + layoutChangedPolls +
223
- 'x, layoutDirty ' + dirtyPolls + 'x, animating ' + animatingPolls + 'x, painted ' + paintedPolls + 'x)',
188
+ while (Date.now() < deadline) {
189
+ const snapshot = await readSnapshot()
190
+ polls++
191
+ if (snapshot.layoutDirty) dirtyPolls++
192
+ if (snapshot.animating || snapshot.shellAnimating) animatingPolls++
193
+ if (polls > 1 && snapshot.layout !== lastLayout) layoutChangedPolls++
194
+ const screenChanged = paintStill && !screenUnchanged(snapshot.screenPixels)
195
+ if (polls > 1 && screenChanged) screenChangedPolls++
196
+ const strictOk =
197
+ !strict ||
198
+ (snapshot.renderStatsAvailable &&
199
+ !snapshot.animating &&
200
+ !snapshot.shellAnimating &&
201
+ !snapshot.layoutDirty)
202
+ // visually settled: no animations, no image content loading, layout
203
+ // unchanged since the last poll.
204
+ const visuallyStill =
205
+ strictOk &&
206
+ !screenChanged &&
207
+ snapshot.pendingFetches === 0 &&
208
+ snapshot.layout === lastLayout
209
+ // generic network quiet: nothing in flight and no new requests issued.
210
+ const networkQuiet =
211
+ snapshot.requestInFlight === 0 && snapshot.requestTotal === lastRequestTotal
212
+ if (visuallyStill) {
213
+ stable++
214
+ if (visuallyStillSince === 0) visuallyStillSince = Date.now()
215
+ // settle once the screen has held still long enough AND either the
216
+ // network is genuinely quiet OR it has refused to quiet within the
217
+ // grace (continuous background traffic must not block forever).
218
+ if (
219
+ stable >= minimumStablePolls &&
220
+ Date.now() - visuallyStillSince >= requiredStillMs &&
221
+ (networkQuiet || Date.now() - visuallyStillSince >= networkQuietGraceMs)
222
+ ) {
223
+ return { settled: true, elapsed: Date.now() - start, blockedBy: '' }
224
+ }
225
+ } else {
226
+ stable = 0
227
+ visuallyStillSince = 0
228
+ }
229
+ lastLayout = snapshot.layout
230
+ lastScreenPixels = snapshot.screenPixels
231
+ lastRequestTotal = snapshot.requestTotal
232
+ await sleep(pollMs)
233
+ }
234
+ const last = await readSnapshot()
235
+ const blockers = []
236
+ if (strict && !last.renderStatsAvailable) blockers.push('render stats unavailable')
237
+ if (last.animating) blockers.push('animations still running')
238
+ if (last.shellAnimating) blockers.push('shell animations still running')
239
+ if (last.layoutDirty) blockers.push('layout still dirty')
240
+ if (last.pendingFetches > 0) blockers.push(last.pendingFetches + ' image fetches pending')
241
+ if (last.layout !== lastLayout) blockers.push('layout still changing')
242
+ if (paintStill && !last.screenPixels) blockers.push('screen pixels unavailable')
243
+ else if (paintStill && !screenUnchanged(last.screenPixels)) blockers.push('screen pixels still changing')
244
+ if (last.requestInFlight > 0) blockers.push(last.requestInFlight + ' requests in flight')
245
+ return {
246
+ settled: false,
247
+ elapsed: Date.now() - start,
248
+ blockedBy:
249
+ (blockers.length ? blockers.join(', ') : 'unknown') +
250
+ ' over ' + polls + ' polls (layout changed ' + layoutChangedPolls +
251
+ 'x, layoutDirty ' + dirtyPolls + 'x, animating ' + animatingPolls + 'x, screen changed ' + screenChangedPolls + 'x)',
252
+ }
253
+ } finally {
254
+ unsubscribe?.()
224
255
  }
225
256
  })()`,
226
257
  },
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.763 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.763 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.763 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.763 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.763 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.763 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.763 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
package/dist-lib/beta.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.763 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
package/dist-lib/beta.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.763 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/beta.ts
4
4
  var IS_BETA = true;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.763 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.763 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.763 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/bridge-contract.ts
4
4
  var SIM_LONG_PRESS_MAX_MS = 5e3;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.763 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.763 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/bridge-contract.ts
4
4
  var REFUSED_PERFORM_STEP_TYPES = [
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.763 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.763 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/capture-contract.ts
4
4
  var RNX_SCREEN_CAPTURE_VERSION = 1;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.763 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.763 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.763 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/cloud-contract.ts
4
4
  var RNX_CLOUD_MAX_ARTIFACT_BYTES = 20 * 1024 * 1024;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.763 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.763 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/cloud-test-args.ts
4
4
  var CLOUD_TEST_ARGS_MAX_COUNT = 32;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.763 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.763 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  var __defProp = Object.defineProperty;
3
3
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
4
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.763 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.763 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.761 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.763 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;