peachsim 0.1.1716 → 0.1.1738

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 (282) hide show
  1. package/README.md +21 -3
  2. package/cli/app-bundle-resources.ts +2 -1
  3. package/cli/app-fonts.ts +4 -4
  4. package/cli/app-splash.ts +4 -4
  5. package/cli/app-stubs.ts +17 -0
  6. package/cli/command-registry.ts +1 -0
  7. package/cli/commands/control.ts +83 -822
  8. package/cli/commands/coverage-swift.ts +112 -4
  9. package/cli/commands/daemon.ts +8 -0
  10. package/cli/commands/detox.ts +3 -0
  11. package/cli/commands/doctor.ts +19 -2
  12. package/cli/commands/inspect/actions.ts +74 -14
  13. package/cli/commands/inspect/core.ts +5 -1
  14. package/cli/commands/inspect/settling.ts +5 -2
  15. package/cli/commands/inspect/wait-ready.ts +6 -0
  16. package/cli/commands/inspect.ts +48 -45
  17. package/cli/commands/kotlin.ts +12 -2
  18. package/cli/commands/package.ts +760 -0
  19. package/cli/commands/serve.ts +6 -0
  20. package/cli/commands/shell-url.ts +838 -0
  21. package/cli/commands/swift.ts +42 -102
  22. package/cli/commands/test.ts +20 -0
  23. package/cli/commands/upload.ts +1 -1
  24. package/cli/device-option.ts +1 -1
  25. package/cli/main.ts +13 -1
  26. package/cli/native-input.ts +199 -0
  27. package/cli/outbound-endpoints.ts +26 -1
  28. package/cli/packaged-app-launcher.ts +95 -0
  29. package/cli/scene-video.ts +36 -12
  30. package/detox/index.ts +196 -24
  31. package/dist-lib/agent-daemon-client.cjs +1 -1
  32. package/dist-lib/agent-events.cjs +1 -1
  33. package/dist-lib/attached-projects.cjs +5 -2
  34. package/dist-lib/auth/shared-session.cjs +5 -2
  35. package/dist-lib/backend-origin.cjs +1 -1
  36. package/dist-lib/beta.cjs +1 -1
  37. package/dist-lib/beta.mjs +1 -1
  38. package/dist-lib/bridge-constants.cjs +1 -1
  39. package/dist-lib/bridge-contract-input.cjs +1 -1
  40. package/dist-lib/bridge-contract-input.mjs +1 -1
  41. package/dist-lib/bridge-contract.cjs +1 -1
  42. package/dist-lib/bridge-contract.mjs +1 -1
  43. package/dist-lib/bundle-channel.cjs +39889 -31873
  44. package/dist-lib/capture-contract.cjs +1 -1
  45. package/dist-lib/capture-contract.mjs +1 -1
  46. package/dist-lib/cloud-contract.cjs +1 -1
  47. package/dist-lib/cloud-contract.mjs +1 -1
  48. package/dist-lib/cloud-test-args.cjs +1 -1
  49. package/dist-lib/cloud-test-args.mjs +1 -1
  50. package/dist-lib/cloud.cjs +1 -1
  51. package/dist-lib/cloud.mjs +1 -1
  52. package/dist-lib/config.cjs +1 -1
  53. package/dist-lib/config.mjs +1 -1
  54. package/dist-lib/detox/index.cjs +195 -63
  55. package/dist-lib/dev-bundle-resolution.cjs +14 -13
  56. package/dist-lib/expo-swift-bundle.cjs +18507 -11835
  57. package/dist-lib/expo-swift-metadata.cjs +4 -1
  58. package/dist-lib/expo-swift-metadata.mjs +3 -1
  59. package/dist-lib/home-paths.cjs +27 -3
  60. package/dist-lib/host/bridge-host.cjs +28373 -24090
  61. package/dist-lib/host/fetch-proxy-handler.cjs +235 -225
  62. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  63. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  64. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  65. package/dist-lib/host/websocket-proxy.cjs +1 -1
  66. package/dist-lib/index.cjs +915 -399
  67. package/dist-lib/jump-to-source-babel.cjs +1 -1
  68. package/dist-lib/jump-to-source-native.cjs +1 -1
  69. package/dist-lib/kotlin-host.cjs +335 -47
  70. package/dist-lib/menu.cjs +13 -1
  71. package/dist-lib/menu.mjs +13 -1
  72. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  73. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  74. package/dist-lib/metro-production-bundle.cjs +1 -1
  75. package/dist-lib/metro-production-bundle.mjs +1 -1
  76. package/dist-lib/metro.cjs +918 -411
  77. package/dist-lib/native-app-identity-project.cjs +703 -283
  78. package/dist-lib/native-app-identity-project.mjs +500 -87
  79. package/dist-lib/native-app-identity.cjs +13 -2
  80. package/dist-lib/native-app-identity.mjs +13 -2
  81. package/dist-lib/native-firebase-metadata.cjs +1 -1
  82. package/dist-lib/native-firebase-metadata.mjs +1 -1
  83. package/dist-lib/plist.cjs +1 -1
  84. package/dist-lib/plist.mjs +1 -1
  85. package/dist-lib/profiles.cjs +5 -2
  86. package/dist-lib/public-brand.cjs +1 -1
  87. package/dist-lib/public-origins-lib-esm.json +28 -23
  88. package/dist-lib/public-origins-lib.json +418 -224
  89. package/dist-lib/react-native-host-modules.cjs +35 -2
  90. package/dist-lib/react-native-host-modules.mjs +35 -2
  91. package/dist-lib/reap-browser.cjs +12 -4
  92. package/dist-lib/scripts/dev-server-scanner.cjs +15 -8
  93. package/dist-lib/sdk.cjs +17 -7
  94. package/dist-lib/sdk.mjs +16 -7
  95. package/dist-lib/skills.cjs +44825 -29141
  96. package/dist-lib/swift-compile.cjs +616 -400
  97. package/dist-lib/swift-compile.mjs +528 -315
  98. package/dist-lib/swift-package.cjs +1 -1
  99. package/dist-lib/swift-package.mjs +1 -1
  100. package/dist-lib/swift-submit.cjs +2 -2
  101. package/dist-lib/swift-submit.mjs +2 -2
  102. package/dist-lib/swift-toolchain.cjs +105 -17
  103. package/dist-lib/swift.cjs +1 -1
  104. package/dist-lib/vite-swift.cjs +4660 -2252
  105. package/dist-lib/vite.cjs +248 -234
  106. package/dist-lib/worklet-executable.cjs +1 -1
  107. package/dist-lib/worklet-executable.mjs +1 -1
  108. package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-cookies.d.ts +17 -8
  109. package/dist-types/packages/peach-engine/src/engine/canvaskit-renderer.d.ts +1 -0
  110. package/dist-types/packages/peach-engine/src/engine/font-config.d.ts +7 -4
  111. package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +9 -6
  112. package/dist-types/packages/peach-engine/src/engine/liquid-glass.d.ts +0 -5
  113. package/dist-types/packages/peach-engine/src/engine/memory-counts.d.ts +11 -1
  114. package/dist-types/packages/peach-engine/src/engine/node.d.ts +5 -12
  115. package/dist-types/packages/peach-engine/src/engine/render-damage.d.ts +2 -2
  116. package/dist-types/packages/peach-engine/src/engine/text-first-baseline.d.ts +5 -0
  117. package/dist-types/packages/peach-engine/src/engine/text-paragraph.d.ts +1 -0
  118. package/dist-types/packages/peach-engine/src/engine/types.d.ts +3 -0
  119. package/dist-types/packages/peach-engine/src/native-preview-bundle.d.ts +2 -0
  120. package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +9 -0
  121. package/dist-types/packages/peach-engine/src/render-worker/host-service-protocol.d.ts +3 -0
  122. package/dist-types/packages/peach-engine/src/render-worker/native-ui-commandContract.d.ts +1 -1
  123. package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +7 -2
  124. package/dist-types/packages/peach-engine/src/render-worker/shell-protocol.d.ts +5 -0
  125. package/dist-types/packages/peach-engine/src/render-worker/tree-sync-port.d.ts +1 -1
  126. package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +36 -2
  127. package/dist-types/packages/peach-engine/src/shell-events.d.ts +1 -0
  128. package/dist-types/packages/peach-globals/src/audioBridgeContract.d.ts +5 -0
  129. package/dist-types/packages/peach-globals/src/index.d.ts +1 -1
  130. package/dist-types/packages/peach-globals/src/keyboardBridgeContract.d.ts +11 -0
  131. package/dist-types/packages/peach-globals/src/shellBridgeContract.d.ts +1 -0
  132. package/dist-types/packages/peach-globals/src/testBridgeContract.d.ts +9 -2
  133. package/dist-types/packages/peach-kit/src/capabilities.d.ts +1 -0
  134. package/kotlin/README.md +3 -0
  135. package/kotlin/sdk.tar.gz +0 -0
  136. package/package.json +1 -1
  137. package/runtime-companion.json +1 -1
  138. package/scripts/dev-server-scanner.ts +12 -25
  139. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccount.h +55 -0
  140. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccountCredential.h +35 -0
  141. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccountStore.h +94 -0
  142. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccountType.h +53 -0
  143. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACError.h +37 -0
  144. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/Accounts.h +13 -0
  145. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/AccountsDefines.h +13 -0
  146. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Modules/module.modulemap +5 -0
  147. package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/ASFoundation.h +52 -0
  148. package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/ASWebAuthenticationSession.h +128 -0
  149. package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/ASWebAuthenticationSessionCallback.h +35 -0
  150. package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/AuthenticationServices.h +3 -0
  151. package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Modules/module.modulemap +5 -0
  152. package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPMessage.h +724 -0
  153. package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h +4 -0
  154. package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkDefs.h +27 -0
  155. package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Modules/module.modulemap +5 -0
  156. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h +1301 -0
  157. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h +3 -1
  158. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationManager.h +21 -50
  159. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLRegion.h +6 -6
  160. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes +58 -3
  161. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +711 -46
  162. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h +12 -0
  163. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIInterface.h +23 -0
  164. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h +7 -9
  165. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIOrientation.h +14 -0
  166. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIStringDrawing.h +12 -0
  167. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIView.h +14 -0
  168. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIViewAnimating.h +12 -0
  169. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIViewController.h +16 -0
  170. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIWindow.h +2 -0
  171. package/sdk/ios/usr/include/ConditionalMacros.h +619 -0
  172. package/sdk/ios/usr/include/module.modulemap +1 -0
  173. package/sdk/ios/usr/include/objc/objc-sync.h +59 -0
  174. package/sdk/ios/usr/include/os/signpost.h +414 -0
  175. package/sdk/ios/usr/include/os.modulemap +10 -0
  176. package/sdk/ios/usr/include/sys/cdefs.h +5 -0
  177. package/sdk/ios/usr/include/sys/ioccom.h +99 -0
  178. package/sdk/ios/usr/include/sys/syslog.h +236 -0
  179. package/sdk/ios/usr/include/syslog.h +24 -0
  180. package/sdk/ios/wasm/include/errno.h +4 -20
  181. package/sdk/ios/wasm/include/fcntl.h +4 -2
  182. package/sdk/ios/wasm/include/pthread.h +3 -0
  183. package/sdk/ios/wasm/include/setjmp.h +57 -0
  184. package/sdk/ios/wasm/include/stdio.h +24 -0
  185. package/sdk/ios/wasm/include/stdlib.h +32 -7
  186. package/sdk/ios/wasm/include/sys/file.h +7 -0
  187. package/sdk/ios/wasm/include/sys/ioctl.h +6 -0
  188. package/sdk/ios/wasm/include/sys/resource.h +2 -2
  189. package/sdk/ios/wasm/include/sys/syscall.h +9 -0
  190. package/sdk/ios/wasm/include/sys/time.h +10 -0
  191. package/sdk/ios/wasm/include/unistd.h +12 -3
  192. package/sdk/native-hashes.json +4 -3
  193. package/skills/contrast/SKILL.md +2 -1
  194. package/skills/peach-debug/SKILL.md +0 -1
  195. package/skills/peach-perf/SKILL.md +0 -1
  196. package/skills/peach-setup/SKILL.md +0 -1
  197. package/skills/peach-test/SKILL.md +7 -4
  198. package/skills/peach-visual/SKILL.md +0 -1
  199. package/src/admitted-mac-build.ts +3 -0
  200. package/src/android-app-identity.ts +18 -0
  201. package/src/android-autolinking.ts +1 -0
  202. package/src/android-bridge-packages.ts +279 -0
  203. package/src/android-root-module.ts +9 -9
  204. package/src/appPackageContract.ts +83 -0
  205. package/src/bridge-contract.ts +50 -0
  206. package/src/bundle-channel.mjs +41 -6
  207. package/src/cli-runtime.ts +9 -5
  208. package/src/dev-bundle-resolution.ts +7 -27
  209. package/src/dom-source-reference.ts +15 -0
  210. package/src/expo-discovery-cache.ts +134 -26
  211. package/src/expo-kotlin-host.ts +97 -26
  212. package/src/expo-manifest-body.ts +33 -0
  213. package/src/expo-native-workspace.ts +158 -38
  214. package/src/expo-swift-host.ts +350 -75
  215. package/src/expo-swift-ready.ts +5 -1
  216. package/src/expoKotlinContract.ts +12 -2
  217. package/src/expoSwiftContract.ts +10 -0
  218. package/src/generated/swift-c-predefines.json +1 -1
  219. package/src/home-paths.ts +41 -2
  220. package/src/host/app-package-handler.ts +47 -0
  221. package/src/host/bridge-host.ts +8 -0
  222. package/src/host/fetch-proxy-handler.ts +10 -0
  223. package/src/host/staged-host-files.ts +18 -0
  224. package/src/index.ts +3 -0
  225. package/src/kotlin-host.ts +225 -48
  226. package/src/kotlin-instance-source.ts +126 -0
  227. package/src/kotlinSdkContract.ts +2 -1
  228. package/src/menu.ts +14 -0
  229. package/src/native-app-identity-project.ts +7 -2
  230. package/src/native-app-identity.ts +11 -0
  231. package/src/native-firebase-config.ts +24 -1
  232. package/src/native-prebuilt.ts +154 -0
  233. package/src/nitro-adapter.lock.json +270 -270
  234. package/src/nitro-adapter.ts +56 -50
  235. package/src/nitro-bundle.ts +92 -74
  236. package/src/nitro-compile.ts +45 -14
  237. package/src/nitro-dependencies.ts +63 -46
  238. package/src/nitro-source.ts +64 -26
  239. package/src/nitroAdapterContract.ts +146 -98
  240. package/src/nitroContract.ts +71 -21
  241. package/src/react-native-bridge-modules.ts +70 -42
  242. package/src/react-native-host-modules.ts +34 -1
  243. package/src/reactNativeConfigurationContract.ts +14 -0
  244. package/src/reap-browser.ts +15 -3
  245. package/src/sdk.ts +5 -0
  246. package/src/settingsContract.ts +38 -1
  247. package/src/sim-client.ts +4 -1
  248. package/src/storageSnapshotContract.ts +32 -81
  249. package/src/swift-compile.ts +268 -89
  250. package/src/swift-coverage/indexdump.ts +22 -6
  251. package/src/swift-coverage/indexing.ts +4 -4
  252. package/src/swift-coverage/provenance.ts +1 -0
  253. package/src/swift-coverage/sdk.ts +104 -20
  254. package/src/swift-coverage/types.ts +34 -0
  255. package/src/swift-coverage/xcode-asset-symbols.ts +922 -0
  256. package/src/swift-coverage/xcode-assets.ts +89 -131
  257. package/src/swift-coverage/xcode.ts +10 -2
  258. package/src/swift-cxx-reachable.ts +2 -1
  259. package/src/swift-distribution.lock.json +20 -16
  260. package/src/swift-host.ts +98 -22
  261. package/src/swift-icu.ts +1 -1
  262. package/src/swift-link-roots.ts +118 -0
  263. package/src/swift-objc-compile.ts +144 -22
  264. package/src/swift-objc-import.ts +6 -0
  265. package/src/swift-objc-standin.ts +2 -14
  266. package/src/swift-package-manifest.ts +14 -6
  267. package/src/swift-packages.ts +75 -11
  268. package/src/swift-pdf-raster.ts +1 -0
  269. package/src/swift-root-lock.ts +17 -1
  270. package/src/swift-source-pods.ts +2 -10
  271. package/src/swift-standin-emit.ts +597 -57
  272. package/src/swift-standins.ts +599 -56
  273. package/src/swift-submit.ts +7 -1
  274. package/src/swift-toolchain.ts +140 -17
  275. package/src/turbo-bundle.ts +81 -0
  276. package/src/turbo-codegen-intake.ts +91 -0
  277. package/src/turbo-compile.ts +120 -0
  278. package/src/turbo-runtime.lock.json +69 -0
  279. package/src/turbo-source.ts +754 -0
  280. package/src/vite-plugin-one.ts +17 -12
  281. package/src/vite-plugin.ts +28 -15
  282. package/src/xcode-project.ts +223 -22
@@ -1,4 +1,5 @@
1
1
  import { writeFile } from 'node:fs/promises'
2
+ import { createServer } from 'node:http'
2
3
  import { createRequire } from 'node:module'
3
4
  import { getCliRuntime } from '../src/cli-runtime.ts'
4
5
  import { launchReapedChrome } from '../src/reap-browser'
@@ -30,11 +31,39 @@ export async function renderSceneToVideo(options: {
30
31
  if (!installed.ok) throw new Error(installed.message)
31
32
  const require = createRequire(import.meta.url)
32
33
  const { chromium }: typeof import('playwright-core') = require(resolved.modulePath)
33
- const browser = await launchReapedChrome((opts) => chromium.launch(opts), {
34
- headless: true,
35
- ...(installed.libraryPath
36
- ? { env: { ...process.env, LD_LIBRARY_PATH: installed.libraryPath } }
37
- : {}),
34
+ // the headless shell provisioned above has no GPU; off a Mac it renders the
35
+ // scene in software, as the sim host that recorded it does.
36
+ const browser = await launchReapedChrome(
37
+ (opts) => chromium.launch(opts),
38
+ {
39
+ headless: true,
40
+ ...(installed.libraryPath
41
+ ? { env: { ...process.env, LD_LIBRARY_PATH: installed.libraryPath } }
42
+ : {}),
43
+ },
44
+ undefined,
45
+ { software: process.platform !== 'darwin' },
46
+ )
47
+ // the viewer fetches the scene from loopback: a body fulfilled through
48
+ // devtools travels base64 over chrome's pipe, which drops the connection
49
+ // past 100 MB, so a large scene closed the browser before it booted.
50
+ const sceneServer = createServer((_request, response) => {
51
+ response.writeHead(200, {
52
+ 'access-control-allow-origin': '*',
53
+ 'content-type': 'application/vnd.peach.scene-stream+gzip',
54
+ 'content-length': options.scene.byteLength,
55
+ })
56
+ response.end(options.scene)
57
+ })
58
+ const port = await new Promise<number>((resolve, reject) => {
59
+ sceneServer.once('error', reject)
60
+ sceneServer.listen(0, '127.0.0.1', () => {
61
+ sceneServer.off('error', reject)
62
+ const address = sceneServer.address()
63
+ if (address === null || typeof address === 'string')
64
+ reject(new Error('scene server has no tcp port'))
65
+ else resolve(address.port)
66
+ })
38
67
  })
39
68
  try {
40
69
  const source = new URL(options.shellUrl)
@@ -45,17 +74,11 @@ export async function renderSceneToVideo(options: {
45
74
  const value = source.searchParams.get(key)
46
75
  if (value) url.searchParams.set(key, value)
47
76
  }
48
- const sceneUrl = new URL('__scene_export.psr.gz', url).href
77
+ const sceneUrl = `http://127.0.0.1:${port}/scene.psr.gz`
49
78
  const page = await browser.newPage({
50
79
  viewport: { width: 600, height: 1000 },
51
80
  deviceScaleFactor: 3,
52
81
  })
53
- await page.route(sceneUrl, (route) =>
54
- route.fulfill({
55
- contentType: 'application/vnd.peach.scene-stream+gzip',
56
- body: Buffer.from(options.scene),
57
- }),
58
- )
59
82
  url.searchParams.set(
60
83
  'remoteEngine',
61
84
  JSON.stringify({ url: sceneUrl, expectedPeer: header.peer, autoplay: false }),
@@ -90,5 +113,6 @@ export async function renderSceneToVideo(options: {
90
113
  return { ...result, sizeBytes: video.byteLength }
91
114
  } finally {
92
115
  await browser.close()
116
+ sceneServer.close()
93
117
  }
94
118
  }
package/detox/index.ts CHANGED
@@ -701,7 +701,12 @@ async function queryMatcherInPage({
701
701
  let hadNumericLayout = false
702
702
  let disappearedMidWait = false
703
703
  while (Date.now() - startedAt < maxWaitMs) {
704
- const observation = await window.__sootsimTest!.observeTapTarget(indexedMatcher)
704
+ // detox taps the element's own activation point and lets window
705
+ // hit-testing pick the receiver, so the settle wait tracks that point
706
+ // even when no finger can reach the element itself.
707
+ const observation = await window.__sootsimTest!.observeTapTarget(indexedMatcher, {
708
+ includeUnreachable: true,
709
+ })
705
710
  const node = observation
706
711
  if (!node) {
707
712
  if (hadNumericLayout) disappearedMidWait = true
@@ -825,7 +830,12 @@ async function dispatchTapAtSootsimPoint(page: Page, point: TapPoint, token?: st
825
830
  if ('nodeId' in point) {
826
831
  // resolve after the viewport read, in the browser task that dispatches
827
832
  // the pointer. a host round trip here can outlive a startup relayout.
828
- const resolved = await window.__sootsimTest!.resolveTapTarget(point.nodeId)
833
+ // detox creates the touch at the element's activation point even when
834
+ // the element itself cannot receive a pointer hit; window hit-testing
835
+ // picks the receiver.
836
+ const resolved = await window.__sootsimTest!.resolveTapTarget(point.nodeId, {
837
+ includeUnreachable: true,
838
+ })
829
839
  if (!resolved) throw new Error(`element disappeared before tap: ${point.nodeId}`)
830
840
  const node = resolved.match
831
841
  if (point.offset) {
@@ -1609,7 +1619,8 @@ function createSootSimElement(matcher: Matcher): SootSimElement {
1609
1619
  // label is visually projected around the wheel and can overlap a later
1610
1620
  // label near the cylinder edge.
1611
1621
  const tapTarget = await page.evaluate(
1612
- async (nodeId) => window.__sootsimTest?.resolveTapTarget(nodeId),
1622
+ async (nodeId) =>
1623
+ window.__sootsimTest?.resolveTapTarget(nodeId, { includeUnreachable: true }),
1613
1624
  target.nodeId,
1614
1625
  )
1615
1626
  if (!tapTarget) {
@@ -1743,7 +1754,15 @@ function createSootSimElement(matcher: Matcher): SootSimElement {
1743
1754
  const node = await findNodeByMatcher(matcher)
1744
1755
  if (!node)
1745
1756
  throw new Error(`element not found for getAttributes: ${JSON.stringify(matcher)}`)
1746
- return attributesOf(node)
1757
+ // detox reports the window point a tap on the element lands on. unlike
1758
+ // frame, it follows presentation transforms, so it moves while a sheet or
1759
+ // push is still sliding and a caller can wait for it to rest.
1760
+ const observation = await getPage().evaluate(
1761
+ (observed) =>
1762
+ window.__sootsimTest!.observeTapTarget(observed, { includeUnreachable: true }),
1763
+ matcher,
1764
+ )
1765
+ return { ...attributesOf(node), activationPoint: observation?.tapPoint ?? null }
1747
1766
  },
1748
1767
 
1749
1768
  atIndex(index: number) {
@@ -1889,6 +1908,48 @@ async function postRemotePushToSimulator(
1889
1908
  // searched at that resolution; a 60Hz step lands up to 16ms deep into the curve
1890
1909
  const ONSET_STEP_MS = 1000 / 240
1891
1910
 
1911
+ // the native onset frame sits an arbitrary phase into the animation, because
1912
+ // it is whichever display tick first showed change and the recording stamps it
1913
+ // on its own irregular grid. a stage is therefore sampled at the animation
1914
+ // progress its native frame showed, found within this window around the nominal
1915
+ // time, and the offset it lands on carries to the stages after it
1916
+ const PHASE_SEARCH_MS = 1000 / 30
1917
+
1918
+ // the changed-pixel inputs of the first timed stage of the stored native leg:
1919
+ // its pre-trigger and stage frames. the leg lives at
1920
+ // <proof dir>/<target>/<case>/<checkpoint> and the prefix is `<case>-<checkpoint>`
1921
+ function storedNativeProgressFrames(namePrefix: string, label: string) {
1922
+ const nativeTarget = `${DETOX_PLATFORM}${(process.env.APPEARANCE_REPORTED || process.env.APPEARANCE) === 'dark' ? '-dark' : ''}`
1923
+ const targetDir = path.resolve(
1924
+ process.cwd(),
1925
+ process.env.CONFORMANCE_PROOF_DIR || 'artifacts/conformance-proof/latest',
1926
+ nativeTarget,
1927
+ )
1928
+ if (!fs.existsSync(targetDir)) return null
1929
+ for (const caseName of fs.readdirSync(targetDir)) {
1930
+ if (!namePrefix.startsWith(`${caseName}-`)) continue
1931
+ const checkpointDir = path.join(
1932
+ targetDir,
1933
+ caseName,
1934
+ namePrefix.slice(caseName.length + 1),
1935
+ )
1936
+ if (!fs.existsSync(path.join(checkpointDir, `${label}.png`))) return null
1937
+ return {
1938
+ baselinePng: fs
1939
+ .readFileSync(path.join(checkpointDir, 'pre-trigger.png'))
1940
+ .toString('base64'),
1941
+ png: fs.readFileSync(path.join(checkpointDir, `${label}.png`)).toString('base64'),
1942
+ }
1943
+ }
1944
+ return null
1945
+ }
1946
+
1947
+ const isProgressStage = (stage: {
1948
+ offsetMs: number
1949
+ nativeActualMs?: number
1950
+ anchor?: object
1951
+ }) => stage.offsetMs > 0 && stage.nativeActualMs === undefined && !stage.anchor
1952
+
1892
1953
  export const device = {
1893
1954
  _currentUrl: '',
1894
1955
  _platform: DETOX_PLATFORM as 'ios' | 'android',
@@ -2155,7 +2216,11 @@ export const device = {
2155
2216
 
2156
2217
  async reloadReactNative() {
2157
2218
  const page = getPage()
2158
- await page.reload({ waitUntil: 'load', timeout: 30000 })
2219
+ // native detox reloads the js bundle inside the running app process: the
2220
+ // old react tree and runtime retire and a new one mounts. the shell page
2221
+ // stays loaded and the tenant worker is replaced in place. the bridge
2222
+ // resolves once the new tenant's display is ready.
2223
+ await page.evaluate(() => window.SootSim!.bridges.hotRemount!.reloadExternalApp())
2159
2224
  await waitForSootsimTree(page, 30000)
2160
2225
  await waitForSootsimSurfaceMetrics(page, 30000)
2161
2226
  await waitForSootsimShellReady(page, 30000)
@@ -2690,6 +2755,9 @@ export const device = {
2690
2755
  // the time after the onset at which the paired native leg sampled this
2691
2756
  // stage; the stage is sampled at that time instead of the nominal offset
2692
2757
  nativeActualMs?: number
2758
+ // the stored native frames whose changed-pixel progress this stage is
2759
+ // sampled at, set on the first timed stage only
2760
+ nativeProgress?: { baselinePng: string; png: string }
2693
2761
  anchor?: { id: string; notBeforeMs: number; onsetThresholdPercent?: number }
2694
2762
  }>,
2695
2763
  options: {
@@ -3283,32 +3351,114 @@ export const device = {
3283
3351
  }
3284
3352
 
3285
3353
  const snapshots: Snapshot[] = []
3354
+ // whole 60Hz frames, then one partial step to land on the target
3355
+ const stepToTime = async (targetMs: number) => {
3356
+ let receipt = currentReceipt
3357
+ if (targetMs < receipt.virtualTimestampMs - 0.01) {
3358
+ throw new Error(
3359
+ `sample time ${targetMs}ms precedes the frames already stepped`,
3360
+ )
3361
+ }
3362
+ while (receipt.virtualTimestampMs + 1000 / 60 <= targetMs + 0.01) {
3363
+ receipt = await controller.stepFrame()
3364
+ }
3365
+ if (targetMs - receipt.virtualTimestampMs > 0.01) {
3366
+ receipt = await controller.stepFrame(targetMs - receipt.virtualTimestampMs)
3367
+ }
3368
+ currentReceipt = receipt
3369
+ return receipt
3370
+ }
3371
+ const sampleAt = async (
3372
+ stage: { label: string; offsetMs: number },
3373
+ anchorReceipt: SootSimLockstepFrameReceipt,
3374
+ anchorId: string,
3375
+ targetMs: number,
3376
+ ) => {
3377
+ const receipt = await stepToTime(targetMs)
3378
+ snapshots.push({
3379
+ actualMs: receipt.virtualTimestampMs - anchorReceipt.virtualTimestampMs,
3380
+ anchorId,
3381
+ bitmap: await captureBitmap(),
3382
+ frameIndex: receipt.frameIndex,
3383
+ label: stage.label,
3384
+ offsetMs: stage.offsetMs,
3385
+ virtualTimestampMs: receipt.virtualTimestampMs,
3386
+ })
3387
+ }
3388
+ const nativeProgressPercent = async (progress: {
3389
+ baselinePng: string
3390
+ png: string
3391
+ }) => {
3392
+ const decode = async (png: string) =>
3393
+ createImageBitmap(
3394
+ await (await fetch(`data:image/png;base64,${png}`)).blob(),
3395
+ )
3396
+ const nativeBaseline = await decode(progress.baselinePng)
3397
+ const nativeStage = await decode(progress.png)
3398
+ const bounds = boundsFor(nativeStage)
3399
+ return measureChange({
3400
+ baseline: regionPixels(nativeBaseline),
3401
+ candidate: regionPixels(nativeStage),
3402
+ definition: input.motionChangeDefinition,
3403
+ height: bounds.height,
3404
+ label: 'native stage progress',
3405
+ width: bounds.width,
3406
+ }).changePercent
3407
+ }
3408
+ // the offset from the nominal time at which the first timed stage
3409
+ // reached the progress its native frame showed
3410
+ let phaseMs = 0
3286
3411
  for (const stage of input.stages) {
3287
3412
  if (state.cancelled) throw new Error('peach motion capture was cancelled')
3288
3413
  const { anchorId, receipt: anchorReceipt } = await resolveAnchor(stage)
3289
3414
  if (typeof stage.nativeActualMs === 'number') {
3290
- // sample the moment the native leg sampled: whole 60Hz frames,
3291
- // then one partial step to land on it
3292
- const targetMs = anchorReceipt.virtualTimestampMs + stage.nativeActualMs
3415
+ // sample the moment the native leg sampled
3416
+ await sampleAt(
3417
+ stage,
3418
+ anchorReceipt,
3419
+ anchorId,
3420
+ anchorReceipt.virtualTimestampMs + stage.nativeActualMs,
3421
+ )
3422
+ continue
3423
+ }
3424
+ const touchOffsetMs = await stageOffsetMs(stage.offsetMs, anchorId)
3425
+ if (stage.nativeProgress) {
3426
+ const targetPercent = await nativeProgressPercent(stage.nativeProgress)
3427
+ const nominalMs = anchorReceipt.virtualTimestampMs + touchOffsetMs
3293
3428
  let receipt = currentReceipt
3294
- if (targetMs < receipt.virtualTimestampMs - 0.01) {
3295
- throw new Error(
3296
- `peach stage ${stage.label} native time ${stage.nativeActualMs}ms precedes the frames already stepped`,
3297
- )
3298
- }
3299
- while (receipt.virtualTimestampMs + 1000 / 60 <= targetMs + 0.01) {
3429
+ while (
3430
+ receipt.virtualTimestampMs + 1000 / 60 <=
3431
+ nominalMs - input.phaseSearchMs
3432
+ ) {
3300
3433
  receipt = await controller.stepFrame()
3301
3434
  }
3302
- if (targetMs - receipt.virtualTimestampMs > 0.01) {
3303
- receipt = await controller.stepFrame(
3304
- targetMs - receipt.virtualTimestampMs,
3305
- )
3435
+ let progressBitmap: ImageBitmap | null = null
3436
+ while (!progressBitmap) {
3437
+ if (receipt.virtualTimestampMs > nominalMs + input.phaseSearchMs) {
3438
+ throw new Error(
3439
+ `peach stage ${stage.label} never reached the native progress ${targetPercent}% within ${input.phaseSearchMs}ms of ${touchOffsetMs}ms`,
3440
+ )
3441
+ }
3442
+ receipt = await controller.stepFrame(1)
3443
+ const candidateBitmap = await captureBitmap()
3444
+ const bounds = boundsFor(candidateBitmap)
3445
+ const progress = measureChange({
3446
+ baseline,
3447
+ candidate: regionPixels(candidateBitmap),
3448
+ definition: input.motionChangeDefinition,
3449
+ height: bounds.height,
3450
+ label: 'peach stage progress',
3451
+ width: bounds.width,
3452
+ }).changePercent
3453
+ if (progress >= targetPercent) progressBitmap = candidateBitmap
3454
+ else candidateBitmap.close()
3306
3455
  }
3307
3456
  currentReceipt = receipt
3457
+ phaseMs = receipt.virtualTimestampMs - nominalMs
3308
3458
  snapshots.push({
3309
3459
  actualMs: receipt.virtualTimestampMs - anchorReceipt.virtualTimestampMs,
3310
3460
  anchorId,
3311
- bitmap: await captureBitmap(),
3461
+ bitmap: progressBitmap,
3312
3462
  frameIndex: receipt.frameIndex,
3313
3463
  label: stage.label,
3314
3464
  offsetMs: stage.offsetMs,
@@ -3316,7 +3466,17 @@ export const device = {
3316
3466
  })
3317
3467
  continue
3318
3468
  }
3319
- const touchOffsetMs = await stageOffsetMs(stage.offsetMs, anchorId)
3469
+ if (phaseMs !== 0) {
3470
+ await sampleAt(
3471
+ stage,
3472
+ anchorReceipt,
3473
+ anchorId,
3474
+ anchorReceipt.virtualTimestampMs +
3475
+ touchOffsetMs +
3476
+ (anchorId === 'transition' ? phaseMs : 0),
3477
+ )
3478
+ continue
3479
+ }
3320
3480
  const stageFrameIndex =
3321
3481
  anchorReceipt.frameIndex + controller.framesForOffset(touchOffsetMs)
3322
3482
  const kept = keptFrames.get(stageFrameIndex)
@@ -3353,8 +3513,9 @@ export const device = {
3353
3513
  // and leave it down. the settle then runs from that release.
3354
3514
  let releasedOffsetMs = 0
3355
3515
  while (input.hold && !releaseReceipt()) {
3356
- const receipt = await controller.stepFrame()
3357
- releasedOffsetMs = receipt.virtualTimestampMs - driveStart.virtualTimestampMs
3516
+ currentReceipt = await controller.stepFrame()
3517
+ releasedOffsetMs =
3518
+ currentReceipt.virtualTimestampMs - driveStart.virtualTimestampMs
3358
3519
  }
3359
3520
  await heldInput
3360
3521
  if (input.settleMs > 0) {
@@ -3366,7 +3527,9 @@ export const device = {
3366
3527
  ),
3367
3528
  releasedOffsetMs,
3368
3529
  )
3369
- await controller.stepToOffset(driveStart, maximumPrimaryMs + input.settleMs)
3530
+ await stepToTime(
3531
+ driveStart.virtualTimestampMs + maximumPrimaryMs + input.settleMs,
3532
+ )
3370
3533
  }
3371
3534
  while (!state.triggerCompleted) {
3372
3535
  if (state.cancelled) throw new Error('peach motion capture was cancelled')
@@ -3415,6 +3578,7 @@ export const device = {
3415
3578
  workletFrameTimestampsSeconds: options.workletFrameTimestampsSeconds,
3416
3579
  detectionTimeoutMs: options.detectionTimeoutMs ?? 3000,
3417
3580
  onsetStepMs: ONSET_STEP_MS,
3581
+ phaseSearchMs: PHASE_SEARCH_MS,
3418
3582
  frame: options.frame ?? null,
3419
3583
  anchorAtTouch: options.anchorAtTouch ?? null,
3420
3584
  witnessedDrag: options.witnessedDrag === true,
@@ -3423,7 +3587,15 @@ export const device = {
3423
3587
  platform: device.getPlatform(),
3424
3588
  rootFrame: options.rootFrame ?? null,
3425
3589
  settleMs,
3426
- stages,
3590
+ stages: stages.map((stage, index) =>
3591
+ index === stages.findIndex(isProgressStage)
3592
+ ? {
3593
+ ...stage,
3594
+ nativeProgress:
3595
+ storedNativeProgressFrames(namePrefix, stage.label) ?? undefined,
3596
+ }
3597
+ : stage,
3598
+ ),
3427
3599
  token,
3428
3600
  },
3429
3601
  )
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1716 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1738 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1716 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1738 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1716 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1738 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -127,10 +127,13 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
127
127
  var import_node_os = require("node:os");
128
128
  var import_node_path = __toESM(require("node:path"), 1);
129
129
  var PEACH_HOME_ENV = "PEACH_HOME";
130
+ function ambientHomeDir() {
131
+ return import_node_path.default.join((0, import_node_os.homedir)(), ".peach");
132
+ }
130
133
  function rnxHomeDir() {
131
134
  const override = process.env[PEACH_HOME_ENV];
132
135
  if (override && override.length > 0) return import_node_path.default.resolve(override);
133
- return import_node_path.default.join((0, import_node_os.homedir)(), ".peach");
136
+ return ambientHomeDir();
134
137
  }
135
138
  function electronDir() {
136
139
  return import_node_path.default.join(rnxHomeDir(), "electron");
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1716 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1738 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -49,10 +49,13 @@ var import_node_path2 = require("node:path");
49
49
  var import_node_os = require("node:os");
50
50
  var import_node_path = __toESM(require("node:path"), 1);
51
51
  var PEACH_HOME_ENV = "PEACH_HOME";
52
+ function ambientHomeDir() {
53
+ return import_node_path.default.join((0, import_node_os.homedir)(), ".peach");
54
+ }
52
55
  function rnxHomeDir() {
53
56
  const override = process.env[PEACH_HOME_ENV];
54
57
  if (override && override.length > 0) return import_node_path.default.resolve(override);
55
- return import_node_path.default.join((0, import_node_os.homedir)(), ".peach");
58
+ return ambientHomeDir();
56
59
  }
57
60
  function electronDir() {
58
61
  return import_node_path.default.join(rnxHomeDir(), "electron");
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1716 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1738 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
package/dist-lib/beta.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1716 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1738 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
package/dist-lib/beta.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1716 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1738 | (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
- /*! peach v0.1.1716 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1738 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1716 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1738 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1716 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1738 | (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
- /*! peach v0.1.1716 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1738 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1716 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1738 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/bridge-contract.ts
4
4
  var REFUSED_PERFORM_STEP_TYPES = [