peachsim 0.1.1406 → 0.1.1463

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 (149) hide show
  1. package/LICENSE +8 -4
  2. package/README.md +22 -2
  3. package/cli/app-fonts.ts +50 -44
  4. package/cli/bin.ts +5 -4
  5. package/cli/bridge-diagnostics.ts +5 -0
  6. package/cli/bridge-flow-runner.ts +21 -13
  7. package/cli/cloud-client.ts +4 -3
  8. package/cli/commands/control.ts +155 -123
  9. package/cli/commands/daemon-mac-app.ts +3 -3
  10. package/cli/commands/daemon.ts +2 -2
  11. package/cli/commands/do-chain.ts +9 -2
  12. package/cli/commands/electron.ts +4 -1
  13. package/cli/commands/inspect/core.ts +1 -1
  14. package/cli/commands/inspect/settle.ts +19 -7
  15. package/cli/commands/inspect/settling.ts +92 -56
  16. package/cli/commands/inspect/wait-idle.ts +21 -9
  17. package/cli/commands/inspect/wait-ready.ts +22 -8
  18. package/cli/commands/inspect.ts +101 -134
  19. package/cli/commands/setup.ts +26 -16
  20. package/cli/commands/upgrade.ts +53 -9
  21. package/cli/desktop-companion.ts +1 -1
  22. package/cli/drivers/playwright-sim-host.ts +22 -13
  23. package/cli/drivers/playwright.ts +3 -3
  24. package/cli/main.ts +14 -5
  25. package/cli/outbound-endpoints.ts +1 -9
  26. package/detox/index.ts +6 -1
  27. package/dist-lib/agent-daemon-client.cjs +1 -1
  28. package/dist-lib/agent-events.cjs +1 -1
  29. package/dist-lib/attached-projects.cjs +1 -1
  30. package/dist-lib/auth/shared-session.cjs +1 -1
  31. package/dist-lib/backend-origin.cjs +1 -1
  32. package/dist-lib/beta.cjs +1 -1
  33. package/dist-lib/beta.mjs +1 -1
  34. package/dist-lib/bridge-constants.cjs +1 -1
  35. package/dist-lib/bridge-contract-input.cjs +1 -1
  36. package/dist-lib/bridge-contract-input.mjs +1 -1
  37. package/dist-lib/bridge-contract.cjs +3 -3
  38. package/dist-lib/bridge-contract.mjs +3 -3
  39. package/dist-lib/bundle-channel.cjs +322 -274
  40. package/dist-lib/capture-contract.cjs +1 -1
  41. package/dist-lib/capture-contract.mjs +1 -1
  42. package/dist-lib/cloud-contract.cjs +1 -1
  43. package/dist-lib/cloud-contract.mjs +1 -1
  44. package/dist-lib/cloud-test-args.cjs +1 -1
  45. package/dist-lib/cloud-test-args.mjs +1 -1
  46. package/dist-lib/cloud.cjs +1 -1
  47. package/dist-lib/cloud.mjs +1 -1
  48. package/dist-lib/config.cjs +1 -1
  49. package/dist-lib/config.mjs +1 -1
  50. package/dist-lib/detox/index.cjs +322 -45
  51. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  52. package/dist-lib/expo-swift-bundle.cjs +69 -33
  53. package/dist-lib/expo-swift-metadata.cjs +1 -1
  54. package/dist-lib/expo-swift-metadata.mjs +1 -1
  55. package/dist-lib/home-paths.cjs +1 -1
  56. package/dist-lib/host/bridge-host.cjs +3650 -3528
  57. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  58. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  59. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  60. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  61. package/dist-lib/host/websocket-proxy.cjs +1 -1
  62. package/dist-lib/index.cjs +327 -123
  63. package/dist-lib/jump-to-source-babel.cjs +1 -1
  64. package/dist-lib/jump-to-source-native.cjs +1 -1
  65. package/dist-lib/kotlin-host.cjs +10 -5
  66. package/dist-lib/menu.cjs +1 -1
  67. package/dist-lib/menu.mjs +1 -1
  68. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  69. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  70. package/dist-lib/metro-production-bundle.cjs +1 -1
  71. package/dist-lib/metro-production-bundle.mjs +1 -1
  72. package/dist-lib/metro.cjs +49 -47
  73. package/dist-lib/native-app-identity-project.cjs +1 -1
  74. package/dist-lib/native-app-identity-project.mjs +1 -1
  75. package/dist-lib/native-app-identity.cjs +1 -1
  76. package/dist-lib/native-app-identity.mjs +1 -1
  77. package/dist-lib/native-firebase-metadata.cjs +1 -1
  78. package/dist-lib/native-firebase-metadata.mjs +1 -1
  79. package/dist-lib/plist.cjs +1 -1
  80. package/dist-lib/plist.mjs +1 -1
  81. package/dist-lib/profiles.cjs +1 -1
  82. package/dist-lib/public-brand.cjs +1 -1
  83. package/dist-lib/react-native-host-modules.cjs +1 -1
  84. package/dist-lib/react-native-host-modules.mjs +1 -1
  85. package/dist-lib/scripts/dev-server-scanner.cjs +23 -17
  86. package/dist-lib/sdk.cjs +99 -61
  87. package/dist-lib/sdk.mjs +97 -61
  88. package/dist-lib/skills.cjs +2959 -2780
  89. package/dist-lib/swift-compile.cjs +26 -12
  90. package/dist-lib/swift-compile.mjs +26 -12
  91. package/dist-lib/swift-package.cjs +1 -1
  92. package/dist-lib/swift-package.mjs +1 -1
  93. package/dist-lib/swift-submit.cjs +2 -2
  94. package/dist-lib/swift-submit.mjs +2 -2
  95. package/dist-lib/swift-toolchain.cjs +1 -1
  96. package/dist-lib/swift.cjs +1 -1
  97. package/dist-lib/vite-swift.cjs +66 -31
  98. package/dist-lib/vite.cjs +1 -1
  99. package/dist-lib/worklet-executable.cjs +1 -1
  100. package/dist-lib/worklet-executable.mjs +1 -1
  101. package/kotlin/AppSources/android/view/Window.kt +2 -0
  102. package/kotlin/AppSources/dev/peach/app/PeachApp.kt +1 -1
  103. package/kotlin/ComposeSources/PeachComposeHost.kt +35 -9
  104. package/kotlin/ExpoComposeSources/dev/peach/expo/PeachExpoCompose.kt +2 -2
  105. package/kotlin/ExpoSources/dev/peach/expo/PeachExpoRuntime.kt +9 -6
  106. package/kotlin/ExpoSources/dev/peach/expo/PeachExpoTypes.kt +4 -4
  107. package/kotlin/ExpoSources/expo/modules/kotlin/modules/Module.kt +2 -2
  108. package/kotlin/ExpoSources/expo/modules/kotlin/viewevent/ViewEvent.kt +22 -8
  109. package/kotlin/ExpoSources/expo/modules/kotlin/views/ExpoView.kt +0 -3
  110. package/kotlin/ExpoSources/expo/modules/kotlin/views/ViewDefinitionBuilder.kt +10 -9
  111. package/kotlin/ExpoSources/expo/modules/kotlin/views/ViewProps.kt +6 -5
  112. package/kotlin/fixtures/import-drawing/Drawing.d.kt.ts +7 -0
  113. package/kotlin/fixtures/import-drawing/Drawing.kt +101 -0
  114. package/kotlin/fixtures/import-drawing/ImportDrawing.native.tsx +18 -0
  115. package/kotlin/fixtures/import-drawing/README.md +34 -0
  116. package/kotlin/fixtures/import-drawing/app/_layout.tsx +4 -0
  117. package/kotlin/fixtures/import-drawing/app/index+spa.tsx +1 -0
  118. package/kotlin/fixtures/import-drawing/package.json +23 -0
  119. package/kotlin/fixtures/import-drawing/tsconfig.json +20 -0
  120. package/kotlin/fixtures/import-drawing/vite.config.ts +20 -0
  121. package/kotlin/fixtures/import-scroll/ImportNested.native.tsx +10 -0
  122. package/kotlin/fixtures/import-scroll/Nested.d.kt.ts +4 -0
  123. package/kotlin/fixtures/import-scroll/README.md +15 -0
  124. package/kotlin/fixtures/import-scroll/app/nested+spa.tsx +1 -0
  125. package/kotlin/fixtures/import-values/ImportValues.native.tsx +26 -0
  126. package/kotlin/fixtures/import-values/README.md +6 -1
  127. package/kotlin/fixtures/import-values/Values.d.kt.ts +4 -0
  128. package/kotlin/fixtures/import-values/Values.kt +18 -0
  129. package/kotlin/tools/expo-types.main.kts +17 -5
  130. package/package.json +2 -1
  131. package/scripts/dev-server-scanner.ts +33 -23
  132. package/src/assetCatalogContract.ts +7 -0
  133. package/src/bridge-contract.ts +21 -3
  134. package/src/connect.ts +18 -5
  135. package/src/desktop-host-delivery.ts +33 -3
  136. package/src/expo-swift-host.ts +6 -3
  137. package/src/host/bridge-host.ts +2 -0
  138. package/src/host/fetch-proxy-transport.ts +8 -0
  139. package/src/kotlin-host.ts +11 -5
  140. package/src/native-firebase-config.ts +95 -54
  141. package/src/process-output.ts +16 -0
  142. package/src/sdk.ts +6 -1
  143. package/src/sim-client.ts +6 -1
  144. package/src/swift-compile.ts +36 -15
  145. package/src/swift-distribution.lock.json +8 -8
  146. package/src/swift-standin-emit.ts +10 -1
  147. package/src/swift-standins.ts +21 -7
  148. package/src/swift-submit.ts +6 -1
  149. /package/kotlin/fixtures/{kotlin-app-variants → import-scroll}/Nested.kt +0 -0
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1406 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1463 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1406 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1463 | (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
- /*! peach v0.1.1406 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1463 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1406 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1463 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/cloud-contract.ts
4
4
  var RNX_CLOUD_MAX_ARTIFACT_BYTES = 40761776;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1406 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1463 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1406 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1463 | (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
- /*! peach v0.1.1406 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1463 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1406 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1463 | (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
- /*! peach v0.1.1406 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1463 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1406 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1463 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/config.ts
4
4
  import { isValidRuntimeVersion } from "@contrast/runtime-delivery/version";
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1406 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1463 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1822,13 +1822,22 @@ function platformChromeLaunch(launch, opts, rendererTarget, policy = {}) {
1822
1822
  return browser;
1823
1823
  };
1824
1824
  }
1825
- function softwareChromeLaunchOptions(opts) {
1825
+ function softwareChromeLaunchOptions(opts, runtime = currentRuntime()) {
1826
1826
  if (opts.ignoreDefaultArgs === true) {
1827
1827
  throw new Error(
1828
1828
  "[reap-browser] ignoreDefaultArgs=true bypasses required Chrome launch defaults"
1829
1829
  );
1830
1830
  }
1831
1831
  const callerArgs = Array.isArray(opts.args) ? opts.args.map(String) : [];
1832
+ if (runtime.platform === "linux" && runtime.env.PEACH_NATIVE_COMPOSITOR === "1") {
1833
+ const native = {
1834
+ ...opts,
1835
+ args: [...callerArgs, "--disable-gpu"]
1836
+ };
1837
+ delete native.channel;
1838
+ delete native.executablePath;
1839
+ return native;
1840
+ }
1832
1841
  const unmanagedCallerArgs = callerArgs.filter((arg) => {
1833
1842
  return !arg.startsWith("--use-angle=") && arg !== "--enable-gpu" && arg !== "--enable-gpu-rasterization" && arg !== "--enable-zero-copy" && arg !== "--ignore-gpu-blocklist" && arg !== "--disable-gpu-watchdog" && arg !== "--enable-skia-graphite" && !/^--enable-unsafe-webgpu(?:=.*)?$/i.test(arg) && !/^--enable-unsafe-swiftshader(?:=.*)?$/i.test(arg);
1834
1843
  });
@@ -1868,7 +1877,7 @@ function chromeLaunchOptions(opts = {}, runtime = currentRuntime()) {
1868
1877
  if (signalShutdownClaimed) {
1869
1878
  opts = { ...opts, handleSIGINT: false, handleSIGTERM: false, handleSIGHUP: false };
1870
1879
  }
1871
- return softwareChromeAllowed(runtime) ? softwareChromeLaunchOptions(opts) : gpuChromeLaunchOptions(opts, runtime);
1880
+ return softwareChromeAllowed(runtime) ? softwareChromeLaunchOptions(opts, runtime) : gpuChromeLaunchOptions(opts, runtime);
1872
1881
  }
1873
1882
  async function launchReapedChromeScoped(launch, opts = {}, rendererTarget, policy = {}) {
1874
1883
  return launchReapedScoped(
@@ -2404,14 +2413,14 @@ function withFrameEmbedderHeaders(headers) {
2404
2413
  ];
2405
2414
  }
2406
2415
  function firstPartyCookie(line, url) {
2407
- let location;
2416
+ let location2;
2408
2417
  try {
2409
- location = new URL(url);
2418
+ location2 = new URL(url);
2410
2419
  } catch {
2411
2420
  return null;
2412
2421
  }
2413
- const loopback = ["localhost", "127.0.0.1", "[::1]"].includes(location.hostname);
2414
- if (location.protocol !== "https:" && !(location.protocol === "http:" && loopback))
2422
+ const loopback = ["localhost", "127.0.0.1", "[::1]"].includes(location2.hostname);
2423
+ if (location2.protocol !== "https:" && !(location2.protocol === "http:" && loopback))
2415
2424
  return null;
2416
2425
  const [pair = "", ...attributes] = line.split(";");
2417
2426
  const separator = pair.indexOf("=");
@@ -2419,8 +2428,8 @@ function firstPartyCookie(line, url) {
2419
2428
  const cookie = {
2420
2429
  name: pair.slice(0, separator).trim(),
2421
2430
  value: pair.slice(separator + 1).trim(),
2422
- domain: location.hostname,
2423
- path: location.pathname.slice(0, location.pathname.lastIndexOf("/")) || "/",
2431
+ domain: location2.hostname,
2432
+ path: location2.pathname.slice(0, location2.pathname.lastIndexOf("/")) || "/",
2424
2433
  expires: -1,
2425
2434
  httpOnly: false,
2426
2435
  secure: true,
@@ -2436,7 +2445,7 @@ function firstPartyCookie(line, url) {
2436
2445
  if (key === "path" && value.startsWith("/")) cookie.path = value;
2437
2446
  if (key === "domain" && value) {
2438
2447
  const domain = value.replace(/^\./, "").toLowerCase();
2439
- if (location.hostname !== domain && !location.hostname.endsWith("." + domain))
2448
+ if (location2.hostname !== domain && !location2.hostname.endsWith("." + domain))
2440
2449
  return null;
2441
2450
  cookie.domain = "." + domain;
2442
2451
  }
@@ -2516,7 +2525,7 @@ function webViewAutomationNames(timingName, bootstrapSource) {
2516
2525
  bootstrapSource: `(${bootstrapSource})(${JSON.stringify(timingName)});`
2517
2526
  };
2518
2527
  }
2519
- async function automateWebViewFrames(context, names, helpers) {
2528
+ async function automateWebViewFrames(context, names, helpers, tenantWorkers) {
2520
2529
  await context.addInitScript({ content: names.bootstrapSource });
2521
2530
  const browser = context.browser();
2522
2531
  if (!browser) throw new Error("webview automation needs the browser behind its context");
@@ -2538,7 +2547,7 @@ async function automateWebViewFrames(context, names, helpers) {
2538
2547
  const expoPromptHeader = "__EXPO_DOM_WEBVIEW_JS_EVAL__";
2539
2548
  const evaluateExpoPrompt = (page, instanceId, webViewId, message) => {
2540
2549
  return new Promise((resolve2) => {
2541
- const workers = page.workers();
2550
+ const workers = tenantWorkers(page);
2542
2551
  let pending = workers.length;
2543
2552
  if (pending === 0) resolve2(null);
2544
2553
  for (const worker of workers) {
@@ -2828,9 +2837,18 @@ async function automateWebViewFrames(context, names, helpers) {
2828
2837
  );
2829
2838
  return answer;
2830
2839
  };
2831
- await browserSession.send("Fetch.enable", {
2832
- patterns: [{ urlPattern: "*", requestStage: "Request" }]
2833
- });
2840
+ let pausesEveryRequest = null;
2841
+ const pauseRequests = async () => {
2842
+ const every = byInstance.size > 0;
2843
+ if (every === pausesEveryRequest) return;
2844
+ pausesEveryRequest = every;
2845
+ await browserSession.send("Fetch.enable", {
2846
+ patterns: [
2847
+ every ? { urlPattern: "*", requestStage: "Request" } : { urlPattern: "*", resourceType: "Document", requestStage: "Request" }
2848
+ ]
2849
+ });
2850
+ };
2851
+ await pauseRequests();
2834
2852
  browserSession.on("Fetch.requestPaused", (event) => {
2835
2853
  const requestId = event.requestId;
2836
2854
  const frameId = typeof event.frameId === "string" ? event.frameId : "";
@@ -2965,18 +2983,18 @@ async function automateWebViewFrames(context, names, helpers) {
2965
2983
  responseHeaders: helpers.withFrameEmbedderHeaders(helpers.withoutFramingRefusals(received)).filter((header) => !/^content-(encoding|length)$/i.test(header.name)),
2966
2984
  body: ""
2967
2985
  });
2968
- const location = received.find((header) => header.name.toLowerCase() === "location");
2969
- if (location) {
2986
+ const location2 = received.find((header) => header.name.toLowerCase() === "location");
2987
+ if (location2) {
2970
2988
  let target = "";
2971
2989
  try {
2972
- target = new URL(location.value, event.request.url).href;
2990
+ target = new URL(location2.value, event.request.url).href;
2973
2991
  } catch {
2974
2992
  }
2975
2993
  if (helpers.isAppScheme(target))
2976
2994
  reportSchemeNavigation(bound.page, bound.instanceId, target);
2977
2995
  }
2978
- if (bound.navigation && location) {
2979
- const target = new URL(location.value, event.request.url).href;
2996
+ if (bound.navigation && location2) {
2997
+ const target = new URL(location2.value, event.request.url).href;
2980
2998
  if (bound.load) {
2981
2999
  const discardBody = (status === 301 || status === 302) && bound.load.method === "POST" || status === 303 && bound.load.method !== "HEAD";
2982
3000
  bound.load = {
@@ -3088,6 +3106,7 @@ async function automateWebViewFrames(context, names, helpers) {
3088
3106
  });
3089
3107
  }
3090
3108
  byInstance.delete(request.instanceId);
3109
+ await pauseRequests();
3091
3110
  return;
3092
3111
  }
3093
3112
  if (request.kind === "tap") {
@@ -3151,6 +3170,7 @@ async function automateWebViewFrames(context, names, helpers) {
3151
3170
  };
3152
3171
  byFrameId.set(frameId, bound);
3153
3172
  byInstance.set(request.instanceId, bound);
3173
+ await pauseRequests();
3154
3174
  await followFrameProcesses(source.page);
3155
3175
  if (request.beforeContent && !beforeKeys.has(request.beforeKey)) {
3156
3176
  beforeKeys.add(request.beforeKey);
@@ -3370,6 +3390,42 @@ ${WEBVIEW_FRAME_COLOR_SCHEME_SOURCE} var webKit = config.webKit || null;
3370
3390
  setMessageHandlers(webKit.messageHandlers);
3371
3391
  }
3372
3392
  var userScripts = (webKit ? webKit.userScripts : []).slice();
3393
+ if (webKit) {
3394
+ var themeColorFramePending = false;
3395
+ var reportedThemeColor;
3396
+ var themeColorContext;
3397
+ function reportThemeColor() {
3398
+ themeColorFramePending = false;
3399
+ var meta = document.querySelector('meta[name="theme-color"]');
3400
+ var content = meta && meta.getAttribute('content');
3401
+ var color = null;
3402
+ if (content && CSS.supports('color', content)) {
3403
+ if (!themeColorContext) {
3404
+ var canvas = document.createElement('canvas');
3405
+ canvas.width = canvas.height = 1;
3406
+ themeColorContext = canvas.getContext('2d', { willReadFrequently: true });
3407
+ if (!themeColorContext) throw new Error('WKWebView theme color has no color context');
3408
+ }
3409
+ themeColorContext.clearRect(0, 0, 1, 1);
3410
+ themeColorContext.fillStyle = content;
3411
+ themeColorContext.fillRect(0, 0, 1, 1);
3412
+ color = Array.from(themeColorContext.getImageData(0, 0, 1, 1).data, function(value) { return value / 255; });
3413
+ }
3414
+ var serialized = JSON.stringify(color);
3415
+ if (serialized === reportedThemeColor) return;
3416
+ reportedThemeColor = serialized;
3417
+ window.parent.postMessage({ __sootsimWebViewKind: 'webKitThemeColor', navigation: webKit.navigation, color: color }, '*');
3418
+ }
3419
+ function scheduleThemeColor() {
3420
+ if (document.readyState !== 'complete' || themeColorFramePending) return;
3421
+ themeColorFramePending = true;
3422
+ requestAnimationFrame(reportThemeColor);
3423
+ }
3424
+ document.addEventListener('DOMContentLoaded', function() {
3425
+ new MutationObserver(scheduleThemeColor).observe(document.head, { childList: true, subtree: true, attributes: true, attributeFilter: ['name', 'content', 'media'] });
3426
+ }, { once: true });
3427
+ window.addEventListener('load', scheduleThemeColor, { once: true });
3428
+ }
3373
3429
  userScripts.filter(function(script) { return script.time === 0; }).forEach(function(script) { (0,eval)(script.source); });
3374
3430
  document.addEventListener('DOMContentLoaded', function() {
3375
3431
  userScripts.filter(function(script) { return script.time === 1; }).forEach(function(script) { (0,eval)(script.source); });
@@ -3587,7 +3643,8 @@ ${WEBVIEW_FRAME_COLOR_SCHEME_SOURCE} var webKit = config.webKit || null;
3587
3643
  } catch (_) {
3588
3644
  return;
3589
3645
  }
3590
- if (target.origin === base.origin &&
3646
+ var shouldPerformDownload = anchor.hasAttribute('download');
3647
+ if (!shouldPerformDownload && target.origin === base.origin &&
3591
3648
  target.pathname === base.pathname &&
3592
3649
  target.search === base.search) {
3593
3650
  // the document carries a <base href> for source.baseUrl, so the
@@ -3618,6 +3675,7 @@ ${WEBVIEW_FRAME_COLOR_SCHEME_SOURCE} var webKit = config.webKit || null;
3618
3675
  requestId: requestId,
3619
3676
  url: String(target),
3620
3677
  navigationType: 'click',
3678
+ shouldPerformDownload: shouldPerformDownload,
3621
3679
  sameDocument: false
3622
3680
  }, '*');
3623
3681
  });
@@ -4227,11 +4285,31 @@ var AUTOMATION_SIM_IDLE_REAP_TTL_MS = 5 * 6e4;
4227
4285
  // src/home-paths.ts
4228
4286
  var DAEMON_LOCKFILE_MAX_BYTES = 16 * 1024;
4229
4287
 
4288
+ // ../peach-engine/src/tenant-bundle-mode.ts
4289
+ var import_metro_production_bundle = require("peachsim/metro-production-bundle");
4290
+
4291
+ // ../peach-engine/src/development-mode.ts
4292
+ var bridgeConstants = __toESM(require("peachsim/bridge-constants"), 1);
4293
+
4294
+ // ../peach-engine/src/tenant-runtime-environment.ts
4295
+ function readBrowserLocation() {
4296
+ try {
4297
+ return typeof location === "undefined" ? null : location;
4298
+ } catch {
4299
+ return null;
4300
+ }
4301
+ }
4302
+ var nativeRuntimeLocation = readBrowserLocation();
4303
+
4304
+ // ../peach-engine/src/development-mode.ts
4305
+ var { DEFAULT_SOOTSIM_BRIDGE_PORT: DEFAULT_SOOTSIM_BRIDGE_PORT2 } = bridgeConstants;
4306
+ var DAEMON_RUNTIME_PORT_MAX = DEFAULT_SOOTSIM_BRIDGE_PORT2 + 10;
4307
+
4230
4308
  // ../peach-engine/src/metro-fingerprint-registry-client.ts
4231
4309
  var import_metro_fingerprint_registry = require("peachsim/metro-fingerprint-registry");
4232
4310
 
4233
4311
  // ../peach-engine/src/metro-fingerprint.ts
4234
- var import_metro_production_bundle = require("peachsim/metro-production-bundle");
4312
+ var import_metro_production_bundle2 = require("peachsim/metro-production-bundle");
4235
4313
  var import_react_native_host_modules = require("peachsim/react-native-host-modules");
4236
4314
 
4237
4315
  // src/cloud-contract.ts
@@ -7370,6 +7448,196 @@ var RUNTIME_PLATFORM_ADAPTERS = Object.freeze({
7370
7448
  android: ANDROID_ADAPTER
7371
7449
  });
7372
7450
 
7451
+ // ../peach-engine/src/settings/dynamic-type.ts
7452
+ function textMetrics(fontSize, lineHeight, leading, ascent) {
7453
+ return Object.freeze({ fontSize, lineHeight, leading, ascent });
7454
+ }
7455
+ var IOS_UIKIT_TEXT_METRICS = Object.freeze({
7456
+ xs: Object.freeze({
7457
+ largeTitle: textMetrics(31, 36.994141, 1.005859, 29.516602),
7458
+ title1: textMetrics(25, 29.833984, 1.166016, 23.803711),
7459
+ title2: textMetrics(19, 22.673828, 1.326172, 18.09082),
7460
+ title3: textMetrics(17, 20.287109, 1.712891, 16.186523),
7461
+ headline: textMetrics(14, 16.707031, 2.292969, 13.330078),
7462
+ body: textMetrics(14, 16.707031, 2.292969, 13.330078),
7463
+ callout: textMetrics(13, 15.513672, 2.486328, 12.37793),
7464
+ subheadline: textMetrics(12, 14.320312, 1.679687, 11.425781),
7465
+ footnote: textMetrics(12, 14.320312, 1.679687, 11.425781),
7466
+ caption1: textMetrics(11, 13.126953, -0.126953, 10.473633),
7467
+ caption2: textMetrics(11, 13.126953, -0.126953, 10.473633)
7468
+ }),
7469
+ s: Object.freeze({
7470
+ largeTitle: textMetrics(32, 38.1875, 0.8125, 30.46875),
7471
+ title1: textMetrics(26, 31.027344, 0.972656, 24.755859),
7472
+ title2: textMetrics(20, 23.867188, 1.132812, 19.042969),
7473
+ title3: textMetrics(18, 21.480469, 1.519531, 17.138672),
7474
+ headline: textMetrics(15, 17.900391, 2.099609, 14.282227),
7475
+ body: textMetrics(15, 17.900391, 2.099609, 14.282227),
7476
+ callout: textMetrics(14, 16.707031, 2.292969, 13.330078),
7477
+ subheadline: textMetrics(13, 15.513672, 2.486328, 12.37793),
7478
+ footnote: textMetrics(12, 14.320312, 1.679687, 11.425781),
7479
+ caption1: textMetrics(11, 13.126953, -0.126953, 10.473633),
7480
+ caption2: textMetrics(11, 13.126953, -0.126953, 10.473633)
7481
+ }),
7482
+ m: Object.freeze({
7483
+ largeTitle: textMetrics(33, 39.380859, 0.619141, 31.420898),
7484
+ title1: textMetrics(27, 32.220703, 0.779297, 25.708008),
7485
+ title2: textMetrics(21, 25.060547, 0.939453, 19.995117),
7486
+ title3: textMetrics(19, 22.673828, 1.326172, 18.09082),
7487
+ headline: textMetrics(16, 19.09375, 1.90625, 15.234375),
7488
+ body: textMetrics(16, 19.09375, 1.90625, 15.234375),
7489
+ callout: textMetrics(15, 17.900391, 2.099609, 14.282227),
7490
+ subheadline: textMetrics(14, 16.707031, 2.292969, 13.330078),
7491
+ footnote: textMetrics(12, 14.320312, 1.679687, 11.425781),
7492
+ caption1: textMetrics(11, 13.126953, -0.126953, 10.473633),
7493
+ caption2: textMetrics(11, 13.126953, -0.126953, 10.473633)
7494
+ }),
7495
+ l: Object.freeze({
7496
+ largeTitle: textMetrics(34, 40.574219, 0.425781, 32.373047),
7497
+ title1: textMetrics(28, 33.414062, 0.585937, 26.660156),
7498
+ title2: textMetrics(22, 26.253906, 1.746094, 20.947266),
7499
+ title3: textMetrics(20, 23.867188, 1.132812, 19.042969),
7500
+ headline: textMetrics(17, 20.287109, 1.712891, 16.186523),
7501
+ body: textMetrics(17, 20.287109, 1.712891, 16.186523),
7502
+ callout: textMetrics(16, 19.09375, 1.90625, 15.234375),
7503
+ subheadline: textMetrics(15, 17.900391, 2.099609, 14.282227),
7504
+ footnote: textMetrics(13, 15.513672, 2.486328, 12.37793),
7505
+ caption1: textMetrics(12, 14.320312, 1.679687, 11.425781),
7506
+ caption2: textMetrics(11, 13.126953, -0.126953, 10.473633)
7507
+ }),
7508
+ xl: Object.freeze({
7509
+ largeTitle: textMetrics(36, 42.960938, 0.039062, 34.277344),
7510
+ title1: textMetrics(30, 35.800781, 0.199219, 28.564453),
7511
+ title2: textMetrics(24, 28.640625, 1.359375, 22.851562),
7512
+ title3: textMetrics(22, 26.253906, 1.746094, 20.947266),
7513
+ headline: textMetrics(19, 22.673828, 1.326172, 18.09082),
7514
+ body: textMetrics(19, 22.673828, 1.326172, 18.09082),
7515
+ callout: textMetrics(18, 21.480469, 1.519531, 17.138672),
7516
+ subheadline: textMetrics(17, 20.287109, 1.712891, 16.186523),
7517
+ footnote: textMetrics(15, 17.900391, 2.099609, 14.282227),
7518
+ caption1: textMetrics(14, 16.707031, 2.292969, 13.330078),
7519
+ caption2: textMetrics(13, 15.513672, 2.486328, 12.37793)
7520
+ }),
7521
+ xxl: Object.freeze({
7522
+ largeTitle: textMetrics(38, 45.347656, 0.652344, 36.181641),
7523
+ title1: textMetrics(32, 38.1875, -0.1875, 30.46875),
7524
+ title2: textMetrics(26, 31.027344, 0.972656, 24.755859),
7525
+ title3: textMetrics(24, 28.640625, 1.359375, 22.851562),
7526
+ headline: textMetrics(21, 25.060547, 0.939453, 19.995117),
7527
+ body: textMetrics(21, 25.060547, 0.939453, 19.995117),
7528
+ callout: textMetrics(20, 23.867188, 1.132812, 19.042969),
7529
+ subheadline: textMetrics(19, 22.673828, 1.326172, 18.09082),
7530
+ footnote: textMetrics(17, 20.287109, 1.712891, 16.186523),
7531
+ caption1: textMetrics(16, 19.09375, 1.90625, 15.234375),
7532
+ caption2: textMetrics(15, 17.900391, 2.099609, 14.282227)
7533
+ }),
7534
+ xxxl: Object.freeze({
7535
+ largeTitle: textMetrics(40, 47.734375, 0.265625, 38.085938),
7536
+ title1: textMetrics(34, 40.574219, 0.425781, 32.373047),
7537
+ title2: textMetrics(28, 33.414062, 0.585937, 26.660156),
7538
+ title3: textMetrics(26, 31.027344, 0.972656, 24.755859),
7539
+ headline: textMetrics(23, 27.447266, 1.552734, 21.899414),
7540
+ body: textMetrics(23, 27.447266, 1.552734, 21.899414),
7541
+ callout: textMetrics(22, 26.253906, 1.746094, 20.947266),
7542
+ subheadline: textMetrics(21, 25.060547, 0.939453, 19.995117),
7543
+ footnote: textMetrics(19, 22.673828, 1.326172, 18.09082),
7544
+ caption1: textMetrics(18, 21.480469, 1.519531, 17.138672),
7545
+ caption2: textMetrics(17, 20.287109, 1.712891, 16.186523)
7546
+ }),
7547
+ ax1: Object.freeze({
7548
+ largeTitle: textMetrics(44, 52.507812, -0.507812, 41.894531),
7549
+ title1: textMetrics(38, 45.347656, 0.652344, 36.181641),
7550
+ title2: textMetrics(34, 40.574219, 0.425781, 32.373047),
7551
+ title3: textMetrics(31, 36.994141, 1.005859, 29.516602),
7552
+ headline: textMetrics(28, 33.414062, 0.585937, 26.660156),
7553
+ body: textMetrics(28, 33.414062, 0.585937, 26.660156),
7554
+ callout: textMetrics(26, 31.027344, 0.972656, 24.755859),
7555
+ subheadline: textMetrics(25, 29.833984, 1.166016, 23.803711),
7556
+ footnote: textMetrics(23, 27.447266, 1.552734, 21.899414),
7557
+ caption1: textMetrics(22, 26.253906, 0.746094, 20.947266),
7558
+ caption2: textMetrics(20, 23.867188, 1.132812, 19.042969)
7559
+ }),
7560
+ ax2: Object.freeze({
7561
+ largeTitle: textMetrics(48, 57.28125, -0.28125, 45.703125),
7562
+ title1: textMetrics(43, 51.314453, -0.314453, 40.942383),
7563
+ title2: textMetrics(39, 46.541016, 0.458984, 37.133789),
7564
+ title3: textMetrics(37, 44.154297, -0.154297, 35.229492),
7565
+ headline: textMetrics(33, 39.380859, 0.619141, 31.420898),
7566
+ body: textMetrics(33, 39.380859, 0.619141, 31.420898),
7567
+ callout: textMetrics(32, 38.1875, 0.8125, 30.46875),
7568
+ subheadline: textMetrics(30, 35.800781, 0.199219, 28.564453),
7569
+ footnote: textMetrics(27, 32.220703, 0.779297, 25.708008),
7570
+ caption1: textMetrics(26, 31.027344, 0.972656, 24.755859),
7571
+ caption2: textMetrics(24, 28.640625, 0.359375, 22.851562)
7572
+ }),
7573
+ ax3: Object.freeze({
7574
+ largeTitle: textMetrics(52, 62.054688, -1.054687, 49.511719),
7575
+ title1: textMetrics(48, 57.28125, -0.28125, 45.703125),
7576
+ title2: textMetrics(44, 52.507812, -0.507812, 41.894531),
7577
+ title3: textMetrics(43, 51.314453, -0.314453, 40.942383),
7578
+ headline: textMetrics(40, 47.734375, 0.265625, 38.085938),
7579
+ body: textMetrics(40, 47.734375, 0.265625, 38.085938),
7580
+ callout: textMetrics(38, 45.347656, 0.652344, 36.181641),
7581
+ subheadline: textMetrics(36, 42.960938, 0.039062, 34.277344),
7582
+ footnote: textMetrics(33, 39.380859, 0.619141, 31.420898),
7583
+ caption1: textMetrics(32, 38.1875, 0.8125, 30.46875),
7584
+ caption2: textMetrics(29, 34.607422, 0.392578, 27.612305)
7585
+ }),
7586
+ ax4: Object.freeze({
7587
+ largeTitle: textMetrics(56, 66.828125, -0.828125, 53.320312),
7588
+ title1: textMetrics(53, 63.248047, -2.248047, 50.463867),
7589
+ title2: textMetrics(50, 59.667969, -0.667969, 47.607422),
7590
+ title3: textMetrics(49, 58.474609, -0.474609, 46.655273),
7591
+ headline: textMetrics(47, 56.087891, -5.087891, 44.750977),
7592
+ body: textMetrics(47, 56.087891, -0.087891, 44.750977),
7593
+ callout: textMetrics(44, 52.507812, -0.507812, 41.894531),
7594
+ subheadline: textMetrics(42, 50.121094, -0.121094, 39.990234),
7595
+ footnote: textMetrics(38, 45.347656, 0.652344, 36.181641),
7596
+ caption1: textMetrics(37, 44.154297, -0.154297, 35.229492),
7597
+ caption2: textMetrics(34, 40.574219, 0.425781, 32.373047)
7598
+ }),
7599
+ ax5: Object.freeze({
7600
+ largeTitle: textMetrics(60, 71.601562, -1.601562, 57.128906),
7601
+ title1: textMetrics(58, 69.214844, -1.214844, 55.224609),
7602
+ title2: textMetrics(56, 66.828125, -0.828125, 53.320312),
7603
+ title3: textMetrics(55, 65.634766, -0.634766, 52.368164),
7604
+ headline: textMetrics(53, 63.248047, -1.248047, 50.463867),
7605
+ body: textMetrics(53, 63.248047, -1.248047, 50.463867),
7606
+ callout: textMetrics(51, 60.861328, -0.861328, 48.55957),
7607
+ subheadline: textMetrics(49, 58.474609, -0.474609, 46.655273),
7608
+ footnote: textMetrics(44, 52.507812, -0.507812, 41.894531),
7609
+ caption1: textMetrics(43, 51.314453, -0.314453, 40.942383),
7610
+ caption2: textMetrics(40, 47.734375, 0.265625, 38.085938)
7611
+ })
7612
+ });
7613
+
7614
+ // ../peach-engine/src/settings/react-native-configuration-values.ts
7615
+ var DEFAULT_REACT_NATIVE_CONFIGURATION = {
7616
+ // the appearance setting itself (automatic, light or dark); the resolved
7617
+ // scheme reaches workers through Appearance
7618
+ colorScheme: "auto",
7619
+ language: "en",
7620
+ region: "US",
7621
+ fontSize: 1,
7622
+ boldText: false,
7623
+ reduceMotion: false,
7624
+ largerAccessibilitySizes: false,
7625
+ glassTintAmount: 0.5,
7626
+ reduceTransparency: false,
7627
+ increaseContrast: false,
7628
+ showBorders: false,
7629
+ onOffLabels: false,
7630
+ differentiateWithoutColor: false,
7631
+ smartInvert: false,
7632
+ preferCrossFadeTransitions: false
7633
+ };
7634
+ var REACT_NATIVE_CONFIGURATION_KEYS = Object.keys(
7635
+ DEFAULT_REACT_NATIVE_CONFIGURATION
7636
+ ).filter(
7637
+ (key) => key in DEFAULT_REACT_NATIVE_CONFIGURATION
7638
+ );
7639
+ var snapshot = { ...DEFAULT_REACT_NATIVE_CONFIGURATION };
7640
+
7373
7641
  // ../peach-engine/src/engine/generated/language-font-manifest.ts
7374
7642
  var LANGUAGE_FONT_SUBSETS = [
7375
7643
  {
@@ -7705,7 +7973,7 @@ var LANGUAGE_FONT_SUBSETS = [
7705
7973
  ];
7706
7974
 
7707
7975
  // ../peach-engine/src/engine/generated/sf-pro-font.ts
7708
- var SF_PRO_FONT_URL = "/fonts/sf-pro.ttf?sha256=ba43865c3955d7d30888927bfdfef2476c932f9b930b5ad6adb50c33ac6a8de0";
7976
+ var SF_PRO_FONT_URL = "/fonts/sf-pro.ttf?sha256=c9bc31c271370f706950ecb918dec10776e546f5896ccb76fec2cda2368a84cb";
7709
7977
 
7710
7978
  // ../peach-engine/src/engine/font-config.ts
7711
7979
  var DEFAULT_FONT_FAMILY = "SF Pro";
@@ -7861,6 +8129,13 @@ var IOS_NAMED_FACES = [
7861
8129
  xHeight: 517
7862
8130
  })
7863
8131
  ];
8132
+ var IOS_FONT_DATA_FILES = new Map([
8133
+ ...IOS_NAMED_FACES.map(
8134
+ (face) => [face.postScript, face.file]
8135
+ ),
8136
+ ["Helvetica", "helvetica-regular.woff2"],
8137
+ ["Helvetica-Bold", "helvetica-bold.woff2"]
8138
+ ]);
7864
8139
  var EMOJI_FONT_FAMILY = "SootSimEmojiMetrics";
7865
8140
  var LANGUAGE_FONT_FAMILY_LIST = LANGUAGE_FONT_SUBSETS.filter(
7866
8141
  (s) => s.shaping === "ok"
@@ -8939,14 +9214,14 @@ async function waitForSootsimSurfaceMetrics(page, timeout = 3e4) {
8939
9214
  if (!windowValue || typeof windowValue !== "object") return null;
8940
9215
  return windowValue;
8941
9216
  };
8942
- const snapshot = await window.__sootsimTest?.getSurfaceMetricsSnapshot?.();
8943
- const windowMetrics = metricsWindow(snapshot);
9217
+ const snapshot2 = await window.__sootsimTest?.getSurfaceMetricsSnapshot?.();
9218
+ const windowMetrics = metricsWindow(snapshot2);
8944
9219
  const width = windowMetrics?.width;
8945
9220
  const height = windowMetrics?.height;
8946
9221
  if (typeof width === "number" && typeof height === "number" && width > 0 && height > 0) {
8947
9222
  return { ready: true };
8948
9223
  }
8949
- return { ready: false, snapshot };
9224
+ return { ready: false, snapshot: snapshot2 };
8950
9225
  });
8951
9226
  if (lastSnapshot && typeof lastSnapshot === "object" && lastSnapshot.ready) {
8952
9227
  return;
@@ -9275,15 +9550,15 @@ async function waitForSootsimIdle(page, maxMs = 3e3, strict = false, transitionS
9275
9550
  let stable = 0;
9276
9551
  let lastSnapshot = null;
9277
9552
  while (Date.now() < deadline) {
9278
- const snapshot = await readSnapshot();
9279
- lastSnapshot = snapshot;
9280
- if ((!strict2 || snapshot.renderStatsAvailable) && !snapshot.animating && !snapshot.layoutDirty && !snapshot.webViewStarting && isLayoutStable(stableLayout, snapshot.layout)) {
9553
+ const snapshot2 = await readSnapshot();
9554
+ lastSnapshot = snapshot2;
9555
+ if ((!strict2 || snapshot2.renderStatsAvailable) && !snapshot2.animating && !snapshot2.layoutDirty && !snapshot2.webViewStarting && isLayoutStable(stableLayout, snapshot2.layout)) {
9281
9556
  stable++;
9282
9557
  if (stable >= requiredStablePolls) {
9283
9558
  return { settled: true, elapsed: Date.now() - start };
9284
9559
  }
9285
9560
  } else {
9286
- stableLayout = snapshot.layout;
9561
+ stableLayout = snapshot2.layout;
9287
9562
  stable = 0;
9288
9563
  }
9289
9564
  await sleep(pollMs);
@@ -10235,7 +10510,8 @@ var device = {
10235
10510
  `peachwv${(0, import_crypto.randomBytes)(12).toString("hex")}`,
10236
10511
  WEBVIEW_HOST_BOOTSTRAP_SOURCE
10237
10512
  ),
10238
- webViewAutomationHelpers
10513
+ webViewAutomationHelpers,
10514
+ (page) => page.workers()
10239
10515
  );
10240
10516
  await _context.exposeBinding("__sootsimHostCapture", async (source, value) => {
10241
10517
  const request = readBrowserCompositeCaptureRequest(value);
@@ -10499,22 +10775,22 @@ var device = {
10499
10775
  );
10500
10776
  return context.getImageData(0, 0, bounds.width, bounds.height).data;
10501
10777
  };
10502
- const encode = (snapshot) => {
10778
+ const encode = (snapshot2) => {
10503
10779
  const canvas = document.createElement("canvas");
10504
- canvas.width = snapshot.bitmap.width;
10505
- canvas.height = snapshot.bitmap.height;
10780
+ canvas.width = snapshot2.bitmap.width;
10781
+ canvas.height = snapshot2.bitmap.height;
10506
10782
  const context = canvas.getContext("2d");
10507
10783
  if (!context) throw new Error("peach motion capture needs a 2d canvas");
10508
- context.drawImage(snapshot.bitmap, 0, 0);
10509
- snapshot.bitmap.close();
10784
+ context.drawImage(snapshot2.bitmap, 0, 0);
10785
+ snapshot2.bitmap.close();
10510
10786
  return {
10511
- actualMs: snapshot.actualMs,
10512
- anchorId: snapshot.anchorId,
10787
+ actualMs: snapshot2.actualMs,
10788
+ anchorId: snapshot2.anchorId,
10513
10789
  dataUrl: canvas.toDataURL("image/png"),
10514
- label: snapshot.label,
10515
- offsetMs: snapshot.offsetMs,
10516
- frameIndex: snapshot.frameIndex,
10517
- virtualTimestampMs: snapshot.virtualTimestampMs
10790
+ label: snapshot2.label,
10791
+ offsetMs: snapshot2.offsetMs,
10792
+ frameIndex: snapshot2.frameIndex,
10793
+ virtualTimestampMs: snapshot2.virtualTimestampMs
10518
10794
  };
10519
10795
  };
10520
10796
  const interact = captureWindow.SootSim?.bridges?.interact;
@@ -10591,6 +10867,7 @@ var device = {
10591
10867
  let detectedMeasurement = null;
10592
10868
  let previousBitmap = null;
10593
10869
  if (input.platform === "android") {
10870
+ const receipt = await controller.flushFrame();
10594
10871
  const candidateBitmap = await captureBitmap();
10595
10872
  const bounds = boundsFor(candidateBitmap);
10596
10873
  const measurement = measureChange({
@@ -10602,7 +10879,7 @@ var device = {
10602
10879
  width: bounds.width
10603
10880
  });
10604
10881
  if (measurement.passedMinimum) {
10605
- visibleStart = controller.initialFrame;
10882
+ visibleStart = receipt;
10606
10883
  detectedMeasurement = measurement;
10607
10884
  keptFrames.set(visibleStart.frameIndex, candidateBitmap);
10608
10885
  } else {
@@ -10769,9 +11046,9 @@ var device = {
10769
11046
  }
10770
11047
  if (input.settleMs > 0) {
10771
11048
  const maximumPrimaryMs = snapshots.reduce(
10772
- (maximum, snapshot) => Math.max(
11049
+ (maximum, snapshot2) => Math.max(
10773
11050
  maximum,
10774
- snapshot.virtualTimestampMs - driveStart.virtualTimestampMs
11051
+ snapshot2.virtualTimestampMs - driveStart.virtualTimestampMs
10775
11052
  ),
10776
11053
  releasedOffsetMs
10777
11054
  );
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1406 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1463 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;