peachsim 0.1.709 → 0.1.711

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 (87) hide show
  1. package/cli/commands/control.ts +55 -1
  2. package/cli/commands/serve.ts +30 -0
  3. package/cli/current-sim.ts +15 -1
  4. package/cli/dev-build-freshness.ts +205 -0
  5. package/cli/drivers/playwright-sim-host.ts +14 -1
  6. package/cli/drivers/playwright.ts +36 -3
  7. package/cli/main.ts +8 -0
  8. package/cli/parent-pid.ts +91 -15
  9. package/cli/ws-bridge.ts +5 -0
  10. package/detox/index.ts +20 -7
  11. package/dist-lib/agent-daemon-client.cjs +1 -1
  12. package/dist-lib/agent-events.cjs +1 -1
  13. package/dist-lib/agent-identity.cjs +1 -1
  14. package/dist-lib/agent-sessions.cjs +1 -1
  15. package/dist-lib/attached-projects.cjs +1 -1
  16. package/dist-lib/auth/shared-session.cjs +1 -1
  17. package/dist-lib/backend-origin.cjs +1 -1
  18. package/dist-lib/beta.cjs +1 -1
  19. package/dist-lib/beta.mjs +1 -1
  20. package/dist-lib/bridge-constants.cjs +1 -1
  21. package/dist-lib/bridge-contract-input.cjs +1 -1
  22. package/dist-lib/bridge-contract-input.mjs +1 -1
  23. package/dist-lib/bridge-contract.cjs +1 -1
  24. package/dist-lib/bridge-contract.mjs +1 -1
  25. package/dist-lib/capture-contract.cjs +1 -1
  26. package/dist-lib/capture-contract.mjs +1 -1
  27. package/dist-lib/cli-constants.cjs +1 -1
  28. package/dist-lib/cloud-contract.cjs +1 -1
  29. package/dist-lib/cloud-contract.mjs +1 -1
  30. package/dist-lib/cloud-test-args.cjs +1 -1
  31. package/dist-lib/cloud-test-args.mjs +1 -1
  32. package/dist-lib/cloud.cjs +1 -1
  33. package/dist-lib/cloud.mjs +1 -1
  34. package/dist-lib/config.cjs +1 -1
  35. package/dist-lib/detox/index.cjs +89 -11
  36. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  37. package/dist-lib/home-paths.cjs +1 -1
  38. package/dist-lib/host/bridge-host.cjs +172 -30
  39. package/dist-lib/host/fetch-proxy-handler.cjs +45 -21
  40. package/dist-lib/host/fetch-proxy-overrides.cjs +2 -2
  41. package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
  42. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  43. package/dist-lib/host/websocket-proxy.cjs +1 -1
  44. package/dist-lib/index.cjs +78 -5
  45. package/dist-lib/jump-to-source-babel.cjs +1 -1
  46. package/dist-lib/jump-to-source-native.cjs +1 -1
  47. package/dist-lib/kotlin-host.cjs +1 -1
  48. package/dist-lib/menu.cjs +1 -1
  49. package/dist-lib/menu.mjs +1 -1
  50. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  51. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  52. package/dist-lib/metro-production-bundle.cjs +1 -1
  53. package/dist-lib/metro-production-bundle.mjs +1 -1
  54. package/dist-lib/metro.cjs +1 -1
  55. package/dist-lib/native-app-identity.cjs +1 -1
  56. package/dist-lib/native-app-identity.mjs +1 -1
  57. package/dist-lib/native-firebase-metadata.cjs +1 -1
  58. package/dist-lib/native-firebase-metadata.mjs +1 -1
  59. package/dist-lib/plist.cjs +1 -1
  60. package/dist-lib/plist.mjs +1 -1
  61. package/dist-lib/profiles.cjs +1 -1
  62. package/dist-lib/public-brand.cjs +1 -1
  63. package/dist-lib/react-native-host-modules.cjs +1 -1
  64. package/dist-lib/react-native-host-modules.mjs +1 -1
  65. package/dist-lib/render-mode.cjs +1 -1
  66. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  67. package/dist-lib/sdk.cjs +1 -1
  68. package/dist-lib/sdk.mjs +1 -1
  69. package/dist-lib/skills.cjs +331 -51
  70. package/dist-lib/swift-compile.cjs +8 -2
  71. package/dist-lib/swift-compile.mjs +8 -2
  72. package/dist-lib/swift-package.cjs +1 -1
  73. package/dist-lib/swift-package.mjs +1 -1
  74. package/dist-lib/swift-submit.cjs +2 -2
  75. package/dist-lib/swift-submit.mjs +2 -2
  76. package/dist-lib/swift-toolchain.cjs +1 -1
  77. package/dist-lib/swift.cjs +1 -1
  78. package/dist-lib/vite-swift.cjs +9 -3
  79. package/dist-lib/vite.cjs +1 -1
  80. package/package.json +2 -1
  81. package/src/host/bridge-host.ts +65 -0
  82. package/src/host/fetch-proxy-handler.ts +52 -23
  83. package/src/host/fetch-proxy-overrides.ts +5 -1
  84. package/src/host/fetch-proxy-transport.ts +82 -0
  85. package/src/runtime-assets.ts +1 -1
  86. package/src/swift-compile.ts +8 -2
  87. package/src/swift-submit.ts +2 -1
package/detox/index.ts CHANGED
@@ -473,13 +473,17 @@ async function closeBrowser() {
473
473
  }
474
474
  }
475
475
 
476
+ // transitionStartWindowMs is how long to wait for a screen transition that an
477
+ // action just requested to begin. a wait that follows no new input passes 0: a
478
+ // transition already running is still waited out, but none can start.
476
479
  export async function waitForSootsimIdle(
477
480
  page: Page,
478
481
  maxMs = 3000,
479
482
  strict = false,
483
+ transitionStartWindowMs = 600,
480
484
  ): Promise<void> {
481
485
  const result = await page.evaluate(
482
- async ({ maxMs, strict }) => {
486
+ async ({ maxMs, strict, transitionStartWindowMs }) => {
483
487
  const start = Date.now()
484
488
  let transitionError: string | null = null
485
489
  try {
@@ -489,7 +493,7 @@ export async function waitForSootsimIdle(
489
493
  const transitionResult = await waitForScreenTransitions({
490
494
  timeoutMs: Math.min(maxMs, 1800),
491
495
  settleMs: 48,
492
- startWindowMs: 600,
496
+ startWindowMs: transitionStartWindowMs,
493
497
  })
494
498
  if (transitionResult?.timedOut) {
495
499
  return {
@@ -591,12 +595,14 @@ export async function waitForSootsimIdle(
591
595
  elapsed: Date.now() - start,
592
596
  reason: transitionError
593
597
  ? `layout fallback after screen transition wait failed: ${transitionError}`
594
- : strict
595
- ? `strict idle state unavailable: renderStats=${lastSnapshot?.renderStatsAvailable === true} animating=${lastSnapshot?.animating === true} layoutDirty=${lastSnapshot?.layoutDirty === true} layoutNodes=${(lastSnapshot?.layout.length ?? 0) / 4} aux=${JSON.stringify(lastSnapshot?.auxSurfaceDebug)}`
596
- : 'layout fallback',
598
+ : !lastSnapshot
599
+ ? 'deadline spent before the first idle poll'
600
+ : strict
601
+ ? `strict idle state unavailable: renderStats=${lastSnapshot?.renderStatsAvailable === true} animating=${lastSnapshot?.animating === true} layoutDirty=${lastSnapshot?.layoutDirty === true} layoutNodes=${(lastSnapshot?.layout.length ?? 0) / 4} aux=${JSON.stringify(lastSnapshot?.auxSurfaceDebug)}`
602
+ : 'layout fallback',
597
603
  }
598
604
  },
599
- { maxMs, strict },
605
+ { maxMs, strict, transitionStartWindowMs },
600
606
  )
601
607
 
602
608
  if (!result?.settled) {
@@ -868,7 +874,14 @@ async function captureSootsimPng(opts?: {
868
874
  let identicalFrames = 1
869
875
  let attempts = 0
870
876
  while (Date.now() < deadline) {
871
- await waitForSootsimIdle(page, Math.max(1, deadline - Date.now()), true)
877
+ // only the first wait follows the caller's last input; later frames in
878
+ // this transaction dispatch nothing that could start a transition.
879
+ await waitForSootsimIdle(
880
+ page,
881
+ Math.max(1, deadline - Date.now()),
882
+ true,
883
+ attempts === 0 ? 600 : 0,
884
+ )
872
885
  const current = await captureSootsimPngFast(opts)
873
886
  attempts++
874
887
  if (framesIdentical(previous, current)) {
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.709 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.711 | (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.709 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.711 | (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.709 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.711 | (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.709 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.711 | (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.709 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.711 | (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.709 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.711 | (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.709 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.711 | (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.709 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.711 | (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.709 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.711 | (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.709 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.711 | (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.709 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.711 | (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.709 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.711 | (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.709 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.711 | (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.709 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.711 | (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.709 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.711 | (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.709 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.711 | (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.709 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.711 | (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.709 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.711 | (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.709 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.711 | (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.709 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.711 | (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.709 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.711 | (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.709 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.711 | (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.709 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.711 | (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.709 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.711 | (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.709 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.711 | (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;
@@ -2244,6 +2244,7 @@ var import_fs = require("fs");
2244
2244
  var import_module = require("module");
2245
2245
  var cached = null;
2246
2246
  var cachedComm = null;
2247
+ var cachedPgid = null;
2247
2248
  function getParentPid(pid) {
2248
2249
  if (!cached) cached = build();
2249
2250
  try {
@@ -2260,6 +2261,14 @@ function getProcessComm(pid) {
2260
2261
  return null;
2261
2262
  }
2262
2263
  }
2264
+ function getProcessPgid(pid) {
2265
+ if (!cachedPgid) cachedPgid = buildPgid();
2266
+ try {
2267
+ return cachedPgid(pid);
2268
+ } catch {
2269
+ return null;
2270
+ }
2271
+ }
2263
2272
  function buildComm() {
2264
2273
  if (process.platform === "linux") {
2265
2274
  return (pid) => {
@@ -2293,6 +2302,31 @@ function build() {
2293
2302
  }
2294
2303
  return () => null;
2295
2304
  }
2305
+ function buildPgid() {
2306
+ if (process.platform === "linux") {
2307
+ return (pid) => {
2308
+ try {
2309
+ const raw = (0, import_fs.readFileSync)(`/proc/${pid}/stat`, "utf8");
2310
+ const end = raw.lastIndexOf(")");
2311
+ if (end < 0) return null;
2312
+ const rest = raw.slice(end + 1).trim().split(/\s+/);
2313
+ const pgid = Number(rest[2]);
2314
+ return Number.isFinite(pgid) && pgid > 0 ? pgid : null;
2315
+ } catch {
2316
+ return null;
2317
+ }
2318
+ };
2319
+ }
2320
+ if (process.platform === "darwin") {
2321
+ const ffi = tryBuildDarwinPgidFfi();
2322
+ if (ffi) return ffi;
2323
+ return (pid) => {
2324
+ const pgid = readProcessTable().get(pid)?.pgid;
2325
+ return pgid !== void 0 && pgid > 0 ? pgid : null;
2326
+ };
2327
+ }
2328
+ return () => null;
2329
+ }
2296
2330
  var PROCESS_TABLE_TTL_MS = 2e3;
2297
2331
  var processTable = { readAt: 0, rows: /* @__PURE__ */ new Map() };
2298
2332
  function readProcessTable() {
@@ -2302,18 +2336,19 @@ function readProcessTable() {
2302
2336
  }
2303
2337
  const rows = /* @__PURE__ */ new Map();
2304
2338
  try {
2305
- const out = (0, import_child_process.execFileSync)("ps", ["-eo", "pid=,ppid=,comm="], {
2339
+ const out = (0, import_child_process.execFileSync)("ps", ["-eo", "pid=,ppid=,pgid=,comm="], {
2306
2340
  encoding: "utf8",
2307
2341
  timeout: 5e3,
2308
2342
  maxBuffer: 8 * 1024 * 1024,
2309
2343
  stdio: ["ignore", "pipe", "ignore"]
2310
2344
  });
2311
2345
  for (const line of out.split("\n")) {
2312
- const parsed = line.trim().match(/^(\d+)\s+(\d+)\s+(.*)$/);
2346
+ const parsed = line.trim().match(/^(\d+)\s+(\d+)\s+(\d+)\s+(.*)$/);
2313
2347
  if (!parsed) continue;
2314
2348
  rows.set(Number(parsed[1]), {
2315
2349
  ppid: Number(parsed[2]),
2316
- comm: (parsed[3].split("/").at(-1) ?? "").slice(0, PBI_COMM_LEN)
2350
+ pgid: Number(parsed[3]),
2351
+ comm: (parsed[4].split("/").at(-1) ?? "").slice(0, PBI_COMM_LEN)
2317
2352
  });
2318
2353
  }
2319
2354
  } catch {
@@ -2390,6 +2425,31 @@ function tryBuildDarwinCommFfi() {
2390
2425
  return null;
2391
2426
  }
2392
2427
  }
2428
+ var PBI_PGID_OFFSET = 100;
2429
+ function tryBuildDarwinPgidFfi() {
2430
+ if (!process.versions?.bun) return null;
2431
+ try {
2432
+ const r = (0, import_module.createRequire)(__sootsim_import_meta_url);
2433
+ const { dlopen, FFIType } = r("bun:ffi");
2434
+ const lib = dlopen("/usr/lib/libproc.dylib", {
2435
+ proc_pidinfo: {
2436
+ args: [FFIType.i32, FFIType.i32, FFIType.u64, FFIType.ptr, FFIType.i32],
2437
+ returns: FFIType.i32
2438
+ }
2439
+ });
2440
+ const buf = Buffer.alloc(PROC_BSDINFO_SIZE);
2441
+ return (pid) => {
2442
+ const ret = Number(
2443
+ lib.symbols.proc_pidinfo(pid, PROC_PIDTBSDINFO, 0n, buf, PROC_BSDINFO_SIZE)
2444
+ );
2445
+ if (ret <= 0) return null;
2446
+ const pgid = buf.readUInt32LE(PBI_PGID_OFFSET);
2447
+ return pgid > 0 ? pgid : null;
2448
+ };
2449
+ } catch {
2450
+ return null;
2451
+ }
2452
+ }
2393
2453
 
2394
2454
  // cli/secure-file.ts
2395
2455
  var import_node_crypto = require("node:crypto");
@@ -2484,6 +2544,15 @@ function getCliIdentity() {
2484
2544
  function getCliIdentityKey() {
2485
2545
  return getCliIdentity().key;
2486
2546
  }
2547
+ function getStableOwnerPid() {
2548
+ return findTopAncestor(process.ppid);
2549
+ }
2550
+ function getOwnerProcessGroupId() {
2551
+ const owner = getStableOwnerPid();
2552
+ if (!owner || owner <= 1) return null;
2553
+ const pgid = getProcessPgid(owner);
2554
+ return pgid !== null && pgid > 1 ? pgid : null;
2555
+ }
2487
2556
  function getCurrentSimPath() {
2488
2557
  if (process.env[CURRENT_SIM_PATH_ENV]) {
2489
2558
  return (0, import_path.resolve)(process.env[CURRENT_SIM_PATH_ENV]);
@@ -2604,7 +2673,11 @@ function createBridge(wsPort, opts = {}) {
2604
2673
  id: 0,
2605
2674
  cliIdentityKey: identity.key,
2606
2675
  cliIdentitySource: identity.source,
2607
- cliLabel: opts.cliLabel
2676
+ cliLabel: opts.cliLabel,
2677
+ // lets the bridge free this cli's leases once its owning
2678
+ // session is entirely gone, instead of blocking others
2679
+ // until the TTL burns out. null when ancestry is unreadable.
2680
+ cliOwnerPgid: getOwnerProcessGroupId()
2608
2681
  })
2609
2682
  );
2610
2683
  } catch {
@@ -4213,9 +4286,9 @@ async function closeBrowser() {
4213
4286
  throw closeError;
4214
4287
  }
4215
4288
  }
4216
- async function waitForSootsimIdle(page, maxMs = 3e3, strict = false) {
4289
+ async function waitForSootsimIdle(page, maxMs = 3e3, strict = false, transitionStartWindowMs = 600) {
4217
4290
  const result = await page.evaluate(
4218
- async ({ maxMs: maxMs2, strict: strict2 }) => {
4291
+ async ({ maxMs: maxMs2, strict: strict2, transitionStartWindowMs: transitionStartWindowMs2 }) => {
4219
4292
  const start = Date.now();
4220
4293
  let transitionError = null;
4221
4294
  try {
@@ -4224,7 +4297,7 @@ async function waitForSootsimIdle(page, maxMs = 3e3, strict = false) {
4224
4297
  const transitionResult = await waitForScreenTransitions({
4225
4298
  timeoutMs: Math.min(maxMs2, 1800),
4226
4299
  settleMs: 48,
4227
- startWindowMs: 600
4300
+ startWindowMs: transitionStartWindowMs2
4228
4301
  });
4229
4302
  if (transitionResult?.timedOut) {
4230
4303
  return {
@@ -4310,10 +4383,10 @@ async function waitForSootsimIdle(page, maxMs = 3e3, strict = false) {
4310
4383
  return {
4311
4384
  settled: false,
4312
4385
  elapsed: Date.now() - start,
4313
- reason: transitionError ? `layout fallback after screen transition wait failed: ${transitionError}` : strict2 ? `strict idle state unavailable: renderStats=${lastSnapshot?.renderStatsAvailable === true} animating=${lastSnapshot?.animating === true} layoutDirty=${lastSnapshot?.layoutDirty === true} layoutNodes=${(lastSnapshot?.layout.length ?? 0) / 4} aux=${JSON.stringify(lastSnapshot?.auxSurfaceDebug)}` : "layout fallback"
4386
+ reason: transitionError ? `layout fallback after screen transition wait failed: ${transitionError}` : !lastSnapshot ? "deadline spent before the first idle poll" : strict2 ? `strict idle state unavailable: renderStats=${lastSnapshot?.renderStatsAvailable === true} animating=${lastSnapshot?.animating === true} layoutDirty=${lastSnapshot?.layoutDirty === true} layoutNodes=${(lastSnapshot?.layout.length ?? 0) / 4} aux=${JSON.stringify(lastSnapshot?.auxSurfaceDebug)}` : "layout fallback"
4314
4387
  };
4315
4388
  },
4316
- { maxMs, strict }
4389
+ { maxMs, strict, transitionStartWindowMs }
4317
4390
  );
4318
4391
  if (!result?.settled) {
4319
4392
  throw new Error(
@@ -4498,7 +4571,12 @@ async function captureSootsimPng(opts) {
4498
4571
  let identicalFrames = 1;
4499
4572
  let attempts = 0;
4500
4573
  while (Date.now() < deadline) {
4501
- await waitForSootsimIdle(page, Math.max(1, deadline - Date.now()), true);
4574
+ await waitForSootsimIdle(
4575
+ page,
4576
+ Math.max(1, deadline - Date.now()),
4577
+ true,
4578
+ attempts === 0 ? 600 : 0
4579
+ );
4502
4580
  const current = await captureSootsimPngFast(opts);
4503
4581
  attempts++;
4504
4582
  if ((0, import_proof_frame.framesIdentical)(previous, current)) {
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.709 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.711 | (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.709 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.711 | (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;