peachsim 0.1.1738 → 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 (327) 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 +67 -16
  6. package/cli/commands/device.ts +3 -1
  7. package/cli/commands/doctor.ts +1 -4
  8. package/cli/commands/inspect/settling.ts +6 -1
  9. package/cli/commands/inspect/wait-ready.ts +22 -2
  10. package/cli/commands/package.ts +22 -20
  11. package/cli/commands/push.ts +56 -0
  12. package/cli/commands/serve.ts +9 -0
  13. package/cli/commands/shell-url.ts +37 -9
  14. package/cli/commands/swift.ts +1 -1
  15. package/cli/current-sim.ts +27 -0
  16. package/cli/drivers/linux-browser-libs.lock.json +323 -1
  17. package/cli/drivers/linux-browser-libs.ts +8 -6
  18. package/cli/drivers/playwright.ts +5 -1
  19. package/cli/internal-child.ts +11 -1
  20. package/cli/main.ts +6 -0
  21. package/cli/native-input.ts +1 -7
  22. package/cli/outbound-endpoints.ts +9 -1
  23. package/cli/packaged-app-launcher.ts +3 -1
  24. package/cli/scene-video.ts +4 -0
  25. package/cli/ws-bridge.ts +3 -1
  26. package/detox/index.ts +9 -4
  27. package/dist-lib/agent-daemon-client.cjs +1 -1
  28. package/dist-lib/agent-events.cjs +1 -1
  29. package/dist-lib/attached-projects.cjs +1 -1
  30. package/dist-lib/auth/shared-session.cjs +1 -1
  31. package/dist-lib/backend-origin.cjs +1 -1
  32. package/dist-lib/beta.cjs +1 -1
  33. package/dist-lib/beta.mjs +1 -1
  34. package/dist-lib/bridge-constants.cjs +1 -1
  35. package/dist-lib/bridge-contract-input.cjs +1 -1
  36. package/dist-lib/bridge-contract-input.mjs +1 -1
  37. package/dist-lib/bridge-contract.cjs +1 -1
  38. package/dist-lib/bridge-contract.mjs +1 -1
  39. package/dist-lib/bundle-channel.cjs +7372 -3675
  40. package/dist-lib/capture-contract.cjs +1 -1
  41. package/dist-lib/capture-contract.mjs +1 -1
  42. package/dist-lib/cloud-contract.cjs +1 -1
  43. package/dist-lib/cloud-contract.mjs +1 -1
  44. package/dist-lib/cloud-test-args.cjs +1 -1
  45. package/dist-lib/cloud-test-args.mjs +1 -1
  46. package/dist-lib/cloud.cjs +1 -1
  47. package/dist-lib/cloud.mjs +1 -1
  48. package/dist-lib/config.cjs +1 -1
  49. package/dist-lib/config.mjs +1 -1
  50. package/dist-lib/detox/index.cjs +22 -8
  51. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  52. package/dist-lib/expo-swift-bundle.cjs +6340 -3064
  53. package/dist-lib/expo-swift-metadata.cjs +14 -2
  54. package/dist-lib/expo-swift-metadata.mjs +14 -2
  55. package/dist-lib/home-paths.cjs +1 -1
  56. package/dist-lib/host/bridge-host.cjs +6524 -2720
  57. package/dist-lib/host/fetch-proxy-handler.cjs +8 -7
  58. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  59. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  60. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  61. package/dist-lib/host/websocket-proxy.cjs +6 -3
  62. package/dist-lib/index.cjs +97 -31
  63. package/dist-lib/jump-to-source-babel.cjs +1 -1
  64. package/dist-lib/jump-to-source-native.cjs +1 -1
  65. package/dist-lib/kotlin-host.cjs +1 -1
  66. package/dist-lib/menu.cjs +1 -1
  67. package/dist-lib/menu.mjs +1 -1
  68. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  69. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  70. package/dist-lib/metro-production-bundle.cjs +1 -1
  71. package/dist-lib/metro-production-bundle.mjs +1 -1
  72. package/dist-lib/metro.cjs +71 -29
  73. package/dist-lib/native-app-identity-project.cjs +53 -22
  74. package/dist-lib/native-app-identity-project.mjs +53 -22
  75. package/dist-lib/native-app-identity.cjs +10 -3
  76. package/dist-lib/native-app-identity.mjs +10 -3
  77. package/dist-lib/native-firebase-metadata.cjs +1 -1
  78. package/dist-lib/native-firebase-metadata.mjs +1 -1
  79. package/dist-lib/plist.cjs +1 -1
  80. package/dist-lib/plist.mjs +1 -1
  81. package/dist-lib/profiles.cjs +1 -1
  82. package/dist-lib/public-brand.cjs +1 -1
  83. package/dist-lib/public-origins-lib-esm.json +25 -23
  84. package/dist-lib/public-origins-lib.json +111 -79
  85. package/dist-lib/react-native-host-modules.cjs +1 -1
  86. package/dist-lib/react-native-host-modules.mjs +1 -1
  87. package/dist-lib/reap-browser.cjs +1 -1
  88. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  89. package/dist-lib/sdk.cjs +4 -1
  90. package/dist-lib/sdk.mjs +4 -1
  91. package/dist-lib/skills.cjs +40549 -37613
  92. package/dist-lib/swift-compile.cjs +2054 -388
  93. package/dist-lib/swift-compile.mjs +1976 -312
  94. package/dist-lib/swift-package.cjs +1 -1
  95. package/dist-lib/swift-package.mjs +1 -1
  96. package/dist-lib/swift-submit.cjs +2 -2
  97. package/dist-lib/swift-submit.mjs +2 -2
  98. package/dist-lib/swift-toolchain.cjs +68 -8
  99. package/dist-lib/swift.cjs +1 -1
  100. package/dist-lib/vite-swift.cjs +5867 -2646
  101. package/dist-lib/vite.cjs +18 -8
  102. package/dist-lib/worklet-executable.cjs +1 -1
  103. package/dist-lib/worklet-executable.mjs +1 -1
  104. package/dist-types/packages/peach-compat/src/stubs/screen-transition-math.d.ts +1 -0
  105. package/dist-types/packages/peach-engine/src/cli-companion.d.ts +1 -0
  106. package/dist-types/packages/peach-engine/src/engine/canvaskit-renderer.d.ts +2 -0
  107. package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +0 -3
  108. package/dist-types/packages/peach-engine/src/engine/node.d.ts +6 -0
  109. package/dist-types/packages/peach-engine/src/engine/paint-boundary.d.ts +1 -0
  110. package/dist-types/packages/peach-engine/src/engine/scene-table.d.ts +25 -3
  111. package/dist-types/packages/peach-engine/src/engine/scroll-platform.d.ts +1 -15
  112. package/dist-types/packages/peach-engine/src/engine/scroll.d.ts +1 -3
  113. package/dist-types/packages/peach-engine/src/engine/text-first-baseline.d.ts +1 -0
  114. package/dist-types/packages/peach-engine/src/engine/types.d.ts +23 -0
  115. package/dist-types/packages/peach-engine/src/ios/chrome-metrics.d.ts +6 -0
  116. package/dist-types/packages/peach-engine/src/metro-identity-contract.d.ts +33 -0
  117. package/dist-types/packages/peach-engine/src/preview/bundle-layout.d.ts +1 -1
  118. package/dist-types/packages/peach-engine/src/remote-stream/scene-recording.d.ts +2 -0
  119. package/dist-types/packages/peach-engine/src/render-worker/compositor-gpu.d.ts +1 -1
  120. package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +2 -0
  121. package/dist-types/packages/peach-engine/src/render-worker/metro-bundle-metadata.d.ts +28 -0
  122. package/dist-types/packages/peach-engine/src/render-worker/native-ui-protocol.d.ts +21 -1
  123. package/dist-types/packages/peach-engine/src/render-worker/prepared-boot-bundle.d.ts +7 -0
  124. package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +8 -0
  125. package/dist-types/packages/peach-engine/src/render-worker/scroll-mirror.d.ts +1 -0
  126. package/dist-types/packages/peach-engine/src/render-worker/shell-protocol.d.ts +5 -0
  127. package/dist-types/packages/peach-engine/src/render-worker/test-bridge-protocol.d.ts +3 -3
  128. package/dist-types/packages/peach-engine/src/render-worker/webgpu-frame-transaction.d.ts +1 -0
  129. package/dist-types/packages/peach-engine/src/render-worker/webgpu-readback-scheduler.d.ts +1 -1
  130. package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +1 -0
  131. package/dist-types/packages/peach-engine/src/rolldown-bundle-inventory.d.ts +8 -1
  132. package/dist-types/packages/peach-engine/src/rolldown-production-fingerprint.d.ts +1 -4
  133. package/dist-types/packages/peach-engine/src/rolldown-production-module.d.ts +12 -0
  134. package/dist-types/packages/peach-engine/src/rolldown-production-roles.d.ts +6 -0
  135. package/dist-types/packages/peach-engine/src/settings/devices.d.ts +6 -1
  136. package/dist-types/packages/peach-engine/src/settings/duo-fold-bus.d.ts +1 -0
  137. package/dist-types/packages/peach-engine/src/shell-events.d.ts +4 -0
  138. package/dist-types/packages/peach-kit/src/capabilities.d.ts +7 -0
  139. package/package.json +2 -1
  140. package/runtime-companion.json +1 -1
  141. package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h +1 -0
  142. package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkErrors.h +257 -0
  143. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFByteOrder.h +305 -0
  144. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h +2 -0
  145. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGAffineTransform.h +204 -0
  146. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBitmapContext.h +260 -0
  147. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColor.h +164 -0
  148. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorConversionInfo.h +101 -0
  149. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorSpace.h +510 -0
  150. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGContext.h +1132 -0
  151. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGConvertColorDataWithFormat.h +34 -0
  152. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataConsumer.h +83 -0
  153. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataProvider.h +197 -0
  154. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEXRToneMappingGamma.h +36 -0
  155. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGError.h +38 -0
  156. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFont.h +312 -0
  157. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFunction.h +106 -0
  158. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGradient.h +123 -0
  159. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGITUToneMapping.h +31 -0
  160. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGImage.h +409 -0
  161. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGLayer.h +78 -0
  162. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFArray.h +120 -0
  163. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContentStream.h +55 -0
  164. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContext.h +535 -0
  165. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDictionary.h +133 -0
  166. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDocument.h +252 -0
  167. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFMarkedContentItem.h +37 -0
  168. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFObject.h +67 -0
  169. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFOperatorTable.h +51 -0
  170. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFPage.h +101 -0
  171. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFScanner.h +123 -0
  172. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFStream.h +44 -0
  173. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFString.h +52 -0
  174. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFStructureElement.h +87 -0
  175. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPath.h +441 -0
  176. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPattern.h +89 -0
  177. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGRenderingBufferProvider.h +49 -0
  178. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGShading.h +124 -0
  179. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGToneMapping.h +85 -0
  180. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h +44 -252
  181. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Modules/module.modulemap +1 -0
  182. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/CFNetworkErrors.h +257 -0
  183. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes +0 -6
  184. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +356 -61
  185. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/NSURLSession+Network.h +32 -0
  186. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/Network.h +51 -0
  187. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/advertise_descriptor.h +193 -0
  188. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/browse_descriptor.h +163 -0
  189. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/browse_result.h +207 -0
  190. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/browser.h +285 -0
  191. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/connection.h +714 -0
  192. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/connection_group.h +629 -0
  193. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/connection_report.h +932 -0
  194. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/content_context.h +229 -0
  195. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/endpoint.h +390 -0
  196. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/error.h +135 -0
  197. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/ethernet_channel.h +349 -0
  198. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/framer_options.h +1187 -0
  199. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/group_descriptor.h +184 -0
  200. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/interface.h +150 -0
  201. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/ip_options.h +351 -0
  202. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/listener.h +438 -0
  203. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/nw_object.h +200 -0
  204. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/parameters.h +1205 -0
  205. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/path.h +392 -0
  206. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/path_monitor.h +216 -0
  207. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/privacy_context.h +188 -0
  208. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/protocol_options.h +126 -0
  209. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/proxy_config.h +357 -0
  210. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/quic_options.h +889 -0
  211. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/resolver_config.h +94 -0
  212. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/tcp_options.h +459 -0
  213. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/tls_options.h +115 -0
  214. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/txt_record.h +432 -0
  215. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/udp_options.h +112 -0
  216. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/ws_options.h +743 -0
  217. package/sdk/ios/System/Library/Frameworks/Network.framework/Modules/module.modulemap +9 -0
  218. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAAnimation.h +395 -0
  219. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CABase.h +132 -0
  220. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CADisplayLink.h +107 -0
  221. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAEmitterCell.h +153 -0
  222. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAEmitterLayer.h +151 -0
  223. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAFrameRateRange.h +40 -0
  224. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAGradientLayer.h +78 -0
  225. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CALayer.h +1078 -0
  226. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAMediaTiming.h +97 -0
  227. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAMediaTimingFunction.h +67 -0
  228. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAReplicatorLayer.h +65 -0
  229. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAScrollLayer.h +64 -0
  230. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAShapeLayer.h +135 -0
  231. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CATextLayer.h +99 -0
  232. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CATiledLayer.h +67 -0
  233. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CATransaction.h +124 -0
  234. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CATransform3D.h +138 -0
  235. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CATransformLayer.h +40 -0
  236. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAValueFunction.h +78 -0
  237. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h +19 -38
  238. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecureTransport.h +1757 -0
  239. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSAttributedString.h +19 -0
  240. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSParagraphStyle.h +28 -0
  241. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityConstants.h +114 -0
  242. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h +16 -0
  243. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIBarAppearance.h +47 -0
  244. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDataDetectors.h +20 -0
  245. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDatePicker.h +13 -0
  246. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDevice.h +16 -0
  247. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIEvent.h +84 -0
  248. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIGestureRecognizer.h +119 -0
  249. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIGestureRecognizerSubclass.h +66 -0
  250. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIHoverGestureRecognizer.h +45 -0
  251. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h +161 -37
  252. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPickerView.h +76 -0
  253. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITabBar.h +8 -0
  254. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITabBarAppearance.h +78 -0
  255. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITextInputTraits.h +29 -0
  256. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITouch.h +104 -0
  257. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITraitCollection.h +19 -0
  258. package/sdk/ios/usr/include/dns_sd.h +3616 -0
  259. package/sdk/ios/usr/include/dnssd.modulemap +4 -0
  260. package/sdk/ios/usr/include/module.modulemap +1 -0
  261. package/sdk/ios/usr/include/sys/socketvar.h +191 -0
  262. package/sdk/ios/usr/include/sys/vsock.h +84 -0
  263. package/sdk/native-hashes.json +1 -1
  264. package/skills/contrast/SKILL.md +6 -5
  265. package/skills/peach-debug/SKILL.md +68 -264
  266. package/skills/peach-debug/references/accessibility.md +37 -73
  267. package/skills/peach-debug/references/commands.md +2 -2
  268. package/skills/peach-debug/references/events.md +74 -0
  269. package/skills/peach-perf/SKILL.md +64 -401
  270. package/skills/peach-perf/references/presentation.md +46 -0
  271. package/skills/peach-perf/references/profiling.md +93 -0
  272. package/skills/peach-perf/references/render-counters.md +57 -0
  273. package/skills/peach-setup/SKILL.md +66 -216
  274. package/skills/peach-setup/references/native-config.md +35 -0
  275. package/skills/peach-setup/references/reporting.md +28 -0
  276. package/skills/peach-test/SKILL.md +68 -284
  277. package/skills/peach-test/references/detox.md +69 -0
  278. package/skills/peach-test/references/maestro.md +95 -0
  279. package/skills/peach-visual/SKILL.md +53 -105
  280. package/src/appPackageContract.ts +12 -1
  281. package/src/assetCatalogContract.ts +8 -1
  282. package/src/bridge-contract.ts +6 -0
  283. package/src/bundle-channel.mjs +133 -59
  284. package/src/cli-runtime.ts +8 -9
  285. package/src/configured-bundle-producer.ts +10 -0
  286. package/src/device-catalog.ts +68 -4
  287. package/src/expo-discovery-cache.ts +3 -0
  288. package/src/expo-native-workspace.ts +81 -17
  289. package/src/expo-swift-host.ts +57 -104
  290. package/src/expo-widget-assets.ts +76 -0
  291. package/src/expoSwiftContract.ts +13 -1
  292. package/src/host/websocket-proxy.ts +7 -2
  293. package/src/native-prebuilt.ts +3 -3
  294. package/src/nitro-adapter.lock.json +263 -263
  295. package/src/nitro-adapter.ts +69 -7
  296. package/src/nitro-bundle.ts +52 -24
  297. package/src/nitro-compile.ts +6 -1
  298. package/src/nitro-source.ts +82 -4
  299. package/src/nitro-superset.lock.json +103 -0
  300. package/src/nitro-superset.ts +137 -0
  301. package/src/nitroContract.ts +5 -1
  302. package/src/react-bridge-importers.ts +1 -0
  303. package/src/settingsContract.ts +26 -1
  304. package/src/swift-compile.ts +267 -68
  305. package/src/swift-compiler-digest.ts +2 -0
  306. package/src/swift-coverage/xcode-packages.ts +61 -1
  307. package/src/swift-coverage/xcode.ts +10 -12
  308. package/src/swift-cxx-reachable.ts +1 -1
  309. package/src/swift-distribution.lock.json +15 -13
  310. package/src/swift-distribution.ts +57 -26
  311. package/src/swift-host.ts +48 -35
  312. package/src/swift-link-roots.ts +45 -18
  313. package/src/swift-objc-compile.ts +78 -2
  314. package/src/swift-objc-standin.ts +3 -0
  315. package/src/swift-shared-sdk.ts +85 -1
  316. package/src/swift-standins.ts +233 -11
  317. package/src/swift-submit.ts +13 -1
  318. package/src/swift-toolchain.ts +82 -7
  319. package/src/swift-wasm-prune.ts +1629 -0
  320. package/src/turbo-bundle.ts +11 -10
  321. package/src/turbo-runtime.lock.json +16 -16
  322. package/src/vite-plugin-one.ts +12 -1
  323. package/src/vite-plugin.ts +82 -23
  324. package/src/wasm-optimize.ts +34 -0
  325. package/src/worker-system-chunks.ts +3 -3
  326. package/src/xcode-project.ts +52 -0
  327. package/src/xcode-target-members.ts +12 -1
@@ -1,126 +1,74 @@
1
1
  ---
2
2
  name: peach-visual
3
- description: Pixel-level rendering comparison between Peach and native iOS — fonts, gradients, shadows, image fidelity
3
+ description: Compare static rendering in Peach with native iOS or an app baseline using lossless screenshots and pixel diffs. Use for font metrics, gradients, shadows, blur, colors, or image fidelity; use peach-debug for tree/props and peach-perf for motion or frame timing.
4
4
  ---
5
5
 
6
6
  # Peach visual fidelity
7
7
 
8
- pixel-level rendering fidelity: does the Peach canvas match native iOS
9
- for text, gradients, shadows, blur, and image rendering? the `peach`
10
- CLI gives you two primitives — **canvas capture** (`peach screenshot`)
11
- and **structural diff** (`peach debug snapshot`/`diff`). pixel
12
- comparison itself is "capture both sides, diff the PNGs with a standard
13
- image tool" — there is no single oracle-diff command, and that's fine:
14
- the capture step is the hard part and it's fully reproducible.
8
+ Use this for visible pixel differences. Start with a connected, pinned sim;
9
+ use `peach-setup` if `peach describe` cannot reach the intended app.
15
10
 
16
- > needs a connected, pinned sim. if `peach describe` errors,
17
- > load `/peach-setup` first.
11
+ ## Establish comparable captures
18
12
 
19
- ## route in
13
+ 1. Check structure with `peach debug snapshot` and `peach debug diff` when a
14
+ changed node or prop could explain the result. Use `peach-debug` for that
15
+ investigation.
16
+ 2. Match device, appearance, orientation, app state, loaded fonts/images,
17
+ logical crop, and pixel dimensions between captures. For native parity,
18
+ open Peach with `--render-resolution high` so it uses native device scale.
19
+ 3. Wait for the relevant state and `peach wait idle`. Perpetual animation needs
20
+ a controlled matching state; an arbitrary frame is not a stable baseline.
21
+ 4. Capture lossless PNGs and inspect both source images and the diff.
20
22
 
21
- - structural change ("which nodes / which props changed?") → load
22
- `/peach-debug`, debugging branch — `debug snapshot` + `debug
23
- diff` is faster, deterministic, and tells you *why*.
24
- - visual change (color, gradient, shadow, font metric, blur, image)? →
25
- continue here.
26
- - comparing Peach to your iOS simulator for fidelity? → continue.
27
- - regressing your own app against itself across commits? → continue.
28
-
29
- ## anti-patterns (read first)
30
-
31
- - **run structural diff before pixel work.** `peach debug snapshot` /
32
- `debug diff` (in `/peach-debug`) is cheaper, deterministic, and
33
- points at the responsible nodes. only when it's empty (or the change is
34
- pure rendering) does a pixel comparison add information.
35
- - **don't single-screenshot animated surfaces.** a gradient
36
- mid-animation never matches. gate the capture behind `peach wait
37
- idle` first.
38
- - **a > 5% pixel threshold hides regressions.** ~1% is the right
39
- ballpark for catching real font / shadow / gradient drift without
40
- flagging anti-alias noise. go higher only with a written reason.
41
- - **pin device and theme.** capture both sides on the same simulated
42
- device and appearance. capture each appearance separately with
43
- `peach screenshot` after setting it on both simulators.
44
- - **commit baselines alongside the code change that produced them.**
45
- baseline churn without code churn means someone captured noise.
46
-
47
- ## capturing — `peach screenshot`
48
-
49
- fast, no extra setup, works on any loaded app:
23
+ ## Capture Peach
50
24
 
51
25
  ```sh
52
- peach screenshot --output app.png # full canvas
53
- peach screenshot --area 0,200,393,400 # crop to a logical rect
54
- peach screenshot --id loginButton -o btn.png # crop to a node by testID
55
- peach screenshot --text "Sign in" # crop to a node by text
56
- peach screenshot --no-shell -o tenant.png # tenant surface only, no iOS chrome
57
- peach screenshot --shell-only # only the simulated iOS chrome
26
+ peach screenshot --output app.png
27
+ peach screenshot --area 0,200,393,400 -o region.png
28
+ peach screenshot --id loginButton -o button.png
29
+ peach screenshot --text "Sign in" -o sign-in.png
30
+ peach screenshot --no-shell -o tenant.png
31
+ peach screenshot --shell-only -o shell.png
58
32
  ```
59
33
 
60
- `peach screenshot` captures the current screen as a PNG. navigate to each
61
- screen you want to inspect and capture it with a distinct output filename.
34
+ Coordinates are logical points. `--id` crops by testID; prefer it to text when
35
+ copy repeats. Capture each affected screen with a distinct filename. Crop the
36
+ same region on both sides so unrelated chrome does not hide a small text or
37
+ shadow regression.
62
38
 
63
- ## comparing pixels
64
-
65
- capture both sides to PNGs, then diff with any standard image tool.
66
-
67
- **Peach vs Peach (regression across your own commits):**
68
-
69
- ```sh
70
- peach screenshot -o before.png # baseline, before your change
71
- # … make the rendering change, let the sim hot-reload …
72
- peach screenshot -o after.png # after your change
73
- npx pixelmatch before.png after.png diff.png 0.1 # writes diff.png
74
- # or: magick compare before.png after.png diff.png
75
- ```
39
+ ## Compare
76
40
 
77
- **Peach vs native iOS (fidelity to the real thing):**
41
+ For your app across revisions, capture before the change, apply it and wait
42
+ for readiness, then capture after. For native iOS, name the exact simulator:
78
43
 
79
44
  ```sh
80
- # native side: lifecycle and UI use xcodebuildmcp with one claimed simulator
81
- # lossless capture names that simulator explicitly; never use the booted alias
82
45
  xcrun simctl io <udid> screenshot --type=png native.png
83
- # peach side: same screen, same appearance
84
46
  peach screenshot -o peach.png
85
- npx pixelmatch native.png peach.png diff.png 0.1
47
+ magick compare native.png peach.png diff.png
86
48
  ```
87
49
 
88
- `xcodebuildmcp simulator screenshot` may return an optimized JPEG even when the
89
- proof contract requires a lossless source. Use it only when JPEG is acceptable.
90
- For parity proof, use the explicit-UDID PNG command above, then verify the
91
- decoded dimensions and file type before admitting the capture.
92
-
93
- crop both to the same region (`--area` / `--id`) when you only care
94
- about one element — a full-screen diff buries a 3px font-baseline shift
95
- under unrelated chrome.
96
-
97
- ## typical workflow
98
-
99
- 1. structural diff first — confirm the change is genuinely visual.
100
- 2. capture the affected screen with `peach screenshot` (crop to the
101
- element if you can).
102
- 3. diff against the baseline (previous commit, or a native capture).
103
- 4. iterate the rendering until the diff is under threshold.
104
- 5. navigate to each affected screen, capture it, and inspect the PNG
105
- for unexpected rendering changes.
106
-
107
- ## you're done when
108
-
109
- - the diff is under threshold on every affected case, **or**
110
- - the differences are explicitly accepted, baselines re-captured, and
111
- both halves (code + baselines) committed together.
112
- - the captures show no unexpected changes across all affected screens.
113
-
114
- ## recovery — common failure modes
115
-
116
- - **a single icon/glyph diffs** — font-load race or image not yet
117
- cached. recapture after `peach wait idle`, or navigate away and back
118
- to seed the cache.
119
- - **everything diffs by a constant offset** — you captured the two sides
120
- on different devices or appearances. pin both, recapture.
121
- - **baselines churn without a code change** — someone captured noise (a
122
- lingering badge, half-open keyboard, a drifting clock). revert and
123
- recapture from a clean, idle state.
124
- - **persistent delta on the same font / shadow / gradient across
125
- unrelated screens** — that's an engine-level rendering fidelity issue,
126
- not your app. report it with the affected captures attached.
50
+ Use an installed standard image-diff tool. ImageMagick `compare` returns a
51
+ nonzero status when images differ; inspect its output rather than treating that
52
+ alone as a tool failure. Verify decoded PNG dimensions before comparing and
53
+ preserve the originals. Optimized JPEG captures introduce compression noise
54
+ and are unsuitable for lossless parity comparisons.
55
+
56
+ Keep the image tool's per-pixel sensitivity distinct from the percentage of
57
+ changed pixels. Choose an acceptance threshold for the actual surface before
58
+ evaluating results; a large full-screen allowance can conceal a local defect.
59
+ Inspect the changed region even when the aggregate score passes.
60
+
61
+ ## Diagnose differences
62
+
63
+ | Pattern | First check |
64
+ | --- | --- |
65
+ | One glyph or icon differs | Font or image readiness |
66
+ | Constant offset across the image | Device geometry, safe area, crop, scale |
67
+ | Baseline changes without code changes | Keyboard, clock, badges, animation or unstable data |
68
+ | Same font/shadow/gradient defect on unrelated screens | Possible renderer issue; preserve minimal captures |
69
+
70
+ Iterate until the affected cases meet their agreed target, or the remaining
71
+ differences are explicitly accepted. Store baselines with the app's existing
72
+ artifact policy and update them alongside the code that justifies the change.
73
+ Do not bless unexplained baseline churn. For visible motion or latency claims,
74
+ use `peach-perf`; a static screenshot cannot prove frame progression.
@@ -1,3 +1,4 @@
1
+ import { DESKTOP_RENDER_RESOLUTION } from './menu'
1
2
  import {
2
3
  isSettingKey,
3
4
  isValidSettingValue,
@@ -30,6 +31,14 @@ export interface AppPackageManifest {
30
31
  routes: Record<string, { file: string; contentType: string }>
31
32
  }
32
33
 
34
+ function parseJsonSetting(raw: string, assignment: string): unknown {
35
+ try {
36
+ return JSON.parse(raw)
37
+ } catch {
38
+ throw new Error(`invalid package setting ${assignment}; expected a JSON array`)
39
+ }
40
+ }
41
+
33
42
  export function packageSettingDefaults(
34
43
  assignments: readonly string[],
35
44
  ): Partial<SettingsValues> {
@@ -43,10 +52,12 @@ export function packageSettingDefaults(
43
52
  // a packaged app is a desktop app: it keeps the computer pointer and
44
53
  // shows only the app, without the device frame or simulator rail.
45
54
  // and types on the computer keyboard, so no software keyboard presents.
55
+ // it renders at the desktop host's density, the pixels its window shows.
46
56
  systemCursor: true,
47
57
  hardwareKeyboard: true,
48
58
  showFrame: false,
49
59
  showRail: false,
60
+ renderResolution: DESKTOP_RENDER_RESOLUTION,
50
61
  }
51
62
  for (const assignment of assignments) {
52
63
  const equals = assignment.indexOf('=')
@@ -67,7 +78,7 @@ export function packageSettingDefaults(
67
78
  ? NaN
68
79
  : Number(raw)
69
80
  : definition.type === 'string-array'
70
- ? JSON.parse(raw)
81
+ ? parseJsonSetting(raw, assignment)
71
82
  : raw
72
83
  if (
73
84
  (typeof value === 'number' && !Number.isFinite(value)) ||
@@ -2,6 +2,7 @@
2
2
  export interface SwiftImageSource {
3
3
  uri: string
4
4
  scale: number
5
+ renderingMode?: 'template' | 'original'
5
6
  }
6
7
 
7
8
  // the scale variants stay available until the runtime knows its device.
@@ -18,7 +19,10 @@ export function isSwiftImageVariants(value: unknown): value is SwiftImageVariant
18
19
  typeof image.uri === 'string' &&
19
20
  typeof image.scale === 'number' &&
20
21
  Number.isFinite(image.scale) &&
21
- image.scale > 0,
22
+ image.scale > 0 &&
23
+ (image.renderingMode === undefined ||
24
+ image.renderingMode === 'template' ||
25
+ image.renderingMode === 'original'),
22
26
  )
23
27
  )
24
28
  }
@@ -70,6 +74,9 @@ export interface SfSymbolImageDrawing {
70
74
  // automatic variable mode draws the value along the paths rather than
71
75
  // turning layers off by threshold
72
76
  variableDraw?: boolean
77
+ // automatic rendering draws the symbol hierarchically: coreui's preferred
78
+ // rendering mode (desktopcomputer's tertiary screen in a tab bar)
79
+ hierarchical?: boolean
73
80
  // coreui's own right to left rendition, which replaces the drawing there
74
81
  rightToLeft?: SfSymbolImageDrawing
75
82
  }
@@ -53,6 +53,12 @@ export type BridgeCommandType =
53
53
  // them, so they stay out of BridgeCommandType and out of its cloud scope table.
54
54
  export type BridgeHostCommandType = 'bridge:list-sims' | 'bridge:claim'
55
55
 
56
+ export interface PushNotificationReceipt {
57
+ appId: string
58
+ id: string
59
+ presented: boolean
60
+ }
61
+
56
62
  // what a caller hands a bridge's `send`: the command minus the correlation id,
57
63
  // which the transport assigns. every send seam names this type rather than an
58
64
  // index-signature bag, because an index signature erases excess-property
@@ -303,21 +303,85 @@ export async function publishBundleChannel(release, { put, fetchObject = fetch }
303
303
  }
304
304
 
305
305
  // peach boots an app from the dev server's bundle: it carries the module graph
306
- // peach maps native seams by, which a release build erases. snapshot each
307
- // platform's bundle from a running dev server and package the files its
308
- // assets register, with the app's local Expo native modules for that platform
309
- // and, on ios, one executable of its installed Nitro providers.
310
- export async function snapshotDevServerBundles(
311
- origin,
306
+ // peach maps native seams by. a release build erases it, but the production
307
+ // bundle of the rolldown path keeps the factories its catalog recognises.
308
+ // package one platform's bundle with the files its assets register, the app's
309
+ // local Expo native modules for that platform and, on ios, one executable of
310
+ // its installed Nitro providers. `readAssetFile` supplies the bytes of a
311
+ // registered asset that has no local file.
312
+ async function packagePlatformBundle(
312
313
  projectRoot,
313
- { platforms = ['ios', 'android'], assertRunning = () => {} } = {},
314
+ platform,
315
+ bundle,
316
+ { config, versions, readAssetFile },
314
317
  ) {
315
318
  const { readFileSync } = await import('node:fs')
316
319
  const { basename } = await import('node:path')
317
- const { resolveRNXAppConfig } = await import('../cli/app-config')
318
320
  const { produceConfiguredBundle } = await import('./configured-bundle-producer')
321
+ const assets = new Map()
322
+ for (const [registration] of bundle
323
+ .toString('utf8')
324
+ .matchAll(/(?<=registerAsset\()\{[^{}]*"__packager_asset": true[^{}]*\}/g)) {
325
+ const asset = JSON.parse(registration)
326
+ const directory = packagedAssetDirectory(asset.httpServerLocation)
327
+ if (asset.files) {
328
+ for (const file of asset.files) {
329
+ const path = `${directory}/${basename(file)}`
330
+ if (!assets.has(path)) assets.set(path, readFileSync(file))
331
+ }
332
+ continue
333
+ }
334
+ // without local files, each scale downloads at the url react native's
335
+ // AssetSourceResolver builds for it
336
+ for (const scale of asset.scales) {
337
+ const file = `${asset.name}${scale === 1 ? '' : `@${scale}x`}.${asset.type}`
338
+ const path = `${directory}/${file}`
339
+ if (!assets.has(path)) assets.set(path, await readAssetFile(asset, file))
340
+ }
341
+ }
342
+ return {
343
+ platform,
344
+ // the versions footer stays last: the rolldown inventory reads it there.
345
+ bundle: Buffer.from(
346
+ insertPackageVersionsFooter(
347
+ await produceConfiguredBundle(
348
+ bundle.toString('utf8'),
349
+ config,
350
+ new Set(Object.keys(versions)),
351
+ ),
352
+ versions,
353
+ ),
354
+ ),
355
+ assets: [...assets].map(([path, bytes]) => ({ path, bytes })),
356
+ ...(platform === 'ios'
357
+ ? {
358
+ expoSwift: await (
359
+ await import('./expo-swift-bundle')
360
+ ).buildExpoSwiftBundle(projectRoot),
361
+ nitro: await (await import('./nitro-bundle')).buildNitroBundle(projectRoot),
362
+ turbo: await (await import('./turbo-bundle')).buildTurboBundle(projectRoot),
363
+ }
364
+ : {
365
+ expoKotlin: await (
366
+ await import('./expo-kotlin-bundle')
367
+ ).buildExpoKotlinBundle(projectRoot),
368
+ }),
369
+ }
370
+ }
371
+
372
+ async function readPackagingInputs(projectRoot) {
373
+ const { resolveRNXAppConfig } = await import('../cli/app-config')
319
374
  const { config } = await resolveRNXAppConfig(projectRoot)
320
- const versions = await readInstalledNativePackageVersionsAsync(projectRoot)
375
+ return { config, versions: await readInstalledNativePackageVersionsAsync(projectRoot) }
376
+ }
377
+
378
+ // snapshot each platform's bundle from a running dev server
379
+ export async function snapshotDevServerBundles(
380
+ origin,
381
+ projectRoot,
382
+ { platforms = ['ios', 'android'], assertRunning = () => {} } = {},
383
+ ) {
384
+ const inputs = await readPackagingInputs(projectRoot)
321
385
  const snapshots = []
322
386
  for (const platform of platforms) {
323
387
  const url = `${origin}/index.bundle?platform=${platform}&dev=true&minify=false`
@@ -331,57 +395,67 @@ export async function snapshotDevServerBundles(
331
395
  if (response?.ok) bundle = Buffer.from(await response.arrayBuffer())
332
396
  else await new Promise((resolve) => setTimeout(resolve, 2000))
333
397
  }
334
- const assets = new Map()
335
- for (const [registration] of bundle
336
- .toString('utf8')
337
- .matchAll(/(?<=registerAsset\()\{[^{}]*"__packager_asset": true[^{}]*\}/g)) {
338
- const asset = JSON.parse(registration)
339
- const directory = packagedAssetDirectory(asset.httpServerLocation)
340
- if (asset.files) {
341
- for (const file of asset.files) {
342
- const path = `${directory}/${basename(file)}`
343
- if (!assets.has(path)) assets.set(path, readFileSync(file))
344
- }
345
- continue
346
- }
347
- // without local files, each scale downloads at the url react native's
348
- // AssetSourceResolver builds for it
349
- for (const scale of asset.scales) {
350
- const file = `${asset.name}${scale === 1 ? '' : `@${scale}x`}.${asset.type}`
351
- const path = `${directory}/${file}`
352
- if (assets.has(path)) continue
353
- const response = await fetch(
354
- `${origin}${asset.httpServerLocation}/${file}?platform=${platform}&hash=${asset.hash}`,
355
- )
356
- if (!response.ok)
357
- throw new Error(`dev server asset ${path} failed: ${response.status}`)
358
- assets.set(path, Buffer.from(await response.arrayBuffer()))
359
- }
398
+ snapshots.push(
399
+ await packagePlatformBundle(projectRoot, platform, bundle, {
400
+ ...inputs,
401
+ readAssetFile: async (asset, file) => {
402
+ const response = await fetch(
403
+ `${origin}${asset.httpServerLocation}/${file}?platform=${platform}&hash=${asset.hash}`,
404
+ )
405
+ if (!response.ok)
406
+ throw new Error(`dev server asset ${file} failed: ${response.status}`)
407
+ return Buffer.from(await response.arrayBuffer())
408
+ },
409
+ }),
410
+ )
411
+ }
412
+ return { platforms: snapshots }
413
+ }
414
+
415
+ // a One app's production bundles. unminified, because the catalog recognises
416
+ // a module by the shape of its factory and only unminified output is
417
+ // deterministic (specs/sootsim-engine/one-updates-input.md).
418
+ export async function snapshotOneProductionBundle(
419
+ projectRoot,
420
+ entryFile,
421
+ env = {},
422
+ { runtimeExecutable = process.execPath, platforms = ['ios', 'android'] } = {},
423
+ ) {
424
+ const { execFile } = await import('node:child_process')
425
+ const { mkdtemp, readFile, rm } = await import('node:fs/promises')
426
+ const { tmpdir } = await import('node:os')
427
+ const { join } = await import('node:path')
428
+ const { promisify } = await import('node:util')
429
+ const inputs = await readPackagingInputs(projectRoot)
430
+ const snapshots = []
431
+ for (const platform of platforms) {
432
+ const out = await mkdtemp(join(tmpdir(), 'peach-production-bundle-'))
433
+ try {
434
+ await promisify(execFile)(
435
+ runtimeExecutable,
436
+ [
437
+ join(projectRoot, 'node_modules/.bin/react-native'),
438
+ 'bundle',
439
+ '--platform', platform,
440
+ '--dev', 'false',
441
+ '--minify', 'false',
442
+ '--entry-file', entryFile,
443
+ '--bundle-output', join(out, 'bundle.js'),
444
+ '--assets-dest', join(out, 'assets'),
445
+ '--sourcemap-output', join(out, 'bundle.js.map'),
446
+ ],
447
+ { cwd: projectRoot, env: { ...process.env, ...env, NODE_ENV: 'production' } },
448
+ )
449
+ snapshots.push(
450
+ await packagePlatformBundle(projectRoot, platform, await readFile(join(out, 'bundle.js')), {
451
+ ...inputs,
452
+ readAssetFile: (asset, file) =>
453
+ readFile(join(out, asset.httpServerLocation, file)),
454
+ }),
455
+ )
456
+ } finally {
457
+ await rm(out, { recursive: true, force: true })
360
458
  }
361
- snapshots.push({
362
- platform,
363
- bundle: Buffer.from(
364
- await produceConfiguredBundle(
365
- insertPackageVersionsFooter(bundle.toString('utf8'), versions),
366
- config,
367
- new Set(Object.keys(versions)),
368
- ),
369
- ),
370
- assets: [...assets].map(([path, bytes]) => ({ path, bytes })),
371
- ...(platform === 'ios'
372
- ? {
373
- expoSwift: await (
374
- await import('./expo-swift-bundle')
375
- ).buildExpoSwiftBundle(projectRoot),
376
- nitro: await (await import('./nitro-bundle')).buildNitroBundle(projectRoot),
377
- turbo: await (await import('./turbo-bundle')).buildTurboBundle(projectRoot),
378
- }
379
- : {
380
- expoKotlin: await (
381
- await import('./expo-kotlin-bundle')
382
- ).buildExpoKotlinBundle(projectRoot),
383
- }),
384
- })
385
459
  }
386
460
  return { platforms: snapshots }
387
461
  }
@@ -3,7 +3,10 @@ import { readFileSync } from 'node:fs'
3
3
  import { createRequire } from 'node:module'
4
4
  import { join } from 'node:path'
5
5
  import companionIdentity from '../runtime-companion.json' with { type: 'json' }
6
- import { findMonorepoRoot, resolveActiveRuntimeRoot } from './runtime-assets'
6
+ import {
7
+ resolveActiveRuntimeRoot,
8
+ resolveDevCheckoutRuntimeAssetRoot,
9
+ } from './runtime-assets'
7
10
  import type * as CliRuntime from '#peach-cli-contract/cli-companion'
8
11
 
9
12
  export const CLI_COMPANION_ABI = 1
@@ -42,14 +45,10 @@ let loaded: { root: string; runtime: typeof CliRuntime } | undefined
42
45
  // so host serializers receive their implementation rather than a forwarding closure.
43
46
  export function getCliRuntime(): typeof CliRuntime {
44
47
  if (loaded) return loaded.runtime
45
- // the companion is built from this source tree, so inside the dev checkout it
46
- // is the one `build:peachsim:cli` copied beside the dev build; an isolated
47
- // PEACH_HOME serves an installed runtime that predates this source and holds
48
- // no companion for it
49
- const monorepoRoot = findMonorepoRoot()
50
- const root = monorepoRoot
51
- ? join(monorepoRoot, 'public/sootsim')
52
- : resolveActiveRuntimeRoot()
48
+ // the companion comes from the runtime the host serves: inside the dev checkout
49
+ // that is the dev build `build:peachsim:cli` copied it beside, unless PEACH_HOME
50
+ // stages a runtime, as a release replay does inside a builder's checkout
51
+ const root = resolveDevCheckoutRuntimeAssetRoot() ?? resolveActiveRuntimeRoot()
53
52
  if (!root) throw new Error('No Peach runtime installed; run `peach runtime install`')
54
53
  verifyCliCompanion(root)
55
54
  const require = createRequire(import.meta.url)
@@ -10,18 +10,28 @@ import { findBundleFooter } from './bundleGlobalFooter'
10
10
  import {
11
11
  collectConfiguredFileModules,
12
12
  createPeachBundleConfigFooter,
13
+ detachPeachBundleConfigFooter,
13
14
  PEACH_CONFIGURED_FILES_HOOK,
14
15
  isPeachConfig,
15
16
  } from './config'
16
17
  import { resolveReplacementModuleFile } from './host/replacement-module-handler'
17
18
  import type { PeachConfig } from './config'
18
19
 
20
+ // the minified prefix's first and last characters, as this producer writes them
21
+ const PREFIX_START = '(function(){const factories={'
22
+ const PREFIX_END = 'install(loaded)})();'
23
+
19
24
  export async function produceConfiguredBundle(
20
25
  source: string,
21
26
  config: PeachConfig | undefined,
22
27
  runtimePackages: ReadonlySet<string>,
23
28
  ): Promise<string> {
24
29
  if (!config) return source
30
+ // a channel bundle already carries its configured files and config; packaging it with its
31
+ // project produces both again, and a second prefix finds the install hook already spent
32
+ source = detachPeachBundleConfigFooter(source).source
33
+ const producedEnd = source.startsWith(PREFIX_START) ? source.indexOf(PREFIX_END) : -1
34
+ if (producedEnd >= 0) source = source.slice(producedEnd + PREFIX_END.length)
25
35
  // functions cannot cross JSON. executable native bindings belong in file entries.
26
36
  const json = JSON.stringify(config, (_key, value: unknown) => {
27
37
  if (