peachsim 0.1.1728 → 0.1.1744

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 (374) hide show
  1. package/README.md +4 -0
  2. package/cli/app-catalog.ts +47 -23
  3. package/cli/app-fonts.ts +19 -1
  4. package/cli/command-registry.ts +3 -0
  5. package/cli/commands/control.ts +68 -16
  6. package/cli/commands/coverage-swift.ts +112 -4
  7. package/cli/commands/device.ts +3 -1
  8. package/cli/commands/doctor.ts +1 -4
  9. package/cli/commands/inspect/settling.ts +6 -1
  10. package/cli/commands/inspect/wait-ready.ts +22 -2
  11. package/cli/commands/package.ts +33 -21
  12. package/cli/commands/push.ts +56 -0
  13. package/cli/commands/serve.ts +9 -0
  14. package/cli/commands/shell-url.ts +41 -9
  15. package/cli/commands/swift.ts +1 -1
  16. package/cli/current-sim.ts +27 -0
  17. package/cli/drivers/linux-browser-libs.lock.json +323 -1
  18. package/cli/drivers/linux-browser-libs.ts +8 -6
  19. package/cli/drivers/playwright.ts +5 -1
  20. package/cli/internal-child.ts +11 -1
  21. package/cli/main.ts +6 -0
  22. package/cli/native-input.ts +1 -7
  23. package/cli/outbound-endpoints.ts +9 -1
  24. package/cli/packaged-app-launcher.ts +3 -1
  25. package/cli/scene-video.ts +28 -7
  26. package/cli/ws-bridge.ts +3 -1
  27. package/detox/index.ts +18 -5
  28. package/dist-lib/agent-daemon-client.cjs +1 -1
  29. package/dist-lib/agent-events.cjs +1 -1
  30. package/dist-lib/attached-projects.cjs +5 -2
  31. package/dist-lib/auth/shared-session.cjs +5 -2
  32. package/dist-lib/backend-origin.cjs +1 -1
  33. package/dist-lib/beta.cjs +1 -1
  34. package/dist-lib/beta.mjs +1 -1
  35. package/dist-lib/bridge-constants.cjs +1 -1
  36. package/dist-lib/bridge-contract-input.cjs +1 -1
  37. package/dist-lib/bridge-contract-input.mjs +1 -1
  38. package/dist-lib/bridge-contract.cjs +1 -1
  39. package/dist-lib/bridge-contract.mjs +1 -1
  40. package/dist-lib/bundle-channel.cjs +9932 -4561
  41. package/dist-lib/capture-contract.cjs +1 -1
  42. package/dist-lib/capture-contract.mjs +1 -1
  43. package/dist-lib/cloud-contract.cjs +1 -1
  44. package/dist-lib/cloud-contract.mjs +1 -1
  45. package/dist-lib/cloud-test-args.cjs +1 -1
  46. package/dist-lib/cloud-test-args.mjs +1 -1
  47. package/dist-lib/cloud.cjs +1 -1
  48. package/dist-lib/cloud.mjs +1 -1
  49. package/dist-lib/config.cjs +1 -1
  50. package/dist-lib/config.mjs +1 -1
  51. package/dist-lib/detox/index.cjs +30 -8
  52. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  53. package/dist-lib/expo-swift-bundle.cjs +6886 -3303
  54. package/dist-lib/expo-swift-metadata.cjs +14 -2
  55. package/dist-lib/expo-swift-metadata.mjs +14 -2
  56. package/dist-lib/home-paths.cjs +7 -2
  57. package/dist-lib/host/bridge-host.cjs +8513 -3085
  58. package/dist-lib/host/fetch-proxy-handler.cjs +19 -7
  59. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  60. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  61. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  62. package/dist-lib/host/websocket-proxy.cjs +6 -3
  63. package/dist-lib/index.cjs +175 -80
  64. package/dist-lib/jump-to-source-babel.cjs +1 -1
  65. package/dist-lib/jump-to-source-native.cjs +1 -1
  66. package/dist-lib/kotlin-host.cjs +209 -32
  67. package/dist-lib/menu.cjs +7 -1
  68. package/dist-lib/menu.mjs +7 -1
  69. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  70. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  71. package/dist-lib/metro-production-bundle.cjs +1 -1
  72. package/dist-lib/metro-production-bundle.mjs +1 -1
  73. package/dist-lib/metro.cjs +146 -76
  74. package/dist-lib/native-app-identity-project.cjs +76 -39
  75. package/dist-lib/native-app-identity-project.mjs +76 -39
  76. package/dist-lib/native-app-identity.cjs +10 -3
  77. package/dist-lib/native-app-identity.mjs +10 -3
  78. package/dist-lib/native-firebase-metadata.cjs +1 -1
  79. package/dist-lib/native-firebase-metadata.mjs +1 -1
  80. package/dist-lib/plist.cjs +1 -1
  81. package/dist-lib/plist.mjs +1 -1
  82. package/dist-lib/profiles.cjs +5 -2
  83. package/dist-lib/public-brand.cjs +1 -1
  84. package/dist-lib/public-origins-lib-esm.json +25 -23
  85. package/dist-lib/public-origins-lib.json +138 -80
  86. package/dist-lib/react-native-host-modules.cjs +5 -2
  87. package/dist-lib/react-native-host-modules.mjs +5 -2
  88. package/dist-lib/reap-browser.cjs +1 -1
  89. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  90. package/dist-lib/sdk.cjs +4 -1
  91. package/dist-lib/sdk.mjs +4 -1
  92. package/dist-lib/skills.cjs +41126 -36493
  93. package/dist-lib/swift-compile.cjs +2103 -444
  94. package/dist-lib/swift-compile.mjs +2025 -369
  95. package/dist-lib/swift-package.cjs +1 -1
  96. package/dist-lib/swift-package.mjs +1 -1
  97. package/dist-lib/swift-submit.cjs +2 -2
  98. package/dist-lib/swift-submit.mjs +2 -2
  99. package/dist-lib/swift-toolchain.cjs +84 -24
  100. package/dist-lib/swift.cjs +1 -1
  101. package/dist-lib/vite-swift.cjs +6094 -2687
  102. package/dist-lib/vite.cjs +32 -10
  103. package/dist-lib/worklet-executable.cjs +1 -1
  104. package/dist-lib/worklet-executable.mjs +1 -1
  105. package/dist-types/packages/peach-compat/src/stubs/screen-transition-math.d.ts +1 -0
  106. package/dist-types/packages/peach-engine/src/cli-companion.d.ts +1 -0
  107. package/dist-types/packages/peach-engine/src/engine/canvaskit-renderer.d.ts +2 -0
  108. package/dist-types/packages/peach-engine/src/engine/font-config.d.ts +7 -4
  109. package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +1 -3
  110. package/dist-types/packages/peach-engine/src/engine/liquid-glass.d.ts +0 -5
  111. package/dist-types/packages/peach-engine/src/engine/memory-counts.d.ts +8 -0
  112. package/dist-types/packages/peach-engine/src/engine/node.d.ts +10 -1
  113. package/dist-types/packages/peach-engine/src/engine/paint-boundary.d.ts +1 -0
  114. package/dist-types/packages/peach-engine/src/engine/render-damage.d.ts +2 -2
  115. package/dist-types/packages/peach-engine/src/engine/scene-table.d.ts +25 -3
  116. package/dist-types/packages/peach-engine/src/engine/scroll-platform.d.ts +1 -15
  117. package/dist-types/packages/peach-engine/src/engine/scroll.d.ts +1 -3
  118. package/dist-types/packages/peach-engine/src/engine/text-first-baseline.d.ts +6 -0
  119. package/dist-types/packages/peach-engine/src/engine/text-paragraph.d.ts +1 -0
  120. package/dist-types/packages/peach-engine/src/engine/types.d.ts +23 -0
  121. package/dist-types/packages/peach-engine/src/ios/chrome-metrics.d.ts +6 -0
  122. package/dist-types/packages/peach-engine/src/metro-identity-contract.d.ts +33 -0
  123. package/dist-types/packages/peach-engine/src/native-preview-bundle.d.ts +2 -0
  124. package/dist-types/packages/peach-engine/src/preview/bundle-layout.d.ts +1 -1
  125. package/dist-types/packages/peach-engine/src/remote-stream/scene-recording.d.ts +2 -0
  126. package/dist-types/packages/peach-engine/src/render-worker/compositor-gpu.d.ts +1 -1
  127. package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +2 -0
  128. package/dist-types/packages/peach-engine/src/render-worker/metro-bundle-metadata.d.ts +28 -0
  129. package/dist-types/packages/peach-engine/src/render-worker/native-ui-protocol.d.ts +21 -1
  130. package/dist-types/packages/peach-engine/src/render-worker/prepared-boot-bundle.d.ts +7 -0
  131. package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +15 -2
  132. package/dist-types/packages/peach-engine/src/render-worker/scroll-mirror.d.ts +1 -0
  133. package/dist-types/packages/peach-engine/src/render-worker/shell-protocol.d.ts +6 -0
  134. package/dist-types/packages/peach-engine/src/render-worker/test-bridge-protocol.d.ts +3 -3
  135. package/dist-types/packages/peach-engine/src/render-worker/webgpu-frame-transaction.d.ts +1 -0
  136. package/dist-types/packages/peach-engine/src/render-worker/webgpu-readback-scheduler.d.ts +1 -1
  137. package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +14 -1
  138. package/dist-types/packages/peach-engine/src/rolldown-bundle-inventory.d.ts +8 -1
  139. package/dist-types/packages/peach-engine/src/rolldown-production-fingerprint.d.ts +1 -4
  140. package/dist-types/packages/peach-engine/src/rolldown-production-module.d.ts +12 -0
  141. package/dist-types/packages/peach-engine/src/rolldown-production-roles.d.ts +6 -0
  142. package/dist-types/packages/peach-engine/src/settings/devices.d.ts +6 -1
  143. package/dist-types/packages/peach-engine/src/settings/duo-fold-bus.d.ts +1 -0
  144. package/dist-types/packages/peach-engine/src/shell-events.d.ts +4 -0
  145. package/dist-types/packages/peach-kit/src/capabilities.d.ts +8 -0
  146. package/kotlin/README.md +3 -0
  147. package/kotlin/sdk.tar.gz +0 -0
  148. package/package.json +2 -1
  149. package/runtime-companion.json +1 -1
  150. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccount.h +55 -0
  151. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccountCredential.h +35 -0
  152. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccountStore.h +94 -0
  153. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccountType.h +53 -0
  154. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACError.h +37 -0
  155. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/Accounts.h +13 -0
  156. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/AccountsDefines.h +13 -0
  157. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Modules/module.modulemap +5 -0
  158. package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h +1 -0
  159. package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkErrors.h +257 -0
  160. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFByteOrder.h +305 -0
  161. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h +2 -0
  162. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGAffineTransform.h +204 -0
  163. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBitmapContext.h +260 -0
  164. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColor.h +164 -0
  165. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorConversionInfo.h +101 -0
  166. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorSpace.h +510 -0
  167. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGContext.h +1132 -0
  168. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGConvertColorDataWithFormat.h +34 -0
  169. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataConsumer.h +83 -0
  170. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataProvider.h +197 -0
  171. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEXRToneMappingGamma.h +36 -0
  172. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGError.h +38 -0
  173. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFont.h +312 -0
  174. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFunction.h +106 -0
  175. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGradient.h +123 -0
  176. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGITUToneMapping.h +31 -0
  177. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGImage.h +409 -0
  178. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGLayer.h +78 -0
  179. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFArray.h +120 -0
  180. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContentStream.h +55 -0
  181. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContext.h +535 -0
  182. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDictionary.h +133 -0
  183. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDocument.h +252 -0
  184. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFMarkedContentItem.h +37 -0
  185. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFObject.h +67 -0
  186. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFOperatorTable.h +51 -0
  187. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFPage.h +101 -0
  188. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFScanner.h +123 -0
  189. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFStream.h +44 -0
  190. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFString.h +52 -0
  191. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFStructureElement.h +87 -0
  192. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPath.h +441 -0
  193. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPattern.h +89 -0
  194. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGRenderingBufferProvider.h +49 -0
  195. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGShading.h +124 -0
  196. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGToneMapping.h +85 -0
  197. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h +44 -252
  198. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Modules/module.modulemap +1 -0
  199. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/CFNetworkErrors.h +257 -0
  200. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes +58 -9
  201. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +992 -98
  202. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/NSURLSession+Network.h +32 -0
  203. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/Network.h +51 -0
  204. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/advertise_descriptor.h +193 -0
  205. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/browse_descriptor.h +163 -0
  206. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/browse_result.h +207 -0
  207. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/browser.h +285 -0
  208. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/connection.h +714 -0
  209. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/connection_group.h +629 -0
  210. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/connection_report.h +932 -0
  211. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/content_context.h +229 -0
  212. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/endpoint.h +390 -0
  213. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/error.h +135 -0
  214. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/ethernet_channel.h +349 -0
  215. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/framer_options.h +1187 -0
  216. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/group_descriptor.h +184 -0
  217. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/interface.h +150 -0
  218. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/ip_options.h +351 -0
  219. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/listener.h +438 -0
  220. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/nw_object.h +200 -0
  221. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/parameters.h +1205 -0
  222. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/path.h +392 -0
  223. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/path_monitor.h +216 -0
  224. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/privacy_context.h +188 -0
  225. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/protocol_options.h +126 -0
  226. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/proxy_config.h +357 -0
  227. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/quic_options.h +889 -0
  228. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/resolver_config.h +94 -0
  229. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/tcp_options.h +459 -0
  230. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/tls_options.h +115 -0
  231. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/txt_record.h +432 -0
  232. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/udp_options.h +112 -0
  233. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/ws_options.h +743 -0
  234. package/sdk/ios/System/Library/Frameworks/Network.framework/Modules/module.modulemap +9 -0
  235. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAAnimation.h +395 -0
  236. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CABase.h +132 -0
  237. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CADisplayLink.h +107 -0
  238. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAEmitterCell.h +153 -0
  239. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAEmitterLayer.h +151 -0
  240. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAFrameRateRange.h +40 -0
  241. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAGradientLayer.h +78 -0
  242. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CALayer.h +1078 -0
  243. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAMediaTiming.h +97 -0
  244. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAMediaTimingFunction.h +67 -0
  245. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAReplicatorLayer.h +65 -0
  246. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAScrollLayer.h +64 -0
  247. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAShapeLayer.h +135 -0
  248. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CATextLayer.h +99 -0
  249. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CATiledLayer.h +67 -0
  250. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CATransaction.h +124 -0
  251. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CATransform3D.h +138 -0
  252. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CATransformLayer.h +40 -0
  253. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAValueFunction.h +78 -0
  254. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h +19 -38
  255. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecureTransport.h +1757 -0
  256. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSAttributedString.h +19 -0
  257. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSParagraphStyle.h +28 -0
  258. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityConstants.h +114 -0
  259. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h +16 -0
  260. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIBarAppearance.h +47 -0
  261. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDataDetectors.h +20 -0
  262. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDatePicker.h +13 -0
  263. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDevice.h +16 -0
  264. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIEvent.h +84 -0
  265. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIGestureRecognizer.h +119 -0
  266. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIGestureRecognizerSubclass.h +66 -0
  267. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIHoverGestureRecognizer.h +45 -0
  268. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h +161 -37
  269. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPickerView.h +76 -0
  270. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITabBar.h +8 -0
  271. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITabBarAppearance.h +78 -0
  272. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITextInputTraits.h +29 -0
  273. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITouch.h +104 -0
  274. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITraitCollection.h +19 -0
  275. package/sdk/ios/usr/include/dns_sd.h +3616 -0
  276. package/sdk/ios/usr/include/dnssd.modulemap +4 -0
  277. package/sdk/ios/usr/include/module.modulemap +1 -0
  278. package/sdk/ios/usr/include/os/signpost.h +414 -0
  279. package/sdk/ios/usr/include/os.modulemap +5 -0
  280. package/sdk/ios/usr/include/sys/socketvar.h +191 -0
  281. package/sdk/ios/usr/include/sys/vsock.h +84 -0
  282. package/sdk/ios/wasm/include/errno.h +4 -20
  283. package/sdk/ios/wasm/include/pthread.h +3 -0
  284. package/sdk/ios/wasm/include/setjmp.h +57 -0
  285. package/sdk/ios/wasm/include/sys/resource.h +2 -2
  286. package/sdk/native-hashes.json +3 -3
  287. package/skills/contrast/SKILL.md +6 -5
  288. package/skills/peach-debug/SKILL.md +68 -265
  289. package/skills/peach-debug/references/accessibility.md +37 -73
  290. package/skills/peach-debug/references/commands.md +2 -2
  291. package/skills/peach-debug/references/events.md +74 -0
  292. package/skills/peach-perf/SKILL.md +64 -402
  293. package/skills/peach-perf/references/presentation.md +46 -0
  294. package/skills/peach-perf/references/profiling.md +93 -0
  295. package/skills/peach-perf/references/render-counters.md +57 -0
  296. package/skills/peach-setup/SKILL.md +66 -217
  297. package/skills/peach-setup/references/native-config.md +35 -0
  298. package/skills/peach-setup/references/reporting.md +28 -0
  299. package/skills/peach-test/SKILL.md +68 -285
  300. package/skills/peach-test/references/detox.md +69 -0
  301. package/skills/peach-test/references/maestro.md +95 -0
  302. package/skills/peach-visual/SKILL.md +53 -106
  303. package/src/android-autolinking.ts +1 -0
  304. package/src/android-bridge-packages.ts +279 -0
  305. package/src/appPackageContract.ts +14 -1
  306. package/src/assetCatalogContract.ts +8 -1
  307. package/src/bridge-contract.ts +6 -0
  308. package/src/bundle-channel.mjs +152 -60
  309. package/src/cli-runtime.ts +3 -0
  310. package/src/configured-bundle-producer.ts +10 -0
  311. package/src/device-catalog.ts +68 -4
  312. package/src/expo-discovery-cache.ts +10 -3
  313. package/src/expo-kotlin-host.ts +97 -26
  314. package/src/expo-native-workspace.ts +211 -52
  315. package/src/expo-swift-host.ts +149 -123
  316. package/src/expo-swift-ready.ts +5 -1
  317. package/src/expo-widget-assets.ts +76 -0
  318. package/src/expoKotlinContract.ts +12 -2
  319. package/src/expoSwiftContract.ts +21 -2
  320. package/src/generated/swift-c-predefines.json +1 -1
  321. package/src/home-paths.ts +6 -1
  322. package/src/host/bridge-host.ts +5 -0
  323. package/src/host/fetch-proxy-handler.ts +10 -0
  324. package/src/host/websocket-proxy.ts +7 -2
  325. package/src/kotlin-host.ts +204 -30
  326. package/src/kotlinSdkContract.ts +2 -1
  327. package/src/menu.ts +7 -0
  328. package/src/native-prebuilt.ts +154 -0
  329. package/src/nitro-adapter.lock.json +261 -261
  330. package/src/nitro-adapter.ts +118 -50
  331. package/src/nitro-bundle.ts +134 -96
  332. package/src/nitro-compile.ts +16 -6
  333. package/src/nitro-dependencies.ts +43 -28
  334. package/src/nitro-source.ts +142 -30
  335. package/src/nitro-superset.lock.json +103 -0
  336. package/src/nitro-superset.ts +137 -0
  337. package/src/nitroAdapterContract.ts +146 -98
  338. package/src/nitroContract.ts +68 -21
  339. package/src/react-bridge-importers.ts +1 -0
  340. package/src/react-native-bridge-modules.ts +2 -0
  341. package/src/react-native-host-modules.ts +4 -1
  342. package/src/settingsContract.ts +37 -1
  343. package/src/storageSnapshotContract.ts +29 -81
  344. package/src/swift-compile.ts +315 -117
  345. package/src/swift-compiler-digest.ts +2 -0
  346. package/src/swift-coverage/indexdump.ts +22 -6
  347. package/src/swift-coverage/indexing.ts +4 -4
  348. package/src/swift-coverage/sdk.ts +104 -20
  349. package/src/swift-coverage/types.ts +34 -0
  350. package/src/swift-coverage/xcode-packages.ts +61 -1
  351. package/src/swift-coverage/xcode.ts +19 -13
  352. package/src/swift-cxx-reachable.ts +1 -1
  353. package/src/swift-distribution.lock.json +18 -13
  354. package/src/swift-distribution.ts +57 -26
  355. package/src/swift-host.ts +51 -35
  356. package/src/swift-link-roots.ts +45 -18
  357. package/src/swift-objc-compile.ts +78 -2
  358. package/src/swift-objc-standin.ts +3 -0
  359. package/src/swift-shared-sdk.ts +85 -1
  360. package/src/swift-standin-emit.ts +6 -1
  361. package/src/swift-standins.ts +403 -19
  362. package/src/swift-submit.ts +17 -1
  363. package/src/swift-toolchain.ts +98 -23
  364. package/src/swift-wasm-prune.ts +1629 -0
  365. package/src/turbo-bundle.ts +82 -0
  366. package/src/turbo-compile.ts +120 -0
  367. package/src/turbo-runtime.lock.json +69 -0
  368. package/src/turbo-source.ts +754 -0
  369. package/src/vite-plugin-one.ts +15 -3
  370. package/src/vite-plugin.ts +82 -23
  371. package/src/wasm-optimize.ts +34 -0
  372. package/src/worker-system-chunks.ts +3 -3
  373. package/src/xcode-project.ts +52 -0
  374. package/src/xcode-target-members.ts +12 -1
@@ -1,16 +1,49 @@
1
- // the prebuilt Nitro adapter archive's shapes and identity rules, shared by its
2
- // builder (packages/sootsim-swift/scripts/build-nitro-adapter-archive.ts), its
1
+ // the prebuilt private adapter archives' shapes and identity rules, shared by
2
+ // their builder (packages/sootsim-swift/scripts/build-nitro-adapter-archive.ts),
3
3
  // publisher (scripts/ops/nitro-adapter-publish.ts) and the installed CLI that
4
- // downloads and verifies it. nothing here reads adapter sources: an installed
5
- // CLI carries this file and checks an archive against the lock it was built with.
4
+ // downloads and verifies them. two families exist: the Nitro adapter, built
5
+ // against an app's original React Native JSI and Nitro headers, and the
6
+ // TurboModule runtime, built against its JSI headers alone. nothing here reads
7
+ // adapter sources: an installed CLI carries this file and checks an archive
8
+ // against the lock it was built with.
6
9
  import { createHash } from 'node:crypto'
7
10
  import { readdirSync, readFileSync } from 'node:fs'
8
11
  import path from 'node:path'
9
12
  import { isRecord } from './is-record'
10
13
 
11
14
  /** the file at the root of an unpacked adapter, and its install marker. */
12
- export const NITRO_ADAPTER_MANIFEST = 'manifest.json'
13
- export const NITRO_ADAPTER_ARCHIVE = 'libPeachNitroAdapter.a'
15
+ export const ADAPTER_MANIFEST = 'manifest.json'
16
+
17
+ export const ADAPTER_FAMILIES = {
18
+ nitro: {
19
+ label: 'Nitro adapter',
20
+ archive: 'libPeachNitroAdapter.a',
21
+ key: 'nitro-adapter',
22
+ headers: ['reactNativeJsi', 'nitroModules'],
23
+ },
24
+ turbo: {
25
+ label: 'TurboModule runtime',
26
+ archive: 'libPeachTurboRuntime.a',
27
+ key: 'turbo-runtime',
28
+ headers: ['reactNativeJsi'],
29
+ },
30
+ } as const
31
+ export type AdapterFamily = keyof typeof ADAPTER_FAMILIES
32
+
33
+ /** what a TurboModule host compiles against: the process's one JSI runtime
34
+ * over the host wire, which the turbo archive defines. */
35
+ export const TURBO_RUNTIME_HEADER = `#pragma once
36
+ #include <jsi/jsi.h>
37
+ #include <functional>
38
+
39
+ namespace peach::jsi_runtime {
40
+ // creates the process's one runtime. drain runs the work a consumer queued once
41
+ // the host's current call returns; dispose runs before the runtime ends.
42
+ facebook::jsi::Runtime& create(std::function<void()> drain, std::function<void()> dispose);
43
+ // asks the host to call drain after its current call returns.
44
+ void scheduleDrain();
45
+ }
46
+ `
14
47
 
15
48
  // header staging the collector exposes: JSI without the dynamic and test
16
49
  // pieces, and Nitro's cpp tree without views, copied to bare and nested names.
@@ -31,43 +64,42 @@ export const HEADER_STAGE = {
31
64
  }
32
65
 
33
66
  export interface NitroAdapterRoots {
34
- nitroModules: string
67
+ nitroModules?: string
35
68
  reactNative: string
36
69
  }
37
70
 
71
+ /** each header closure's digest, keyed by the family's header names. */
72
+ export type AdapterHeaders = Record<string, string>
73
+
38
74
  /** what the installed CLI needs to trust an archive; no private provenance. */
39
- export interface NitroAdapterManifest {
75
+ export interface AdapterManifest {
40
76
  schema: 1
41
77
  /** the guest platform the producer built for; every consumer matches it against the lock or its own recomputed identity. */
42
78
  platform: string
43
79
  target: string
44
80
  recipe: string
45
81
  adapter: { sha256: string }
46
- headers: { reactNativeJsi: string; nitroModules: string }
82
+ headers: AdapterHeaders
47
83
  compiler: string
48
84
  sdk: { id: string; checksum: string }
49
85
  framework: { distribution: string; wireAbi: string }
50
86
  archive: { path: string; size: number; sha256: string }
51
87
  }
52
88
 
53
- /** every published tarball one CLI build installs, committed beside
54
- * swift-distribution.lock.json: one build identity, and one archive per pair of
55
- * original React Native JSI and Nitro headers it was compiled against. */
56
- export interface NitroAdapterLock extends Omit<
57
- NitroAdapterManifest,
89
+ /** every published tarball of one family one CLI build installs, committed
90
+ * beside swift-distribution.lock.json: one build identity, and one archive per
91
+ * set of original headers it was compiled against. */
92
+ export interface AdapterLock extends Omit<
93
+ AdapterManifest,
58
94
  'schema' | 'archive' | 'headers'
59
95
  > {
60
96
  schema: 2
61
97
  /** each downloaded .tar.gz, which installVerifiedTarball checks. */
62
- archives: {
63
- headers: NitroAdapterManifest['headers']
64
- sha256: string
65
- size: number
66
- }[]
98
+ archives: { headers: AdapterHeaders; sha256: string; size: number }[]
67
99
  }
68
100
 
69
101
  /** the one archive an app's headers select: its manifest identity and tarball. */
70
- export interface NitroAdapterPin extends Omit<NitroAdapterManifest, 'archive'> {
102
+ export interface AdapterPin extends Omit<AdapterManifest, 'archive'> {
71
103
  archive: { sha256: string; size: number }
72
104
  }
73
105
 
@@ -94,7 +126,8 @@ function headerFiles(base: string, directory: string, skip: string[], keep: RegE
94
126
  return files.sort()
95
127
  }
96
128
 
97
- /** the original header closures the collector exposes, with per-file hashes. */
129
+ /** the original header closures the collector exposes, with per-file hashes;
130
+ * the Nitro closure is empty without a Nitro root. */
98
131
  export function headerClosure(roots: NitroAdapterRoots) {
99
132
  const { jsi: j, nitro: n } = HEADER_STAGE
100
133
  const jsiFiles = headerFiles(
@@ -103,115 +136,126 @@ export function headerClosure(roots: NitroAdapterRoots) {
103
136
  j.skip,
104
137
  new RegExp(j.keep),
105
138
  ).filter((file) => !file.endsWith(`/${j.exclude}`))
106
- const nitroFiles = headerFiles(roots.nitroModules, n.from, n.skip, new RegExp(n.keep))
139
+ const nitroFiles = roots.nitroModules
140
+ ? headerFiles(roots.nitroModules, n.from, n.skip, new RegExp(n.keep))
141
+ : []
107
142
  const hashes = (base: string, files: string[]) =>
108
143
  Object.fromEntries(
109
144
  files.map((file) => [file, sha256Hex(readFileSync(path.join(base, file)))]),
110
145
  )
111
146
  return {
112
147
  jsi: hashes(roots.reactNative, jsiFiles),
113
- nitro: hashes(roots.nitroModules, nitroFiles),
148
+ nitro: roots.nitroModules ? hashes(roots.nitroModules, nitroFiles) : {},
114
149
  nitroFiles,
115
150
  jsiFiles,
116
151
  }
117
152
  }
118
153
 
119
- /** the digests an app's original React Native and Nitro headers must match. */
120
- export function headerDigests(roots: NitroAdapterRoots) {
154
+ /** the digests an app's original headers must match, in the family's order. */
155
+ export function headerDigests(
156
+ family: AdapterFamily,
157
+ roots: NitroAdapterRoots,
158
+ ): AdapterHeaders {
121
159
  const closure = headerClosure(roots)
122
- return { reactNativeJsi: digest(closure.jsi), nitroModules: digest(closure.nitro) }
160
+ const all: AdapterHeaders = {
161
+ reactNativeJsi: digest(closure.jsi),
162
+ nitroModules: digest(closure.nitro),
163
+ }
164
+ return Object.fromEntries(
165
+ ADAPTER_FAMILIES[family].headers.map((key) => [key, all[key]!]),
166
+ )
123
167
  }
124
168
 
125
169
  const hex64 = (value: unknown): value is string =>
126
170
  typeof value === 'string' && /^[a-f0-9]{64}$/.test(value)
127
171
 
128
- function text(value: unknown, what: string): string {
172
+ function text(family: AdapterFamily, value: unknown, what: string): string {
129
173
  if (typeof value !== 'string' || !value)
130
- throw new Error(`invalid Nitro adapter ${what}`)
174
+ throw new Error(`invalid ${ADAPTER_FAMILIES[family].label} ${what}`)
131
175
  return value
132
176
  }
133
177
 
134
- function digestField(value: unknown, what: string): string {
135
- if (!hex64(value)) throw new Error(`invalid Nitro adapter ${what}`)
178
+ function digestField(family: AdapterFamily, value: unknown, what: string): string {
179
+ if (!hex64(value)) throw new Error(`invalid ${ADAPTER_FAMILIES[family].label} ${what}`)
136
180
  return value
137
181
  }
138
182
 
139
- function identity(value: unknown) {
140
- if (!isRecord(value) || value.schema !== 1)
141
- throw new Error('invalid Nitro adapter manifest')
142
- const { adapter, headers, sdk, framework } = value
143
- if (!isRecord(adapter) || !isRecord(headers) || !isRecord(sdk) || !isRecord(framework))
144
- throw new Error('invalid Nitro adapter manifest')
183
+ function headerSet(family: AdapterFamily, value: unknown): AdapterHeaders {
184
+ const keys = ADAPTER_FAMILIES[family].headers
185
+ if (!isRecord(value) || Object.keys(value).length !== keys.length)
186
+ throw new Error(`invalid ${ADAPTER_FAMILIES[family].label} headers`)
187
+ return Object.fromEntries(
188
+ keys.map((key) => [key, digestField(family, value[key], `${key} header digest`)]),
189
+ )
190
+ }
191
+
192
+ function identity(family: AdapterFamily, value: unknown) {
193
+ const invalid = () => new Error(`invalid ${ADAPTER_FAMILIES[family].label} manifest`)
194
+ if (!isRecord(value) || value.schema !== 1) throw invalid()
195
+ const { adapter, sdk, framework } = value
196
+ if (!isRecord(adapter) || !isRecord(sdk) || !isRecord(framework)) throw invalid()
145
197
  return {
146
198
  schema: 1 as const,
147
- platform: text(value.platform, 'platform'),
148
- target: text(value.target, 'target'),
149
- recipe: digestField(value.recipe, 'recipe'),
150
- adapter: { sha256: digestField(adapter.sha256, 'adapter digest') },
151
- headers: {
152
- reactNativeJsi: digestField(headers.reactNativeJsi, 'JSI header digest'),
153
- nitroModules: digestField(headers.nitroModules, 'Nitro header digest'),
154
- },
155
- compiler: text(value.compiler, 'compiler'),
199
+ platform: text(family, value.platform, 'platform'),
200
+ target: text(family, value.target, 'target'),
201
+ recipe: digestField(family, value.recipe, 'recipe'),
202
+ adapter: { sha256: digestField(family, adapter.sha256, 'adapter digest') },
203
+ headers: headerSet(family, value.headers),
204
+ compiler: text(family, value.compiler, 'compiler'),
156
205
  sdk: {
157
- id: text(sdk.id, 'sdk id'),
158
- checksum: digestField(sdk.checksum, 'sdk checksum'),
206
+ id: text(family, sdk.id, 'sdk id'),
207
+ checksum: digestField(family, sdk.checksum, 'sdk checksum'),
159
208
  },
160
209
  framework: {
161
- distribution: text(framework.distribution, 'distribution'),
162
- wireAbi: digestField(framework.wireAbi, 'wire abi'),
210
+ distribution: text(family, framework.distribution, 'distribution'),
211
+ wireAbi: digestField(family, framework.wireAbi, 'wire abi'),
163
212
  },
164
213
  }
165
214
  }
166
215
 
167
216
  /** keeps only the public fields, so a producer's private provenance never
168
217
  * reaches a packed manifest. */
169
- export function parseNitroAdapterManifest(value: unknown): NitroAdapterManifest {
218
+ export function parseAdapterManifest(
219
+ family: AdapterFamily,
220
+ value: unknown,
221
+ ): AdapterManifest {
170
222
  const archive = isRecord(value) ? value.archive : undefined
171
223
  if (
172
224
  !isRecord(archive) ||
173
- typeof archive.path !== 'string' ||
174
- archive.path !== NITRO_ADAPTER_ARCHIVE ||
225
+ archive.path !== ADAPTER_FAMILIES[family].archive ||
175
226
  typeof archive.size !== 'number'
176
227
  )
177
- throw new Error('invalid Nitro adapter archive record')
228
+ throw new Error(`invalid ${ADAPTER_FAMILIES[family].label} archive record`)
178
229
  return {
179
- ...identity(value),
230
+ ...identity(family, value),
180
231
  archive: {
181
- path: archive.path,
232
+ path: ADAPTER_FAMILIES[family].archive,
182
233
  size: archive.size,
183
- sha256: digestField(archive.sha256, 'archive digest'),
234
+ sha256: digestField(family, archive.sha256, 'archive digest'),
184
235
  },
185
236
  }
186
237
  }
187
238
 
188
- function headerPair(value: unknown): NitroAdapterManifest['headers'] {
189
- if (!isRecord(value)) throw new Error('invalid Nitro adapter headers')
190
- return {
191
- reactNativeJsi: digestField(value.reactNativeJsi, 'JSI header digest'),
192
- nitroModules: digestField(value.nitroModules, 'Nitro header digest'),
193
- }
194
- }
195
-
196
- const sameHeaders = (
197
- a: NitroAdapterManifest['headers'],
198
- b: NitroAdapterManifest['headers'],
199
- ) => a.reactNativeJsi === b.reactNativeJsi && a.nitroModules === b.nitroModules
239
+ const sameHeaders = (a: AdapterHeaders, b: AdapterHeaders) =>
240
+ JSON.stringify(a) === JSON.stringify(b)
200
241
 
201
- export function parseNitroAdapterLock(value: unknown): NitroAdapterLock {
242
+ export function parseAdapterLock(family: AdapterFamily, value: unknown): AdapterLock {
243
+ const label = ADAPTER_FAMILIES[family].label
202
244
  if (!isRecord(value) || value.schema !== 2 || !Array.isArray(value.archives))
203
- throw new Error('invalid Nitro adapter lock')
204
- const { headers: _headers, ...shared } = identity({
245
+ throw new Error(`invalid ${label} lock`)
246
+ const { headers: _headers, ...shared } = identity(family, {
205
247
  ...value,
206
248
  schema: 1,
207
- headers: { reactNativeJsi: '0'.repeat(64), nitroModules: '0'.repeat(64) },
249
+ headers: Object.fromEntries(
250
+ ADAPTER_FAMILIES[family].headers.map((key) => [key, '0'.repeat(64)]),
251
+ ),
208
252
  })
209
253
  const archives = value.archives.map((entry: unknown) => {
210
254
  if (!isRecord(entry) || typeof entry.size !== 'number')
211
- throw new Error('invalid Nitro adapter lock archive')
255
+ throw new Error(`invalid ${label} lock archive`)
212
256
  return {
213
- headers: headerPair(entry.headers),
214
- sha256: digestField(entry.sha256, 'lock archive digest'),
257
+ headers: headerSet(family, entry.headers),
258
+ sha256: digestField(family, entry.sha256, 'lock archive digest'),
215
259
  size: entry.size,
216
260
  }
217
261
  })
@@ -219,16 +263,16 @@ export function parseNitroAdapterLock(value: unknown): NitroAdapterLock {
219
263
  if (
220
264
  archives.findIndex((other) => sameHeaders(other.headers, entry.headers)) !== index
221
265
  )
222
- throw new Error('Nitro adapter lock repeats a header pair')
266
+ throw new Error(`${label} lock repeats a header set`)
223
267
  })
224
268
  return { ...shared, schema: 2, archives }
225
269
  }
226
270
 
227
271
  /** the archive built against these original headers, or null when none was published. */
228
- export function nitroAdapterPin(
229
- lock: NitroAdapterLock,
230
- headers: NitroAdapterManifest['headers'],
231
- ): NitroAdapterPin | null {
272
+ export function adapterPin(
273
+ lock: AdapterLock,
274
+ headers: AdapterHeaders,
275
+ ): AdapterPin | null {
232
276
  const entry = lock.archives.find((archive) => sameHeaders(archive.headers, headers))
233
277
  if (!entry) return null
234
278
  // manifest field order: the installed manifest is compared as JSON
@@ -248,11 +292,11 @@ export function nitroAdapterPin(
248
292
 
249
293
  /** the lock with one published manifest's tarball added, replacing the archive
250
294
  * for the same headers. every archive in a lock shares one build identity. */
251
- export function withNitroAdapterArchive(
252
- lock: NitroAdapterLock | null,
253
- manifest: NitroAdapterManifest,
295
+ export function withAdapterArchive(
296
+ lock: AdapterLock | null,
297
+ manifest: AdapterManifest,
254
298
  tarball: { sha256: string; size: number },
255
- ): NitroAdapterLock {
299
+ ): AdapterLock {
256
300
  const { archive: _library, headers, schema: _schema, ...shared } = manifest
257
301
  if (lock) {
258
302
  const { archives: _archives, schema: _lockSchema, ...current } = lock
@@ -261,37 +305,41 @@ export function withNitroAdapterArchive(
261
305
  'the archive was built with another adapter, recipe, compiler, SDK or distribution than the lock; rebuild every archive',
262
306
  )
263
307
  }
308
+ const order = (entry: { headers: AdapterHeaders }) =>
309
+ Object.values(entry.headers).join('')
264
310
  const archives = [
265
311
  ...(lock?.archives ?? []).filter((entry) => !sameHeaders(entry.headers, headers)),
266
312
  { headers, ...tarball },
267
- ].sort((a, b) =>
268
- `${a.headers.reactNativeJsi}${a.headers.nitroModules}`.localeCompare(
269
- `${b.headers.reactNativeJsi}${b.headers.nitroModules}`,
270
- ),
271
- )
313
+ ].sort((a, b) => order(a).localeCompare(order(b)))
272
314
  return { schema: 2, ...shared, archives }
273
315
  }
274
316
 
275
317
  /** the tarball's path under PEACH_SWIFT_ENDPOINT: content addressed, so immutable. */
276
- export function nitroAdapterArchiveKey(pin: { archive: { sha256: string } }): string {
277
- return `nitro-adapter/${pin.archive.sha256}.tar.gz`
318
+ export function adapterArchiveKey(
319
+ family: AdapterFamily,
320
+ pin: { archive: { sha256: string } },
321
+ ): string {
322
+ return `${ADAPTER_FAMILIES[family].key}/${pin.archive.sha256}.tar.gz`
278
323
  }
279
324
 
280
325
  /** throws unless an unpacked adapter is the one the pin names and its library
281
326
  * bytes are the ones its manifest records. needs no adapter source. */
282
- export function verifyInstalledNitroAdapter(
327
+ export function verifyInstalledAdapter(
328
+ family: AdapterFamily,
283
329
  directory: string,
284
- pin: NitroAdapterPin,
285
- ): NitroAdapterManifest {
286
- const manifest = parseNitroAdapterManifest(
287
- JSON.parse(readFileSync(path.join(directory, NITRO_ADAPTER_MANIFEST), 'utf8')),
330
+ pin: AdapterPin,
331
+ ): AdapterManifest {
332
+ const label = ADAPTER_FAMILIES[family].label
333
+ const manifest = parseAdapterManifest(
334
+ family,
335
+ JSON.parse(readFileSync(path.join(directory, ADAPTER_MANIFEST), 'utf8')),
288
336
  )
289
337
  const { archive, ...recorded } = manifest
290
338
  const { archive: _tarball, ...pinned } = pin
291
339
  if (JSON.stringify(recorded) !== JSON.stringify(pinned))
292
- throw new Error('Nitro adapter manifest does not match the lock this build carries')
340
+ throw new Error(`${label} manifest does not match the lock this build carries`)
293
341
  const bytes = readFileSync(path.join(directory, archive.path))
294
342
  if (bytes.length !== archive.size || sha256Hex(bytes) !== archive.sha256)
295
- throw new Error('Nitro adapter library does not match its manifest')
343
+ throw new Error(`${label} library does not match its manifest`)
296
344
  return manifest
297
345
  }
@@ -13,49 +13,82 @@ export const NITRO_GUEST_PLATFORM = 'ios'
13
13
  export const COMPILED_NITRO_NATIVE_PACKAGES: readonly string[] = [
14
14
  'react-native-nitro-base64',
15
15
  'react-native-nitro-buffer',
16
+ 'react-native-nitro-geocoder',
17
+ 'react-native-nitro-haptics',
18
+ 'react-native-nitro-sound',
19
+ 'react-native-nitro-cookies',
20
+ 'react-native-nitro-geolocation',
21
+ 'react-native-nitro-markdown',
22
+ 'react-native-nitro-network-info',
23
+ 'react-native-nitro-audio-manager',
24
+ 'react-native-nitro-sqlite',
16
25
  ]
17
26
 
18
- export interface NitroCompiledModule {
27
+ /** installed C++ TurboModule providers whose original native source Peach
28
+ * compiles in place of any hand-written answer. */
29
+ export const COMPILED_TURBO_NATIVE_PACKAGES: readonly string[] = [
30
+ 'react-native-quick-base64',
31
+ ]
32
+
33
+ interface CompiledModule<Package> {
19
34
  platform: typeof NITRO_GUEST_PLATFORM
20
- /** the original providers this one executable registers, by package name,
21
- * with the HybridObject names each registers. a name the app answers
22
- * is in no provider's list. */
23
- packages: { name: string; version: string; hybridObjects: string[] }[]
35
+ /** the original providers this one executable registers, by package name. */
36
+ packages: Package[]
24
37
  url: string
25
38
  hash: string
26
39
  icuUrl: string
27
40
  bundleFiles: NonNullable<SwiftEntryOptions['bundleFiles']>
28
41
  }
29
42
 
30
- function readNitroPackage(
31
- value: unknown,
32
- ): NitroCompiledModule['packages'][number] | null {
43
+ type CompiledPackage = { name: string; version: string }
44
+
45
+ /** an app's compiled Nitro providers, each with the HybridObject names it
46
+ * registers. a name the app answers is in no provider's list. */
47
+ export type NitroCompiledModule = CompiledModule<
48
+ CompiledPackage & { hybridObjects: string[] }
49
+ >
50
+ /** an app's compiled C++ TurboModule providers. the module names they
51
+ * register are read from the executable, as React Native reads its map. */
52
+ export type TurboCompiledModule = CompiledModule<CompiledPackage>
53
+
54
+ function readCompiledPackage(value: unknown): CompiledPackage | null {
33
55
  if (typeof value !== 'object' || value === null) return null
34
56
  const name = Reflect.get(value, 'name')
35
57
  const version = Reflect.get(value, 'version')
36
- const names = Reflect.get(value, 'hybridObjects')
37
- return typeof name === 'string' &&
38
- name &&
39
- typeof version === 'string' &&
40
- version &&
58
+ return typeof name === 'string' && name && typeof version === 'string' && version
59
+ ? { name, version }
60
+ : null
61
+ }
62
+
63
+ function readNitroPackage(
64
+ value: unknown,
65
+ ): NitroCompiledModule['packages'][number] | null {
66
+ const read = readCompiledPackage(value)
67
+ const names = read && Reflect.get(Object(value), 'hybridObjects')
68
+ return read &&
41
69
  Array.isArray(names) &&
42
70
  names.length > 0 &&
43
71
  names.every((entry): entry is string => typeof entry === 'string' && entry !== '') &&
44
72
  new Set(names).size === names.length
45
- ? { name, version, hybridObjects: names }
73
+ ? { ...read, hybridObjects: names }
46
74
  : null
47
75
  }
48
76
 
49
- export function readNitroMetadata(value: unknown): NitroCompiledModule | null {
77
+ function readCompiledMetadata<Package extends CompiledPackage>(
78
+ label: string,
79
+ value: unknown,
80
+ readPackage: (value: unknown) => Package | null,
81
+ names: (entry: Package) => string[],
82
+ ): CompiledModule<Package> | null {
50
83
  if (value === null || value === undefined) return null
51
84
  if (
52
85
  typeof value !== 'object' ||
53
86
  Array.isArray(value) ||
54
87
  Reflect.get(value, 'platform') !== NITRO_GUEST_PLATFORM
55
88
  )
56
- throw new Error('invalid Nitro compilation metadata')
89
+ throw new Error(`invalid ${label} compilation metadata`)
57
90
  const listed = Reflect.get(value, 'packages')
58
- const packages = Array.isArray(listed) ? listed.map(readNitroPackage) : []
91
+ const packages = Array.isArray(listed) ? listed.map(readPackage) : []
59
92
  const url = Reflect.get(value, 'url')
60
93
  const hash = Reflect.get(value, 'hash')
61
94
  const icuUrl = Reflect.get(value, 'icuUrl')
@@ -64,8 +97,8 @@ export function readNitroMetadata(value: unknown): NitroCompiledModule | null {
64
97
  packages.length === 0 ||
65
98
  !packages.every((entry) => entry !== null) ||
66
99
  new Set(packages.map(({ name }) => name)).size !== packages.length ||
67
- new Set(packages.flatMap((entry) => entry.hybridObjects)).size !==
68
- packages.reduce((total, entry) => total + entry.hybridObjects.length, 0) ||
100
+ new Set(packages.flatMap(names)).size !==
101
+ packages.reduce((total, entry) => total + names(entry).length, 0) ||
69
102
  typeof url !== 'string' ||
70
103
  !url ||
71
104
  typeof hash !== 'string' ||
@@ -74,7 +107,7 @@ export function readNitroMetadata(value: unknown): NitroCompiledModule | null {
74
107
  !icuUrl ||
75
108
  !isRecord(packed)
76
109
  )
77
- throw new Error('invalid Nitro compilation metadata')
110
+ throw new Error(`invalid ${label} compilation metadata`)
78
111
  const bundleFiles = Object.fromEntries(
79
112
  Object.entries(packed).map(([name, bytes]) => {
80
113
  if (
@@ -82,13 +115,18 @@ export function readNitroMetadata(value: unknown): NitroCompiledModule | null {
82
115
  typeof bytes !== 'string' ||
83
116
  !/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(bytes)
84
117
  )
85
- throw new Error('invalid Nitro bundle file')
118
+ throw new Error(`invalid ${label} bundle file`)
86
119
  return [name, bytes] satisfies [string, string]
87
120
  }),
88
121
  )
89
122
  return { platform: 'ios', packages, url, hash, icuUrl, bundleFiles }
90
123
  }
91
124
 
125
+ export const readNitroMetadata = (value: unknown): NitroCompiledModule | null =>
126
+ readCompiledMetadata('Nitro', value, readNitroPackage, (entry) => entry.hybridObjects)
127
+ export const readTurboMetadata = (value: unknown): TurboCompiledModule | null =>
128
+ readCompiledMetadata('TurboModule', value, readCompiledPackage, () => [])
129
+
92
130
  export function readNitroFooter(source: string): NitroCompiledModule | null {
93
131
  return readNitroMetadata(readBundleMetadataFooter(source, 'nitro'))
94
132
  }
@@ -97,3 +135,12 @@ export function insertNitroFooter(source: string, metadata: NitroCompiledModule)
97
135
  readNitroMetadata(metadata)
98
136
  return insertBundleMetadataFooter(source, 'nitro', metadata)
99
137
  }
138
+
139
+ export function readTurboFooter(source: string): TurboCompiledModule | null {
140
+ return readTurboMetadata(readBundleMetadataFooter(source, 'turbo'))
141
+ }
142
+
143
+ export function insertTurboFooter(source: string, metadata: TurboCompiledModule): string {
144
+ readTurboMetadata(metadata)
145
+ return insertBundleMetadataFooter(source, 'turbo', metadata)
146
+ }
@@ -9,6 +9,7 @@ export function isEngineReactImporter(importer: string): boolean {
9
9
  importer.includes('/peach-compat/src/') ||
10
10
  importer.includes('/peach-compat/dist-pressability/') ||
11
11
  importer.includes('/peach-kit/src/') ||
12
+ importer.includes('/markdown-to-jsx/src/') ||
12
13
  importer.includes('react-reconciler')
13
14
  )
14
15
  }
@@ -458,6 +458,8 @@ export function collectBridgeModuleSources(
458
458
  moduleId,
459
459
  classes: [],
460
460
  bridgeModules: [],
461
+ appDelegateSubscribers: [],
462
+ reactDelegateHandlers: [],
461
463
  files: {},
462
464
  frameworks: [],
463
465
  swiftLanguageMode: target.languageMode,
@@ -11,7 +11,6 @@ export const REACT_NATIVE_PASSTHROUGH_SPECIFIERS: readonly string[] = [
11
11
  'react-native/src/setup-env',
12
12
  // upstream initialization owns the native DOM constructors for its version.
13
13
  'react-native/Libraries/Core/InitializeCore',
14
- 'react-native/Libraries/Core/setUpGlobals',
15
14
  'react-native/Libraries/Core/setUpRegeneratorRuntime',
16
15
  'react-native/src/private/setup/setUpDefaultReactNativeEnvironment',
17
16
  'react-native/src/private/setup/setUpDefaltReactNativeEnvironment',
@@ -45,6 +44,7 @@ export const REACT_NATIVE_PASSTHROUGH_SPECIFIERS: readonly string[] = [
45
44
  'react-native/Libraries/NativeModules/specs/NativeRedBox',
46
45
  'react-native/src/private/debugging/FuseboxSessionObserver',
47
46
  'react-native/src/private/devsupport/rndevtools/FuseboxSessionObserver',
47
+ 'react-native/src/private/fusebox/FuseboxSessionObserver',
48
48
  'react-native/src/private/devsupport/rndevtools/GlobalStateObserver',
49
49
  'react-native/src/private/devsupport/rndevtools/TracingStateObserver',
50
50
  'react-native/src/private/specs_DEPRECATED/modules/NativeDevSettings',
@@ -76,6 +76,8 @@ export const REACT_NATIVE_PASSTHROUGH_SPECIFIERS: readonly string[] = [
76
76
  'react-native/Libraries/Blob/BlobRegistry',
77
77
  'react-native/Libraries/Blob/NativeBlobModule',
78
78
  'react-native/Libraries/Utilities/binaryToBase64',
79
+ 'react-native/src/private/specs/modules/NativeWebSocketModule',
80
+ 'react-native/src/private/specs/modules/NativeBlobModule',
79
81
  'react-native/src/private/specs_DEPRECATED/modules/NativeWebSocketModule',
80
82
  'react-native/src/private/specs_DEPRECATED/modules/NativeBlobModule',
81
83
  'react-native/Libraries/vendor/emitter',
@@ -118,6 +120,7 @@ export const REACT_NATIVE_PASSTHROUGH_SPECIFIERS: readonly string[] = [
118
120
  // Appearance reads its spec through TurboModuleRegistry.get('Appearance'),
119
121
  // which the engine registers.
120
122
  'react-native/Libraries/Utilities/NativeAppearance',
123
+ 'react-native/src/private/specs/modules/NativeAppearance',
121
124
  'react-native/src/private/specs_DEPRECATED/modules/NativeAppearance',
122
125
  'react-native/Libraries/Utilities/useColorScheme',
123
126
  'react-native/Libraries/Utilities/FeatureDetection',