peachsim 0.1.2935 → 0.1.2937

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 (345) hide show
  1. package/LICENSE +6 -8
  2. package/cli/account-gate.ts +20 -3
  3. package/cli/app-bundle-resources.ts +66 -19
  4. package/cli/catalog/meta.ts +2 -106
  5. package/cli/command-agent.ts +7 -0
  6. package/cli/command-registry.ts +0 -1
  7. package/cli/commands/control.ts +13 -5
  8. package/cli/commands/daemon.ts +4 -2
  9. package/cli/commands/device.ts +78 -8
  10. package/cli/commands/do-chain.ts +11 -8
  11. package/cli/commands/inspect/core.ts +4 -9
  12. package/cli/commands/inspect/settling.ts +1 -0
  13. package/cli/commands/logout.ts +6 -1
  14. package/cli/commands/map.ts +2 -6
  15. package/cli/commands/package.ts +112 -57
  16. package/cli/commands/shell-url.ts +0 -1
  17. package/cli/download-auth.ts +2 -0
  18. package/cli/drivers/playwright-provisioning.ts +10 -38
  19. package/cli/github-workflow-identity.ts +8 -0
  20. package/cli/internal-child-contract.ts +1 -0
  21. package/cli/internal-child.ts +5 -0
  22. package/cli/main.ts +2 -10
  23. package/cli/outbound-endpoints.ts +26 -0
  24. package/detox/index.ts +227 -131
  25. package/dist-lib/agent-daemon-client.cjs +1 -1
  26. package/dist-lib/agent-events.cjs +1 -1
  27. package/dist-lib/attached-projects.cjs +1 -1
  28. package/dist-lib/auth/shared-session.cjs +1 -1
  29. package/dist-lib/backend-origin.cjs +1 -1
  30. package/dist-lib/beta.cjs +1 -1
  31. package/dist-lib/beta.mjs +2 -2
  32. package/dist-lib/bridge-constants.cjs +1 -1
  33. package/dist-lib/bridge-contract-input.cjs +47 -3
  34. package/dist-lib/bridge-contract-input.mjs +6 -6
  35. package/dist-lib/bridge-contract.cjs +10 -1
  36. package/dist-lib/bridge-contract.mjs +3 -3
  37. package/dist-lib/bundle-channel.cjs +12779 -9515
  38. package/dist-lib/capture-contract.cjs +39 -17
  39. package/dist-lib/capture-contract.mjs +3 -3
  40. package/dist-lib/cloud-contract.cjs +1 -1
  41. package/dist-lib/cloud-contract.mjs +3 -3
  42. package/dist-lib/cloud-test-args.cjs +1 -1
  43. package/dist-lib/cloud-test-args.mjs +2 -2
  44. package/dist-lib/cloud.cjs +1 -1
  45. package/dist-lib/cloud.mjs +8 -8
  46. package/dist-lib/config.cjs +1 -1
  47. package/dist-lib/config.mjs +6 -6
  48. package/dist-lib/detox/index.cjs +200 -132
  49. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  50. package/dist-lib/esm-chunks/{acorn-Q5TRRYSO.mjs → acorn-IIBLEO25.mjs} +3 -3
  51. package/dist-lib/esm-chunks/{chunk-UDWBTBVG.mjs → chunk-4FTPQKPT.mjs} +10 -1
  52. package/dist-lib/esm-chunks/chunk-4WIDTRBB.mjs +10232 -0
  53. package/dist-lib/esm-chunks/{chunk-LCMFYMT7.mjs → chunk-5QZOQ3NZ.mjs} +1 -1
  54. package/dist-lib/esm-chunks/{chunk-BJ2OGUX7.mjs → chunk-CIY67HNL.mjs} +39 -17
  55. package/dist-lib/esm-chunks/{chunk-SKQTNQYE.mjs → chunk-CQFEMJ64.mjs} +1 -1
  56. package/dist-lib/esm-chunks/{chunk-AXWVXRHX.mjs → chunk-CWVMCW23.mjs} +1 -1
  57. package/dist-lib/esm-chunks/{chunk-MTALOHQR.mjs → chunk-F6DZ4DS2.mjs} +1 -1
  58. package/dist-lib/esm-chunks/{chunk-I4R7IZRD.mjs → chunk-HJMF6O7L.mjs} +74 -46
  59. package/dist-lib/esm-chunks/chunk-I6T4PXJF.mjs +154 -0
  60. package/dist-lib/esm-chunks/{chunk-XWAUZKIA.mjs → chunk-IJU3JMWM.mjs} +1 -1
  61. package/dist-lib/esm-chunks/{chunk-CXWUIOCH.mjs → chunk-KODEPXQC.mjs} +4 -4
  62. package/dist-lib/esm-chunks/{chunk-WJE5QHSD.mjs → chunk-LD4K2VBL.mjs} +155 -36
  63. package/dist-lib/esm-chunks/{chunk-2TSM64HI.mjs → chunk-LTE7YMEG.mjs} +1 -1
  64. package/dist-lib/esm-chunks/{chunk-3GGOXUJA.mjs → chunk-M3CSKAJE.mjs} +1 -1
  65. package/dist-lib/esm-chunks/{chunk-7G5UETIG.mjs → chunk-NA6DJPB6.mjs} +43 -1
  66. package/dist-lib/esm-chunks/{chunk-MSUHMNAI.mjs → chunk-NNAX24FS.mjs} +1 -1
  67. package/dist-lib/esm-chunks/{chunk-VDJA4LP4.mjs → chunk-PZPJJBAS.mjs} +1 -1
  68. package/dist-lib/esm-chunks/{chunk-UEEEJVQA.mjs → chunk-QXSTHMWN.mjs} +1 -1
  69. package/dist-lib/esm-chunks/{chunk-S2RJB5I7.mjs → chunk-RBPVK5YI.mjs} +1 -1
  70. package/dist-lib/esm-chunks/{chunk-VRAXNGYT.mjs → chunk-SCT5OFDV.mjs} +1 -1
  71. package/dist-lib/esm-chunks/{chunk-T3M73LGP.mjs → chunk-U3CJGYSP.mjs} +50 -6
  72. package/dist-lib/esm-chunks/{chunk-SLUGTGQQ.mjs → chunk-VXTOQ522.mjs} +12 -6
  73. package/dist-lib/esm-chunks/{chunk-EL44SZMV.mjs → chunk-WMSVGYTH.mjs} +1 -1
  74. package/dist-lib/esm-chunks/{chunk-FEDEPSEV.mjs → chunk-WRWINRWK.mjs} +1 -1
  75. package/dist-lib/esm-chunks/{chunk-BNO52N2S.mjs → chunk-YZF2USRD.mjs} +1905 -8760
  76. package/dist-lib/esm-chunks/{chunk-TQLKYMVP.mjs → chunk-ZNHR6C3L.mjs} +1 -1
  77. package/dist-lib/esm-chunks/{download-auth-registry-G75MIT55.mjs → download-auth-registry-AHS5MSIB.mjs} +4 -4
  78. package/dist-lib/esm-chunks/{metro-layout-parser-FXLUDTYT.mjs → metro-layout-parser-24ZYK5UP.mjs} +3 -3
  79. package/dist-lib/esm-chunks/{swift-package-prebuilt-524D4MA2.mjs → swift-package-prebuilt-L4YNXQRD.mjs} +15 -15
  80. package/dist-lib/esm-chunks/{swift-sdk-app-module-EX544YJY.mjs → swift-sdk-app-module-RM652JSW.mjs} +87 -71
  81. package/dist-lib/esm-chunks/{swift-sdk-image-LOTMWVM7.mjs → swift-sdk-image-5PQ44UJT.mjs} +15 -15
  82. package/dist-lib/esm-chunks/{swift-sdk-image-producer-UO6B3M4U.mjs → swift-sdk-image-producer-GD3SM6YI.mjs} +5 -5
  83. package/dist-lib/esm-chunks/swift-sdk-later-data-62QYJ2KH.mjs +590 -0
  84. package/dist-lib/expo-swift-bundle.cjs +21037 -17896
  85. package/dist-lib/expo-swift-metadata.cjs +8 -2
  86. package/dist-lib/expo-swift-metadata.mjs +9 -8
  87. package/dist-lib/home-paths.cjs +1 -1
  88. package/dist-lib/host/bridge-host.cjs +22481 -18741
  89. package/dist-lib/host/fetch-proxy-handler.cjs +21079 -17980
  90. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  91. package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
  92. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  93. package/dist-lib/host/websocket-proxy.cjs +1 -1
  94. package/dist-lib/index.cjs +68 -38
  95. package/dist-lib/kotlin-host.cjs +97 -21
  96. package/dist-lib/menu.cjs +1 -1
  97. package/dist-lib/menu.mjs +3 -3
  98. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  99. package/dist-lib/metro-fingerprint-registry.mjs +3 -3
  100. package/dist-lib/metro-production-bundle.cjs +23 -1
  101. package/dist-lib/metro-production-bundle.mjs +24 -4
  102. package/dist-lib/native-app-identity-project.cjs +3582 -571
  103. package/dist-lib/native-app-identity-project.mjs +1024 -398
  104. package/dist-lib/native-app-identity.cjs +1 -1
  105. package/dist-lib/native-app-identity.mjs +6 -6
  106. package/dist-lib/native-firebase-metadata.cjs +1 -1
  107. package/dist-lib/native-firebase-metadata.mjs +3 -3
  108. package/dist-lib/pdfium-raster.cjs +1 -1
  109. package/dist-lib/pdfium-raster.mjs +2 -2
  110. package/dist-lib/plist.cjs +1 -1
  111. package/dist-lib/plist.mjs +3 -3
  112. package/dist-lib/profiles.cjs +1 -1
  113. package/dist-lib/public-brand.cjs +1 -1
  114. package/dist-lib/public-origins-lib-esm.json +132 -116
  115. package/dist-lib/public-origins-lib.json +215 -173
  116. package/dist-lib/react-native-host-modules.cjs +1 -1
  117. package/dist-lib/react-native-host-modules.mjs +2 -2
  118. package/dist-lib/reap-browser.cjs +17 -1
  119. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  120. package/dist-lib/sdk.cjs +6 -7
  121. package/dist-lib/sdk.mjs +13 -14
  122. package/dist-lib/skills.cjs +23216 -19650
  123. package/dist-lib/swift-compile.cjs +4337 -2905
  124. package/dist-lib/swift-compile.mjs +15 -13
  125. package/dist-lib/swift-package.cjs +1 -1
  126. package/dist-lib/swift-package.mjs +3 -3
  127. package/dist-lib/swift-submit.cjs +1 -1
  128. package/dist-lib/swift-submit.mjs +6 -6
  129. package/dist-lib/swift-svg-raster.cjs +1 -1
  130. package/dist-lib/swift-svg-raster.mjs +2 -2
  131. package/dist-lib/swift-toolchain.cjs +19 -1
  132. package/dist-lib/swift.cjs +1 -1
  133. package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
  134. package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
  135. package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
  136. package/dist-lib/vendor/acorn.cjs +1 -1
  137. package/dist-lib/vendor/stream-json.cjs +1 -1
  138. package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
  139. package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
  140. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
  141. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
  142. package/dist-lib/vendor/sucrase.cjs +1 -1
  143. package/dist-lib/vendor/terser.cjs +1 -1
  144. package/dist-lib/vendor/valibot.cjs +1 -1
  145. package/dist-lib/vendor/ws.cjs +94 -32
  146. package/dist-lib/vendor/zod.cjs +1 -1
  147. package/dist-lib/worklet-executable.cjs +8 -5
  148. package/dist-lib/worklet-executable.mjs +9 -6
  149. package/dist-types/packages/peach-engine/src/canvaskit-artifact-urls.d.ts +2 -1
  150. package/dist-types/packages/peach-engine/src/capture/compositor-presentation-recording.d.ts +1 -0
  151. package/dist-types/packages/peach-engine/src/engine/generated/canvaskit-artifact-hashes.d.ts +26 -0
  152. package/dist-types/packages/peach-engine/src/engine/guest-scene-inspect.d.ts +1 -1
  153. package/dist-types/packages/peach-engine/src/engine/inspect-info.d.ts +1 -0
  154. package/dist-types/packages/peach-engine/src/engine/metalTypes.d.ts +32 -2
  155. package/dist-types/packages/peach-engine/src/engine/portalContract.d.ts +24 -0
  156. package/dist-types/packages/peach-engine/src/engine/remote-display-protocol.d.ts +12 -2
  157. package/dist-types/packages/peach-engine/src/guest/http-cookie-storage.d.ts +73 -0
  158. package/dist-types/packages/peach-engine/src/guest/native-evaluation-lease.d.ts +5 -0
  159. package/dist-types/packages/peach-engine/src/guest/nitro-jsi-host.d.ts +3 -1
  160. package/dist-types/packages/peach-engine/src/ios/apps/canvas-map-data.d.ts +225 -9
  161. package/dist-types/packages/peach-engine/src/ios/chrome-metrics.d.ts +4 -1
  162. package/dist-types/packages/peach-engine/src/ios/duo-vertical-bar-geometry.d.ts +0 -1
  163. package/dist-types/packages/peach-engine/src/native-preview-bundle.d.ts +1 -0
  164. package/dist-types/packages/peach-engine/src/remote-stream/canvas-display-compositor.d.ts +1 -0
  165. package/dist-types/packages/peach-engine/src/remote-stream/canvas-display-contract.d.ts +44 -10
  166. package/dist-types/packages/peach-engine/src/remote-stream/cloud-display.d.ts +4 -3
  167. package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +2 -4
  168. package/dist-types/packages/peach-engine/src/render-worker/metro-bundle-metadata.d.ts +2 -0
  169. package/dist-types/packages/peach-engine/src/render-worker/native-widgetContract.d.ts +1 -1
  170. package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +15 -27
  171. package/dist-types/packages/peach-engine/src/render-worker/reanimated-readiness.d.ts +2 -6
  172. package/dist-types/packages/peach-engine/src/render-worker/shell-protocol.d.ts +11 -3
  173. package/dist-types/packages/peach-engine/src/settings/devices.d.ts +3 -1
  174. package/dist-types/packages/peach-engine/src/settings/duo-fold.d.ts +1 -1
  175. package/dist-types/packages/peach-engine/src/webview-automation-host.d.ts +1 -1
  176. package/dist-types/packages/peach-globals/src/app-bundle-resources.d.ts +10 -0
  177. package/dist-types/packages/peach-globals/src/compositorBridgeContract.d.ts +1 -1
  178. package/dist-types/packages/peach-globals/src/hostStorageBridgeContract.d.ts +1 -0
  179. package/dist-types/packages/peach-globals/src/index.d.ts +2 -2
  180. package/dist-types/packages/peach-globals/src/lockstepCaptureBridgeContract.d.ts +9 -6
  181. package/dist-types/packages/peach-globals/src/nodeContract.d.ts +11 -0
  182. package/dist-types/packages/peach-globals/src/oneWidgetContract.d.ts +28 -0
  183. package/package.json +2 -2
  184. package/runtime-companion.json +1 -1
  185. package/sdk/ios/System/Library/Frameworks/CoreHaptics.framework/Headers/CoreHaptics.h +251 -0
  186. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INImage.h +14 -0
  187. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INIntent.h +18 -0
  188. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INIntentIdentifiers.h +30 -0
  189. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INIntentResponse.h +12 -0
  190. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INInteraction.h +35 -0
  191. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INObjectCollection.h +0 -7
  192. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INObjectSection.h +0 -7
  193. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INOutgoingMessageType.h +7 -0
  194. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INPerson.h +36 -0
  195. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INPersonHandle.h +22 -0
  196. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INSendMessageIntent+UserNotifications.h +6 -0
  197. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INSendMessageIntent.h +33 -0
  198. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INSpeakableString.h +24 -0
  199. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/Intents.h +11 -7
  200. package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMailComposeViewController.h +1 -1
  201. package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMessageComposeViewController.h +1 -1
  202. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLRenderCommandEncoder.h +0 -8
  203. package/sdk/ios/System/Library/Frameworks/MetalTypes.framework/Headers/MetalTypes.h +8 -0
  204. package/sdk/ios/System/Library/Frameworks/Social.framework/Headers/SLServiceTypes.h +9 -0
  205. package/sdk/ios/System/Library/Frameworks/Social.framework/Headers/Social.h +1 -0
  206. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotification.h +1 -1
  207. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationAction.h +2 -2
  208. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationAttachment.h +1 -1
  209. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationCategory.h +1 -1
  210. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationContent.h +2 -2
  211. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationRequest.h +1 -1
  212. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationResponse.h +2 -2
  213. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationSound.h +1 -1
  214. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationTrigger.h +5 -5
  215. package/sdk/ios/usr/lib/swift/UIKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +4 -0
  216. package/sdk/ios/wasm/include/unistd.h +1 -0
  217. package/src/acorn-program.ts +3 -0
  218. package/src/audio-codec-archives.ts +141 -0
  219. package/src/bridge-contract-input.ts +61 -1
  220. package/src/bridge-contract.ts +45 -4
  221. package/src/bundle-channel.mjs +44 -30
  222. package/src/capture-contract.ts +57 -39
  223. package/src/conformance-comparison-contract.ts +2 -0
  224. package/src/expo-discovery-cache.ts +0 -2
  225. package/src/expo-macro-host.ts +8 -3
  226. package/src/expo-native-compiler-digest.ts +0 -1
  227. package/src/expo-native-prebuilt.ts +1 -1
  228. package/src/expo-native-workspace.ts +83 -45
  229. package/src/expo-pod-prebuilt.ts +1 -0
  230. package/src/expo-swift-host.ts +158 -77
  231. package/src/expo-swift-legacy-runtime-source.ts +12 -1
  232. package/src/expo-swift-view-source.ts +51 -20
  233. package/src/expo-workspace-exclusion.ts +7 -1
  234. package/src/expoSwiftContract.ts +10 -1
  235. package/src/ffmpeg-source-build.ts +123 -59
  236. package/src/genrule-archives.ts +7 -2
  237. package/src/genrule-library-builds.ts +101 -18
  238. package/src/host/bridge-host.ts +10 -1
  239. package/src/installed-native-libraries.ts +147 -23
  240. package/src/installed-package-versions.ts +30 -0
  241. package/src/ios-rn-bundle-request.ts +3 -1
  242. package/src/ios-rn-bundle.ts +38 -27
  243. package/src/ios-rn-compile.ts +23 -6
  244. package/src/ios-rn-startup.ts +2 -1
  245. package/src/java-module-abi.ts +4 -3
  246. package/src/kotlin-host.ts +4 -4
  247. package/src/kotlin-library-sources.ts +8 -5
  248. package/src/metro-production-bundle.ts +24 -0
  249. package/src/native-firebase-config.ts +2 -0
  250. package/src/native-framework-compiler.ts +5 -0
  251. package/src/native-package-slice-build.ts +3 -0
  252. package/src/native-package-slice.ts +15 -10
  253. package/src/native-preparation.ts +4 -1
  254. package/src/native-static-libraries.ts +107 -33
  255. package/src/nativeRuntimePackageIndex.ts +1 -4
  256. package/src/nitro-adapter.lock.json +286 -286
  257. package/src/nitro-app-providers.ts +20 -8
  258. package/src/nitro-compile.ts +131 -37
  259. package/src/nitro-dependencies.ts +42 -8
  260. package/src/nitro-source.ts +40 -36
  261. package/src/nitro-superset.lock.json +4 -4
  262. package/src/nitroAdapterContract.ts +32 -7
  263. package/src/nitroContract.ts +21 -37
  264. package/src/one-direct-host-source.ts +247 -140
  265. package/src/one-fabric.ts +129 -0
  266. package/src/one-native-controls-package.ts +95 -21
  267. package/src/one-native-controls-release.ts +147 -14
  268. package/src/one-native-source.ts +4 -1
  269. package/src/one-nitro-inputs.ts +1 -1
  270. package/src/one-nitro-source.ts +45 -1
  271. package/src/one-sdk/source.ts +10 -41
  272. package/src/one-widget-metadata.ts +2 -2
  273. package/src/one-widget-package.ts +1 -1
  274. package/src/oneSdkContract.ts +3 -0
  275. package/src/playwright-browser-paths.ts +30 -0
  276. package/src/pods-install.ts +6 -2
  277. package/src/pods-post-install.ts +2 -2
  278. package/src/pods-project.ts +10 -0
  279. package/src/podspec-ruby-stdlib.ts +73 -0
  280. package/src/podspec-ruby.ts +1 -1
  281. package/src/podspec-sources.ts +31 -13
  282. package/src/process-group.ts +135 -5
  283. package/src/published-swift-sdk.ts +25 -1
  284. package/src/react-native-bridge-modules.ts +35 -3
  285. package/src/react-native-core-build.ts +14 -2
  286. package/src/react-native-core.ts +12 -2
  287. package/src/rive-runtime-dependencies.ts +178 -40
  288. package/src/serverDiscoveryContract.ts +1 -1
  289. package/src/storageSnapshotContract.ts +1 -1
  290. package/src/swift-app-data-store.ts +35 -0
  291. package/src/swift-compile.ts +403 -121
  292. package/src/swift-compiler-digest.ts +4 -0
  293. package/src/swift-darwin-records.ts +6 -0
  294. package/src/swift-distribution-mirror.ts +10 -1
  295. package/src/swift-distribution.lock.json +19 -18
  296. package/src/swift-distribution.ts +17 -1
  297. package/src/swift-entry-module.ts +1 -0
  298. package/src/swift-guest-compile.ts +8 -1
  299. package/src/swift-host.ts +79 -23
  300. package/src/swift-installed-targets.ts +51 -20
  301. package/src/swift-objc-standin.ts +60 -8
  302. package/src/swift-packages.ts +104 -24
  303. package/src/swift-project-user.ts +2 -1
  304. package/src/swift-reproducible.ts +99 -1
  305. package/src/swift-root-lock.ts +52 -46
  306. package/src/swift-sdk-app-module.ts +65 -13
  307. package/src/swift-sdk-image-producer.ts +2 -1
  308. package/src/swift-sdk-image.ts +23 -8
  309. package/src/swift-sdk-later-data.ts +294 -44
  310. package/src/swift-sdk-surface.ts +233 -55
  311. package/src/swift-shared-sdk.ts +7 -0
  312. package/src/swift-standin-builtin-behavior.ts +18 -0
  313. package/src/swift-standin-emit.ts +242 -54
  314. package/src/swift-standins.ts +184 -38
  315. package/src/swift-startup-split.ts +19 -9
  316. package/src/swift-toolchain.ts +18 -0
  317. package/src/swift-wasm-prune.ts +179 -9
  318. package/src/swift-xcframework.ts +16 -0
  319. package/src/swiftContract.ts +4 -1
  320. package/src/swiftSdkLinkContract.ts +2 -0
  321. package/src/swiftTargetContract.ts +1 -0
  322. package/src/turbo-bundle.ts +6 -3
  323. package/src/turbo-codegen-intake.ts +106 -16
  324. package/src/turbo-compile.ts +89 -68
  325. package/src/turbo-fabric-app.ts +287 -23
  326. package/src/turbo-provider-host.ts +122 -31
  327. package/src/turbo-runtime.lock.json +26 -26
  328. package/src/turbo-source.ts +374 -157
  329. package/src/vite-plugin.ts +48 -112
  330. package/src/wasm-binary-sections.ts +40 -0
  331. package/src/wasm-code-immediates.ts +35 -5
  332. package/src/widget-extension-bundle.ts +15 -1
  333. package/src/worklet-executable.ts +2 -1
  334. package/src/worklet-kernel.ts +5 -3
  335. package/src/worklets-babel.ts +2 -1
  336. package/src/xcode-project.ts +151 -53
  337. package/src/xcode-scheme-actions.ts +104 -0
  338. package/cli/commands/canvas.ts +0 -1204
  339. package/dist-lib/esm-chunks/chunk-B5QD2KEV.mjs +0 -2787
  340. package/dist-lib/vendor/magic-string.cjs +0 -1693
  341. package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-cookies.d.ts +0 -127
  342. package/src/appBundleResourcesContract.ts +0 -51
  343. package/src/canvas-groups.ts +0 -28
  344. package/src/canvas-map-layout.ts +0 -161
  345. package/src/oneWidgetContract.ts +0 -134
@@ -14,6 +14,7 @@ import type {
14
14
  SystemPermissionStatus,
15
15
  PeachAccessibilityNode,
16
16
  ResetOptions,
17
+ SimStyleOverrides,
17
18
  SootSimAgentActionDetail,
18
19
  SootSimAgentIdentity,
19
20
  SootSimCaptureFilter,
@@ -131,6 +132,7 @@ export interface WsCommand {
131
132
  y?: number
132
133
  durationMs?: number
133
134
  maxFrames?: number
135
+ timeoutMs?: number
134
136
  target?: SootSimAgentActionDetail['target']
135
137
  action?: string
136
138
  text?: string
@@ -249,9 +251,9 @@ export type SimTapResult = Partial<Omit<SootSimTapResult, 'reason' | 'hit'>> & {
249
251
  // testID lookup is exact, so tapId resolves in-engine.
250
252
  export type PerformStep =
251
253
  // raw pointer steps — full control over gesture physics
252
- | { type: 'touchDown'; x: number; y: number; pointerId?: number }
253
- | { type: 'touchMove'; x: number; y: number; pointerId?: number }
254
- | { type: 'touchUp'; x: number; y: number; pointerId?: number }
254
+ | { type: 'touchDown'; x: number; y: number; pointerId?: number; gate?: boolean }
255
+ | { type: 'touchMove'; x: number; y: number; pointerId?: number; gate?: boolean }
256
+ | { type: 'touchUp'; x: number; y: number; pointerId?: number; gate?: boolean }
255
257
  | { type: 'touchCancel'; pointerId?: number }
256
258
  // semantic steps
257
259
  | { type: 'tap'; x: number; y: number; target?: SootSimAgentActionDetail['target'] }
@@ -316,6 +318,12 @@ export type PerformStep =
316
318
  | { type: 'keyDown'; key: string }
317
319
  | { type: 'keyUp'; key: string }
318
320
  | { type: 'setOrientation'; orientation: 'portrait' | 'landscape' }
321
+ | {
322
+ type: 'setPosture'
323
+ rest?: 'closed' | 'book' | 'open' | 'laptop' | 'tent'
324
+ posture?: 'closed' | 'book' | 'open' | 'laptop' | 'tent'
325
+ orientation?: 'portrait' | 'landscape'
326
+ }
319
327
  | { type: 'deviceInfo' }
320
328
  | { type: 'deviceHardware'; action: DeviceHardwareAction }
321
329
  // refused with a named reason, never emulated: no hardware-button model,
@@ -327,6 +335,22 @@ export type PerformStep =
327
335
  | { type: 'decrementElement'; id: string }
328
336
  | { type: 'discoverStoreKitConfig' }
329
337
  | { type: 'clearStoreKitConfig' }
338
+ // native Duo host frame stepping: the host clock advances only on stepFrame until releaseClock
339
+ | {
340
+ type: 'stepFrame'
341
+ ms: number
342
+ pointers?: {
343
+ phase: string
344
+ x: number
345
+ y: number
346
+ timeMs?: number
347
+ gate?: boolean
348
+ }[]
349
+ }
350
+ | { type: 'releaseClock' }
351
+ | { type: 'screenshot' }
352
+ | { type: 'describe'; depth?: number }
353
+ | { type: 'scrollStateAt'; x: number; y: number }
330
354
 
331
355
  export interface PerformOptions {
332
356
  // stop the batch at the first failing step. default true — a gesture whose
@@ -360,6 +384,7 @@ export const REFUSED_PERFORM_STEP_TYPES = [
360
384
  'keyDown',
361
385
  'keyUp',
362
386
  'setOrientation',
387
+ 'setPosture',
363
388
  'buttonDown',
364
389
  'buttonUp',
365
390
  'incrementElement',
@@ -377,6 +402,8 @@ export function refusedPerformStepReason(type: RefusedPerformStepType): string {
377
402
  return `${type} is not supported: keys dispatch atomically; use the key step`
378
403
  case 'setOrientation':
379
404
  return 'setOrientation is not supported: the simulator viewport is fixed at boot'
405
+ case 'setPosture':
406
+ return 'setPosture is not supported: the simulator posture is fixed at boot'
380
407
  case 'buttonDown':
381
408
  case 'buttonUp':
382
409
  return `${type} is not supported: the simulator has no hardware buttons`
@@ -397,6 +424,7 @@ export function performStepRefusal(type: PerformStep['type']): string | null {
397
424
  case 'keyDown':
398
425
  case 'keyUp':
399
426
  case 'setOrientation':
427
+ case 'setPosture':
400
428
  case 'buttonDown':
401
429
  case 'buttonUp':
402
430
  case 'incrementElement':
@@ -404,6 +432,11 @@ export function performStepRefusal(type: PerformStep['type']): string | null {
404
432
  case 'discoverStoreKitConfig':
405
433
  case 'clearStoreKitConfig':
406
434
  return refusedPerformStepReason(type)
435
+ case 'stepFrame':
436
+ case 'releaseClock':
437
+ case 'screenshot':
438
+ case 'describe':
439
+ case 'scrollStateAt':
407
440
  case 'touchDown':
408
441
  case 'touchMove':
409
442
  case 'touchUp':
@@ -671,6 +704,11 @@ export type SimSemanticQuery =
671
704
  | { kind: 'screen' }
672
705
  // the element at a point, with its frame and source chain
673
706
  | { kind: 'inspectAt'; x: number; y: number; excludeTestIds?: string[] }
707
+ // one element with its children, after applying any style overrides to it
708
+ // (a null value removes that override)
709
+ | { kind: 'inspectNode'; nodeId: number; style?: SimStyleOverrides }
710
+
711
+ export type { SimStyleOverrides }
674
712
 
675
713
  export type SimNodeRecord = SootSimNodeRecord
676
714
 
@@ -693,8 +731,11 @@ export interface SimSemanticQueryResult {
693
731
  hit?: SootSimTapTargetVerification
694
732
  // { kind: 'screen' }
695
733
  screen?: { width: number; height: number }
696
- // { kind: 'inspectAt' }: null when nothing inspectable is there
734
+ // { kind: 'inspectAt' } and { kind: 'inspectNode' }: null when nothing
735
+ // inspectable is there
697
736
  inspected?: SootSimInspectInfo | null
737
+ // { kind: 'inspectNode' }: its inspectable children in order
738
+ children?: SootSimInspectInfo[]
698
739
  }
699
740
 
700
741
  export type SimSemanticResolveSelector = { testID: string } | { text: string }
@@ -7,10 +7,15 @@ import { brotliCompressSync, constants as zlibConstants } from 'node:zlib'
7
7
  import { isValidRuntimeVersion } from '@contrast/runtime-delivery/version'
8
8
  import { isLoopbackHost } from './backend-origin'
9
9
  import { resolveConnectionInput } from './dev-bundle-resolution'
10
+ import { isOneFramework } from '../../contrast-bundler/src/oneFramework.ts'
10
11
  import { cacheDir } from './home-paths'
11
12
  import { getCliRuntime, loadCliRuntime } from './cli-runtime'
12
13
  import { readInstalledNativePackageVersionsAsync } from './installed-package-versions'
13
14
  import { buildNativeBundles, insertNativeBundleFooters } from './native-bundles'
15
+ import {
16
+ packagedMetroAssetDirectory,
17
+ relocateMetroAssetLocations,
18
+ } from './metro-production-bundle'
14
19
  import { nodeHttpFetch } from './node-http-fetch'
15
20
  import {
16
21
  detachPackageVersionsFooter,
@@ -22,21 +27,15 @@ import {
22
27
  discoverProjectOneNativeAppCatalog,
23
28
  } from '../cli/app-catalog'
24
29
  import { captureStagedHostFiles } from './host/staged-host-files'
30
+ import {
31
+ describeAppBundleResources,
32
+ readAppBundleResourceFiles,
33
+ } from '../cli/app-bundle-resources'
34
+ import { insertAppBundleResourcesFooter } from '@peach/globals/app-bundle-resources'
25
35
 
26
36
  const digest = (bytes) => createHash('sha256').update(bytes).digest('hex')
27
37
  const segment = /^[a-zA-Z0-9._-]+$/
28
38
 
29
- // where a dev server asset location's files live in a release. metro names a
30
- // file outside the project root by an `unstable_path` query.
31
- function packagedAssetDirectory(location) {
32
- const parsed = new URL(location, 'https://packaged.invalid')
33
- if (parsed.origin !== 'https://packaged.invalid')
34
- throw new Error(`non-packaged asset location: ${location}`)
35
- const outside = parsed.searchParams.get('unstable_path')
36
- if (outside === null) return parsed.pathname.replace(/^\/+/, '')
37
- return `assets/${outside.replace(/^\.\//, '').replace(/\.\.\//g, '_')}`
38
- }
39
-
40
39
  // each platform publishes its own channel. ios keeps the original deployed
41
40
  // keys, which home screen configs already name.
42
41
  const channelKey = (platform) =>
@@ -113,6 +112,7 @@ async function prepareChannel({
113
112
  nitro = null,
114
113
  turbo = null,
115
114
  appCatalog = null,
115
+ appBundleResources = null,
116
116
  }) {
117
117
  if (!(platform in nativeAssetPath)) throw new Error(`unknown platform: ${platform}`)
118
118
  const native = platform === 'ios' ? expoSwift : expoKotlin
@@ -177,6 +177,7 @@ async function prepareChannel({
177
177
  if (nitro) identity.update(JSON.stringify(nitro.metadata))
178
178
  if (turbo) identity.update(JSON.stringify(turbo.metadata))
179
179
  if (appCatalog) identity.update(JSON.stringify(appCatalog))
180
+ if (appBundleResources) identity.update(JSON.stringify(appBundleResources))
180
181
  const releaseKey = `${prefix}/peach/releases/${identity.digest('hex')}`
181
182
  const assetBaseUrl = `${origin.origin}/${releaseKey}/`
182
183
  const directories = new Set(
@@ -191,23 +192,18 @@ async function prepareChannel({
191
192
  new TextDecoder('utf-8', { fatal: true }).decode(bundle),
192
193
  ),
193
194
  )
194
- let source = detached.source.replace(
195
- // minifiers emit the location as a JSON string or a plain template literal.
196
- /("?httpServerLocation"?\s*:\s*)(?:"((?:[^"\\]|\\.)*)"|`([^`\\$]*)`)/g,
197
- (match, property, quoted, template) => {
198
- const location = quoted === undefined ? template : JSON.parse(`"${quoted}"`)
199
- const path = packagedAssetDirectory(location)
200
- if (!directories.has(path)) {
201
- throw new Error(`bundle asset location has no packaged files: ${location}`)
202
- }
203
- locations++
204
- return `${property}${JSON.stringify(new URL(path, assetBaseUrl).href)}`
205
- },
206
- )
195
+ let source = relocateMetroAssetLocations(detached.source, (location) => {
196
+ const path = packagedMetroAssetDirectory(location)
197
+ if (!directories.has(path)) {
198
+ throw new Error(`bundle asset location has no packaged files: ${location}`)
199
+ }
200
+ locations++
201
+ return new URL(path, assetBaseUrl).href
202
+ })
207
203
  if (oneDevAssets.length) {
208
204
  source = source.replaceAll(`${oneDevAssetOrigin}/`, assetBaseUrl)
209
205
  }
210
- if (assets.some(asset => !asset.path.startsWith('assets/native-catalog/')) && !locations)
206
+ if (assets.some(asset => !/^assets\/native-(catalog|resources)\//.test(asset.path)) && !locations)
211
207
  throw new Error('bundle has packaged files but no asset metadata')
212
208
  const attached = insertNativeBundleFooters(
213
209
  source,
@@ -224,6 +220,14 @@ async function prepareChannel({
224
220
  ])),
225
221
  })
226
222
  }
223
+ if (appBundleResources)
224
+ source = insertAppBundleResourcesFooter(
225
+ source,
226
+ Object.fromEntries(Object.entries(appBundleResources).map(([path, resource]) => [
227
+ path,
228
+ { ...resource, uri: new URL(resource.uri, assetBaseUrl).href },
229
+ ])),
230
+ )
227
231
  if (detached.versions)
228
232
  source = insertPackageVersionsFooter(source, detached.versions)
229
233
  source = await attachRolldownBundleInventory(source)
@@ -355,7 +359,7 @@ async function packagePlatformBundle(
355
359
  .toString('utf8')
356
360
  .matchAll(/(?<=registerAsset\()\{[^{}]*"__packager_asset": true[^{}]*\}/g)) {
357
361
  const asset = JSON.parse(registration)
358
- const directory = packagedAssetDirectory(asset.httpServerLocation)
362
+ const directory = packagedMetroAssetDirectory(asset.httpServerLocation)
359
363
  if (asset.files) {
360
364
  for (const file of asset.files) {
361
365
  const path = `${directory}/${basename(file)}`
@@ -394,6 +398,15 @@ async function packagePlatformBundle(
394
398
  }
395
399
  }
396
400
  }
401
+ let appBundleResources = null
402
+ if (platform === 'ios') {
403
+ const files = readAppBundleResourceFiles(projectRoot)
404
+ if (files.length) {
405
+ const paths = files.map(({ bytes }) => `assets/native-resources/${digest(bytes)}`)
406
+ files.forEach(({ bytes }, index) => assets.set(paths[index], bytes))
407
+ appBundleResources = describeAppBundleResources(files, paths)
408
+ }
409
+ }
397
410
  const source = insertPackageVersionsFooter(
398
411
  await produceConfiguredBundle(bundle.toString('utf8'), config, new Set(Object.keys(versions))),
399
412
  versions,
@@ -405,6 +418,7 @@ async function packagePlatformBundle(
405
418
  return {
406
419
  platform,
407
420
  appCatalog,
421
+ appBundleResources,
408
422
  bundle: Buffer.from(source),
409
423
  assets: [...assets].map(([path, bytes]) => ({ path, bytes })),
410
424
  ...natives,
@@ -534,7 +548,7 @@ export async function snapshotOneProductionBundle(
534
548
  return { platforms: snapshots }
535
549
  }
536
550
 
537
- async function snapshotOneV3DevBundle(projectRoot, compiler, env) {
551
+ async function snapshotOneV3DevBundle(projectRoot, compiler, env, runtimeExecutable) {
538
552
  const { spawn } = await import('node:child_process')
539
553
  const { mkdtemp, readFile, rm } = await import('node:fs/promises')
540
554
  const { tmpdir } = await import('node:os')
@@ -542,7 +556,7 @@ async function snapshotOneV3DevBundle(projectRoot, compiler, env) {
542
556
  const out = await mkdtemp(join(tmpdir(), 'peach-one-dev-'))
543
557
  try {
544
558
  // the native dev compiler runs in Bun; the publisher and packaged CLI run in Node.
545
- const child = spawn('bun', ['-e', `
559
+ const child = spawn(runtimeExecutable, ['-e', `
546
560
  const [compiler, output, origin] = process.argv.slice(1)
547
561
  const { createPeachDevBundle } = await import(compiler)
548
562
  const dev = await createPeachDevBundle({
@@ -594,11 +608,11 @@ export async function snapshotOneDevBundle(projectRoot, env = {}, options = {})
594
608
  'one/package.json',
595
609
  )
596
610
  const manifest = JSON.parse(readFileSync(onePackage, 'utf8'))
597
- if (manifest.name === '@one-v3/framework') {
611
+ if (isOneFramework(manifest.name, manifest.version)) {
598
612
  if (options.platforms?.some((platform) => platform !== 'ios'))
599
613
  throw new Error('One native dev snapshots require the Peach iOS host')
600
614
  const compiler = createRequire(onePackage).resolve('@one/native-engine/peach')
601
- return snapshotOneV3DevBundle(projectRoot, compiler, env)
615
+ return snapshotOneV3DevBundle(projectRoot, compiler, env, runtimeExecutable ?? 'bun')
602
616
  }
603
617
  const platforms = options.platforms ?? ['ios', 'android']
604
618
  const oneBin = join(dirname(onePackage), manifest.bin.one)
@@ -178,36 +178,50 @@ export interface RnxRasterRegionTree {
178
178
  }[]
179
179
  }
180
180
 
181
- export function isLiveRasterSource(node: RnxRasterRegionTree['nodes'][number]): boolean {
181
+ function imageSourceUri(node: RnxRasterRegionTree['nodes'][number]): string | null {
182
182
  const source = node.props?.source
183
- return (
184
- node.type === 'image' &&
183
+ return node.type === 'image' &&
185
184
  !!source &&
186
185
  typeof source === 'object' &&
187
186
  'uri' in source &&
188
- typeof source.uri === 'string' &&
189
- source.uri.startsWith('live:')
190
- )
187
+ typeof source.uri === 'string'
188
+ ? source.uri
189
+ : null
190
+ }
191
+
192
+ export function isLiveRasterSource(node: RnxRasterRegionTree['nodes'][number]): boolean {
193
+ return imageSourceUri(node)?.startsWith('live:') ?? false
194
+ }
195
+
196
+ function isGuestProjectImage(uri: string | null): boolean {
197
+ return uri !== null && /^(?:https?:\/\/[^/?#]+)?\/__contrast_project_asset\//.test(uri)
191
198
  }
192
199
 
193
- // the frame a raster layer captures, before paint outsets. a live source
194
- // (video, a gpu scene) is cut to its visible bounds: opaque content in front
195
- // of it replays semantically over the rest. one hidden entirely keeps its
196
- // layout frame. the budget and the region both read this, so a layer costs
197
- // the atlas exactly what it was budgeted.
198
- function rasterLayerFrame(node: RnxRasterRegionTree['nodes'][number]): RnxCaptureRect {
200
+ function rasterLayerFrame(
201
+ node: RnxRasterRegionTree['nodes'][number],
202
+ viewport: Pick<RnxRasterRegionTree, 'width' | 'height'>,
203
+ ): RnxCaptureRect {
199
204
  const visible = node.visibleFrame
200
- if (isLiveRasterSource(node) && visible && visible.width > 0 && visible.height > 0) {
205
+ const uri = imageSourceUri(node)
206
+ if (visible && visible.width > 0 && visible.height > 0 && isGuestProjectImage(uri)) {
201
207
  return { x: visible.x, y: visible.y, width: visible.width, height: visible.height }
202
208
  }
203
- return (
204
- node.frame ?? {
205
- x: node.absolutePosition.x,
206
- y: node.absolutePosition.y,
207
- width: node.layout.width,
208
- height: node.layout.height,
209
- }
210
- )
209
+ const frame = node.frame ?? {
210
+ x: node.absolutePosition.x,
211
+ y: node.absolutePosition.y,
212
+ width: node.layout.width,
213
+ height: node.layout.height,
214
+ }
215
+ if (!uri?.startsWith('live:')) return frame
216
+ // occlusion bounds can omit pixels still visible around later layers.
217
+ const x = Math.max(frame.x, 0)
218
+ const y = Math.max(frame.y, 0)
219
+ return {
220
+ x,
221
+ y,
222
+ width: Math.max(0, Math.min(frame.x + frame.width, viewport.width) - x),
223
+ height: Math.max(0, Math.min(frame.y + frame.height, viewport.height) - y),
224
+ }
211
225
  }
212
226
 
213
227
  // `nodeIds` is every node the atlas carries. a node in `ownPaint` carries only
@@ -226,12 +240,13 @@ export function selectRnxRasterNodeIds(
226
240
  const maxLayerArea = tree.width * tree.height * 0.25
227
241
  const eligible = new Map<
228
242
  number,
229
- { nodeId: number; area: number; liveSource: boolean; ownPaint: boolean }
243
+ { nodeId: number; area: number; priority: number; ownPaint: boolean }
230
244
  >()
231
245
  for (const node of tree.nodes) {
232
- const liveSource = isLiveRasterSource(node)
246
+ const uri = imageSourceUri(node)
247
+ const liveSource = uri?.startsWith('live:') ?? false
233
248
  const visibleFrame = liveSource
234
- ? rasterLayerFrame(node)
249
+ ? rasterLayerFrame(node, tree)
235
250
  : (node.visibleFrame ?? node.frame)
236
251
  if (!visibleFrame || visibleFrame.width <= 0 || visibleFrame.height <= 0) continue
237
252
  const glass =
@@ -240,11 +255,13 @@ export function selectRnxRasterNodeIds(
240
255
  node.style._liquidGlassMaterialTint !== undefined
241
256
  const background = node.style.experimental_backgroundImage
242
257
  const layers = Array.isArray(background) ? background : [background]
243
- // native image layers may reference resources owned by the capture guest.
258
+ // the guest's image registry is gone by the time a frozen board is replayed.
259
+ const guestImage = isGuestProjectImage(uri)
244
260
  const imageBackground =
245
261
  (node.type === 'view' || node.type === 'root' || node.type === 'scroll-view') &&
246
262
  layers.some((layer) => typeof layer === 'string' && layer.startsWith('@'))
247
263
  const unsupported =
264
+ guestImage ||
248
265
  imageBackground ||
249
266
  node.type === 'masked-view' ||
250
267
  node.props?.__peachCaptureSvgRaster === true ||
@@ -257,35 +274,33 @@ export function selectRnxRasterNodeIds(
257
274
  ))) ||
258
275
  glass
259
276
  if (!unsupported) continue
260
- const captured = rasterLayerFrame(node)
277
+ const captured = liveSource ? visibleFrame : rasterLayerFrame(node, tree)
261
278
  const area = captured.width * captured.height
262
279
  const ownPaint = imageBackground || (glass && area > maxLayerArea)
263
- if (liveSource || area <= maxLayerArea || ownPaint) {
264
- eligible.set(node.nodeId, { nodeId: node.nodeId, area, liveSource, ownPaint })
280
+ const priority = liveSource ? 2 : guestImage || ownPaint ? 1 : 0
281
+ if (priority > 0 || area <= maxLayerArea) {
282
+ eligible.set(node.nodeId, { nodeId: node.nodeId, area, priority, ownPaint })
265
283
  }
266
284
  }
267
- // a whole-subtree layer takes its descendants' live priority. own-paint
285
+ // a whole-subtree layer takes its descendants' priority. own-paint
268
286
  // layers leave their descendants separate.
269
287
  for (const [nodeId, layer] of eligible) {
270
288
  let parentNodeId = nodesById.get(nodeId)?.parentNodeId ?? null
271
289
  while (parentNodeId !== null) {
272
290
  const parent = eligible.get(parentNodeId)
273
291
  if (parent && !parent.ownPaint) {
274
- parent.liveSource ||= layer.liveSource
292
+ parent.priority = Math.max(parent.priority, layer.priority)
275
293
  eligible.delete(nodeId)
276
294
  break
277
295
  }
278
296
  parentNodeId = nodesById.get(parentNodeId)?.parentNodeId ?? null
279
297
  }
280
298
  }
281
- // live sources and own-paint layers (sheet material, image backgrounds) claim the atlas
282
- // first, up to a screen between them; the other layers follow smallest
283
- // first, up to half a screen of their own. the whole atlas stays within a
284
- // screen and a quarter, which the packer's pixel budget holds at the producer's density.
299
+ // live images claim up to one screen. when present, later layers use
300
+ // the remaining space within the same atlas cap.
285
301
  const candidates = [...eligible.values()].sort(
286
302
  (left, right) =>
287
- Number(right.liveSource) - Number(left.liveSource) ||
288
- Number(right.ownPaint) - Number(left.ownPaint) ||
303
+ right.priority - left.priority ||
289
304
  left.area - right.area ||
290
305
  left.nodeId - right.nodeId,
291
306
  )
@@ -293,10 +308,12 @@ export function selectRnxRasterNodeIds(
293
308
  const selection: RnxRasterSelection = { nodeIds: new Set(), ownPaint: new Set() }
294
309
  let atlasArea = 0
295
310
  let layerArea = 0
311
+ let hasLiveLayer = false
296
312
  for (const candidate of candidates) {
297
- const leading = candidate.liveSource || candidate.ownPaint
313
+ const leading = candidate.priority > 0
314
+ const reserveHeadroom = candidate.priority === 2 || (leading && !hasLiveLayer)
298
315
  if (
299
- atlasArea + candidate.area > screenArea * (leading ? 1 : 1.25) ||
316
+ atlasArea + candidate.area > screenArea * (reserveHeadroom ? 1 : 1.25) ||
300
317
  (!leading && layerArea + candidate.area > screenArea * 0.5)
301
318
  ) {
302
319
  continue
@@ -304,6 +321,7 @@ export function selectRnxRasterNodeIds(
304
321
  selection.nodeIds.add(candidate.nodeId)
305
322
  if (candidate.ownPaint) selection.ownPaint.add(candidate.nodeId)
306
323
  atlasArea += candidate.area
324
+ hasLiveLayer ||= candidate.priority === 2
307
325
  if (!leading) layerArea += candidate.area
308
326
  }
309
327
  // the area budget does not see shelf waste or the packer's bounds, so a
@@ -334,7 +352,7 @@ export function rnxRasterFrames(
334
352
  const frames = new Map<number, RnxCaptureRect>()
335
353
  for (const node of tree.nodes) {
336
354
  if (!nodeIds.has(node.nodeId)) continue
337
- const frame = rasterLayerFrame(node)
355
+ const frame = rasterLayerFrame(node, tree)
338
356
  // a region is what the node paints, and nothing else: a producer that crops
339
357
  // a composited screenshot copies every pixel inside it, so any margin past
340
358
  // the paint carries neighbours (a header title, a hairline, a list row)
@@ -5,6 +5,8 @@ export const CONFORMANCE_PIXEL_THRESHOLD = 0.05
5
5
  export const CONFORMANCE_POSITIONAL_RADIUS = 1
6
6
  export const CONFORMANCE_MAX_DIFF_PERCENT = 1
7
7
  export const CONFORMANCE_MAX_DIFF_RATIO = CONFORMANCE_MAX_DIFF_PERCENT / 100
8
+ // a cell whose tree matches and whose pixels are within this is partially verified
9
+ export const CONFORMANCE_PARTIAL_MAX_DIFF_PERCENT = 3
8
10
  export const CONFORMANCE_INCLUDE_ANTIALIASING = true
9
11
 
10
12
  // flat-shade rule. the per-pixel tolerance exists to forgive antialiasing and
@@ -8,7 +8,6 @@ import { createHash, randomUUID } from 'node:crypto'
8
8
  import fs from 'node:fs'
9
9
  import path from 'node:path'
10
10
  import { zstdCompressSync, zstdDecompressSync } from 'node:zlib'
11
- import { EXPO_EAGER_NATIVE_VIEWS } from '../../peach-compat/src/stubs/native-seams/expo-eager-seam-contract'
12
11
  import { peachAnsweredNativePackages } from './answeredNativePackages'
13
12
  import { expoNativeCompilerDigestValue } from './expo-native-compiler-digest'
14
13
  import { hashExpoWorkspace } from './expo-native-workspace'
@@ -27,7 +26,6 @@ function peachPin(): string {
27
26
  .update(
28
27
  `${FORMAT}\0${expoNativeCompilerDigestValue()}\0${swiftNativePin().distribution.id}\0`,
29
28
  )
30
- .update(JSON.stringify([...EXPO_EAGER_NATIVE_VIEWS]))
31
29
  .update(JSON.stringify([...peachAnsweredNativePackages()].sort()))
32
30
  .digest('hex')
33
31
  }
@@ -64,7 +64,12 @@ function hostMacro(root: string) {
64
64
  if (header.equals(Buffer.from([0x7f, 0x45, 0x4c, 0x46]))) return { binary: installed }
65
65
 
66
66
  const release = privateSwiftRelease() ?? swiftNativePin().distribution.release
67
- const stamp = createHash('sha256').update(`${release}\0${process.arch}\0host-syntax\0`)
67
+ // the binary's runpath names this toolchain's host libraries, so a toolchain
68
+ // installed elsewhere (a job's temporary home) builds its own.
69
+ const host = path.resolve(swiftToolchainBin(release), '../lib/swift/host')
70
+ const stamp = createHash('sha256').update(
71
+ `${release}\0${process.arch}\0host-syntax\0${host}\0`,
72
+ )
68
73
  const sources = path.join(source, 'Sources')
69
74
  const swiftFiles = fs
70
75
  .readdirSync(sources, { recursive: true, encoding: 'utf8' })
@@ -84,7 +89,7 @@ function hostMacro(root: string) {
84
89
  const cache = path.join(swiftCacheDir(), 'expo-macro-host', stamp.digest('hex'))
85
90
  return {
86
91
  binary: path.join(cache, 'ExpoModulesMacros'),
87
- build: { cache, release, source, sources, swiftFiles },
92
+ build: { cache, release, host, source, sources, swiftFiles },
88
93
  }
89
94
  }
90
95
 
@@ -104,7 +109,7 @@ export async function prepareExpoMacroBinary(
104
109
  async (lease) => {
105
110
  if (fs.existsSync(binary)) return binary
106
111
  const bin = swiftToolchainBin(build.release)
107
- const host = path.resolve(bin, '../lib/swift/host')
112
+ const { host } = build
108
113
  const lock = path.join(build.source, 'Package.resolved')
109
114
  fs.mkdirSync(build.cache, { recursive: true })
110
115
  await prefetchSwiftCheckouts(build.cache, [lock], signal)
@@ -17,7 +17,6 @@ export const EXPO_NATIVE_COMPILER_SOURCES = [
17
17
  'expo-autolinking.ts',
18
18
  'expo-native-workspace.ts',
19
19
  'expoSwiftContract.ts',
20
- '../../peach-compat/src/stubs/native-seams/expo-eager-seam-contract.ts',
21
20
  'turbo-bundle.ts',
22
21
  'turbo-fabric-app.ts',
23
22
  'turbo-source.ts',
@@ -157,7 +157,7 @@ export async function expoNativeInputs(appRoot: string): Promise<{
157
157
  compiler: expoNativeCompilerDigestValue(),
158
158
  'swift-pin': JSON.stringify(swiftNativePin()),
159
159
  answered: JSON.stringify([...peachAnsweredNativePackages()].sort()),
160
- 'pods-environment': JSON.stringify(reactNativePodsEnvironment()),
160
+ 'pods-environment': JSON.stringify(reactNativePodsEnvironment(appRoot)),
161
161
  fingerprint: createHash('sha256').update(lines.sort().join('\n')).digest('hex'),
162
162
  },
163
163
  packages,