peachsim 0.1.1684 → 0.1.1700

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 (406) hide show
  1. package/cli/bridge-flow-runner.ts +61 -39
  2. package/cli/commands/agent-wrapper.ts +21 -10
  3. package/cli/commands/control.ts +27 -7
  4. package/cli/commands/coverage-swift.ts +72 -5
  5. package/cli/commands/coverage.ts +1 -1
  6. package/cli/commands/detect.ts +17 -4
  7. package/cli/commands/inspect/actions.ts +1 -0
  8. package/cli/commands/maestro-compare.ts +25 -99
  9. package/cli/commands/screenshot.ts +12 -0
  10. package/cli/help-core.ts +3 -4
  11. package/cli/maestro-compare.ts +172 -4
  12. package/cli/outbound-endpoints.ts +2 -10
  13. package/detox/index.ts +15 -0
  14. package/detox/launch-permissions.ts +169 -0
  15. package/dist-lib/agent-daemon-client.cjs +2 -2
  16. package/dist-lib/agent-events.cjs +2 -2
  17. package/dist-lib/attached-projects.cjs +2 -2
  18. package/dist-lib/auth/shared-session.cjs +2 -2
  19. package/dist-lib/backend-origin.cjs +2 -2
  20. package/dist-lib/beta.cjs +2 -2
  21. package/dist-lib/beta.mjs +1 -1
  22. package/dist-lib/bridge-constants.cjs +2 -2
  23. package/dist-lib/bridge-contract-input.cjs +2 -2
  24. package/dist-lib/bridge-contract-input.mjs +1 -1
  25. package/dist-lib/bridge-contract.cjs +2 -2
  26. package/dist-lib/bridge-contract.mjs +1 -1
  27. package/dist-lib/bundle-channel.cjs +6729 -3591
  28. package/dist-lib/capture-contract.cjs +2 -2
  29. package/dist-lib/capture-contract.mjs +1 -1
  30. package/dist-lib/cloud-contract.cjs +2 -2
  31. package/dist-lib/cloud-contract.mjs +1 -1
  32. package/dist-lib/cloud-test-args.cjs +2 -2
  33. package/dist-lib/cloud-test-args.mjs +1 -1
  34. package/dist-lib/cloud.cjs +2 -2
  35. package/dist-lib/cloud.mjs +1 -1
  36. package/dist-lib/config.cjs +2 -2
  37. package/dist-lib/config.mjs +1 -1
  38. package/dist-lib/detox/index.cjs +104 -3
  39. package/dist-lib/dev-bundle-resolution.cjs +208 -44
  40. package/dist-lib/expo-swift-bundle.cjs +3475 -2137
  41. package/dist-lib/expo-swift-metadata.cjs +2 -2
  42. package/dist-lib/expo-swift-metadata.mjs +1 -1
  43. package/dist-lib/home-paths.cjs +2 -2
  44. package/dist-lib/host/bridge-host.cjs +8970 -3652
  45. package/dist-lib/host/fetch-proxy-handler.cjs +332 -40
  46. package/dist-lib/host/fetch-proxy-overrides.cjs +2 -2
  47. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  48. package/dist-lib/host/replacement-module-handler.cjs +2 -2
  49. package/dist-lib/host/websocket-proxy.cjs +2 -2
  50. package/dist-lib/index.cjs +469 -143
  51. package/dist-lib/jump-to-source-babel.cjs +2 -2
  52. package/dist-lib/jump-to-source-native.cjs +2 -2
  53. package/dist-lib/kotlin-host.cjs +2 -2
  54. package/dist-lib/menu.cjs +2 -2
  55. package/dist-lib/menu.mjs +1 -1
  56. package/dist-lib/metro-fingerprint-registry.cjs +2 -2
  57. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  58. package/dist-lib/metro-production-bundle.cjs +2 -2
  59. package/dist-lib/metro-production-bundle.mjs +1 -1
  60. package/dist-lib/metro.cjs +465 -139
  61. package/dist-lib/native-app-identity-project.cjs +209 -86
  62. package/dist-lib/native-app-identity-project.mjs +251 -116
  63. package/dist-lib/native-app-identity.cjs +2 -2
  64. package/dist-lib/native-app-identity.mjs +1 -1
  65. package/dist-lib/native-firebase-metadata.cjs +2 -2
  66. package/dist-lib/native-firebase-metadata.mjs +1 -1
  67. package/dist-lib/plist.cjs +2 -2
  68. package/dist-lib/plist.mjs +1 -1
  69. package/dist-lib/profiles.cjs +2 -2
  70. package/dist-lib/public-brand.cjs +2 -2
  71. package/dist-lib/public-origins-lib-esm.json +27 -23
  72. package/dist-lib/public-origins-lib.json +221 -88
  73. package/dist-lib/react-native-host-modules.cjs +2 -2
  74. package/dist-lib/react-native-host-modules.mjs +1 -1
  75. package/dist-lib/reap-browser.cjs +2 -2
  76. package/dist-lib/scripts/dev-server-scanner.cjs +206 -31
  77. package/dist-lib/sdk.cjs +3 -3
  78. package/dist-lib/sdk.mjs +2 -2
  79. package/dist-lib/skills.cjs +20997 -16596
  80. package/dist-lib/swift-compile.cjs +3075 -459
  81. package/dist-lib/swift-compile.mjs +3028 -415
  82. package/dist-lib/swift-package.cjs +131 -69
  83. package/dist-lib/swift-package.mjs +126 -68
  84. package/dist-lib/swift-submit.cjs +2 -2
  85. package/dist-lib/swift-submit.mjs +1 -1
  86. package/dist-lib/swift-toolchain.cjs +31 -4
  87. package/dist-lib/swift.cjs +2 -2
  88. package/dist-lib/vite-swift.cjs +5049 -1704
  89. package/dist-lib/vite.cjs +261 -58
  90. package/dist-lib/worklet-executable.cjs +8 -5
  91. package/dist-lib/worklet-executable.mjs +7 -4
  92. package/dist-types/packages/peach-engine/src/engine/clipboardContract.d.ts +15 -1
  93. package/dist-types/packages/peach-engine/src/engine/font-config.d.ts +1 -1
  94. package/dist-types/packages/peach-engine/src/engine/node.d.ts +1 -0
  95. package/dist-types/packages/peach-engine/src/engine/scroll-pan-contacts.d.ts +3 -1
  96. package/dist-types/packages/peach-engine/src/engine/scroll.d.ts +7 -0
  97. package/dist-types/packages/peach-engine/src/engine/types.d.ts +2 -1
  98. package/dist-types/packages/peach-engine/src/remote-stream/cloud-display.d.ts +2 -2
  99. package/dist-types/packages/peach-engine/src/render-worker/host-service-protocol.d.ts +3 -0
  100. package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +1 -0
  101. package/dist-types/packages/peach-engine/src/render-worker/scroll-mirror.d.ts +17 -0
  102. package/dist-types/packages/peach-engine/src/render-worker/worker-input-runtime.d.ts +2 -1
  103. package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +3 -0
  104. package/dist-types/packages/peach-globals/src/cameraBridgeContract.d.ts +1 -0
  105. package/dist-types/packages/peach-globals/src/clipboardBridgeContract.d.ts +6 -0
  106. package/dist-types/packages/peach-globals/src/index.d.ts +1 -1
  107. package/dist-types/packages/peach-globals/src/nodeContract.d.ts +3 -2
  108. package/dist-types/packages/peach-globals/src/replayBridgeContract.d.ts +1 -0
  109. package/dist-types/packages/peach-globals/src/shellHostBridgeContract.d.ts +3 -0
  110. package/dist-types/packages/peach-kit/src/capabilities.d.ts +1 -0
  111. package/dist-types/packages/peach-kit/src/materials/types.d.ts +1 -0
  112. package/package.json +1 -1
  113. package/runtime-companion.json +1 -1
  114. package/scripts/dev-server-scanner.ts +4 -0
  115. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Alpha.h +2282 -0
  116. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/BasicImageTypes.h +55 -0
  117. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Conversion.h +10551 -6
  118. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Convolution.h +4236 -3
  119. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Geometry.h +827 -8
  120. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Histogram.h +1369 -0
  121. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Morphology.h +1243 -0
  122. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Transform.h +1747 -0
  123. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage.h +291 -2
  124. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_CVUtilities.h +1283 -0
  125. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Types.h +811 -91
  126. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Utilities.h +1342 -25
  127. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns.h +2738 -0
  128. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns_constants.h +1685 -0
  129. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns_graph.h +913 -0
  130. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns_structures.h +1917 -0
  131. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/LinearAlgebra.h +23 -0
  132. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/arithmetic.h +209 -0
  133. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/base.h +104 -0
  134. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/linear_systems.h +77 -0
  135. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/matrix.h +554 -0
  136. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/norms.h +58 -0
  137. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/object.h +186 -0
  138. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/splat.h +86 -0
  139. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/vector.h +364 -0
  140. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Quadrature/Integration.h +195 -0
  141. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Quadrature/Quadrature.h +44 -0
  142. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/BLAS/BLAS.h +2330 -0
  143. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/BLAS/Types.h +123 -0
  144. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/Solve.h +8339 -0
  145. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementation.h +520 -0
  146. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementationTyped.h +1893 -0
  147. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/Sparse.h +10 -0
  148. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/blas_new.h +1098 -0
  149. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/cblas.h +859 -0
  150. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/cblas_new.h +1134 -0
  151. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/clapack.h +10555 -0
  152. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/fortran_blas.h +695 -0
  153. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/lapack.h +38526 -0
  154. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/lapack_types.h +60 -0
  155. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/lapack_version.h +20 -0
  156. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/thread_api.h +50 -0
  157. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vBasicOps.h +1218 -0
  158. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vBigNum.h +1458 -0
  159. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vDSP.h +10377 -0
  160. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vDSP_translate.h +167 -0
  161. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vForce.h +1243 -0
  162. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vecLib.h +114 -0
  163. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vecLibTypes.h +146 -0
  164. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vectorOps.h +1106 -0
  165. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vfp.h +294 -0
  166. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.h +25 -1
  167. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFArray.h +673 -0
  168. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h +232 -0
  169. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h +827 -0
  170. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCalendar.h +121 -0
  171. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCharacterSet.h +387 -0
  172. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFData.h +79 -0
  173. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDate.h +122 -0
  174. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDictionary.h +674 -0
  175. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFError.h +182 -0
  176. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFLocale.h +213 -0
  177. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNotificationCenter.h +82 -0
  178. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumber.h +129 -0
  179. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSet.h +491 -0
  180. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h +883 -2
  181. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTimeZone.h +98 -0
  182. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h +11 -220
  183. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h +2 -6
  184. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLAvailability.h +22 -0
  185. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLBackgroundActivitySession.h +145 -0
  186. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLBeaconIdentityCondition.h +113 -0
  187. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLBeaconIdentityConstraint.h +34 -0
  188. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLBeaconRegion.h +225 -0
  189. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLBody.h +26 -0
  190. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLCircularGeographicCondition.h +59 -0
  191. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLCircularRegion.h +64 -0
  192. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLCondition.h +48 -0
  193. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLError.h +52 -0
  194. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLErrorDomain.h +24 -0
  195. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLGeocoder.h +55 -0
  196. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLHeading.h +117 -0
  197. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocation.h +9 -0
  198. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationManager+CLVisitExtensions.h +45 -0
  199. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationManager.h +877 -0
  200. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationManagerDelegate.h +225 -0
  201. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationPushServiceError.h +33 -0
  202. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationPushServiceExtension.h +28 -0
  203. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationUpdater.h +250 -0
  204. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLMonitor.h +140 -0
  205. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLMonitorConfiguration.h +77 -0
  206. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLMonitoringEvent.h +184 -0
  207. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLMonitoringRecord.h +57 -0
  208. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLPlacemark.h +98 -0
  209. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLRegion.h +123 -0
  210. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLServiceSession.h +211 -0
  211. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLVisit.h +66 -0
  212. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.h +46 -0
  213. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Modules/module.modulemap +7 -0
  214. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +98 -3
  215. package/sdk/ios/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceBase.h +52 -0
  216. package/sdk/ios/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceObjC.h +240 -0
  217. package/sdk/ios/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceRef.h +474 -0
  218. package/sdk/ios/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceTypes.h +66 -0
  219. package/sdk/ios/System/Library/Frameworks/IOSurface.framework/Modules/module.modulemap +10 -0
  220. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4AccelerationStructure.h +9 -0
  221. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4Archive.h +16 -0
  222. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4ArgumentTable.h +17 -0
  223. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4BinaryFunction.h +13 -0
  224. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4BinaryFunctionDescriptor.h +14 -0
  225. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4BufferRange.h +79 -0
  226. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4CommandAllocator.h +15 -0
  227. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4CommandBuffer.h +17 -0
  228. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4CommandEncoder.h +16 -0
  229. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4CommandQueue.h +19 -0
  230. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4CommitFeedback.h +15 -0
  231. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4Compiler.h +13 -0
  232. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4CompilerTask.h +13 -0
  233. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4ComputeCommandEncoder.h +19 -0
  234. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4ComputePipeline.h +13 -0
  235. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4Counters.h +19 -0
  236. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4FunctionDescriptor.h +13 -0
  237. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4LibraryDescriptor.h +13 -0
  238. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4LibraryFunctionDescriptor.h +13 -0
  239. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4LinkingDescriptor.h +13 -0
  240. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4MachineLearningCommandEncoder.h +17 -0
  241. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4MachineLearningPipeline.h +13 -0
  242. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4MeshRenderPipeline.h +13 -0
  243. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4PipelineDataSetSerializer.h +13 -0
  244. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4PipelineState.h +13 -0
  245. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4RenderCommandEncoder.h +17 -0
  246. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4RenderPass.h +17 -0
  247. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4RenderPipeline.h +13 -0
  248. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4SpecializedFunctionDescriptor.h +13 -0
  249. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4StitchedFunctionDescriptor.h +13 -0
  250. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4TileRenderPipeline.h +13 -0
  251. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLAccelerationStructure.h +1212 -0
  252. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLAccelerationStructureCommandEncoder.h +322 -0
  253. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLAccelerationStructureTypes.h +224 -0
  254. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLAllocation.h +22 -0
  255. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLArgument.h +279 -0
  256. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLArgumentEncoder.h +199 -0
  257. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLBinaryArchive.h +142 -0
  258. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLBlitCommandEncoder.h +266 -0
  259. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLBlitPass.h +82 -0
  260. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLBuffer.h +94 -0
  261. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLCaptureManager.h +113 -0
  262. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLCaptureScope.h +43 -0
  263. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLCommandBuffer.h +449 -0
  264. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLCommandEncoder.h +148 -0
  265. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLCommandQueue.h +102 -0
  266. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLComputeCommandEncoder.h +350 -0
  267. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLComputePass.h +90 -0
  268. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLComputePipeline.h +274 -0
  269. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLCounters.h +225 -0
  270. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDataType.h +232 -0
  271. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDefines.h +39 -0
  272. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDepthStencil.h +93 -0
  273. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDevice.h +1122 -0
  274. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDeviceCertification.h +29 -0
  275. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDrawable.h +36 -0
  276. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDynamicLibrary.h +81 -0
  277. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLEvent.h +79 -0
  278. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLFence.h +22 -0
  279. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLFunctionConstantValues.h +30 -0
  280. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLFunctionDescriptor.h +95 -0
  281. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLFunctionHandle.h +29 -0
  282. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLFunctionLog.h +37 -0
  283. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLFunctionStitching.h +131 -0
  284. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLGPUAddress.h +19 -0
  285. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLHeap.h +284 -0
  286. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLIOCommandBuffer.h +10 -0
  287. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLIOCommandQueue.h +11 -0
  288. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLIOCompressor.h +10 -0
  289. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLIndirectCommandBuffer.h +157 -0
  290. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLIndirectCommandEncoder.h +110 -0
  291. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLIntersectionFunctionTable.h +186 -0
  292. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLLibrary.h +549 -0
  293. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLLinkedFunctions.h +57 -0
  294. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLLogState.h +65 -0
  295. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLParallelRenderCommandEncoder.h +77 -0
  296. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLPipeline.h +57 -0
  297. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLPixelFormat.h +342 -0
  298. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLRasterizationRate.h +323 -0
  299. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLRenderCommandEncoder.h +1068 -0
  300. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLRenderPass.h +411 -0
  301. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLRenderPipeline.h +788 -0
  302. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLResidencySet.h +141 -0
  303. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLResource.h +307 -0
  304. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLResourceStateCommandEncoder.h +125 -0
  305. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLResourceStatePass.h +85 -0
  306. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLResourceViewPool.h +22 -0
  307. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLSampler.h +252 -0
  308. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLStageInputOutputDescriptor.h +158 -0
  309. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLTensor.h +17 -0
  310. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLTexture.h +460 -0
  311. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLTextureViewPool.h +18 -0
  312. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLTypes.h +125 -0
  313. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLVertexDescriptor.h +153 -0
  314. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLVisibleFunctionTable.h +45 -0
  315. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/Metal.h +94 -0
  316. package/sdk/ios/System/Library/Frameworks/Metal.framework/Modules/module.modulemap +6 -0
  317. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h +1 -0
  318. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecBase.h +906 -3
  319. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecCertificate.h +613 -0
  320. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecItem.h +1284 -29
  321. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecPolicy.h +441 -0
  322. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecTrust.h +845 -0
  323. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/Security.h +4 -0
  324. package/sdk/ios/System/Library/Frameworks/UniformTypeIdentifiers.framework/Headers/UTDefines.h +35 -0
  325. package/sdk/ios/System/Library/Frameworks/UniformTypeIdentifiers.framework/Headers/UTTagClass.h +33 -0
  326. package/sdk/ios/System/Library/Frameworks/UniformTypeIdentifiers.framework/Headers/UTType.h +504 -0
  327. package/sdk/ios/System/Library/Frameworks/_LocationEssentials.framework/Headers/CLEssentialsAvailability.h +14 -0
  328. package/sdk/ios/System/Library/Frameworks/_LocationEssentials.framework/Headers/CLLocationEssentials.h +444 -0
  329. package/sdk/ios/System/Library/Frameworks/_LocationEssentials.framework/Headers/LocationEssentials.h +14 -0
  330. package/sdk/ios/System/Library/Frameworks/_LocationEssentials.framework/Modules/module.modulemap +14 -0
  331. package/sdk/ios/usr/include/AvailabilityMacros.h +3985 -0
  332. package/sdk/ios/usr/include/complex.h +167 -0
  333. package/sdk/ios/usr/include/copyfile.h +143 -0
  334. package/sdk/ios/usr/include/dispatch/dispatch.h +5 -0
  335. package/sdk/ios/usr/include/mach/mach_types.h +1 -0
  336. package/sdk/ios/usr/include/malloc/_malloc.h +143 -0
  337. package/sdk/ios/usr/include/malloc/_malloc_type.h +153 -0
  338. package/sdk/ios/usr/include/malloc/_platform.h +80 -0
  339. package/sdk/ios/usr/include/malloc/_ptrcheck.h +43 -0
  340. package/sdk/ios/usr/include/malloc/malloc.h +768 -0
  341. package/sdk/ios/usr/include/math.h +835 -2
  342. package/sdk/ios/usr/include/os/availability.h +168 -6
  343. package/sdk/ios/usr/include/os/base.h +351 -0
  344. package/sdk/ios/usr/include/os/clock.h +18 -0
  345. package/sdk/ios/usr/include/os/lock.h +232 -10
  346. package/sdk/ios/usr/include/os/log.h +521 -38
  347. package/sdk/ios/usr/include/os/object.h +320 -3
  348. package/sdk/ios/usr/include/os/trace.h +492 -0
  349. package/sdk/ios/usr/include/os/trace_base.h +167 -0
  350. package/sdk/ios/usr/include/os/workgroup.h +37 -0
  351. package/sdk/ios/usr/include/os/workgroup_base.h +91 -0
  352. package/sdk/ios/usr/include/os/workgroup_interval.h +156 -0
  353. package/sdk/ios/usr/include/os/workgroup_object.h +359 -0
  354. package/sdk/ios/usr/include/os/workgroup_parallel.h +76 -0
  355. package/sdk/ios/usr/include/sys/cdefs.h +38 -1
  356. package/sdk/ios/wasm/include/unistd.h +3 -0
  357. package/skills/contrast/SKILL.md +3 -0
  358. package/src/codex-client.ts +11 -6
  359. package/src/dev-bundle-resolution.ts +124 -48
  360. package/src/expo-native-workspace.ts +176 -0
  361. package/src/expo-swift-host.ts +161 -26
  362. package/src/expo-swift-ready.ts +14 -28
  363. package/src/expoSwiftContract.ts +4 -1
  364. package/src/generated/swift-c-predefines.json +2044 -0
  365. package/src/host/bridge-host.ts +5 -0
  366. package/src/installed-package-versions.ts +14 -1
  367. package/src/metro-project-root.ts +44 -33
  368. package/src/native-app-identity-project.ts +1 -0
  369. package/src/nitro-adapter.lock.json +916 -10
  370. package/src/nitro-adapter.ts +33 -24
  371. package/src/nitro-bundle.ts +108 -21
  372. package/src/nitro-compile.ts +36 -5
  373. package/src/nitro-source.ts +13 -3
  374. package/src/nitroAdapterContract.ts +100 -20
  375. package/src/nitroContract.ts +18 -2
  376. package/src/node-http-fetch.ts +116 -0
  377. package/src/packageVersionsContract.ts +46 -0
  378. package/src/serverDiscoveryContract.ts +1 -0
  379. package/src/settingsContract.ts +0 -30
  380. package/src/swift-binary-modules.ts +20 -5
  381. package/src/swift-compile.ts +598 -81
  382. package/src/swift-coverage/package.ts +3 -1
  383. package/src/swift-coverage/xcode-assets.ts +66 -5
  384. package/src/swift-coverage/xcode-packages.ts +11 -6
  385. package/src/swift-host.ts +347 -60
  386. package/src/swift-objc-compile.ts +52 -10
  387. package/src/swift-objc-metadata.ts +2 -2
  388. package/src/swift-objc-platform.ts +2 -2
  389. package/src/swift-objc-standin.ts +53 -13
  390. package/src/swift-package-manifest.ts +151 -28
  391. package/src/swift-package.ts +158 -75
  392. package/src/swift-packages.ts +141 -44
  393. package/src/swift-source-file.ts +10 -15
  394. package/src/swift-source-pods.ts +126 -41
  395. package/src/swift-standin-digest.ts +77 -0
  396. package/src/swift-standin-emit.ts +40 -4
  397. package/src/swift-standins.ts +154 -31
  398. package/src/swift-submit.ts +5 -0
  399. package/src/swift-toolchain.ts +38 -0
  400. package/src/swiftContract.ts +168 -75
  401. package/src/target-matcher.ts +15 -2
  402. package/src/vite-plugin.ts +0 -10
  403. package/src/worklet-executable.ts +7 -3
  404. package/src/xcode-json-project.ts +14 -2
  405. package/src/xcode-project.ts +215 -100
  406. package/src/settings-flags.ts +0 -107
@@ -7,19 +7,23 @@ import { spawn, spawnSync } from 'child_process'
7
7
  import * as fs from 'fs'
8
8
  import * as os from 'os'
9
9
  import * as path from 'path'
10
- import { PNG } from 'pngjs'
11
- import { devices } from '../../src/device-catalog.ts'
12
10
  import { rnxHomeDir } from '../../src/home-paths'
13
11
  import { parseFlowFile } from '../flow-file'
14
12
  import {
13
+ alignNativeCapture,
15
14
  buildCompareHtml,
16
15
  buildCompareSide,
17
16
  compareScreens,
17
+ discoverNativeOutputs,
18
+ readJson,
19
+ statusBarPx,
18
20
  comparePassed,
19
21
  instrumentFlowSource,
20
22
  nativeStepsFromCommandsJson,
21
23
  nativeFlowVerdictsFromJunit,
22
24
  junitFlowKey,
25
+ nativeFlowVerdict,
26
+ nativeRecordsScreenshot,
23
27
  peachStepsFromCommandsJson,
24
28
  screensOverThreshold,
25
29
  type CompareCapture,
@@ -155,52 +159,6 @@ function runLogged(bin: string, args: string[], logPath: string): Promise<number
155
159
  })
156
160
  }
157
161
 
158
- // the status bar band of the device whose screen matches the iOS capture's
159
- // pixel size (peach's own device table); 0 for a size no device has.
160
- function statusBarPx(png: Buffer): number {
161
- // png ihdr: width and height are the big-endian words at bytes 16 and 20
162
- const width = png.readUInt32BE(16)
163
- const height = png.readUInt32BE(20)
164
- const spec = Object.values(devices).find(
165
- (d) =>
166
- // maestro can truncate fractional point bounds one pixel below simctl.
167
- Math.abs(Math.round(d.width * d.scale) - width) <= 1 &&
168
- Math.abs(Math.round(d.height * d.scale) - height) <= 1,
169
- )
170
- return spec ? spec.statusBarHeight * spec.scale : 0
171
- }
172
-
173
- // maestro's xctest shot on an ios 27 simulator drops the rightmost column of
174
- // an odd framebuffer (1179 becomes 1178). diffing at that short width
175
- // resamples peach off the pixel grid, so restore the column first.
176
- function alignNativeCapture(png: Buffer): Buffer {
177
- const width = png.readUInt32BE(16)
178
- const height = png.readUInt32BE(20)
179
- const spec = Object.values(devices).find(
180
- (d) =>
181
- Math.abs(Math.round(d.width * d.scale) - width) <= 1 &&
182
- Math.abs(Math.round(d.height * d.scale) - height) <= 1,
183
- )
184
- if (!spec) return png
185
- const expectedW = Math.round(spec.width * spec.scale)
186
- const expectedH = Math.round(spec.height * spec.scale)
187
- if (expectedH !== height || expectedW !== width + 1) return png
188
- const src = PNG.sync.read(png)
189
- const dst = new PNG({ width: expectedW, height })
190
- for (let y = 0; y < height; y++) {
191
- const srow = y * src.width * 4
192
- const drow = y * expectedW * 4
193
- src.data.copy(dst.data, drow, srow, srow + src.width * 4)
194
- const last = srow + (src.width - 1) * 4
195
- const o = drow + src.width * 4
196
- dst.data[o] = src.data[last] ?? 0
197
- dst.data[o + 1] = src.data[last + 1] ?? 0
198
- dst.data[o + 2] = src.data[last + 2] ?? 0
199
- dst.data[o + 3] = 255
200
- }
201
- return PNG.sync.write(dst)
202
- }
203
-
204
162
  // the flow as its author would name it: relative inside the working
205
163
  // directory, home-relative or absolute outside it.
206
164
  function displayPath(cwd: string, file: string): string {
@@ -210,14 +168,6 @@ function displayPath(cwd: string, file: string): string {
210
168
  return file.startsWith(home + path.sep) ? `~${file.slice(home.length)}` : file
211
169
  }
212
170
 
213
- function readJson(file: string): unknown {
214
- try {
215
- return JSON.parse(fs.readFileSync(file, 'utf8'))
216
- } catch {
217
- return null
218
- }
219
- }
220
-
221
171
  function formatConsoleEntry(entry: unknown): string {
222
172
  if (typeof entry === 'string') return entry
223
173
  if (entry && typeof entry === 'object') {
@@ -477,52 +427,23 @@ export async function runMaestroCompare(
477
427
  )
478
428
 
479
429
  // 3. pair and diff
480
- const nativeRun = fs.existsSync(nativeOut)
481
- ? fs
482
- .readdirSync(nativeOut)
483
- .map((d) => path.join(nativeOut, d))
484
- .filter((d) => fs.statSync(d).isDirectory())
485
- .sort()
486
- .pop()
487
- : undefined
488
- const nativeOutputs = new Map<string, Array<{ dir: string; commands: unknown }>>()
489
- for (const entry of nativeRun
490
- ? fs.readdirSync(nativeRun, { withFileTypes: true })
491
- : []) {
492
- if (!entry.isDirectory()) continue
493
- const dir = path.join(nativeRun!, entry.name)
494
- const commands = readJson(path.join(dir, 'commands.json'))
495
- if (!Array.isArray(commands)) continue
496
- // display names are not paths: maestro replaces slashes and suffixes collisions.
497
- // the top-level bookkeeping retains the original flow identity.
498
- let name: string | undefined
499
- let fileStem: string | undefined
500
- for (const command of commands) {
501
- if (command?.metadata?.depth !== 0) continue
502
- const config = command?.command?.applyConfigurationCommand?.config
503
- if (typeof config?.name === 'string') name ??= config.name
504
- const env = command?.command?.defineVariablesCommand?.env
505
- if (typeof env?.MAESTRO_FILENAME === 'string') fileStem ??= env.MAESTRO_FILENAME
506
- }
507
- if (fileStem === undefined) continue
508
- const key = JSON.stringify([name ?? fileStem, fileStem])
509
- const outputs = nativeOutputs.get(key) ?? []
510
- outputs.push({ dir, commands })
511
- nativeOutputs.set(key, outputs)
512
- }
430
+ const { nativeOutputs, flatShots } = discoverNativeOutputs(nativeOut)
513
431
  const imagesDir = path.join(out, 'images')
514
432
  const flows: CompareFlow[] = []
515
433
  for (const [i, flow] of instrumented.entries()) {
516
434
  const fileStem = path.basename(flow.copy).replace(/\.(ya?ml)$/i, '')
517
- const nativeOutput = nativeOutputs.get(JSON.stringify([flow.name, fileStem]))?.shift()
518
- const nativeDir = nativeOutput?.dir
435
+ // two outputs for one identity cannot be told apart: neither is used
436
+ const candidates = nativeOutputs.get(JSON.stringify([flow.name, fileStem])) ?? []
437
+ const nativeOutput = candidates.length === 1 ? candidates[0] : undefined
519
438
  const nativeRan = Boolean(nativeOutput)
520
439
  const peachResult = peachResults.get(path.resolve(flow.copy))
521
440
  const peachDir = peachResult?.outputDir
522
- const verdicts = nativeVerdicts.get(junitFlowKey(flow.name, fileStem))
523
- const nativeFailure = verdicts?.length
524
- ? verdicts.shift()
525
- : 'no native verdict in ios-report.xml'
441
+ const nativeFailure = nativeFlowVerdict(
442
+ nativeVerdicts,
443
+ flow.name,
444
+ fileStem,
445
+ instrumented.filter((f) => f.name === flow.name).length === 1,
446
+ )
526
447
  const peachRan = Boolean(
527
448
  peachDir && fs.existsSync(path.join(peachDir, 'commands.json')),
528
449
  )
@@ -546,9 +467,12 @@ export async function runMaestroCompare(
546
467
  ]
547
468
  const screens = []
548
469
  for (const capture of flow.captures) {
549
- const nativePng = nativeDir
550
- ? path.join(nativeDir, 'takeScreenshot', `${capture.name}.png`)
551
- : ''
470
+ const nativePng =
471
+ nativeOutput?.shotDir &&
472
+ (nativeOutput.shotDir !== flatShots ||
473
+ nativeRecordsScreenshot(nativeOutput.commands, capture.name))
474
+ ? path.join(nativeOutput.shotDir, `${capture.name}.png`)
475
+ : ''
552
476
  const peachPng = peachDir
553
477
  ? path.join(peachDir, 'screenshots', `${capture.name}.png`)
554
478
  : ''
@@ -589,7 +513,9 @@ export async function runMaestroCompare(
589
513
  nativeRan
590
514
  ? []
591
515
  : [
592
- `maestro produced no output for this flow (exit ${nativeExit}); see ios.log`,
516
+ candidates.length > 1
517
+ ? `maestro wrote ${candidates.length} outputs for this flow identity; they cannot be told apart`
518
+ : `maestro produced no output for this flow (exit ${nativeExit}); see ios.log`,
593
519
  ],
594
520
  nativeFailure,
595
521
  ),
@@ -235,6 +235,9 @@ async function captureViaBridge(
235
235
  // build 27864867412 logged `screenshot failed: command timed out after 10s`.
236
236
  // a generous ceiling costs nothing on fast hardware — bridge.send resolves
237
237
  // the instant the frame is ready (~1.5s), never waiting out the timeout.
238
+ // the stage in flight, so a timeout names the request that stalled (health,
239
+ // ready probe, rect lookup, screenshot) instead of a bare "command timed out".
240
+ let stage = 'health'
238
241
  const bridge = createBridgeFromParsed({ ...parsed, commandTimeoutMs: 45000 })
239
242
  try {
240
243
  // a hidden tab paints to a throttled buffer — the canvas is whatever was
@@ -264,6 +267,7 @@ async function captureViaBridge(
264
267
  // which beats a boot-card thumbnail). an app already showing content
265
268
  // answers from one probe, so the capture is of the screen as it is now.
266
269
  if (!allowLoading) {
270
+ stage = 'ready probe'
267
271
  const readyMaxMs = Number(process.env.CONTRAST_SCREENSHOT_READY_MAX_MS) || 90_000
268
272
  const readiness = await inspectCaptureReady(bridge, readyMaxMs)
269
273
  // "don't baseline this" is not "don't capture this". a boot/loading card
@@ -285,6 +289,7 @@ async function captureViaBridge(
285
289
  }
286
290
  }
287
291
 
292
+ stage = 'rect lookup'
288
293
  phase('ready')
289
294
  let resolvedRect: SampleRect | null = rect
290
295
  const matcher = (rect as { __matcher?: { id?: string; text?: string } })?.__matcher
@@ -315,8 +320,10 @@ async function captureViaBridge(
315
320
  }
316
321
  if (layers) request.layers = layers
317
322
  if (cropRect) request.crop = cropRect
323
+ stage = 'screenshot request'
318
324
  const dataUrl: string = await bridge.send(request)
319
325
  phase('capture')
326
+ stage = 'write'
320
327
  const pngPrefix = 'data:image/png;base64,'
321
328
  // never write a 0-byte "saved" file from an empty or malformed payload —
322
329
  // the sim may be alive but not painting (check `peach get errors`)
@@ -349,6 +356,11 @@ async function captureViaBridge(
349
356
  phase('write')
350
357
  if (verbose) console.log(` timing: ${phases.join(', ')}`)
351
358
  console.log(` saved: ${outputPath}`)
359
+ } catch (err) {
360
+ const message = err instanceof Error ? err.message : String(err)
361
+ throw new Error(
362
+ `${message} (stage: ${stage}; completed: ${phases.join(', ') || 'none'})`,
363
+ )
352
364
  } finally {
353
365
  bridge.close()
354
366
  }
package/cli/help-core.ts CHANGED
@@ -8,7 +8,6 @@ import {
8
8
  DEFAULT_SOOTSIM_BRIDGE_PORT,
9
9
  DEFAULT_SOOTSIM_BRIDGE_URL,
10
10
  } from '../src/bridge-constants'
11
- import { formatFlagHelp } from '../src/settings-flags.ts'
12
11
  import {
13
12
  getRnxCommandAvailability,
14
13
  getRnxFirstPositional,
@@ -100,7 +99,7 @@ export function renderRnxHelp(options: RnxHelpOptions): string {
100
99
  // backend; the public cli runs the node backend and never sees them.
101
100
  const factory = options.backend === 'browser'
102
101
  if (!command) {
103
- const index = renderCliIndexHelp(HELP_CONTEXT, formatFlagHelp()).trimEnd()
102
+ const index = renderCliIndexHelp(HELP_CONTEXT).trimEnd()
104
103
  if (!factory) return index
105
104
  return `${index}
106
105
 
@@ -116,7 +115,7 @@ ${renderRootAvailability(options.backend)}`
116
115
  if (factory && (command === 'web' || command === 'ios' || command === 'android')) {
117
116
  body = renderPreviewHelp(command)
118
117
  } else if (options.group === command && !options.prefer) {
119
- body = renderCliGroupHelp(command, HELP_CONTEXT, formatFlagHelp())
118
+ body = renderCliGroupHelp(command, HELP_CONTEXT)
120
119
  } else {
121
120
  const subVerb = getRnxFirstPositional(commandArgs)
122
121
  const grouping = new Set(['do', 'get', 'debug', 'wait'])
@@ -126,7 +125,7 @@ ${renderRootAvailability(options.backend)}`
126
125
  group: options.group,
127
126
  })
128
127
  if (!body && grouping.has(command)) {
129
- body = renderCliGroupHelp(command, HELP_CONTEXT, formatFlagHelp())
128
+ body = renderCliGroupHelp(command, HELP_CONTEXT)
130
129
  }
131
130
  }
132
131
 
@@ -4,11 +4,13 @@
4
4
  // from both commands.json shapes, the three-panel pixel diff, and the html
5
5
  // report. commands/maestro-compare.ts runs the two sides.
6
6
 
7
+ import * as fs from 'fs'
7
8
  import * as path from 'path'
8
9
  import { PNG } from 'pngjs'
9
10
  import yaml from 'yaml'
10
11
  import { CONFORMANCE_DEFAULT_COMPARISON_SETTINGS } from '../src/conformance-comparison-contract'
11
12
  import { compareConformancePixels } from '../src/conformance-pixel-comparison'
13
+ import { devices } from '../src/device-catalog'
12
14
  import { MAESTRO_YAML_OPTIONS } from './flow-file'
13
15
 
14
16
  // injected captures live under this screenshot path on both sides, so they
@@ -250,7 +252,12 @@ function isInjectedShot(label: string): boolean {
250
252
  export function nativeStepsFromCommandsJson(json: unknown): CompareStep[] {
251
253
  if (!Array.isArray(json)) return []
252
254
  const steps: CompareStep[] = []
253
- for (const entry of json as Array<Record<string, any>>) {
255
+ // the flat per-flow file is not written in run order; its timestamps are
256
+ const entries = [...(json as Array<Record<string, any>>)]
257
+ if (entries.every((entry) => typeof entry?.metadata?.timestamp === 'number')) {
258
+ entries.sort((a, b) => a.metadata.timestamp - b.metadata.timestamp)
259
+ }
260
+ for (const entry of entries) {
254
261
  const command = entry?.command
255
262
  const metadata = entry?.metadata ?? {}
256
263
  if (!command || typeof command !== 'object') continue
@@ -297,10 +304,62 @@ function decodeXml(text: string): string {
297
304
  })
298
305
  }
299
306
 
300
- export function junitFlowKey(name: string, fileStem: string): string {
307
+ // a testcase without a file attribute (maestro 2.3) is keyed by name alone
308
+ export function junitFlowKey(name: string, fileStem: string | null): string {
301
309
  return JSON.stringify([name, fileStem])
302
310
  }
303
311
 
312
+ // the failure for one flow, undefined for a pass. a report without file
313
+ // attributes binds by name, only when no other selected flow shares it. exactly
314
+ // one record may match: more cannot be told apart, so none is trusted.
315
+ export function nativeFlowVerdict(
316
+ verdicts: Map<string, Array<string | undefined>>,
317
+ name: string,
318
+ fileStem: string,
319
+ nameIsUnique: boolean,
320
+ ): string | undefined {
321
+ const records = [
322
+ ...(verdicts.get(junitFlowKey(name, fileStem)) ?? []),
323
+ ...(nameIsUnique ? (verdicts.get(junitFlowKey(name, null)) ?? []) : []),
324
+ ]
325
+ if (records.length === 0) return 'no native verdict in ios-report.xml'
326
+ if (records.length > 1) {
327
+ return `ios-report.xml has ${records.length} verdict records for this flow; they cannot be told apart`
328
+ }
329
+ return records[0]
330
+ }
331
+
332
+ // the flow a native commands.json belongs to, from the top-level bookkeeping
333
+ // maestro records in it (display names are not paths: maestro replaces
334
+ // slashes and suffixes collisions). undefined when it records no file stem.
335
+ export function nativeFlowIdentity(
336
+ json: unknown,
337
+ ): { name: string; fileStem: string } | undefined {
338
+ if (!Array.isArray(json)) return undefined
339
+ let name: string | undefined
340
+ let fileStem: string | undefined
341
+ for (const entry of json) {
342
+ if (entry?.metadata?.depth !== undefined && entry.metadata.depth !== 0) continue
343
+ const config = entry?.command?.applyConfigurationCommand?.config
344
+ if (typeof config?.name === 'string') name ??= config.name
345
+ const env = entry?.command?.defineVariablesCommand?.env
346
+ if (typeof env?.MAESTRO_FILENAME === 'string') fileStem ??= env.MAESTRO_FILENAME
347
+ }
348
+ return fileStem === undefined ? undefined : { name: name ?? fileStem, fileStem }
349
+ }
350
+
351
+ // whether the commands record a finished screenshot at this path
352
+ export function nativeRecordsScreenshot(json: unknown, shot: string): boolean {
353
+ return (
354
+ Array.isArray(json) &&
355
+ json.some(
356
+ (entry) =>
357
+ entry?.command?.takeScreenshotCommand?.path === shot &&
358
+ (entry.metadata?.status === 'COMPLETED' || entry.metadata?.status === 'WARNED'),
359
+ )
360
+ )
361
+ }
362
+
304
363
  // maestro's own per-flow report (--format junit): one testcase per flow, whose
305
364
  // status and failure text are the verdict whatever the flow did or printed.
306
365
  // values hold the failure message per testcase, undefined for a pass, in
@@ -316,13 +375,16 @@ export function nativeFlowVerdictsFromJunit(
316
375
  }
317
376
  const file = attrs.get('file')
318
377
  const name = attrs.get('name')
319
- if (file === undefined || name === undefined) continue
378
+ if (name === undefined) continue
320
379
  const body = match[3] ?? ''
321
380
  const failure =
322
381
  /<(?:failure|error)\b[^>]*?(?:\/>|>([\s\S]*?)<\/(?:failure|error)>)/.exec(body)
323
382
  const failed = failure !== null || attrs.get('status') === 'ERROR'
324
383
  const message = failure?.[1] ? decodeXml(failure[1]).trim() : ''
325
- const key = junitFlowKey(name, path.basename(file).replace(/\.(ya?ml)$/i, ''))
384
+ const key = junitFlowKey(
385
+ name,
386
+ file === undefined ? null : path.basename(file).replace(/\.(ya?ml)$/i, ''),
387
+ )
326
388
  const list = verdicts.get(key) ?? []
327
389
  list.push(failed ? `Maestro failed this flow: ${message || 'no message'}` : undefined)
328
390
  verdicts.set(key, list)
@@ -546,6 +608,112 @@ export function compareScreens(
546
608
  }
547
609
  }
548
610
 
611
+ // the status bar band of the device whose screen matches the iOS capture's
612
+ // pixel size (peach's own device table); 0 for a size no device has.
613
+ export function statusBarPx(png: Buffer): number {
614
+ // png ihdr: width and height are the big-endian words at bytes 16 and 20
615
+ const width = png.readUInt32BE(16)
616
+ const height = png.readUInt32BE(20)
617
+ const spec = Object.values(devices).find(
618
+ (d) =>
619
+ // maestro can truncate fractional point bounds one pixel below simctl.
620
+ Math.abs(Math.round(d.width * d.scale) - width) <= 1 &&
621
+ Math.abs(Math.round(d.height * d.scale) - height) <= 1,
622
+ )
623
+ return spec ? spec.statusBarHeight * spec.scale : 0
624
+ }
625
+
626
+ // maestro's xctest shot on an ios 27 simulator drops the rightmost column of
627
+ // an odd framebuffer (1179 becomes 1178). diffing at that short width
628
+ // resamples peach off the pixel grid, so restore the column first.
629
+ export function alignNativeCapture(png: Buffer): Buffer {
630
+ const width = png.readUInt32BE(16)
631
+ const height = png.readUInt32BE(20)
632
+ const spec = Object.values(devices).find(
633
+ (d) =>
634
+ Math.abs(Math.round(d.width * d.scale) - width) <= 1 &&
635
+ Math.abs(Math.round(d.height * d.scale) - height) <= 1,
636
+ )
637
+ if (!spec) return png
638
+ const expectedW = Math.round(spec.width * spec.scale)
639
+ const expectedH = Math.round(spec.height * spec.scale)
640
+ if (expectedH !== height || expectedW !== width + 1) return png
641
+ const src = PNG.sync.read(png)
642
+ const dst = new PNG({ width: expectedW, height })
643
+ for (let y = 0; y < height; y++) {
644
+ const srow = y * src.width * 4
645
+ const drow = y * expectedW * 4
646
+ src.data.copy(dst.data, drow, srow, srow + src.width * 4)
647
+ const last = srow + (src.width - 1) * 4
648
+ const o = drow + src.width * 4
649
+ dst.data[o] = src.data[last] ?? 0
650
+ dst.data[o + 1] = src.data[last + 1] ?? 0
651
+ dst.data[o + 2] = src.data[last + 2] ?? 0
652
+ dst.data[o + 3] = 255
653
+ }
654
+ return PNG.sync.write(dst)
655
+ }
656
+
657
+ export function readJson(file: string): unknown {
658
+ try {
659
+ return JSON.parse(fs.readFileSync(file, 'utf8'))
660
+ } catch {
661
+ return null
662
+ }
663
+ }
664
+
665
+ export interface NativeOutput {
666
+ commands: unknown
667
+ // directory holding this flow's own captures; undefined when none is attributable
668
+ shotDir?: string
669
+ }
670
+
671
+ // maestro writes either <run>/<flow>/commands.json with takeScreenshot/ beside
672
+ // it, or a flat <run>/commands-(<name>).json with the run's captures shared in
673
+ // <out>/screenshots. flows bind by the identity recorded inside the commands,
674
+ // never by directory or file name.
675
+ export function discoverNativeOutputs(nativeOut: string): {
676
+ nativeOutputs: Map<string, NativeOutput[]>
677
+ flatShots: string | undefined
678
+ } {
679
+ const nativeRun = fs.existsSync(nativeOut)
680
+ ? fs
681
+ .readdirSync(nativeOut)
682
+ .map((d) => path.join(nativeOut, d))
683
+ .filter((d) => path.basename(d) !== 'screenshots' && fs.statSync(d).isDirectory())
684
+ .sort()
685
+ .pop()
686
+ : undefined
687
+ const nativeOutputs = new Map<string, NativeOutput[]>()
688
+ const addNative = (output: NativeOutput) => {
689
+ const identity = nativeFlowIdentity(output.commands)
690
+ if (!identity) return
691
+ const key = JSON.stringify([identity.name, identity.fileStem])
692
+ nativeOutputs.set(key, [...(nativeOutputs.get(key) ?? []), output])
693
+ }
694
+ const flatOutputs: NativeOutput[] = []
695
+ for (const entry of nativeRun
696
+ ? fs.readdirSync(nativeRun, { withFileTypes: true })
697
+ : []) {
698
+ const full = path.join(nativeRun!, entry.name)
699
+ if (entry.isDirectory()) {
700
+ const commands = readJson(path.join(full, 'commands.json'))
701
+ if (Array.isArray(commands)) {
702
+ addNative({ commands, shotDir: path.join(full, 'takeScreenshot') })
703
+ }
704
+ } else if (/^commands-\(.*\)\.json$/.test(entry.name)) {
705
+ const commands = readJson(full)
706
+ if (Array.isArray(commands)) flatOutputs.push({ commands })
707
+ }
708
+ }
709
+ // the flat captures are shared by every flow of the run, so they belong to a
710
+ // flow only when it is the run's single native flow.
711
+ const flatShots =
712
+ flatOutputs.length === 1 ? path.join(nativeOut, 'screenshots') : undefined
713
+ for (const output of flatOutputs) addNative({ ...output, shotDir: flatShots })
714
+ return { nativeOutputs, flatShots }
715
+ }
716
+
549
717
  export interface CompareSide {
550
718
  status: 'passed' | 'failed' | 'not run'
551
719
  durationMs: number
@@ -678,7 +678,7 @@ export const DECLARED_OUTBOUND_CALLS: Record<string, OutboundCallDeclaration> =
678
678
  },
679
679
  "packages/peach-engine/src/settings/persistence.ts :: fetch :: '/__sootsim/shared-config'":
680
680
  { category: 'same_origin_runtime', count: 1 },
681
- 'packages/peachsim/src/metro-project-root.ts :: fetch :: `${origin}/`': {
681
+ 'packages/peachsim/src/node-http-fetch.ts :: transport.request :: target': {
682
682
  category: 'local_development',
683
683
  count: 1,
684
684
  },
@@ -835,11 +835,7 @@ export const DECLARED_OUTBOUND_CALLS: Record<string, OutboundCallDeclaration> =
835
835
  category: 'local_development',
836
836
  count: 1,
837
837
  },
838
- 'packages/peachsim/src/expo-swift-ready.ts :: fetch :: endpointUrl': {
839
- category: 'local_development',
840
- count: 1,
841
- },
842
- 'packages/peach-engine/src/expo-swift-compilation.ts :: fetch-alias :: address': {
838
+ 'packages/peach-engine/src/swift-compilation.ts :: fetch-alias :: address': {
843
839
  category: 'local_development',
844
840
  count: 1,
845
841
  },
@@ -859,10 +855,6 @@ export const DECLARED_OUTBOUND_CALLS: Record<string, OutboundCallDeclaration> =
859
855
  category: 'guest_app_network',
860
856
  count: 1,
861
857
  },
862
- 'packages/peachsim/src/metro-project-root.ts :: fetch :: `${origin}/status`': {
863
- category: 'local_development',
864
- count: 1,
865
- },
866
858
  'packages/peachsim/cli/app-splash.ts :: fetch :: `${origin}/manifest`': {
867
859
  category: 'local_development',
868
860
  count: 1,
package/detox/index.ts CHANGED
@@ -40,6 +40,10 @@ import {
40
40
  sootsimToPage,
41
41
  waitForSootsimGestureHandler,
42
42
  } from './gestures'
43
+ import {
44
+ applyDetoxLaunchPermissions,
45
+ type DetoxLaunchPermissions,
46
+ } from './launch-permissions'
43
47
  import { by, type Matcher } from './matchers'
44
48
  import { describeSootsimBridgeFailure, navigateSootsimPage } from './navigation-lifecycle'
45
49
  import {
@@ -1887,6 +1891,11 @@ export const device = {
1887
1891
  async launchApp(opts?: {
1888
1892
  delete?: boolean
1889
1893
  newInstance?: boolean
1894
+ // detox permission presets for the guest app, applied through the
1895
+ // permission store once the test bridge is up and before launchApp
1896
+ // returns. ios only: native android silently ignores launchApp
1897
+ // permissions, so peach android ignores them too.
1898
+ permissions?: DetoxLaunchPermissions
1890
1899
  url?: string
1891
1900
  sourceApp?: string
1892
1901
  launchArgs?: Record<string, any>
@@ -1934,6 +1943,9 @@ export const device = {
1934
1943
  )
1935
1944
  }
1936
1945
  await waitForSootsimTree(page, 10000)
1946
+ if (opts?.permissions && DETOX_PLATFORM === 'ios') {
1947
+ await applyDetoxLaunchPermissions(page, opts.permissions)
1948
+ }
1937
1949
  if (opts?.url) {
1938
1950
  await device.openURL({ url: opts.url, sourceApp: opts.sourceApp })
1939
1951
  }
@@ -2105,6 +2117,9 @@ export const device = {
2105
2117
  }
2106
2118
 
2107
2119
  await waitForSootsimTree(_page!, 30000)
2120
+ if (opts?.permissions && DETOX_PLATFORM === 'ios') {
2121
+ await applyDetoxLaunchPermissions(_page!, opts.permissions)
2122
+ }
2108
2123
  await waitForSootsimSurfaceMetrics(_page!, 30000)
2109
2124
  await waitForSootsimShellReady(_page!, 30000)
2110
2125
  await waitForSootsimWorkletsIdle(_page!, 3000)