peachsim 0.1.1674 → 0.1.1692

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 (350) hide show
  1. package/cli/commands/control.ts +13 -1
  2. package/cli/commands/coverage-swift.ts +150 -27
  3. package/cli/commands/coverage.ts +219 -20
  4. package/cli/commands/detect.ts +10 -6
  5. package/cli/commands/inspect/actions.ts +1 -0
  6. package/cli/commands/inspect/core.ts +2 -0
  7. package/cli/commands/inspect/wait-ready.ts +7 -0
  8. package/cli/commands/screenshot.ts +12 -0
  9. package/cli/outbound-endpoints.ts +12 -0
  10. package/detox/index.ts +11 -1
  11. package/detox/jest-environment.cjs +14 -0
  12. package/dist-lib/agent-daemon-client.cjs +1 -1
  13. package/dist-lib/agent-events.cjs +1 -1
  14. package/dist-lib/attached-projects.cjs +1 -1
  15. package/dist-lib/auth/shared-session.cjs +1 -1
  16. package/dist-lib/backend-origin.cjs +1 -1
  17. package/dist-lib/beta.cjs +1 -1
  18. package/dist-lib/beta.mjs +1 -1
  19. package/dist-lib/bridge-constants.cjs +1 -1
  20. package/dist-lib/bridge-contract-input.cjs +1 -1
  21. package/dist-lib/bridge-contract-input.mjs +1 -1
  22. package/dist-lib/bridge-contract.cjs +1 -1
  23. package/dist-lib/bridge-contract.mjs +1 -1
  24. package/dist-lib/bundle-channel.cjs +4833 -2432
  25. package/dist-lib/capture-contract.cjs +1 -1
  26. package/dist-lib/capture-contract.mjs +1 -1
  27. package/dist-lib/cloud-contract.cjs +1 -1
  28. package/dist-lib/cloud-contract.mjs +1 -1
  29. package/dist-lib/cloud-test-args.cjs +1 -1
  30. package/dist-lib/cloud-test-args.mjs +1 -1
  31. package/dist-lib/cloud.cjs +1 -1
  32. package/dist-lib/cloud.mjs +1 -1
  33. package/dist-lib/config.cjs +1 -1
  34. package/dist-lib/config.mjs +1 -1
  35. package/dist-lib/detox/index.cjs +6 -4
  36. package/dist-lib/detox/jest-environment.cjs +14 -0
  37. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  38. package/dist-lib/expo-swift-bundle.cjs +3785 -1737
  39. package/dist-lib/expo-swift-metadata.cjs +1 -1
  40. package/dist-lib/expo-swift-metadata.mjs +1 -1
  41. package/dist-lib/home-paths.cjs +1 -1
  42. package/dist-lib/host/bridge-host.cjs +4253 -2205
  43. package/dist-lib/host/fetch-proxy-handler.cjs +20 -7
  44. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  45. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  46. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  47. package/dist-lib/host/websocket-proxy.cjs +1 -1
  48. package/dist-lib/index.cjs +2065 -796
  49. package/dist-lib/jump-to-source-babel.cjs +1 -1
  50. package/dist-lib/jump-to-source-native.cjs +1 -1
  51. package/dist-lib/kotlin-host.cjs +1 -1
  52. package/dist-lib/menu.cjs +1 -1
  53. package/dist-lib/menu.mjs +1 -1
  54. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  55. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  56. package/dist-lib/metro-production-bundle.cjs +1 -1
  57. package/dist-lib/metro-production-bundle.mjs +1 -1
  58. package/dist-lib/metro.cjs +6325 -4287
  59. package/dist-lib/native-app-identity-project.cjs +192 -55
  60. package/dist-lib/native-app-identity-project.mjs +235 -86
  61. package/dist-lib/native-app-identity.cjs +1 -1
  62. package/dist-lib/native-app-identity.mjs +1 -1
  63. package/dist-lib/native-firebase-metadata.cjs +1 -1
  64. package/dist-lib/native-firebase-metadata.mjs +1 -1
  65. package/dist-lib/plist.cjs +1 -1
  66. package/dist-lib/plist.mjs +1 -1
  67. package/dist-lib/profiles.cjs +1 -1
  68. package/dist-lib/public-brand.cjs +1 -1
  69. package/dist-lib/public-origins-lib-esm.json +27 -23
  70. package/dist-lib/public-origins-lib-static.json +1 -1
  71. package/dist-lib/public-origins-lib.json +156 -87
  72. package/dist-lib/react-native-host-modules.cjs +1 -1
  73. package/dist-lib/react-native-host-modules.mjs +1 -1
  74. package/dist-lib/reap-browser.cjs +2 -2
  75. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  76. package/dist-lib/sdk.cjs +3 -2
  77. package/dist-lib/sdk.mjs +3 -2
  78. package/dist-lib/skills.cjs +5036 -2833
  79. package/dist-lib/swift-compile.cjs +2937 -437
  80. package/dist-lib/swift-compile.mjs +2932 -435
  81. package/dist-lib/swift-package.cjs +137 -49
  82. package/dist-lib/swift-package.mjs +132 -49
  83. package/dist-lib/swift-submit.cjs +1 -1
  84. package/dist-lib/swift-submit.mjs +1 -1
  85. package/dist-lib/swift-toolchain.cjs +26 -11
  86. package/dist-lib/swift.cjs +1 -1
  87. package/dist-lib/vite-swift.cjs +6005 -1725
  88. package/dist-lib/vite.cjs +1911 -776
  89. package/dist-lib/worklet-executable.cjs +7 -4
  90. package/dist-lib/worklet-executable.mjs +7 -4
  91. package/dist-types/packages/peach-engine/src/engine/canvaskit-api.d.ts +1 -1
  92. package/dist-types/packages/peach-engine/src/engine/clipboardContract.d.ts +24 -2
  93. package/dist-types/packages/peach-engine/src/preview/upload-protocol.d.ts +11 -3
  94. package/dist-types/packages/peach-engine/src/webview-automation-host.d.ts +6 -0
  95. package/dist-types/packages/peach-globals/src/clipboardBridgeContract.d.ts +8 -0
  96. package/dist-types/packages/peach-globals/src/index.d.ts +1 -1
  97. package/dist-types/packages/peach-globals/src/nodeContract.d.ts +3 -2
  98. package/dist-types/packages/peach-kit/src/capabilities.d.ts +1 -0
  99. package/package.json +1 -1
  100. package/runtime-companion.json +1 -1
  101. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h +60 -2
  102. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLAvailability.h +22 -0
  103. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLBackgroundActivitySession.h +145 -0
  104. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLBeaconIdentityCondition.h +113 -0
  105. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLBeaconIdentityConstraint.h +34 -0
  106. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLBeaconRegion.h +225 -0
  107. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLBody.h +26 -0
  108. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLCircularGeographicCondition.h +59 -0
  109. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLCircularRegion.h +64 -0
  110. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLCondition.h +48 -0
  111. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLError.h +52 -0
  112. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLErrorDomain.h +24 -0
  113. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLGeocoder.h +55 -0
  114. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLHeading.h +117 -0
  115. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocation.h +9 -0
  116. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationManager+CLVisitExtensions.h +45 -0
  117. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationManager.h +877 -0
  118. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationManagerDelegate.h +225 -0
  119. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationPushServiceError.h +33 -0
  120. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationPushServiceExtension.h +28 -0
  121. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationUpdater.h +250 -0
  122. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLMonitor.h +140 -0
  123. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLMonitorConfiguration.h +77 -0
  124. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLMonitoringEvent.h +184 -0
  125. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLMonitoringRecord.h +57 -0
  126. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLPlacemark.h +98 -0
  127. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLRegion.h +123 -0
  128. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLServiceSession.h +211 -0
  129. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLVisit.h +66 -0
  130. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.h +46 -0
  131. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Modules/module.modulemap +7 -0
  132. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +117 -2
  133. package/sdk/ios/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceBase.h +52 -0
  134. package/sdk/ios/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceObjC.h +240 -0
  135. package/sdk/ios/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceRef.h +474 -0
  136. package/sdk/ios/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceTypes.h +66 -0
  137. package/sdk/ios/System/Library/Frameworks/IOSurface.framework/Modules/module.modulemap +10 -0
  138. package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFComposeAssistantViewController.h +29 -0
  139. package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMailComposeControllerDeferredAction.h +14 -0
  140. package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMailComposeViewController.h +162 -0
  141. package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMailDraft.h +24 -0
  142. package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMessageComposeViewController+UPI.h +31 -0
  143. package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMessageComposeViewController.h +169 -0
  144. package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MessageUI.h +13 -0
  145. package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Modules/module.modulemap +11 -0
  146. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4AccelerationStructure.h +9 -0
  147. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4Archive.h +16 -0
  148. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4ArgumentTable.h +17 -0
  149. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4BinaryFunction.h +13 -0
  150. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4BinaryFunctionDescriptor.h +14 -0
  151. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4BufferRange.h +79 -0
  152. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4CommandAllocator.h +15 -0
  153. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4CommandBuffer.h +17 -0
  154. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4CommandEncoder.h +16 -0
  155. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4CommandQueue.h +19 -0
  156. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4CommitFeedback.h +15 -0
  157. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4Compiler.h +13 -0
  158. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4CompilerTask.h +13 -0
  159. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4ComputeCommandEncoder.h +19 -0
  160. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4ComputePipeline.h +13 -0
  161. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4Counters.h +19 -0
  162. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4FunctionDescriptor.h +13 -0
  163. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4LibraryDescriptor.h +13 -0
  164. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4LibraryFunctionDescriptor.h +13 -0
  165. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4LinkingDescriptor.h +13 -0
  166. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4MachineLearningCommandEncoder.h +17 -0
  167. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4MachineLearningPipeline.h +13 -0
  168. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4MeshRenderPipeline.h +13 -0
  169. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4PipelineDataSetSerializer.h +13 -0
  170. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4PipelineState.h +13 -0
  171. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4RenderCommandEncoder.h +17 -0
  172. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4RenderPass.h +17 -0
  173. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4RenderPipeline.h +13 -0
  174. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4SpecializedFunctionDescriptor.h +13 -0
  175. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4StitchedFunctionDescriptor.h +13 -0
  176. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4TileRenderPipeline.h +13 -0
  177. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLAccelerationStructure.h +1212 -0
  178. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLAccelerationStructureCommandEncoder.h +322 -0
  179. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLAccelerationStructureTypes.h +224 -0
  180. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLAllocation.h +22 -0
  181. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLArgument.h +279 -0
  182. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLArgumentEncoder.h +199 -0
  183. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLBinaryArchive.h +142 -0
  184. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLBlitCommandEncoder.h +266 -0
  185. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLBlitPass.h +82 -0
  186. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLBuffer.h +94 -0
  187. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLCaptureManager.h +113 -0
  188. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLCaptureScope.h +43 -0
  189. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLCommandBuffer.h +449 -0
  190. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLCommandEncoder.h +148 -0
  191. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLCommandQueue.h +102 -0
  192. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLComputeCommandEncoder.h +350 -0
  193. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLComputePass.h +90 -0
  194. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLComputePipeline.h +274 -0
  195. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLCounters.h +225 -0
  196. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDataType.h +232 -0
  197. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDefines.h +39 -0
  198. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDepthStencil.h +93 -0
  199. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDevice.h +1122 -0
  200. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDeviceCertification.h +29 -0
  201. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDrawable.h +36 -0
  202. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDynamicLibrary.h +81 -0
  203. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLEvent.h +79 -0
  204. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLFence.h +22 -0
  205. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLFunctionConstantValues.h +30 -0
  206. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLFunctionDescriptor.h +95 -0
  207. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLFunctionHandle.h +29 -0
  208. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLFunctionLog.h +37 -0
  209. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLFunctionStitching.h +131 -0
  210. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLGPUAddress.h +19 -0
  211. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLHeap.h +284 -0
  212. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLIOCommandBuffer.h +10 -0
  213. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLIOCommandQueue.h +11 -0
  214. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLIOCompressor.h +10 -0
  215. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLIndirectCommandBuffer.h +157 -0
  216. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLIndirectCommandEncoder.h +110 -0
  217. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLIntersectionFunctionTable.h +186 -0
  218. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLLibrary.h +549 -0
  219. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLLinkedFunctions.h +57 -0
  220. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLLogState.h +65 -0
  221. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLParallelRenderCommandEncoder.h +77 -0
  222. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLPipeline.h +57 -0
  223. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLPixelFormat.h +342 -0
  224. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLRasterizationRate.h +323 -0
  225. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLRenderCommandEncoder.h +1068 -0
  226. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLRenderPass.h +411 -0
  227. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLRenderPipeline.h +788 -0
  228. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLResidencySet.h +141 -0
  229. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLResource.h +307 -0
  230. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLResourceStateCommandEncoder.h +125 -0
  231. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLResourceStatePass.h +85 -0
  232. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLResourceViewPool.h +22 -0
  233. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLSampler.h +252 -0
  234. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLStageInputOutputDescriptor.h +158 -0
  235. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLTensor.h +17 -0
  236. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLTexture.h +460 -0
  237. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLTextureViewPool.h +18 -0
  238. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLTypes.h +125 -0
  239. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLVertexDescriptor.h +153 -0
  240. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLVisibleFunctionTable.h +45 -0
  241. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/Metal.h +94 -0
  242. package/sdk/ios/System/Library/Frameworks/Metal.framework/Modules/module.modulemap +6 -0
  243. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h +10 -0
  244. package/sdk/ios/System/Library/Frameworks/UniformTypeIdentifiers.framework/Headers/UTDefines.h +35 -0
  245. package/sdk/ios/System/Library/Frameworks/UniformTypeIdentifiers.framework/Headers/UTTagClass.h +33 -0
  246. package/sdk/ios/System/Library/Frameworks/UniformTypeIdentifiers.framework/Headers/UTType.h +504 -0
  247. package/sdk/ios/System/Library/Frameworks/_LocationEssentials.framework/Headers/CLEssentialsAvailability.h +14 -0
  248. package/sdk/ios/System/Library/Frameworks/_LocationEssentials.framework/Headers/CLLocationEssentials.h +444 -0
  249. package/sdk/ios/System/Library/Frameworks/_LocationEssentials.framework/Headers/LocationEssentials.h +14 -0
  250. package/sdk/ios/System/Library/Frameworks/_LocationEssentials.framework/Modules/module.modulemap +14 -0
  251. package/sdk/ios/usr/include/arm/param.h +151 -0
  252. package/sdk/ios/usr/include/complex.h +167 -0
  253. package/sdk/ios/usr/include/dispatch/dispatch.h +8 -0
  254. package/sdk/ios/usr/include/dlfcn.h +1 -2
  255. package/sdk/ios/usr/include/mach/mach_types.h +1 -0
  256. package/sdk/ios/usr/include/machine/param.h +42 -0
  257. package/sdk/ios/usr/include/math.h +835 -2
  258. package/sdk/ios/usr/include/net/if.h +1 -2
  259. package/sdk/ios/usr/include/peach/pthread.h +4 -4
  260. package/sdk/ios/usr/include/pthread/qos.h +304 -0
  261. package/sdk/ios/usr/include/sys/_types/_fd_clr.h +31 -0
  262. package/sdk/ios/usr/include/sys/_types/_fd_copy.h +31 -0
  263. package/sdk/ios/usr/include/sys/_types/_fd_def.h +121 -0
  264. package/sdk/ios/usr/include/sys/_types/_fd_isset.h +31 -0
  265. package/sdk/ios/usr/include/sys/_types/_fd_set.h +31 -0
  266. package/sdk/ios/usr/include/sys/_types/_fd_setsize.h +31 -0
  267. package/sdk/ios/usr/include/sys/_types/_fd_zero.h +31 -0
  268. package/sdk/ios/usr/include/sys/cdefs.h +3 -1
  269. package/sdk/ios/usr/include/sys/param.h +235 -0
  270. package/sdk/ios/usr/include/sys/proc.h +1 -0
  271. package/sdk/ios/usr/include/sys/qos.h +151 -12
  272. package/sdk/ios/wasm/include/__typedef_sigset_t.h +7 -0
  273. package/sdk/ios/wasm/include/fcntl.h +11 -0
  274. package/sdk/ios/wasm/include/mach/machine/boolean.h +2 -0
  275. package/sdk/ios/wasm/include/mach/machine/exception.h +5 -0
  276. package/sdk/ios/wasm/include/mach/machine/kern_return.h +2 -0
  277. package/sdk/ios/wasm/include/mach/machine/processor_info.h +2 -0
  278. package/sdk/ios/wasm/include/mach/machine/rpc.h +2 -0
  279. package/sdk/ios/wasm/include/mach/machine/thread_state.h +3 -0
  280. package/sdk/ios/wasm/include/mach/machine/thread_status.h +3 -0
  281. package/sdk/ios/wasm/include/mach/machine/vm_param.h +3 -0
  282. package/sdk/ios/wasm/include/mach/machine/vm_types.h +18 -0
  283. package/sdk/ios/wasm/include/machine/_types.h +153 -0
  284. package/sdk/ios/wasm/include/machine/endian.h +2 -0
  285. package/sdk/ios/wasm/include/machine/limits.h +2 -0
  286. package/sdk/ios/wasm/include/machine/types.h +30 -0
  287. package/sdk/ios/wasm/include/poll.h +8 -0
  288. package/sdk/ios/wasm/include/pthread.h +50 -0
  289. package/sdk/ios/wasm/include/signal.h +72 -0
  290. package/sdk/ios/wasm/include/stdlib.h +3 -0
  291. package/sdk/ios/wasm/include/string.h +10 -0
  292. package/sdk/ios/wasm/include/sys/_pthread/_pthread_attr_t.h +7 -0
  293. package/sdk/ios/wasm/include/sys/_pthread/_pthread_t.h +7 -0
  294. package/sdk/ios/wasm/include/sys/mman.h +122 -0
  295. package/sdk/ios/wasm/include/sys/select.h +37 -0
  296. package/sdk/ios/wasm/include/sys/signal.h +259 -0
  297. package/sdk/ios/wasm/include/sys/socket.h +8 -0
  298. package/sdk/ios/wasm/include/sys/types.h +14 -0
  299. package/sdk/ios/wasm/include/sys/ucontext.h +1 -0
  300. package/sdk/ios/wasm/include/sys/uio.h +11 -0
  301. package/sdk/ios/wasm/include/sys/wait.h +89 -0
  302. package/sdk/ios/wasm/include/time.h +8 -0
  303. package/sdk/ios/wasm/include/unistd.h +17 -0
  304. package/src/bridge-contract.ts +2 -0
  305. package/src/chromium-admission.ts +10 -5
  306. package/src/device-catalog.ts +4 -4
  307. package/src/generated/swift-c-predefines.json +1988 -0
  308. package/src/host/fetch-proxy-handler.ts +20 -0
  309. package/src/metro-plugin.ts +5 -2
  310. package/src/nitro-adapter.lock.json +6 -6
  311. package/src/nitro-bundle.ts +1 -0
  312. package/src/nitro-compile.ts +67 -2
  313. package/src/nitroContract.ts +18 -2
  314. package/src/numbered-lock.ts +72 -0
  315. package/src/react-native-coverage/capability-reference-resolution.ts +62 -5
  316. package/src/react-native-coverage/capability-source-references.ts +50 -13
  317. package/src/react-native-coverage/native-source-credit.ts +126 -0
  318. package/src/react-native-coverage/native-source-ranges-file.ts +38 -0
  319. package/src/react-native-coverage/native-surface.ts +49 -0
  320. package/src/react-native-coverage/verified-reach.ts +22 -2
  321. package/src/runtime-assets.ts +17 -0
  322. package/src/swift-compile.ts +530 -97
  323. package/src/swift-coverage/indexing.ts +17 -1
  324. package/src/swift-coverage/package.ts +3 -1
  325. package/src/swift-coverage/sdk.ts +71 -0
  326. package/src/swift-coverage/source.ts +74 -2
  327. package/src/swift-coverage/types.ts +6 -0
  328. package/src/swift-coverage/xcode-assets.ts +62 -2
  329. package/src/swift-coverage/xcode-packages.ts +11 -6
  330. package/src/swift-distribution.lock.json +12 -12
  331. package/src/swift-host.ts +457 -62
  332. package/src/swift-objc-compile.ts +26 -26
  333. package/src/swift-objc-metadata.ts +2 -8
  334. package/src/swift-objc-platform.ts +53 -0
  335. package/src/swift-objc-standin.ts +66 -12
  336. package/src/swift-package-manifest.ts +196 -28
  337. package/src/swift-package.ts +186 -60
  338. package/src/swift-packages.ts +298 -88
  339. package/src/swift-source-file.ts +10 -15
  340. package/src/swift-source-pods.ts +288 -0
  341. package/src/swift-standins.ts +87 -13
  342. package/src/swift-submit.ts +5 -0
  343. package/src/swift-toolchain.ts +32 -10
  344. package/src/swiftContract.ts +160 -75
  345. package/src/target-matcher.ts +15 -2
  346. package/src/vite-plugin-one.ts +5 -4
  347. package/src/worker-system-chunks.ts +7 -1
  348. package/src/worklet-executable.ts +7 -3
  349. package/src/xcode-json-project.ts +14 -2
  350. package/src/xcode-project.ts +193 -69
@@ -0,0 +1,288 @@
1
+ import { createHash } from 'node:crypto'
2
+ import fs from 'node:fs'
3
+ import path from 'node:path'
4
+ import yaml from 'yaml'
5
+ import { cacheDir } from './home-paths'
6
+ import { compileInput, disposeSwiftProject, openXcodeProject } from './swift-host'
7
+ import { swiftManifestTargets } from './swift-package'
8
+ import { withSwiftRootLock } from './swift-root-lock'
9
+ import { readXcodeAppTarget } from './xcode-project'
10
+ import type { SwiftCompileInput } from './swift-compile'
11
+
12
+ const APP = 'PeachPodDependencies'
13
+ const record = (value: unknown): value is Record<string, unknown> =>
14
+ value !== null && typeof value === 'object' && !Array.isArray(value)
15
+
16
+ // this is an empty host project; CocoaPods alone writes every dependency target.
17
+ const project = `{
18
+ archiveVersion = 1;
19
+ objectVersion = 56;
20
+ objects = {
21
+ A00000000000000000000001 = { isa = PBXProject; buildConfigurationList = A00000000000000000000002; compatibilityVersion = "Xcode 14.0"; mainGroup = A00000000000000000000003; productRefGroup = A00000000000000000000004; projectDirPath = ""; projectRoot = ""; targets = (A00000000000000000000005,); };
22
+ A00000000000000000000002 = { isa = XCConfigurationList; buildConfigurations = (A00000000000000000000006,); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; };
23
+ A00000000000000000000003 = { isa = PBXGroup; children = (A00000000000000000000004,A00000000000000000000007,); sourceTree = "<group>"; };
24
+ A00000000000000000000004 = { isa = PBXGroup; children = (A00000000000000000000008,); name = Products; sourceTree = "<group>"; };
25
+ A00000000000000000000005 = { isa = PBXNativeTarget; buildConfigurationList = A00000000000000000000009; buildPhases = (A0000000000000000000000A,); buildRules = (); dependencies = (); name = ${APP}; productName = ${APP}; productReference = A00000000000000000000008; productType = "com.apple.product-type.application"; };
26
+ A00000000000000000000006 = { isa = XCBuildConfiguration; buildSettings = { SDKROOT = iphoneos; IPHONEOS_DEPLOYMENT_TARGET = 16.0; }; name = Release; };
27
+ A00000000000000000000007 = { isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
28
+ A00000000000000000000008 = { isa = PBXFileReference; explicitFileType = wrapper.application; path = ${APP}.app; sourceTree = BUILT_PRODUCTS_DIR; };
29
+ A00000000000000000000009 = { isa = XCConfigurationList; buildConfigurations = (A0000000000000000000000B,); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; };
30
+ A0000000000000000000000A = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = (A0000000000000000000000C,); runOnlyForDeploymentPostprocessing = 0; };
31
+ A0000000000000000000000B = { isa = XCBuildConfiguration; buildSettings = { PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_BUNDLE_IDENTIFIER = dev.peach.dependencies; SWIFT_VERSION = 5.0; GENERATE_INFOPLIST_FILE = YES; CURRENT_PROJECT_VERSION = 1; MARKETING_VERSION = 1.0; }; name = Release; };
32
+ A0000000000000000000000C = { isa = PBXBuildFile; fileRef = A00000000000000000000007; };
33
+ };
34
+ rootObject = A00000000000000000000001;
35
+ }
36
+ `
37
+
38
+ interface LockedPod {
39
+ name: string
40
+ version: string
41
+ dependencies: string[]
42
+ }
43
+
44
+ function lockedPods(value: unknown): Map<string, LockedPod> {
45
+ if (!record(value) || !Array.isArray(value.PODS))
46
+ throw new Error('Podfile.lock has no PODS list')
47
+ const pods = new Map<string, LockedPod>()
48
+ for (const entry of value.PODS) {
49
+ const entries =
50
+ typeof entry === 'string'
51
+ ? [[entry, []]]
52
+ : record(entry)
53
+ ? Object.entries(entry)
54
+ : []
55
+ if (entries.length !== 1) throw new Error('Podfile.lock has an invalid pod entry')
56
+ const [label, dependencies] = entries[0]!
57
+ if (
58
+ typeof label !== 'string' ||
59
+ !Array.isArray(dependencies) ||
60
+ !dependencies.every((dep): dep is string => typeof dep === 'string')
61
+ )
62
+ throw new Error('Podfile.lock has invalid pod dependencies')
63
+ const match =
64
+ /^([A-Za-z_][A-Za-z0-9_.+-]*(?:\/[A-Za-z0-9_.+-]+)*) \(([A-Za-z0-9_.+-]+)\)$/.exec(
65
+ label,
66
+ )
67
+ if (!match) throw new Error(`Podfile.lock has an invalid version: ${label}`)
68
+ const name = match[1]!
69
+ if (pods.has(name)) throw new Error(`Podfile.lock repeats ${name}`)
70
+ pods.set(name, {
71
+ name,
72
+ version: match[2]!,
73
+ dependencies: dependencies.map((dep) => dep.split(' ')[0]!).sort(),
74
+ })
75
+ }
76
+ return pods
77
+ }
78
+
79
+ /** install only the locked closure of missing imports, then read CocoaPods' real project. */
80
+ export async function collectSwiftSourcePods(
81
+ appRoot: string,
82
+ modules: readonly string[],
83
+ moduleRoot: string,
84
+ ): Promise<SwiftCompileInput | null> {
85
+ const lockFile = path.join(appRoot, 'Podfile.lock')
86
+ if (modules.length === 0 || !fs.existsSync(lockFile)) return null
87
+ const original = fs.readFileSync(lockFile, 'utf8')
88
+ const lock: unknown = yaml.parse(original)
89
+ const pods = lockedPods(lock)
90
+ if (!record(lock) || !record(lock['SPEC CHECKSUMS']) || !record(lock['SPEC REPOS']))
91
+ throw new Error(
92
+ `${lockFile}: source pods require specification checksums and repositories`,
93
+ )
94
+ const checksums = lock['SPEC CHECKSUMS']
95
+ const repositories = lock['SPEC REPOS']
96
+ const selected = new Map<string, LockedPod>()
97
+ const visit = (name: string) => {
98
+ if (selected.has(name)) return
99
+ const pod = pods.get(name)
100
+ if (!pod) throw new Error(`${lockFile}: dependency ${name} is not locked`)
101
+ const root = name.split('/')[0]!
102
+ if (record(lock['EXTERNAL SOURCES']) && root in lock['EXTERNAL SOURCES'])
103
+ throw new Error(
104
+ `${lockFile}: ${root} requires its original installed CocoaPods workspace`,
105
+ )
106
+ selected.set(name, pod)
107
+ for (const dependency of pod.dependencies) visit(dependency)
108
+ }
109
+ for (const module of modules) {
110
+ const roots = [
111
+ ...new Set([...pods.keys()].map((name) => name.split('/')[0]!)),
112
+ ].filter((name) => name.replace(/[^A-Za-z0-9_]/g, '_') === module)
113
+ if (roots.length === 0) continue
114
+ if (roots.length !== 1) throw new Error(`${lockFile}: ambiguous pod module ${module}`)
115
+ const root = roots[0]!
116
+ if (pods.has(root)) visit(root)
117
+ else for (const name of pods.keys()) if (name.startsWith(`${root}/`)) visit(name)
118
+ }
119
+ if (selected.size === 0) return null
120
+ const roots = new Set([...selected.keys()].map((name) => name.split('/')[0]!))
121
+ const trunk = repositories.trunk
122
+ if (!Array.isArray(trunk) || [...roots].some((root) => !trunk.includes(root)))
123
+ throw new Error(
124
+ `${lockFile}: source pod intake requires checksum-pinned trunk JSON specifications`,
125
+ )
126
+ const specificationChecksums: Record<string, string> = {}
127
+ for (const root of roots)
128
+ if (typeof checksums[root] !== 'string' || !/^[a-f0-9]{40}$/.test(checksums[root]))
129
+ throw new Error(`${lockFile}: missing checksum for ${root}`)
130
+ else specificationChecksums[root] = checksums[root]
131
+ const podfile = [
132
+ "source 'https://cdn.cocoapods.org/'",
133
+ "platform :ios, '16.0'",
134
+ 'use_frameworks! :linkage => :static',
135
+ "install! 'cocoapods', :deterministic_uuids => true",
136
+ `target '${APP}' do`,
137
+ ...[...selected.values()]
138
+ .sort((a, b) => a.name.localeCompare(b.name))
139
+ .map(
140
+ (pod) =>
141
+ ` pod ${JSON.stringify(pod.name)}, :podspec => ${JSON.stringify(`${pod.name.split('/')[0]}.podspec.json`)}`,
142
+ ),
143
+ 'end',
144
+ '',
145
+ ].join('\n')
146
+ const key = createHash('sha256')
147
+ .update(project)
148
+ .update(podfile)
149
+ .update(JSON.stringify([...selected].sort(([a], [b]) => a.localeCompare(b))))
150
+ .update(
151
+ JSON.stringify(
152
+ Object.entries(specificationChecksums).sort(([a], [b]) => a.localeCompare(b)),
153
+ ),
154
+ )
155
+ .digest('hex')
156
+ const work = path.join(cacheDir(), 'swift-source-pods', key)
157
+ return withSwiftRootLock(work, async (lease) => {
158
+ fs.mkdirSync(path.join(work, `${APP}.xcodeproj`), { recursive: true })
159
+ const runPod = async (args: string[]): Promise<string> => {
160
+ const child = lease.spawn('pod', args, { cwd: work })
161
+ child.stdin.end()
162
+ const output: Buffer[] = []
163
+ const errors: Buffer[] = []
164
+ child.stdout.on('data', (bytes: Buffer) => output.push(bytes))
165
+ child.stderr.on('data', (bytes: Buffer) => errors.push(bytes))
166
+ await new Promise<void>((resolve, reject) => {
167
+ child.once('error', (error) =>
168
+ reject(
169
+ new Error(
170
+ `CocoaPods is required to install source dependencies: ${error.message}`,
171
+ { cause: error },
172
+ ),
173
+ ),
174
+ )
175
+ child.once('close', (status) =>
176
+ status === 0
177
+ ? resolve()
178
+ : reject(
179
+ new Error(
180
+ `CocoaPods command pod ${args.join(' ')} exited ${status}: ${Buffer.concat(errors).toString('utf8')}`,
181
+ ),
182
+ ),
183
+ )
184
+ })
185
+ if (args[0] === 'install')
186
+ fs.writeFileSync(
187
+ path.join(work, 'pod-install.log'),
188
+ Buffer.concat([...output, ...errors]),
189
+ )
190
+ return Buffer.concat(output).toString('utf8')
191
+ }
192
+ const installed = path.join(work, 'Pods/Manifest.lock')
193
+ const complete = path.join(work, 'pod-install-complete')
194
+ const installedChecksums: Record<string, string> = {}
195
+ // checksum-pinned JSON binds the original prepare_command too; CocoaPods owns execution.
196
+ for (const root of [...roots].sort()) {
197
+ const version = [...selected.values()].find(
198
+ (pod) => pod.name.split('/')[0] === root,
199
+ )!.version
200
+ const file = path.join(work, `${root}.podspec.json`)
201
+ let text: string
202
+ if (fs.existsSync(file)) text = fs.readFileSync(file, 'utf8')
203
+ else {
204
+ const shard = createHash('md5')
205
+ .update(root)
206
+ .digest('hex')
207
+ .slice(0, 3)
208
+ .split('')
209
+ .join('/')
210
+ const response = await fetch(
211
+ `https://cdn.cocoapods.org/Specs/${shard}/${root}/${version}/${root}.podspec.json`,
212
+ )
213
+ if (!response.ok)
214
+ throw new Error(
215
+ `CocoaPods specification ${root} ${version}: HTTP ${response.status}`,
216
+ )
217
+ text = await response.text()
218
+ }
219
+ if (createHash('sha1').update(text).digest('hex') !== specificationChecksums[root])
220
+ throw new Error(`${work}: ${root} podspec checksum differs from ${lockFile}`)
221
+ const spec: unknown = JSON.parse(text)
222
+ if (!record(spec) || spec.name !== root || spec.version !== version)
223
+ throw new Error(`${work}: specification identity differs for ${root} ${version}`)
224
+ if (!fs.existsSync(file)) fs.writeFileSync(file, text)
225
+ // CocoaPods serializes external JSON specs before computing their installed checksum.
226
+ const serialized = await runPod(['ipc', 'spec', file])
227
+ installedChecksums[root] = createHash('sha1').update(serialized).digest('hex')
228
+ }
229
+ if (!fs.existsSync(complete)) {
230
+ fs.writeFileSync(path.join(work, `${APP}.xcodeproj/project.pbxproj`), project)
231
+ fs.writeFileSync(path.join(work, 'main.swift'), 'import Foundation\n')
232
+ fs.writeFileSync(path.join(work, 'Podfile'), podfile)
233
+ await runPod(['install'])
234
+ fs.writeFileSync(complete, key)
235
+ }
236
+ const actualLock: unknown = yaml.parse(fs.readFileSync(installed, 'utf8'))
237
+ const actual = lockedPods(actualLock)
238
+ if (
239
+ JSON.stringify([...actual].sort(([a], [b]) => a.localeCompare(b))) !==
240
+ JSON.stringify([...selected].sort(([a], [b]) => a.localeCompare(b)))
241
+ )
242
+ throw new Error(
243
+ `${work}: installed pod versions or dependencies differ from ${lockFile}`,
244
+ )
245
+ if (!record(actualLock) || !record(actualLock['SPEC CHECKSUMS']))
246
+ throw new Error(`${work}: installed pod checksums missing`)
247
+ for (const root of roots)
248
+ if (actualLock['SPEC CHECKSUMS'][root] !== installedChecksums[root])
249
+ throw new Error(`${work}: ${root} podspec checksum differs from ${lockFile}`)
250
+ const workspace = path.join(work, `${APP}.xcworkspace`)
251
+ const app = readXcodeAppTarget(workspace, APP, 'Release', { installedPods: true })
252
+ if (app.binaryFrameworks.length > 0)
253
+ throw new Error(
254
+ `${work}: source pod intake does not replace vendored binary frameworks`,
255
+ )
256
+ const root = openXcodeProject(workspace, APP, moduleRoot, 'Release')
257
+ try {
258
+ const input = compileInput(root, 'main.swift')
259
+ if (
260
+ Object.keys(input.images ?? {}).length > 0 ||
261
+ Object.values(input.resources ?? {}).some((encoded) => {
262
+ const bytes = Buffer.from(encoded, 'base64')
263
+ return !Buffer.from(bytes.toString('utf8')).equals(bytes)
264
+ })
265
+ )
266
+ throw new Error(
267
+ `${work}: binary pod resources require original binary file transport`,
268
+ )
269
+ const targets = swiftManifestTargets(input.files['Package.swift']!).filter(
270
+ (target) => !target.executable,
271
+ )
272
+ // Nitro carries only parsed dependency target calls; its consumer owns the executable.
273
+ for (const file of Object.keys(input.files))
274
+ if (file.startsWith('__app__/')) delete input.files[file]
275
+ input.files['SourcePodfile.lock'] = original
276
+ input.nativeTargets = input.nativeTargets?.filter((target) => target.name !== APP)
277
+ input.resourceBundles = input.resourceBundles?.filter(
278
+ (bundle) => bundle.target !== APP,
279
+ )
280
+ for (const module of modules)
281
+ if (roots.has(module) && !targets.some((target) => target.name === module))
282
+ throw new Error(`${work}: CocoaPods did not provide module ${module}`)
283
+ return input
284
+ } finally {
285
+ disposeSwiftProject(root)
286
+ }
287
+ })
288
+ }
@@ -34,10 +34,11 @@ import {
34
34
  WASI_EMULATION,
35
35
  WASI_EMULATION_FLAGS,
36
36
  nativeInterfaceView,
37
+ moduleMapHeaders,
37
38
  objcView,
38
39
  type ObjcSurface,
39
40
  } from './swift-objc-standin'
40
- import { swiftTargetModuleName } from './swift-package'
41
+ import { moduleMapName, swiftTargetModuleName } from './swift-package'
41
42
  import {
42
43
  STANDIN_EMIT_VERSION,
43
44
  STANDIN_IMPORTS,
@@ -62,6 +63,8 @@ export interface SwiftStandin {
62
63
  target: string
63
64
  /** the target's files, relative to its directory. */
64
65
  files: Record<string, string>
66
+ /** target-relative directory containing the original public module map. */
67
+ publicHeadersPath?: string
65
68
  /** other generated modules named by this target's public headers. */
66
69
  dependencies?: string[]
67
70
  }
@@ -236,6 +239,52 @@ function xcframework(binary: SwiftPackageBinary): {
236
239
  return { dir: found, digest: sha }
237
240
  }
238
241
 
242
+ /**
243
+ * the -F directory xcode gives a package binary target: the iOS simulator
244
+ * slice's frameworks with their headers and module maps, staged under `root`
245
+ * where the original Objective-C compile reads its inputs. the executable
246
+ * stays in the artifact. null when the slice has no framework with a module
247
+ * map, which a swift-only module lacks.
248
+ */
249
+ export function binaryFrameworkSearchPath(
250
+ binary: SwiftPackageBinary,
251
+ root: string,
252
+ ): string | null {
253
+ const artifact = xcframework(binary)
254
+ const frameworks = [
255
+ ...new Set(
256
+ surfaces(artifact.dir).flatMap((surface) =>
257
+ 'modulemap' in surface &&
258
+ path.basename(path.dirname(surface.modulemap)) === 'Modules'
259
+ ? [path.dirname(path.dirname(surface.modulemap))]
260
+ : [],
261
+ ),
262
+ ),
263
+ ]
264
+ if (frameworks.length === 0) return null
265
+ const search = path.join(root, 'peach-binary-frameworks', artifact.digest.slice(0, 32))
266
+ if (fs.existsSync(search)) return search
267
+ // publish a complete directory so concurrent workspaces never read a partial one.
268
+ const pending = `${search}.${process.pid}.tmp`
269
+ fs.rmSync(pending, { recursive: true, force: true })
270
+ for (const framework of frameworks)
271
+ for (const part of ['Headers', 'Modules'])
272
+ if (fs.existsSync(path.join(framework, part)))
273
+ fs.cpSync(
274
+ path.join(framework, part),
275
+ path.join(pending, path.basename(framework), part),
276
+ { recursive: true, dereference: true },
277
+ )
278
+ try {
279
+ fs.renameSync(pending, search)
280
+ } catch (error) {
281
+ // another process published the same digest first; its directory is complete
282
+ fs.rmSync(pending, { recursive: true, force: true })
283
+ if (!fs.existsSync(search)) throw error
284
+ }
285
+ return search
286
+ }
287
+
239
288
  const files = (dir: string, test: (name: string) => boolean): string[] =>
240
289
  fs.existsSync(dir)
241
290
  ? fs
@@ -264,6 +313,12 @@ function headerSurface(module: string, modulemap: string, headers: string): Surf
264
313
  }
265
314
 
266
315
  function surfaces(xcframeworkDir: string): Surface[] {
316
+ const standaloneMap = path.join(xcframeworkDir, 'module.modulemap')
317
+ if (fs.existsSync(standaloneMap)) {
318
+ const module = moduleMapName(fs.readFileSync(standaloneMap, 'utf8'))
319
+ if (!module) throw new Error('its module map declares no module')
320
+ return [headerSurface(module, standaloneMap, xcframeworkDir)]
321
+ }
267
322
  const slice = fs
268
323
  .readdirSync(xcframeworkDir)
269
324
  .filter((name) => /^ios-.+-simulator$/.test(name))
@@ -318,7 +373,7 @@ function surfaces(xcframeworkDir: string): Surface[] {
318
373
  const headers = path.join(root, 'Headers')
319
374
  for (const map of files(headers, (name) => name === 'module.modulemap')) {
320
375
  const modulemap = path.join(headers, map)
321
- const module = /(?:^|\s)module\s+(\w+)/.exec(fs.readFileSync(modulemap, 'utf8'))?.[1]
376
+ const module = moduleMapName(fs.readFileSync(modulemap, 'utf8'))
322
377
  if (module) found.push(headerSurface(module, modulemap, path.dirname(modulemap)))
323
378
  }
324
379
  return found
@@ -794,15 +849,12 @@ function cStandin(
794
849
  toolchain: Toolchain,
795
850
  work: string,
796
851
  ): SwiftStandin {
797
- const named = [
798
- ...fs
799
- .readFileSync(surface.modulemap, 'utf8')
800
- .matchAll(/(?:umbrella\s+)?header\s+"([^"]+)"/g),
801
- ].map((match) => match[1]!)
802
852
  const headers = files(surface.headers, (name) => name.endsWith('.h'))
853
+ const framework = path.basename(path.dirname(surface.modulemap)) === 'Modules'
854
+ const headerDirectory = framework ? `${surface.module}.framework/Headers` : '.'
803
855
  const texts = new Map(
804
856
  headers.map((file) => [
805
- file,
857
+ path.posix.join(headerDirectory, file),
806
858
  fs.readFileSync(path.join(surface.headers, file), 'utf8'),
807
859
  ]),
808
860
  )
@@ -812,7 +864,10 @@ function cStandin(
812
864
  fs.mkdirSync(path.dirname(path.join(include, file)), { recursive: true })
813
865
  fs.writeFileSync(path.join(include, file), text)
814
866
  }
815
- const roots = named.length > 0 ? named : headers
867
+ const roots = moduleMapHeaders(surface.modulemap, headers).map((file) =>
868
+ path.posix.join(headerDirectory, file),
869
+ )
870
+ const frameworkMap = `${surface.module}.framework/Modules/module.modulemap`
816
871
  const modulemap = `module ${surface.module} {\n${roots.map((file) => ` header "${file}"\n`).join('')} export *\n}\n`
817
872
  const probe = path.join(work, 'declarations.c')
818
873
  fs.writeFileSync(probe, roots.map((file) => `#include "${file}"\n`).join(''))
@@ -832,7 +887,9 @@ function cStandin(
832
887
  probe,
833
888
  ]),
834
889
  )
835
- const byPath = new Map(headers.map((file) => [path.join(include, file), file]))
890
+ const byPath = new Map(
891
+ [...texts.keys()].map((file) => [path.join(include, file), file]),
892
+ )
836
893
  // clang's offsets count bytes, which a header with non-ascii comments
837
894
  // (generated ffi headers carry emoji) puts ahead of string indices
838
895
  const bytes = new Map(
@@ -878,7 +935,7 @@ function cStandin(
878
935
  const source = [
879
936
  `// generated by peach from ${surface.module}'s headers: ${binary.target} ships`,
880
937
  '// iOS machine code only, so every extern function traps naming itself.',
881
- ...roots.map((file) => `#include "${file}"`),
938
+ ...roots.map((file) => `#include "${framework ? `include/${file}` : file}"`),
882
939
  '#include <stdio.h>',
883
940
  '#include <stdlib.h>',
884
941
  '',
@@ -911,11 +968,16 @@ function cStandin(
911
968
  return {
912
969
  module: surface.module,
913
970
  target: binary.target,
971
+ ...(framework
972
+ ? { publicHeadersPath: `include/${surface.module}.framework/Modules` }
973
+ : {}),
914
974
  files: {
915
975
  ...Object.fromEntries(
916
976
  [...texts].map(([file, text]) => [`include/${file}`, text] as const),
917
977
  ),
918
- 'include/module.modulemap': modulemap,
978
+ ...(framework
979
+ ? { [`include/${frameworkMap}`]: fs.readFileSync(surface.modulemap, 'utf8') }
980
+ : { 'include/module.modulemap': modulemap }),
919
981
  [`${surface.module}.c`]: source,
920
982
  },
921
983
  }
@@ -975,6 +1037,7 @@ function crateFor(root: string, name: string): string | null {
975
1037
  // the simulator slice's static library as the xcframework's Info.plist
976
1038
  // declares it, the name Xcode links; the archive itself may be unbuilt.
977
1039
  function simulatorLibraryName(dir: string): string | undefined {
1040
+ if (!dir.endsWith('.xcframework')) return undefined
978
1041
  const info = parsePlistSource(fs.readFileSync(path.join(dir, 'Info.plist'), 'utf8'))
979
1042
  const libraries =
980
1043
  info && typeof info === 'object' ? Reflect.get(info, 'AvailableLibraries') : undefined
@@ -1246,6 +1309,10 @@ function readStandinResults(
1246
1309
  item.target !== entry.target ||
1247
1310
  !isRecord(item.files) ||
1248
1311
  !Object.values(item.files).every((text) => typeof text === 'string') ||
1312
+ (item.publicHeadersPath !== undefined &&
1313
+ (typeof item.publicHeadersPath !== 'string' ||
1314
+ typeof item.files[`${item.publicHeadersPath}/module.modulemap`] !==
1315
+ 'string')) ||
1249
1316
  (item.dependencies !== undefined &&
1250
1317
  (!Array.isArray(item.dependencies) ||
1251
1318
  !item.dependencies.every((name) => typeof name === 'string')))
@@ -1260,6 +1327,9 @@ function readStandinResults(
1260
1327
  module: item.module,
1261
1328
  target: entry.target,
1262
1329
  files,
1330
+ ...(typeof item.publicHeadersPath === 'string'
1331
+ ? { publicHeadersPath: item.publicHeadersPath }
1332
+ : {}),
1263
1333
  ...(item.dependencies === undefined ? {} : { dependencies: item.dependencies }),
1264
1334
  })
1265
1335
  }
@@ -1281,7 +1351,7 @@ export function standinGenerationInputs(
1281
1351
  const { moduleRoot, release } = toolchain
1282
1352
  const sdk = swiftModuleSdk(moduleRoot)
1283
1353
  const parts = [
1284
- 'standin/v9',
1354
+ 'standin/v11',
1285
1355
  release,
1286
1356
  sdk.wasmSdkId,
1287
1357
  sdk.wasmSdkChecksum,
@@ -1633,6 +1703,7 @@ export function swiftStandins(
1633
1703
  const target = byModule.get(module)
1634
1704
  if (target) visit(target)
1635
1705
  }
1706
+ const started = Date.now()
1636
1707
  const result = binaryStandins(
1637
1708
  binary,
1638
1709
  generatedToolchain,
@@ -1641,6 +1712,9 @@ export function swiftStandins(
1641
1712
  frameworks,
1642
1713
  siblings.get(binary)!,
1643
1714
  )
1715
+ console.error(
1716
+ `[swift-standins] ${binary.target} ${typeof result === 'string' ? 'gap' : 'ready'} in ${Date.now() - started}ms`,
1717
+ )
1644
1718
  if (typeof result === 'string') {
1645
1719
  gaps.set(binary.target, result)
1646
1720
  return
@@ -25,6 +25,7 @@ import {
25
25
  isSwiftMetalLibrarySources,
26
26
  type SwiftMetalLibrarySource,
27
27
  type SwiftResourceBundle,
28
+ type SwiftPackageFiles,
28
29
  type SwiftNativeTarget,
29
30
  type SwiftObjCPeerStartup,
30
31
  } from './swiftContract'
@@ -237,6 +238,8 @@ export interface SwiftCompileContext {
237
238
 
238
239
  export type SwiftCompileSubmit = (work: {
239
240
  files: Record<string, string>
241
+ packageFiles?: SwiftPackageFiles
242
+ packageGuestImports?: string[]
240
243
  nativeTargets?: SwiftNativeTarget[]
241
244
  objcPeerStartup?: SwiftObjCPeerStartup
242
245
  metalSources?: Record<string, string>
@@ -404,6 +407,8 @@ export async function compileSwiftProject(
404
407
  submit: SwiftCompileSubmit,
405
408
  work: {
406
409
  files: Record<string, string>
410
+ packageFiles?: SwiftPackageFiles
411
+ packageGuestImports?: string[]
407
412
  nativeTargets?: SwiftNativeTarget[]
408
413
  objcPeerStartup?: SwiftObjCPeerStartup
409
414
  metalSources?: Record<string, string>
@@ -49,20 +49,20 @@ export function swiftSdkOptions(): string[] {
49
49
  }
50
50
 
51
51
  // host archives include the official driver/runtime and the qualified patched frontend.
52
- export const SWIFT_HOST_COMPILER_RELEASE = 'swift-6.4.0-RELEASE-custom-0d775d32d7c74eae'
53
- export const SWIFT_HOST_COMPILER_ID = '0d775d32d7c74eae'
52
+ export const SWIFT_HOST_COMPILER_RELEASE = 'swift-6.4.0-RELEASE-custom-8be2e4a7a393b003'
53
+ export const SWIFT_HOST_COMPILER_ID = '8be2e4a7a393b003'
54
54
  const compilerArchives: Record<string, { checksum: string; manifest: string }> = {
55
55
  'darwin-arm64': {
56
- checksum: '957e85486f92327ee5cf8d3c5bb9336d17ab80145c87645c637c49130a50477a',
57
- manifest: 'c63e2f81694e8d8ad046d10c71d0638dbae4e5a36601294ed670988d1cb5b6f1',
56
+ checksum: '88d69b7ac912962adaadce9fdb2c57fe07cd19e4d8158088e0acbd247496ca6d',
57
+ manifest: '70d5e2be8c959eb5dd1d9b576e6c209e1f58bfb9089f90c38c2d7e087759f0b3',
58
58
  },
59
59
  'linux-x64': {
60
- checksum: '6302230fb126b79c9af5fc2bc0208a936bb573c343da7ae949c5c1687e761cd2',
61
- manifest: '31b507a6a8648a2266a187b9fed092e29a63cae99d57c5defdf2e82a7cbbc113',
60
+ checksum: '7c42ded03742d16816e64f8ae8fca478aaaff450d22ab3d698daf78c010854b2',
61
+ manifest: '90cfb09c5a0ba8c119066787cf47244a45bf3cda68dce94c6b1a16337b9b91bd',
62
62
  },
63
63
  'linux-arm64': {
64
- checksum: '9b40d39ea5ba82fd9a417868f0a449f5e98e37cf83acaac9cedd3a8b8d91a218',
65
- manifest: 'fe07a29d4f4374cad47b29de70e90aa2e3b7664e08c8b53d304585e65637da24',
64
+ checksum: 'f9f1d96fb1a6325d3bb30ab12a75fc06e4e8535aab58a91581e03f3d91f68fa6',
65
+ manifest: 'f988181dce795f6c8a6d4a8d86f7b61768f23a743b4e7bea76e64862ef328ad6',
66
66
  },
67
67
  }
68
68
 
@@ -349,7 +349,9 @@ function verifySwiftSdk(swift: string, sdk: SwiftWasmSdk): void {
349
349
  function installSwiftSdkArchive(swift: string, sdk: SwiftWasmSdk, archive: string): void {
350
350
  validateSwiftSdkIdentity(sdk)
351
351
  const staging = fs.realpathSync(
352
- fs.mkdtempSync(path.join(scratch?.directory ?? os.tmpdir(), 'peach-sdk-verification-')),
352
+ fs.mkdtempSync(
353
+ path.join(scratch?.directory ?? os.tmpdir(), 'peach-sdk-verification-'),
354
+ ),
353
355
  )
354
356
  try {
355
357
  if (swiftFileChecksum(archive) !== sdk.wasmSdkChecksum)
@@ -430,7 +432,9 @@ export function installSwiftWasmSdk(release: string, sdk: SwiftWasmSdk): void {
430
432
  // an unverified existing SDK must be compared with the declared archive.
431
433
  }
432
434
  const swift = path.join(swiftCompiler(release), 'swift')
433
- const staging = fs.mkdtempSync(path.join(scratch?.directory ?? os.tmpdir(), 'builder-swift-sdk-'))
435
+ const staging = fs.mkdtempSync(
436
+ path.join(scratch?.directory ?? os.tmpdir(), 'builder-swift-sdk-'),
437
+ )
434
438
  const archive = path.join(staging, 'sdk.artifactbundle.tar.gz')
435
439
  try {
436
440
  if (sdk.wasmSdkUrl.startsWith('file:'))
@@ -514,6 +518,24 @@ export function swiftCompiler(release: string): string {
514
518
  return bin
515
519
  }
516
520
 
521
+ /**
522
+ * admission's compiler check: the pinned compiler is installed, or this host
523
+ * has its qualified archive and no tree at its destination, so preparation
524
+ * installs it (install-host-compiler.mjs) as it installs a missing SDK.
525
+ */
526
+ export function swiftCompilerAdmissible(release: string): void {
527
+ try {
528
+ swiftCompiler(release)
529
+ } catch (error) {
530
+ if (
531
+ !release.includes('-custom-') ||
532
+ fs.existsSync(path.resolve(swiftToolchainBin(release), '../..'))
533
+ )
534
+ throw error
535
+ swiftHostCompilerArchive(release)
536
+ }
537
+ }
538
+
517
539
  /** the command that installs and qualifies the pinned SDK for an installed compiler. */
518
540
  export function swiftSdkInstallStep(release: string, wasmSdk: SwiftWasmSdk): string {
519
541
  return `install the pinned SDK:\n ${swiftSdkInstallCommand(release, wasmSdk)}`