peachsim 0.1.762 → 0.1.764

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 (74) 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 +10 -16
  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 +206 -181
  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 +10 -16
  72. package/dist-lib/vite.cjs +1 -1
  73. package/package.json +1 -1
  74. package/src/swift-packages.ts +21 -19
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.762 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.764 | (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.762 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.764 | (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;
@@ -9198,15 +9198,13 @@ function resolveSwiftPackages(options) {
9198
9198
  const files = swiftTargetFiles(pkg.manifest, target);
9199
9199
  if (files.some((file) => C_FAMILY.test(file)))
9200
9200
  return `${name2} is a C or Objective-C target`;
9201
- for (const dependency of target.dependencies) {
9202
- if (dependency.kind === "target") {
9203
- const nested2 = resolveTarget(pkg, dependency.name);
9204
- if (nested2) return nested2;
9205
- continue;
9206
- }
9201
+ const reasons = target.dependencies.map((dependency) => {
9202
+ if (dependency.kind === "target") return resolveTarget(pkg, dependency.name);
9207
9203
  const nested = resolveDependencyProduct(pkg, dependency.package, dependency.name);
9208
- if (nested) return `${dependency.name}: ${nested}`;
9209
- }
9204
+ return nested && `${dependency.name}: ${nested}`;
9205
+ });
9206
+ const blocked = reasons.find((reason) => reason !== null);
9207
+ if (blocked) return blocked;
9210
9208
  const relative2 = files.map((file) => import_node_path14.default.relative(target.dir, file));
9211
9209
  targets.set(`${pkg.manifest.dir}\0${name2}`, {
9212
9210
  name: name2,
@@ -9229,11 +9227,7 @@ function resolveSwiftPackages(options) {
9229
9227
  if (provided.has(product)) return null;
9230
9228
  const roots = pkg.manifest.products.get(product);
9231
9229
  if (!roots) return `${import_node_path14.default.basename(pkg.manifest.dir)} has no library ${product}`;
9232
- for (const name2 of roots) {
9233
- const reason = resolveTarget(pkg, name2);
9234
- if (reason) return reason;
9235
- }
9236
- return null;
9230
+ return roots.map((name2) => resolveTarget(pkg, name2)).find((reason) => reason !== null) ?? null;
9237
9231
  };
9238
9232
  const resolveDependencyProduct = (pkg, packageName, product) => {
9239
9233
  if (provided.has(product)) return null;
@@ -9274,7 +9268,7 @@ function resolveSwiftPackages(options) {
9274
9268
  const reached = /* @__PURE__ */ new Set();
9275
9269
  const reach = (pkg, name2) => {
9276
9270
  const key = `${pkg.manifest.dir}\0${name2}`;
9277
- if (reached.has(key) || !targets.has(key)) return;
9271
+ if (reached.has(key)) return;
9278
9272
  reached.add(key);
9279
9273
  for (const dependency of pkg.manifest.targets.get(name2)?.dependencies ?? []) {
9280
9274
  if (dependency.kind === "target") reach(pkg, dependency.name);
@@ -9289,7 +9283,7 @@ function resolveSwiftPackages(options) {
9289
9283
  };
9290
9284
  for (const { product, source } of products) {
9291
9285
  const pkg = source.kind === "unnamed" ? unnamed().find((candidate) => candidate.manifest.products.has(product)) : packages.get(source.kind === "local" ? import_node_path14.default.resolve(source.dir) : source.url);
9292
- if (!pkg || typeof pkg === "string" || result.unavailable.has(product)) continue;
9286
+ if (!pkg || typeof pkg === "string") continue;
9293
9287
  for (const root of pkg.manifest.products.get(product) ?? []) reach(pkg, root);
9294
9288
  }
9295
9289
  result.targets = [...targets.entries()].filter(([key]) => reached.has(key)).map(([, target]) => target);
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.762 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.764 | (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.762 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.764 | (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.762 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.764 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/host/fetch-proxy-overrides.ts
4
4
  var FETCH_PROXY_NATIVE_USER_AGENT_HEADER = "x-sootsim-native-user-agent";
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.762 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.764 | (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.762 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.764 | (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.762 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.764 | (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;
@@ -3268,179 +3268,211 @@ async function waitForSootsimIdle({
3268
3268
  const start = Date.now()
3269
3269
  const deadline = start + ${Math.max(0, Math.round(maxMs))}
3270
3270
  const pollMs = ${Math.max(1, Math.round(pollMs))}
3271
- const requiredStillMs = ${Math.max(1, Math.round(stablePolls)) * Math.max(1, Math.round(pollMs))}
3272
- const minimumStablePolls = ${Math.min(2, Math.max(1, Math.round(stablePolls)))}
3273
3271
  const strict = ${strict ? "true" : "false"}
3274
3272
  const paintStill = ${paintStill ? "true" : "false"}
3273
+ const requiredStillMs = paintStill ? 0 : ${Math.max(1, Math.round(stablePolls)) * Math.max(1, Math.round(pollMs))}
3274
+ const minimumStablePolls = paintStill ? 1 : ${Math.min(2, Math.max(1, Math.round(stablePolls)))}
3275
3275
  const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms))
3276
-
3277
- // route-aware settle: a tap that pushes/pops a screen is async \u2014 the
3278
- // old screen still renders for a moment, then the new one mounts and
3279
- // its content loads. a pure layout-hash check reports "idle" on the
3280
- // outgoing screen or on the incoming skeleton, so a driver re-taps
3281
- // and stacks duplicate navigations. drain any in-flight screen
3282
- // transition FIRST, bounded by the overall budget. when no
3283
- // transition is happening this returns in ~80ms (startWindowMs), so
3284
- // a plain button tap barely pays for it.
3276
+ const composite = paintStill ? window.SootSim?.bridges?.liveComposite : null
3277
+ if (paintStill && !composite) {
3278
+ return { settled: false, elapsed: Date.now() - start, blockedBy: 'screen pixels unavailable' }
3279
+ }
3280
+ // subscribe to presented frames; authoritative screenshots force a
3281
+ // worker render, which changes the very counter we used to inspect.
3282
+ const unsubscribe = composite?.subscribe(() => {})
3283
+ let pixelFrameToken = -1
3284
+ let screenPixels = null
3285
3285
  try {
3286
- const wfst = window.__sootsimTest?.waitForScreenTransitions
3287
- if (typeof wfst === 'function') {
3288
- const remaining = deadline - Date.now()
3289
- if (remaining > 120) {
3290
- await wfst({
3291
- timeoutMs: Math.min(remaining - 80, 4000),
3292
- settleMs: 64,
3293
- startWindowMs: 80,
3294
- })
3286
+
3287
+ // route-aware settle: a tap that pushes/pops a screen is async \u2014 the
3288
+ // old screen still renders for a moment, then the new one mounts and
3289
+ // its content loads. a pure layout-hash check reports "idle" on the
3290
+ // outgoing screen or on the incoming skeleton, so a driver re-taps
3291
+ // and stacks duplicate navigations. drain any in-flight screen
3292
+ // transition FIRST, bounded by the overall budget. when no
3293
+ // transition is happening this returns in ~80ms (startWindowMs), so
3294
+ // a plain button tap barely pays for it.
3295
+ try {
3296
+ const wfst = window.__sootsimTest?.waitForScreenTransitions
3297
+ if (typeof wfst === 'function') {
3298
+ const remaining = deadline - Date.now()
3299
+ if (remaining > 120) {
3300
+ await wfst({
3301
+ timeoutMs: Math.min(remaining - 80, 4000),
3302
+ settleMs: 64,
3303
+ startWindowMs: 80,
3304
+ })
3305
+ }
3295
3306
  }
3296
- }
3297
- } catch {}
3307
+ } catch {}
3298
3308
 
3299
- const readSnapshot = async () => {
3300
- let animating = false
3301
- let layoutDirty = false
3302
- let pendingFetches = 0
3303
- let requestTotal = 0
3304
- let requestInFlight = 0
3305
- let renderStatsAvailable = false
3306
- let frameCount = -1
3307
- let shellAnimating = false
3308
- // strict also waits out shell motion: a system alert, sheet or menu
3309
- // animates in the shell worker while the app's own stats read still,
3310
- // so its presentation is complete only once the shell's list empties.
3311
- if (strict) {
3309
+ const readSnapshot = async () => {
3310
+ let animating = false
3311
+ let layoutDirty = false
3312
+ let pendingFetches = 0
3313
+ let requestTotal = 0
3314
+ let requestInFlight = 0
3315
+ let renderStatsAvailable = false
3316
+ let shellAnimating = false
3317
+ // strict also waits out shell motion: a system alert, sheet or menu
3318
+ // animates in the shell worker while the app's own stats read still,
3319
+ // so its presentation is complete only once the shell's list empties.
3320
+ if (strict) {
3321
+ try {
3322
+ const motion = await window.__sootsimTest?.listAnimations?.()
3323
+ shellAnimating = Array.isArray(motion) && motion.some((anim) => anim.realm === 'shell')
3324
+ } catch {}
3325
+ }
3312
3326
  try {
3313
- const motion = await window.__sootsimTest?.listAnimations?.()
3314
- shellAnimating = Array.isArray(motion) && motion.some((anim) => anim.realm === 'shell')
3327
+ const stats = await window.__sootsimRenderHost?.queryStats?.()
3328
+ if (stats) {
3329
+ renderStatsAvailable = true
3330
+ animating =
3331
+ stats.hasActiveAnims === true ||
3332
+ stats.hasActiveNativeAnimations === true ||
3333
+ stats.hasPendingAnimationFrames === true
3334
+ layoutDirty =
3335
+ stats.layoutDirty === true && stats.renderRequested === true
3336
+ // a freshly-pushed screen showing a skeleton is layout-stable
3337
+ // but not actually settled \u2014 its data/images are still in
3338
+ // flight. treat bounded image-loader fetches as not-idle so
3339
+ // settle waits for real content, capped by the budget.
3340
+ const pf = stats.memory && stats.memory.imageLoader
3341
+ ? stats.memory.imageLoader.pendingFetches
3342
+ : 0
3343
+ pendingFetches = typeof pf === 'number' ? pf : 0
3344
+ }
3315
3345
  } catch {}
3316
- }
3317
- try {
3318
- const stats = await window.__sootsimRenderHost?.queryStats?.()
3319
- if (stats) {
3320
- renderStatsAvailable = true
3321
- frameCount = typeof stats.frameCount === 'number' ? stats.frameCount : -1
3322
- animating =
3323
- stats.hasActiveAnims === true ||
3324
- stats.hasActiveNativeAnimations === true ||
3325
- stats.hasPendingAnimationFrames === true
3326
- layoutDirty =
3327
- stats.layoutDirty === true && stats.renderRequested === true
3328
- // a freshly-pushed screen showing a skeleton is layout-stable
3329
- // but not actually settled \u2014 its data/images are still in
3330
- // flight. treat bounded image-loader fetches as not-idle so
3331
- // settle waits for real content, capped by the budget.
3332
- const pf = stats.memory && stats.memory.imageLoader
3333
- ? stats.memory.imageLoader.pendingFetches
3334
- : 0
3335
- pendingFetches = typeof pf === 'number' ? pf : 0
3346
+ try {
3347
+ const counts = await window.__sootsimTest?.getRequestCounts?.()
3348
+ requestTotal = typeof counts?.total === 'number' ? counts.total : 0
3349
+ requestInFlight = typeof counts?.inFlight === 'number' ? counts.inFlight : 0
3350
+ } catch {}
3351
+ const root = window.__sootsimRoot
3352
+ const nodes = []
3353
+ if (root) {
3354
+ const walk = (n) => {
3355
+ if (n.layout && n.layout.width > 0) {
3356
+ nodes.push(Math.round(n.layout.x) + ',' + Math.round(n.layout.y) + ',' + Math.round(n.layout.width))
3357
+ }
3358
+ for (const c of n.children || []) walk(c)
3359
+ }
3360
+ walk(root)
3336
3361
  }
3337
- } catch {}
3338
- try {
3339
- const counts = await window.__sootsimTest?.getRequestCounts?.()
3340
- requestTotal = typeof counts?.total === 'number' ? counts.total : 0
3341
- requestInFlight = typeof counts?.inFlight === 'number' ? counts.inFlight : 0
3342
- } catch {}
3343
- const root = window.__sootsimRoot
3344
- const nodes = []
3345
- if (root) {
3346
- const walk = (n) => {
3347
- if (n.layout && n.layout.width > 0) {
3348
- nodes.push(Math.round(n.layout.x) + ',' + Math.round(n.layout.y) + ',' + Math.round(n.layout.width))
3362
+ if (paintStill) {
3363
+ const canvas = composite.getCanvas()
3364
+ const token = composite.getFrameToken()
3365
+ if (!canvas || canvas.width <= 1 || canvas.height <= 1) {
3366
+ screenPixels = null
3367
+ } else if (token !== pixelFrameToken || canvas.width !== screenPixels?.width || canvas.height !== screenPixels?.height) {
3368
+ const context = canvas.getContext('2d')
3369
+ const image = context?.getImageData(0, 0, canvas.width, canvas.height)
3370
+ screenPixels = image ? { width: image.width, height: image.height, data: new Uint32Array(image.data.buffer) } : null
3371
+ pixelFrameToken = token
3349
3372
  }
3350
- for (const c of n.children || []) walk(c)
3351
3373
  }
3352
- walk(root)
3374
+ return { layout: nodes.join(';'), screenPixels, animating, shellAnimating, layoutDirty, pendingFetches, renderStatsAvailable, requestTotal, requestInFlight }
3353
3375
  }
3354
- return { layout: nodes.join(';'), frameCount, animating, shellAnimating, layoutDirty, pendingFetches, renderStatsAvailable, requestTotal, requestInFlight }
3355
- }
3356
3376
 
3357
- // how long generic background network is allowed to keep us waiting AFTER
3358
- // the screen is otherwise visually settled. apps with continuous traffic
3359
- // (polling, realtime sockets, a tap that fires 20-50 fetches) never reach
3360
- // requestInFlight===0 / a stable requestTotal, so requiring full network
3361
- // quiet burns the ENTIRE budget on every command \u2014 the leading idle that
3362
- // failed PR-preview recordings for network-heavy apps (3pc fight-pulse).
3363
- // layout-stability + the image-loader already prove visible content
3364
- // loaded (a data load changes layout; an image load shows in the loader),
3365
- // so the generic request counters are a courtesy, not a gate: honor them
3366
- // only within this grace once the screen is visually still.
3367
- const networkQuietGraceMs = 1200
3368
- let lastLayout = ''
3369
- let lastFrameCount = -2
3370
- let paintedPolls = 0
3371
- let lastRequestTotal = -1
3372
- let stable = 0
3373
- let visuallyStillSince = 0
3374
- // counts across the whole budget: a flag that is true on every poll is a
3375
- // different bug from one that is true intermittently, and the two need
3376
- // opposite fixes (engine vs budget).
3377
- let polls = 0
3378
- let dirtyPolls = 0
3379
- let animatingPolls = 0
3380
- let layoutChangedPolls = 0
3381
- while (Date.now() < deadline) {
3382
- const snapshot = await readSnapshot()
3383
- polls++
3384
- if (snapshot.layoutDirty) dirtyPolls++
3385
- if (snapshot.animating || snapshot.shellAnimating) animatingPolls++
3386
- if (polls > 1 && snapshot.layout !== lastLayout) layoutChangedPolls++
3387
- const painted = paintStill && snapshot.frameCount !== lastFrameCount
3388
- if (polls > 1 && painted) paintedPolls++
3389
- const strictOk =
3390
- !strict ||
3391
- (snapshot.renderStatsAvailable &&
3392
- !snapshot.animating &&
3393
- !snapshot.shellAnimating &&
3394
- !snapshot.layoutDirty)
3395
- // visually settled: no animations, no image content loading, layout
3396
- // unchanged since the last poll.
3397
- const visuallyStill =
3398
- strictOk &&
3399
- !painted &&
3400
- snapshot.pendingFetches === 0 &&
3401
- snapshot.layout === lastLayout
3402
- // generic network quiet: nothing in flight and no new requests issued.
3403
- const networkQuiet =
3404
- snapshot.requestInFlight === 0 && snapshot.requestTotal === lastRequestTotal
3405
- if (visuallyStill) {
3406
- stable++
3407
- if (visuallyStillSince === 0) visuallyStillSince = Date.now()
3408
- // settle once the screen has held still long enough AND either the
3409
- // network is genuinely quiet OR it has refused to quiet within the
3410
- // grace (continuous background traffic must not block forever).
3411
- if (
3412
- stable >= minimumStablePolls &&
3413
- Date.now() - visuallyStillSince >= requiredStillMs &&
3414
- (networkQuiet || Date.now() - visuallyStillSince >= networkQuietGraceMs)
3415
- ) {
3416
- return { settled: true, elapsed: Date.now() - start, blockedBy: '' }
3377
+ // how long generic background network is allowed to keep us waiting AFTER
3378
+ // the screen is otherwise visually settled. apps with continuous traffic
3379
+ // (polling, realtime sockets, a tap that fires 20-50 fetches) never reach
3380
+ // requestInFlight===0 / a stable requestTotal, so requiring full network
3381
+ // quiet burns the ENTIRE budget on every command \u2014 the leading idle that
3382
+ // failed PR-preview recordings for network-heavy apps (3pc fight-pulse).
3383
+ // layout-stability + the image-loader already prove visible content
3384
+ // loaded (a data load changes layout; an image load shows in the loader),
3385
+ // so the generic request counters are a courtesy, not a gate: honor them
3386
+ // only within this grace once the screen is visually still.
3387
+ const networkQuietGraceMs = 1200
3388
+ let lastLayout = ''
3389
+ let lastScreenPixels = null
3390
+ let screenChangedPolls = 0
3391
+ let lastRequestTotal = -1
3392
+ let stable = 0
3393
+ let visuallyStillSince = 0
3394
+ // counts across the whole budget: a flag that is true on every poll is a
3395
+ // different bug from one that is true intermittently, and the two need
3396
+ // opposite fixes (engine vs budget).
3397
+ let polls = 0
3398
+ let dirtyPolls = 0
3399
+ let animatingPolls = 0
3400
+ let layoutChangedPolls = 0
3401
+ const screenUnchanged = (pixels) => {
3402
+ if (!pixels || !lastScreenPixels || pixels.width !== lastScreenPixels.width || pixels.height !== lastScreenPixels.height) return false
3403
+ if (pixels === lastScreenPixels) return true
3404
+ for (let i = 0; i < pixels.data.length; i++) {
3405
+ if (pixels.data[i] !== lastScreenPixels.data[i]) return false
3417
3406
  }
3418
- } else {
3419
- stable = 0
3420
- visuallyStillSince = 0
3407
+ return true
3421
3408
  }
3422
- lastLayout = snapshot.layout
3423
- lastFrameCount = snapshot.frameCount
3424
- lastRequestTotal = snapshot.requestTotal
3425
- await sleep(pollMs)
3426
- }
3427
- const last = await readSnapshot()
3428
- const blockers = []
3429
- if (strict && !last.renderStatsAvailable) blockers.push('render stats unavailable')
3430
- if (last.animating) blockers.push('animations still running')
3431
- if (last.shellAnimating) blockers.push('shell animations still running')
3432
- if (last.layoutDirty) blockers.push('layout still dirty')
3433
- if (last.pendingFetches > 0) blockers.push(last.pendingFetches + ' image fetches pending')
3434
- if (last.layout !== lastLayout) blockers.push('layout still changing')
3435
- if (paintStill && last.frameCount !== lastFrameCount) blockers.push('still painting')
3436
- if (last.requestInFlight > 0) blockers.push(last.requestInFlight + ' requests in flight')
3437
- return {
3438
- settled: false,
3439
- elapsed: Date.now() - start,
3440
- blockedBy:
3441
- (blockers.length ? blockers.join(', ') : 'unknown') +
3442
- ' over ' + polls + ' polls (layout changed ' + layoutChangedPolls +
3443
- 'x, layoutDirty ' + dirtyPolls + 'x, animating ' + animatingPolls + 'x, painted ' + paintedPolls + 'x)',
3409
+ while (Date.now() < deadline) {
3410
+ const snapshot = await readSnapshot()
3411
+ polls++
3412
+ if (snapshot.layoutDirty) dirtyPolls++
3413
+ if (snapshot.animating || snapshot.shellAnimating) animatingPolls++
3414
+ if (polls > 1 && snapshot.layout !== lastLayout) layoutChangedPolls++
3415
+ const screenChanged = paintStill && !screenUnchanged(snapshot.screenPixels)
3416
+ if (polls > 1 && screenChanged) screenChangedPolls++
3417
+ const strictOk =
3418
+ !strict ||
3419
+ (snapshot.renderStatsAvailable &&
3420
+ !snapshot.animating &&
3421
+ !snapshot.shellAnimating &&
3422
+ !snapshot.layoutDirty)
3423
+ // visually settled: no animations, no image content loading, layout
3424
+ // unchanged since the last poll.
3425
+ const visuallyStill =
3426
+ strictOk &&
3427
+ !screenChanged &&
3428
+ snapshot.pendingFetches === 0 &&
3429
+ snapshot.layout === lastLayout
3430
+ // generic network quiet: nothing in flight and no new requests issued.
3431
+ const networkQuiet =
3432
+ snapshot.requestInFlight === 0 && snapshot.requestTotal === lastRequestTotal
3433
+ if (visuallyStill) {
3434
+ stable++
3435
+ if (visuallyStillSince === 0) visuallyStillSince = Date.now()
3436
+ // settle once the screen has held still long enough AND either the
3437
+ // network is genuinely quiet OR it has refused to quiet within the
3438
+ // grace (continuous background traffic must not block forever).
3439
+ if (
3440
+ stable >= minimumStablePolls &&
3441
+ Date.now() - visuallyStillSince >= requiredStillMs &&
3442
+ (networkQuiet || Date.now() - visuallyStillSince >= networkQuietGraceMs)
3443
+ ) {
3444
+ return { settled: true, elapsed: Date.now() - start, blockedBy: '' }
3445
+ }
3446
+ } else {
3447
+ stable = 0
3448
+ visuallyStillSince = 0
3449
+ }
3450
+ lastLayout = snapshot.layout
3451
+ lastScreenPixels = snapshot.screenPixels
3452
+ lastRequestTotal = snapshot.requestTotal
3453
+ await sleep(pollMs)
3454
+ }
3455
+ const last = await readSnapshot()
3456
+ const blockers = []
3457
+ if (strict && !last.renderStatsAvailable) blockers.push('render stats unavailable')
3458
+ if (last.animating) blockers.push('animations still running')
3459
+ if (last.shellAnimating) blockers.push('shell animations still running')
3460
+ if (last.layoutDirty) blockers.push('layout still dirty')
3461
+ if (last.pendingFetches > 0) blockers.push(last.pendingFetches + ' image fetches pending')
3462
+ if (last.layout !== lastLayout) blockers.push('layout still changing')
3463
+ if (paintStill && !last.screenPixels) blockers.push('screen pixels unavailable')
3464
+ else if (paintStill && !screenUnchanged(last.screenPixels)) blockers.push('screen pixels still changing')
3465
+ if (last.requestInFlight > 0) blockers.push(last.requestInFlight + ' requests in flight')
3466
+ return {
3467
+ settled: false,
3468
+ elapsed: Date.now() - start,
3469
+ blockedBy:
3470
+ (blockers.length ? blockers.join(', ') : 'unknown') +
3471
+ ' over ' + polls + ' polls (layout changed ' + layoutChangedPolls +
3472
+ 'x, layoutDirty ' + dirtyPolls + 'x, animating ' + animatingPolls + 'x, screen changed ' + screenChangedPolls + 'x)',
3473
+ }
3474
+ } finally {
3475
+ unsubscribe?.()
3444
3476
  }
3445
3477
  })()`
3446
3478
  },
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.762 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.764 | (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.762 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.764 | (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.762 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.764 | (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;
package/dist-lib/menu.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.762 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.764 | (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/menu.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.762 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.764 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/public-brand.ts
4
4
  var name = "Peach";
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.762 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.764 | (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.762 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.764 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/is-record.ts
4
4
  function isRecord(value) {
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.762 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.764 | (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.762 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.764 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/metro-production-bundle.ts
4
4
  var RNXSIM_METRO_MODULE_PATHS_PREFIX = "globalThis.__sootsimModulePaths=";
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.762 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.764 | (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.762 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.764 | (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.762 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.764 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/native-app-identity.ts
4
4
  var NATIVE_APP_IDENTITY_PREFIX = "globalThis.__sootsimNativeAppIdentity=";
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.762 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.764 | (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.762 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.764 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/native-firebase-metadata.ts
4
4
  var PREFIX = "globalThis.__peachNativeFirebaseConfig=";
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.762 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.764 | (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.762 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.764 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/plist.ts
4
4
  import plist from "plist";
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.762 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.764 | (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.762 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.764 | (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.762 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.764 | (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;