peachsim 0.1.1692 → 0.1.1716

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 (991) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +59 -3
  3. package/cli/app-bundle-resources.ts +3 -1
  4. package/cli/app-catalog.ts +10 -0
  5. package/cli/app-fonts.ts +1 -1
  6. package/cli/app-stubs.ts +19 -9
  7. package/cli/bridge-diagnostics.ts +2 -1
  8. package/cli/bridge-flow-runner.ts +61 -39
  9. package/cli/cloud-client.ts +6 -3
  10. package/cli/commands/agent-wrapper.ts +21 -10
  11. package/cli/commands/control.ts +149 -46
  12. package/cli/commands/coverage-swift.ts +19 -1
  13. package/cli/commands/coverage.ts +1 -1
  14. package/cli/commands/detect.ts +85 -25
  15. package/cli/commands/doctor.ts +159 -20
  16. package/cli/commands/flow.ts +4 -1
  17. package/cli/commands/inspect/core.ts +176 -17
  18. package/cli/commands/inspect/settling.ts +17 -5
  19. package/cli/commands/inspect/wait-ready.ts +7 -5
  20. package/cli/commands/inspect.ts +8 -2
  21. package/cli/commands/maestro-compare.ts +25 -99
  22. package/cli/commands/record.ts +263 -32
  23. package/cli/commands/screenshot.ts +2 -13
  24. package/cli/commands/test.ts +49 -101
  25. package/cli/current-sim.ts +4 -4
  26. package/cli/help-core.ts +3 -4
  27. package/cli/hints.ts +1 -6
  28. package/cli/maestro-compare.ts +172 -4
  29. package/cli/main.ts +8 -1
  30. package/cli/metro-bundle-assets.ts +77 -0
  31. package/cli/outbound-endpoints.ts +8 -12
  32. package/cli/run-registry.ts +0 -8
  33. package/cli/scene-video.ts +5 -3
  34. package/cli/ws-bridge.ts +56 -14
  35. package/detox/index.ts +76 -3
  36. package/detox/launch-permissions.ts +325 -0
  37. package/dist-lib/agent-daemon-client.cjs +2 -2
  38. package/dist-lib/agent-events.cjs +2 -2
  39. package/dist-lib/attached-projects.cjs +2 -2
  40. package/dist-lib/auth/shared-session.cjs +2 -2
  41. package/dist-lib/backend-origin.cjs +11 -10
  42. package/dist-lib/beta.cjs +2 -2
  43. package/dist-lib/beta.mjs +1 -1
  44. package/dist-lib/bridge-constants.cjs +6 -2
  45. package/dist-lib/bridge-contract-input.cjs +2 -2
  46. package/dist-lib/bridge-contract-input.mjs +1 -1
  47. package/dist-lib/bridge-contract.cjs +2 -2
  48. package/dist-lib/bridge-contract.mjs +1 -1
  49. package/dist-lib/bundle-channel.cjs +26769 -24228
  50. package/dist-lib/capture-contract.cjs +2 -2
  51. package/dist-lib/capture-contract.mjs +1 -1
  52. package/dist-lib/cloud-contract.cjs +2 -2
  53. package/dist-lib/cloud-contract.mjs +1 -1
  54. package/dist-lib/cloud-test-args.cjs +2 -2
  55. package/dist-lib/cloud-test-args.mjs +1 -1
  56. package/dist-lib/cloud.cjs +3 -2
  57. package/dist-lib/cloud.mjs +2 -1
  58. package/dist-lib/config.cjs +2 -2
  59. package/dist-lib/config.mjs +1 -1
  60. package/dist-lib/detox/index.cjs +256 -14
  61. package/dist-lib/dev-bundle-resolution.cjs +209 -51
  62. package/dist-lib/expo-swift-bundle.cjs +10795 -17575
  63. package/dist-lib/expo-swift-metadata.cjs +2 -2
  64. package/dist-lib/expo-swift-metadata.mjs +1 -1
  65. package/dist-lib/home-paths.cjs +2 -2
  66. package/dist-lib/host/bridge-host.cjs +36893 -31765
  67. package/dist-lib/host/fetch-proxy-handler.cjs +796 -114
  68. package/dist-lib/host/fetch-proxy-overrides.cjs +2 -2
  69. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  70. package/dist-lib/host/replacement-module-handler.cjs +3 -2
  71. package/dist-lib/host/websocket-proxy.cjs +312 -46
  72. package/dist-lib/index.cjs +2244 -642
  73. package/dist-lib/jump-to-source-babel.cjs +2 -2
  74. package/dist-lib/jump-to-source-native.cjs +2 -2
  75. package/dist-lib/kotlin-host.cjs +2 -2
  76. package/dist-lib/menu.cjs +5 -2
  77. package/dist-lib/menu.mjs +3 -1
  78. package/dist-lib/metro-fingerprint-registry.cjs +2 -2
  79. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  80. package/dist-lib/metro-production-bundle.cjs +2 -2
  81. package/dist-lib/metro-production-bundle.mjs +1 -1
  82. package/dist-lib/metro.cjs +2088 -612
  83. package/dist-lib/native-app-identity-project.cjs +863 -232
  84. package/dist-lib/native-app-identity-project.mjs +871 -234
  85. package/dist-lib/native-app-identity.cjs +15 -2
  86. package/dist-lib/native-app-identity.mjs +12 -1
  87. package/dist-lib/native-firebase-metadata.cjs +2 -2
  88. package/dist-lib/native-firebase-metadata.mjs +1 -1
  89. package/dist-lib/plist.cjs +2 -2
  90. package/dist-lib/plist.mjs +1 -1
  91. package/dist-lib/profiles.cjs +2 -2
  92. package/dist-lib/public-brand.cjs +2 -2
  93. package/dist-lib/public-origins-lib-esm.json +31 -100
  94. package/dist-lib/public-origins-lib.json +449 -453
  95. package/dist-lib/react-native-host-modules.cjs +98 -4
  96. package/dist-lib/react-native-host-modules.mjs +96 -3
  97. package/dist-lib/reap-browser.cjs +2 -2
  98. package/dist-lib/scripts/dev-server-scanner.cjs +225 -75
  99. package/dist-lib/sdk.cjs +146 -19
  100. package/dist-lib/sdk.mjs +139 -18
  101. package/dist-lib/skills.cjs +53577 -48467
  102. package/dist-lib/swift-compile.cjs +6111 -16733
  103. package/dist-lib/swift-compile.mjs +6052 -16681
  104. package/dist-lib/swift-package.cjs +104 -22
  105. package/dist-lib/swift-package.mjs +99 -21
  106. package/dist-lib/swift-submit.cjs +15 -5
  107. package/dist-lib/swift-submit.mjs +14 -4
  108. package/dist-lib/swift-toolchain.cjs +42 -13
  109. package/dist-lib/swift.cjs +2 -2
  110. package/dist-lib/vite-swift.cjs +13416 -21189
  111. package/dist-lib/vite.cjs +790 -157
  112. package/dist-lib/worklet-executable.cjs +2 -2
  113. package/dist-lib/worklet-executable.mjs +1 -1
  114. package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-gesture-handler.d.ts +2 -0
  115. package/dist-types/packages/peach-compat/src/stubs/screen-transition-math.d.ts +1 -1
  116. package/dist-types/packages/peach-engine/src/capture/lockstep-clockContract.d.ts +1 -0
  117. package/dist-types/packages/peach-engine/src/engine/fiber-debug-metadata.d.ts +4 -0
  118. package/dist-types/packages/peach-engine/src/engine/font-config.d.ts +2 -2
  119. package/dist-types/packages/peach-engine/src/engine/fontDataContract.d.ts +1 -0
  120. package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +2 -0
  121. package/dist-types/packages/peach-engine/src/engine/lottie-types.d.ts +3 -0
  122. package/dist-types/packages/peach-engine/src/engine/node.d.ts +6 -3
  123. package/dist-types/packages/peach-engine/src/engine/riveContract.d.ts +5 -0
  124. package/dist-types/packages/peach-engine/src/engine/scroll-pan-contacts.d.ts +3 -1
  125. package/dist-types/packages/peach-engine/src/engine/scroll.d.ts +7 -0
  126. package/dist-types/packages/peach-engine/src/engine/types.d.ts +2 -1
  127. package/dist-types/packages/peach-engine/src/guest-module-overrides.d.ts +3 -0
  128. package/dist-types/packages/peach-engine/src/ios/chrome-metrics.d.ts +2 -1
  129. package/dist-types/packages/peach-engine/src/permissions/system-permission-types.d.ts +2 -1
  130. package/dist-types/packages/peach-engine/src/react-native/host-services.d.ts +1 -0
  131. package/dist-types/packages/peach-engine/src/react-native/platform-colors.d.ts +1 -0
  132. package/dist-types/packages/peach-engine/src/remote-stream/cloud-display.d.ts +6 -2
  133. package/dist-types/packages/peach-engine/src/remote-stream/scene-recording.d.ts +4 -0
  134. package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +16 -0
  135. package/dist-types/packages/peach-engine/src/render-worker/host-service-protocol.d.ts +18 -2
  136. package/dist-types/packages/peach-engine/src/render-worker/live-frame-mirror.d.ts +11 -0
  137. package/dist-types/packages/peach-engine/src/render-worker/native-ui-protocol.d.ts +10 -1
  138. package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +11 -0
  139. package/dist-types/packages/peach-engine/src/render-worker/scroll-mirror.d.ts +17 -0
  140. package/dist-types/packages/peach-engine/src/render-worker/shell-protocol.d.ts +5 -0
  141. package/dist-types/packages/peach-engine/src/render-worker/shell-tree-wire.d.ts +5 -0
  142. package/dist-types/packages/peach-engine/src/render-worker/tree-sync-port.d.ts +5 -0
  143. package/dist-types/packages/peach-engine/src/render-worker/worker-input-runtime.d.ts +2 -1
  144. package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime-kind.d.ts +5 -1
  145. package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +9 -4
  146. package/dist-types/packages/peach-engine/src/render-worker/workletThreadIdentityContract.d.ts +4 -0
  147. package/dist-types/packages/peach-globals/src/cameraBridgeContract.d.ts +1 -0
  148. package/dist-types/packages/peach-globals/src/guestExecutionContract.d.ts +30 -0
  149. package/dist-types/packages/peach-globals/src/index.d.ts +6 -4
  150. package/dist-types/packages/peach-globals/src/nativeBuildOptionsContract.d.ts +1 -0
  151. package/dist-types/packages/peach-globals/src/permissionsBridgeContract.d.ts +11 -0
  152. package/dist-types/packages/peach-globals/src/recordingBridgeContract.d.ts +22 -1
  153. package/dist-types/packages/peach-globals/src/replayBridgeContract.d.ts +1 -0
  154. package/dist-types/packages/peach-globals/src/sceneStreamBridgeContract.d.ts +10 -0
  155. package/dist-types/packages/peach-globals/src/shellHostBridgeContract.d.ts +9 -0
  156. package/dist-types/packages/peach-globals/src/testBridgeContract.d.ts +3 -0
  157. package/dist-types/packages/peach-kit/src/capabilities.d.ts +1 -0
  158. package/dist-types/packages/peach-kit/src/materials/types.d.ts +1 -0
  159. package/package.json +3 -1
  160. package/runtime-companion.json +1 -1
  161. package/scripts/dev-server-scanner.ts +61 -70
  162. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Alpha.h +2282 -0
  163. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/BasicImageTypes.h +55 -0
  164. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Conversion.h +10551 -6
  165. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Convolution.h +4236 -3
  166. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Geometry.h +827 -8
  167. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Histogram.h +1369 -0
  168. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Morphology.h +1243 -0
  169. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Transform.h +1747 -0
  170. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage.h +291 -2
  171. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_CVUtilities.h +1283 -0
  172. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Types.h +811 -91
  173. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Utilities.h +1342 -25
  174. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns.h +2738 -0
  175. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns_constants.h +1685 -0
  176. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns_graph.h +913 -0
  177. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/BNNS/bnns_structures.h +1917 -0
  178. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/LinearAlgebra.h +23 -0
  179. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/arithmetic.h +209 -0
  180. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/base.h +104 -0
  181. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/linear_systems.h +77 -0
  182. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/matrix.h +554 -0
  183. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/norms.h +58 -0
  184. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/object.h +186 -0
  185. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/splat.h +86 -0
  186. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/LinearAlgebra/vector.h +364 -0
  187. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Quadrature/Integration.h +195 -0
  188. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Quadrature/Quadrature.h +44 -0
  189. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/BLAS/BLAS.h +2330 -0
  190. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/BLAS/Types.h +123 -0
  191. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/Solve.h +8339 -0
  192. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementation.h +520 -0
  193. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementationTyped.h +1893 -0
  194. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/Sparse.h +10 -0
  195. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/blas_new.h +1098 -0
  196. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/cblas.h +859 -0
  197. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/cblas_new.h +1134 -0
  198. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/clapack.h +10555 -0
  199. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/fortran_blas.h +695 -0
  200. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/lapack.h +38526 -0
  201. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/lapack_types.h +60 -0
  202. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/lapack_version.h +20 -0
  203. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/thread_api.h +50 -0
  204. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vBasicOps.h +1218 -0
  205. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vBigNum.h +1458 -0
  206. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vDSP.h +10377 -0
  207. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vDSP_translate.h +167 -0
  208. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vForce.h +1243 -0
  209. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vecLib.h +114 -0
  210. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vecLibTypes.h +146 -0
  211. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vectorOps.h +1106 -0
  212. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vfp.h +294 -0
  213. package/sdk/ios/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.h +25 -1
  214. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBATTRequest.h +69 -0
  215. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBAdvertisementData.h +94 -0
  216. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBAttribute.h +34 -0
  217. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBCentral.h +41 -0
  218. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBCentralManager.h +394 -0
  219. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBCentralManagerConstants.h +224 -0
  220. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBCharacteristic.h +187 -0
  221. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBDefines.h +16 -0
  222. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBDescriptor.h +78 -0
  223. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBError.h +75 -0
  224. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBL2CAPChannel.h +50 -0
  225. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBManager.h +88 -0
  226. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBPeer.h +28 -0
  227. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBPeripheral.h +530 -0
  228. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBPeripheralManager.h +489 -0
  229. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBPeripheralManagerConstants.h +63 -0
  230. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBService.h +100 -0
  231. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBUUID.h +144 -0
  232. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CoreBluetooth.apinotes +7 -0
  233. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CoreBluetooth.h +32 -0
  234. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Modules/module.modulemap +5 -0
  235. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFArray.h +673 -0
  236. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h +232 -0
  237. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h +827 -0
  238. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCGTypes.h +131 -0
  239. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCalendar.h +121 -0
  240. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCharacterSet.h +387 -0
  241. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFData.h +79 -0
  242. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDate.h +122 -0
  243. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDictionary.h +674 -0
  244. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFError.h +182 -0
  245. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFLocale.h +213 -0
  246. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNotificationCenter.h +82 -0
  247. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumber.h +129 -0
  248. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSet.h +491 -0
  249. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h +883 -2
  250. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTimeZone.h +98 -0
  251. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h +13 -223
  252. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBase.h +359 -2
  253. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGeometry.h +328 -0
  254. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h +3 -66
  255. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/CoreNFC.apinotes +258 -0
  256. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/CoreNFC.h +31 -0
  257. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/NFCError.h +103 -0
  258. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/NFCFeliCaTag.h +267 -0
  259. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/NFCISO15693ReaderSession.h +59 -0
  260. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/NFCISO15693Tag.h +739 -0
  261. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/NFCISO7816Tag.h +159 -0
  262. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/NFCMiFareTag.h +94 -0
  263. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/NFCNDEFMessage.h +60 -0
  264. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/NFCNDEFPayload.h +121 -0
  265. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/NFCNDEFReaderSession.h +169 -0
  266. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/NFCNDEFTag.h +93 -0
  267. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/NFCPaymentTagReaderSession.h +58 -0
  268. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/NFCReaderSession.h +156 -0
  269. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/NFCTag.h +127 -0
  270. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/NFCTagReaderSession.h +201 -0
  271. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/NFCVASReaderSession.h +237 -0
  272. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/NSUserActivity+CoreNFC.h +35 -0
  273. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Modules/module.modulemap +21 -0
  274. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTCall.h +53 -0
  275. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTCallCenter.h +45 -0
  276. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTCarrier.h +87 -0
  277. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTCellularData.h +39 -0
  278. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTCellularPlanProperties.h +46 -0
  279. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTCellularPlanProvisioning.h +33 -0
  280. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTCellularPlanProvisioningRequest.h +36 -0
  281. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTCellularPlanStatus.h +57 -0
  282. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTQuickSwitch.h +53 -0
  283. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTSubscriber.h +107 -0
  284. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTSubscriberInfo.h +34 -0
  285. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTTelephonyNetworkInfo.h +161 -0
  286. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CoreTelephonyDefines.h +39 -0
  287. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Modules/module.modulemap +5 -0
  288. package/sdk/ios/System/Library/Frameworks/CoreText.framework/Headers/CTDefines.h +92 -0
  289. package/sdk/ios/System/Library/Frameworks/CoreText.framework/Headers/CTFontDescriptor.h +634 -0
  290. package/sdk/ios/System/Library/Frameworks/CoreText.framework/Headers/CTFontTraits.h +118 -0
  291. package/sdk/ios/System/Library/Frameworks/CoreText.framework/Headers/CoreText.h +1 -0
  292. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes +2497 -0
  293. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +2900 -370
  294. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKAccessPoint.h +110 -0
  295. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKAchievement.h +64 -0
  296. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKAchievementDescription.h +88 -0
  297. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKAchievementViewController.h +30 -0
  298. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKBasePlayer.h +15 -0
  299. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKChallenge.h +199 -0
  300. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKChallengeDefinition.h +71 -0
  301. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKChallengeEventHandler.h +43 -0
  302. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKChallengesViewController.h +33 -0
  303. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKCloudPlayer.h +19 -0
  304. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKDefines.h +17 -0
  305. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKDialogController.h +35 -0
  306. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKError.h +52 -0
  307. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKEventListener.h +36 -0
  308. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKFriendRequestComposeViewController.h +60 -0
  309. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKGameActivity.h +201 -0
  310. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKGameActivityDefinition.h +98 -0
  311. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKGameActivityListener.h +28 -0
  312. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKGameActivityPlayStyle.h +17 -0
  313. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKGameActivityState.h +22 -0
  314. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKGameCenterViewController.h +102 -0
  315. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKGameSession.h +87 -0
  316. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKGameSessionError.h +26 -0
  317. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKGameSessionEventListener.h +25 -0
  318. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKGameSessionSharingViewController.h +33 -0
  319. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKLeaderboard.h +205 -0
  320. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKLeaderboardEntry.h +23 -0
  321. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKLeaderboardScore.h +25 -0
  322. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKLeaderboardSet.h +64 -0
  323. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKLeaderboardViewController.h +34 -0
  324. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKLocalPlayer.h +321 -0
  325. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKMatch.h +94 -0
  326. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKMatchmaker.h +229 -0
  327. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKMatchmakerViewController.h +100 -0
  328. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKNotificationBanner.h +20 -0
  329. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKPeerPickerController.h +93 -0
  330. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKPlayer.h +82 -0
  331. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKPublicConstants.h +57 -0
  332. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKPublicProtocols.h +71 -0
  333. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKReleaseState.h +16 -0
  334. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKSavedGame.h +41 -0
  335. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKSavedGameListener.h +22 -0
  336. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKScore.h +73 -0
  337. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKSession.h +87 -0
  338. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKSessionError.h +30 -0
  339. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKTurnBasedMatch.h +314 -0
  340. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKTurnBasedMatchmakerViewController.h +69 -0
  341. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKVoiceChat.h +48 -0
  342. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKVoiceChatService.h +145 -0
  343. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GameKit.apinotes +307 -0
  344. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GameKit.h +79 -0
  345. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Modules/module.modulemap +6 -0
  346. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKActivitySummary.h +122 -0
  347. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKActivitySummaryQuery.h +48 -0
  348. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKAnchoredObjectQuery.h +93 -0
  349. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKAppleSleepingBreathingDisturbancesClassification.h +39 -0
  350. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKAppleWalkingSteadinessClassification.h +49 -0
  351. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKAttachment.h +74 -0
  352. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKAttachmentStore.h +95 -0
  353. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKAudiogramSample.h +66 -0
  354. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKAudiogramSensitivityPoint.h +82 -0
  355. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKAudiogramSensitivityPointClampingRange.h +54 -0
  356. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKAudiogramSensitivityTest.h +101 -0
  357. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKCDADocumentSample.h +131 -0
  358. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKCategorySample.h +92 -0
  359. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKCategoryValues.h +279 -0
  360. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKCharacteristicObjects.h +79 -0
  361. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKCharacteristicValues.h +87 -0
  362. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKClinicalCoding.h +55 -0
  363. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKClinicalRecord.h +53 -0
  364. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKClinicalType.h +68 -0
  365. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKContactsLensSpecification.h +59 -0
  366. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKContactsPrescription.h +74 -0
  367. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKCorrelation.h +85 -0
  368. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKCorrelationQuery.h +57 -0
  369. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKCumulativeQuantitySample.h +36 -0
  370. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKCumulativeQuantitySeriesSample.h +23 -0
  371. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKDefines.h +114 -0
  372. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKDeletedObject.h +40 -0
  373. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKDevice.h +164 -0
  374. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKDiscreteQuantitySample.h +67 -0
  375. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKDocumentQuery.h +83 -0
  376. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKDocumentSample.h +29 -0
  377. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKElectrocardiogram.h +109 -0
  378. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKElectrocardiogramQuery.h +68 -0
  379. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKFHIRRelease.h +35 -0
  380. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKFHIRResource.h +81 -0
  381. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKFHIRVersion.h +50 -0
  382. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKGAD7Assessment.h +73 -0
  383. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKGlassesLensSpecification.h +81 -0
  384. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKGlassesPrescription.h +66 -0
  385. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKHealthConceptIdentifier.h +46 -0
  386. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKHealthStore.h +470 -0
  387. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKHeartbeatSeriesBuilder.h +104 -0
  388. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKHeartbeatSeriesQuery.h +47 -0
  389. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKHeartbeatSeriesSample.h +26 -0
  390. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKLensSpecification.h +53 -0
  391. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKLiveWorkoutBuilder.h +131 -0
  392. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKLiveWorkoutDataSource.h +67 -0
  393. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKLiveWorkoutZoneUpdate.h +25 -0
  394. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKMedicationConcept.h +95 -0
  395. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKMedicationDoseEvent.h +113 -0
  396. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKMetadata.h +583 -0
  397. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKMetadataEnums.h +250 -0
  398. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKObject.h +64 -0
  399. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKObjectType.h +294 -0
  400. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKObserverQuery.h +48 -0
  401. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKPHQ9Assessment.h +77 -0
  402. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKQuantity.h +55 -0
  403. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKQuantityAggregationStyle.h +30 -0
  404. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKQuantitySample.h +83 -0
  405. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKQuantitySeriesSampleBuilder.h +184 -0
  406. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKQuantitySeriesSampleQuery.h +90 -0
  407. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKQuery.h +722 -0
  408. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKQueryAnchor.h +33 -0
  409. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKQueryDescriptor.h +46 -0
  410. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKSample.h +48 -0
  411. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKSampleQuery.h +95 -0
  412. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKScoredAssessment.h +31 -0
  413. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKSeriesBuilder.h +40 -0
  414. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKSeriesSample.h +32 -0
  415. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKSource.h +45 -0
  416. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKSourceQuery.h +42 -0
  417. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKSourceRevision.h +78 -0
  418. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKStateOfMind.h +157 -0
  419. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKStatistics.h +166 -0
  420. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKStatisticsCollectionQuery.h +80 -0
  421. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKStatisticsQuery.h +37 -0
  422. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKTypeIdentifiers.h +359 -0
  423. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKUnit.h +287 -0
  424. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKUserAnnotatedMedication.h +60 -0
  425. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKUserAnnotatedMedicationQuery.h +38 -0
  426. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKVerifiableClinicalRecord.h +131 -0
  427. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKVerifiableClinicalRecordQuery.h +76 -0
  428. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKVerifiableClinicalRecordSubject.h +39 -0
  429. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKVisionPrescription.h +76 -0
  430. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKVisionPrism.h +123 -0
  431. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKWorkout.h +341 -0
  432. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKWorkoutActivity.h +127 -0
  433. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKWorkoutActivityType.h +147 -0
  434. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKWorkoutBuilder.h +264 -0
  435. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKWorkoutConfiguration.h +62 -0
  436. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKWorkoutEffortRelationshipQuery.h +80 -0
  437. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKWorkoutRoute.h +20 -0
  438. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKWorkoutRouteBuilder.h +102 -0
  439. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKWorkoutRouteQuery.h +67 -0
  440. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKWorkoutSession.h +364 -0
  441. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HealthKit.apinotes +5 -0
  442. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HealthKit.h +101 -0
  443. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Modules/module.modulemap +5 -0
  444. package/sdk/ios/System/Library/Frameworks/MediaAccessibility.framework/Headers/MAAudibleMedia.h +41 -0
  445. package/sdk/ios/System/Library/Frameworks/MediaAccessibility.framework/Headers/MACaptionAppearance.h +406 -0
  446. package/sdk/ios/System/Library/Frameworks/MediaAccessibility.framework/Headers/MADefinitions.h +38 -0
  447. package/sdk/ios/System/Library/Frameworks/MediaAccessibility.framework/Headers/MAFlashingLightsProcessing.h +53 -0
  448. package/sdk/ios/System/Library/Frameworks/MediaAccessibility.framework/Headers/MAImageCaptioning.h +55 -0
  449. package/sdk/ios/System/Library/Frameworks/MediaAccessibility.framework/Headers/MAMusicHaptics.h +69 -0
  450. package/sdk/ios/System/Library/Frameworks/MediaAccessibility.framework/Headers/MAVideoAccommodations.h +34 -0
  451. package/sdk/ios/System/Library/Frameworks/MediaAccessibility.framework/Headers/MediaAccessibility.h +14 -0
  452. package/sdk/ios/System/Library/Frameworks/MediaAccessibility.framework/Modules/module.modulemap +11 -0
  453. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEAppProxyFlow.h +142 -0
  454. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEAppProxyProvider.h +93 -0
  455. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEAppProxyProviderManager.h +40 -0
  456. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEAppProxyTCPFlow.h +63 -0
  457. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEAppProxyUDPFlow.h +86 -0
  458. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEAppPushManager.h +208 -0
  459. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEAppPushProvider.h +87 -0
  460. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEAppRule.h +80 -0
  461. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEDNSProxyManager.h +109 -0
  462. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEDNSProxyProvider.h +98 -0
  463. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEDNSProxyProviderProtocol.h +45 -0
  464. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEDNSSettings.h +124 -0
  465. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEDNSSettingsManager.h +116 -0
  466. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEEthernetTunnelNetworkSettings.h +45 -0
  467. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEEthernetTunnelProvider.h +31 -0
  468. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFilterControlProvider.h +80 -0
  469. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFilterDataProvider.h +235 -0
  470. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFilterFlow.h +177 -0
  471. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFilterManager.h +138 -0
  472. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFilterPacketProvider.h +99 -0
  473. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFilterProvider.h +335 -0
  474. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFilterProviderConfiguration.h +94 -0
  475. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFilterRule.h +46 -0
  476. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFilterSettings.h +56 -0
  477. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFlowMetaData.h +45 -0
  478. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEHotspotConfigurationManager.h +493 -0
  479. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEHotspotHelper.h +529 -0
  480. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEHotspotNetwork.h +87 -0
  481. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEIPv4Settings.h +122 -0
  482. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEIPv6Settings.h +121 -0
  483. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NENetworkRule.h +218 -0
  484. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEOnDemandRule.h +210 -0
  485. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEPacket.h +67 -0
  486. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEPacketTunnelFlow.h +62 -0
  487. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEPacketTunnelNetworkSettings.h +135 -0
  488. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEPacketTunnelProvider.h +97 -0
  489. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEProvider.h +160 -0
  490. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEProxySettings.h +140 -0
  491. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NERelay.h +83 -0
  492. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NERelayManager.h +195 -0
  493. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NETransparentProxyManager.h +39 -0
  494. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NETransparentProxyNetworkSettings.h +62 -0
  495. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NETransparentProxyProvider.h +33 -0
  496. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NETunnelNetworkSettings.h +57 -0
  497. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NETunnelProvider.h +113 -0
  498. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NETunnelProviderManager.h +108 -0
  499. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NETunnelProviderProtocol.h +44 -0
  500. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NETunnelProviderSession.h +55 -0
  501. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEURLFilter.h +51 -0
  502. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEVPNConnection.h +162 -0
  503. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEVPNManager.h +153 -0
  504. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEVPNProtocol.h +135 -0
  505. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEVPNProtocolIKEv2.h +357 -0
  506. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEVPNProtocolIPSec.h +71 -0
  507. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NWBonjourServiceEndpoint.h +82 -0
  508. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NWEndpoint.h +40 -0
  509. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NWHostEndpoint.h +68 -0
  510. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NWPath.h +93 -0
  511. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NWTCPConnection.h +335 -0
  512. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NWTLSParameters.h +70 -0
  513. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NWUDPSession.h +207 -0
  514. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NetworkExtension.apinotes +351 -0
  515. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NetworkExtension.h +74 -0
  516. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Modules/module.modulemap +5 -0
  517. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h +1 -0
  518. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/ModelIO.h +84 -0
  519. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNAction.h +197 -0
  520. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNAnimation.h +428 -0
  521. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNAudioSource.h +170 -0
  522. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNBoundingVolume.h +50 -0
  523. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNCAAnimationExtensions.h +58 -0
  524. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNCamera.h +356 -0
  525. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNCameraController.h +124 -0
  526. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNConstraint.h +431 -0
  527. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNGeometry.h +591 -0
  528. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNHitTest.h +101 -0
  529. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNJavascript.h +58 -0
  530. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNLevelOfDetail.h +56 -0
  531. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNLight.h +350 -0
  532. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNMaterial.h +349 -0
  533. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNMaterialProperty.h +149 -0
  534. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNMorpher.h +79 -0
  535. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNNode.h +695 -0
  536. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNParametricGeometry.h +727 -0
  537. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNParticleSystem.h +462 -0
  538. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNPhysicsBehavior.h +219 -0
  539. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNPhysicsBody.h +148 -0
  540. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNPhysicsContact.h +34 -0
  541. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNPhysicsField.h +124 -0
  542. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNPhysicsShape.h +58 -0
  543. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNPhysicsWorld.h +90 -0
  544. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNReferenceNode.h +80 -0
  545. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNRenderer.h +102 -0
  546. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNScene.h +250 -0
  547. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNSceneRenderer.h +389 -0
  548. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNSceneSource.h +348 -0
  549. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNShadable.h +573 -0
  550. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNSkinner.h +84 -0
  551. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNTechnique.h +320 -0
  552. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNTransaction.h +64 -0
  553. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNView.h +170 -0
  554. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SceneKit.apinotes +423 -0
  555. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SceneKit.h +58 -0
  556. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SceneKitAvailability.h +10 -0
  557. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SceneKitDeprecated.h +88 -0
  558. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SceneKitTypes.h +264 -0
  559. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/scn_metal +75 -0
  560. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Modules/module.modulemap +12 -0
  561. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/CipherSuite.h +281 -0
  562. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecAccessControl.h +133 -0
  563. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecBase.h +906 -3
  564. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecCertificate.h +613 -0
  565. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecIdentity.h +232 -0
  566. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecItem.h +1284 -29
  567. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecKey.h +1616 -0
  568. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecPolicy.h +441 -0
  569. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecProtocolMetadata.h +429 -0
  570. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecProtocolObject.h +71 -0
  571. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecProtocolOptions.h +775 -0
  572. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecProtocolTypes.h +327 -0
  573. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecRandom.h +84 -0
  574. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecTrust.h +845 -0
  575. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/Security.h +13 -0
  576. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h +19 -0
  577. package/sdk/ios/usr/include/AvailabilityInternal.h +23 -0
  578. package/sdk/ios/usr/include/AvailabilityMacros.h +3985 -0
  579. package/sdk/ios/usr/include/Block.h +56 -0
  580. package/sdk/ios/usr/include/CommonCrypto/CommonCrypto.h +34 -0
  581. package/sdk/ios/usr/include/CommonCrypto/CommonCryptoError.h +78 -0
  582. package/sdk/ios/usr/include/CommonCrypto/CommonCryptor.h +763 -0
  583. package/sdk/ios/usr/include/CommonCrypto/CommonDigest.h +254 -47
  584. package/sdk/ios/usr/include/CommonCrypto/CommonHMAC.h +162 -0
  585. package/sdk/ios/usr/include/CommonCrypto/CommonKeyDerivation.h +136 -0
  586. package/sdk/ios/usr/include/CommonCrypto/CommonRandom.h +63 -0
  587. package/sdk/ios/usr/include/CommonCrypto/CommonSymmetricKeywrap.h +162 -0
  588. package/sdk/ios/usr/include/CommonCrypto/module.modulemap +15 -0
  589. package/sdk/ios/usr/include/ObjectiveC.apinotes +437 -0
  590. package/sdk/ios/usr/include/TargetConditionals.h +525 -14
  591. package/sdk/ios/usr/include/___wctype.h +193 -0
  592. package/sdk/ios/usr/include/__wctype.h +43 -0
  593. package/sdk/ios/usr/include/_abort.h +36 -0
  594. package/sdk/ios/usr/include/_assert.h +80 -0
  595. package/sdk/ios/usr/include/_static_assert.h +33 -0
  596. package/sdk/ios/usr/include/_stdlib.h +403 -0
  597. package/sdk/ios/usr/include/_string.h +231 -0
  598. package/sdk/ios/usr/include/_strings.h +101 -0
  599. package/sdk/ios/usr/include/_types/_wctrans_t.h +33 -0
  600. package/sdk/ios/usr/include/_types/_wctype_t.h +33 -0
  601. package/sdk/ios/usr/include/_wchar.h +263 -0
  602. package/sdk/ios/usr/include/_wctype.h +129 -0
  603. package/sdk/ios/usr/include/_xlocale.h +47 -0
  604. package/sdk/ios/usr/include/alloca.h +46 -0
  605. package/sdk/ios/usr/include/architecture/byte_order.h +381 -0
  606. package/sdk/ios/usr/include/arm/_limits.h +13 -0
  607. package/sdk/ios/usr/include/arm/arch.h +71 -0
  608. package/sdk/ios/usr/include/arm/limits.h +136 -0
  609. package/sdk/ios/usr/include/arpa/inet.h +100 -0
  610. package/sdk/ios/usr/include/assert.h +77 -10
  611. package/sdk/ios/usr/include/bsm/audit.h +434 -0
  612. package/sdk/ios/usr/include/copyfile.h +143 -0
  613. package/sdk/ios/usr/include/crt_externs.h +50 -0
  614. package/sdk/ios/usr/include/dispatch/base.h +369 -0
  615. package/sdk/ios/usr/include/dispatch/block.h +509 -0
  616. package/sdk/ios/usr/include/dispatch/data.h +290 -0
  617. package/sdk/ios/usr/include/dispatch/dispatch.h +68 -172
  618. package/sdk/ios/usr/include/dispatch/dispatch_swift_shims.h +61 -0
  619. package/sdk/ios/usr/include/dispatch/group.h +289 -0
  620. package/sdk/ios/usr/include/dispatch/introspection.h +190 -0
  621. package/sdk/ios/usr/include/dispatch/io.h +617 -0
  622. package/sdk/ios/usr/include/dispatch/object.h +680 -0
  623. package/sdk/ios/usr/include/dispatch/once.h +128 -0
  624. package/sdk/ios/usr/include/dispatch/queue.h +1824 -0
  625. package/sdk/ios/usr/include/dispatch/semaphore.h +124 -0
  626. package/sdk/ios/usr/include/dispatch/source.h +803 -0
  627. package/sdk/ios/usr/include/dispatch/time.h +144 -0
  628. package/sdk/ios/usr/include/dispatch/workloop.h +178 -0
  629. package/sdk/ios/usr/include/dlfcn.h +320 -7
  630. package/sdk/ios/usr/include/execinfo.h +100 -10
  631. package/sdk/ios/usr/include/ftw.h +63 -0
  632. package/sdk/ios/usr/include/gethostuuid.h +45 -0
  633. package/sdk/ios/usr/include/libkern/arm/OSByteOrder.h +195 -0
  634. package/sdk/ios/usr/include/limits.h +167 -4
  635. package/sdk/ios/usr/include/mach/arm/boolean.h +74 -0
  636. package/sdk/ios/usr/include/mach/arm/exception.h +86 -0
  637. package/sdk/ios/usr/include/mach/arm/kern_return.h +78 -0
  638. package/sdk/ios/usr/include/mach/arm/processor_info.h +76 -0
  639. package/sdk/ios/usr/include/mach/arm/rpc.h +39 -0
  640. package/sdk/ios/usr/include/mach/arm/thread_state.h +42 -0
  641. package/sdk/ios/usr/include/mach/arm/thread_status.h +302 -0
  642. package/sdk/ios/usr/include/mach/arm/vm_param.h +118 -0
  643. package/sdk/ios/usr/include/mach/arm/vm_types.h +162 -0
  644. package/sdk/ios/usr/include/mach/boolean.h +88 -4
  645. package/sdk/ios/usr/include/mach/clock.h +249 -0
  646. package/sdk/ios/usr/include/mach/clock_priv.h +203 -0
  647. package/sdk/ios/usr/include/mach/clock_types.h +127 -0
  648. package/sdk/ios/usr/include/mach/dyld_kernel.h +66 -0
  649. package/sdk/ios/usr/include/mach/error.h +117 -0
  650. package/sdk/ios/usr/include/mach/exc.h +285 -0
  651. package/sdk/ios/usr/include/mach/exception_types.h +204 -25
  652. package/sdk/ios/usr/include/mach/host_info.h +136 -51
  653. package/sdk/ios/usr/include/mach/host_notify.h +39 -0
  654. package/sdk/ios/usr/include/mach/host_priv.h +1167 -0
  655. package/sdk/ios/usr/include/mach/host_security.h +225 -0
  656. package/sdk/ios/usr/include/mach/host_special_ports.h +315 -0
  657. package/sdk/ios/usr/include/mach/kern_return.h +291 -2
  658. package/sdk/ios/usr/include/mach/kmod.h +180 -0
  659. package/sdk/ios/usr/include/mach/mach.h +237 -12
  660. package/sdk/ios/usr/include/mach/mach_error.h +93 -10
  661. package/sdk/ios/usr/include/mach/mach_host.h +1329 -5
  662. package/sdk/ios/usr/include/mach/mach_init.h +112 -13
  663. package/sdk/ios/usr/include/mach/mach_interface.h +52 -0
  664. package/sdk/ios/usr/include/mach/mach_port.h +1935 -4
  665. package/sdk/ios/usr/include/mach/mach_time.h +77 -14
  666. package/sdk/ios/usr/include/mach/mach_traps.h +311 -0
  667. package/sdk/ios/usr/include/mach/mach_types.h +297 -20
  668. package/sdk/ios/usr/include/mach/mach_voucher_types.h +259 -0
  669. package/sdk/ios/usr/include/mach/machine/boolean.h +40 -0
  670. package/sdk/ios/usr/include/mach/machine/exception.h +40 -0
  671. package/sdk/ios/usr/include/mach/machine/kern_return.h +40 -0
  672. package/sdk/ios/usr/include/mach/machine/processor_info.h +40 -0
  673. package/sdk/ios/usr/include/mach/machine/rpc.h +40 -0
  674. package/sdk/ios/usr/include/mach/machine/thread_state.h +44 -0
  675. package/sdk/ios/usr/include/mach/machine/thread_status.h +40 -0
  676. package/sdk/ios/usr/include/mach/machine/vm_param.h +40 -0
  677. package/sdk/ios/usr/include/mach/machine/vm_types.h +40 -0
  678. package/sdk/ios/usr/include/mach/machine.h +456 -142
  679. package/sdk/ios/usr/include/mach/memory_object_types.h +312 -0
  680. package/sdk/ios/usr/include/mach/message.h +972 -0
  681. package/sdk/ios/usr/include/mach/mig.h +180 -0
  682. package/sdk/ios/usr/include/mach/mig_errors.h +125 -0
  683. package/sdk/ios/usr/include/mach/mig_strncpy_zerofill_support.h +35 -0
  684. package/sdk/ios/usr/include/mach/ndr.h +207 -0
  685. package/sdk/ios/usr/include/mach/notify.h +141 -0
  686. package/sdk/ios/usr/include/mach/policy.h +235 -0
  687. package/sdk/ios/usr/include/mach/port.h +648 -0
  688. package/sdk/ios/usr/include/mach/processor.h +364 -0
  689. package/sdk/ios/usr/include/mach/processor_info.h +171 -0
  690. package/sdk/ios/usr/include/mach/processor_set.h +589 -0
  691. package/sdk/ios/usr/include/mach/rpc.h +135 -0
  692. package/sdk/ios/usr/include/mach/semaphore.h +78 -0
  693. package/sdk/ios/usr/include/mach/std_types.h +75 -0
  694. package/sdk/ios/usr/include/mach/sync_policy.h +47 -0
  695. package/sdk/ios/usr/include/mach/task.h +2887 -7
  696. package/sdk/ios/usr/include/mach/task_info.h +584 -19
  697. package/sdk/ios/usr/include/mach/task_inspect.h +57 -0
  698. package/sdk/ios/usr/include/mach/task_policy.h +182 -26
  699. package/sdk/ios/usr/include/mach/task_special_ports.h +135 -0
  700. package/sdk/ios/usr/include/mach/thread_act.h +1550 -5
  701. package/sdk/ios/usr/include/mach/thread_info.h +206 -28
  702. package/sdk/ios/usr/include/mach/thread_policy.h +268 -0
  703. package/sdk/ios/usr/include/mach/thread_special_ports.h +87 -0
  704. package/sdk/ios/usr/include/mach/thread_status.h +100 -0
  705. package/sdk/ios/usr/include/mach/thread_switch.h +77 -0
  706. package/sdk/ios/usr/include/mach/time_value.h +96 -4
  707. package/sdk/ios/usr/include/mach/vm_attributes.h +99 -0
  708. package/sdk/ios/usr/include/mach/vm_behavior.h +86 -0
  709. package/sdk/ios/usr/include/mach/vm_inherit.h +93 -0
  710. package/sdk/ios/usr/include/mach/vm_map.h +1558 -0
  711. package/sdk/ios/usr/include/mach/vm_page_size.h +68 -0
  712. package/sdk/ios/usr/include/mach/vm_prot.h +183 -7
  713. package/sdk/ios/usr/include/mach/vm_purgable.h +166 -0
  714. package/sdk/ios/usr/include/mach/vm_region.h +400 -36
  715. package/sdk/ios/usr/include/mach/vm_statistics.h +387 -96
  716. package/sdk/ios/usr/include/mach/vm_sync.h +84 -0
  717. package/sdk/ios/usr/include/mach/vm_types.h +194 -7
  718. package/sdk/ios/usr/include/mach-o/arch.h +154 -16
  719. package/sdk/ios/usr/include/mach-o/fat.h +89 -0
  720. package/sdk/ios/usr/include/mach-o/getsect.h +146 -12
  721. package/sdk/ios/usr/include/mach-o/loader.h +1679 -139
  722. package/sdk/ios/usr/include/mach_debug/hash_info.h +75 -0
  723. package/sdk/ios/usr/include/mach_debug/ipc_info.h +199 -0
  724. package/sdk/ios/usr/include/mach_debug/lockgroup_info.h +74 -0
  725. package/sdk/ios/usr/include/mach_debug/mach_debug_types.h +200 -0
  726. package/sdk/ios/usr/include/mach_debug/page_info.h +64 -0
  727. package/sdk/ios/usr/include/mach_debug/vm_info.h +149 -0
  728. package/sdk/ios/usr/include/mach_debug/zone_info.h +209 -0
  729. package/sdk/ios/usr/include/machine/limits.h +14 -0
  730. package/sdk/ios/usr/include/malloc/_malloc.h +143 -0
  731. package/sdk/ios/usr/include/malloc/_malloc_type.h +153 -0
  732. package/sdk/ios/usr/include/malloc/_platform.h +80 -0
  733. package/sdk/ios/usr/include/malloc/_ptrcheck.h +43 -0
  734. package/sdk/ios/usr/include/malloc/malloc.h +768 -0
  735. package/sdk/ios/usr/include/module.modulemap +4 -0
  736. package/sdk/ios/usr/include/net/if_types.h +152 -0
  737. package/sdk/ios/usr/include/objc/NSObjCRuntime.h +10 -0
  738. package/sdk/ios/usr/include/objc/NSObject.h +23 -25
  739. package/sdk/ios/usr/include/objc/objc-api.h +310 -0
  740. package/sdk/ios/usr/include/objc/objc.h +243 -0
  741. package/sdk/ios/usr/include/objc/runtime.h +1933 -0
  742. package/sdk/ios/usr/include/os/availability.h +168 -6
  743. package/sdk/ios/usr/include/os/base.h +351 -0
  744. package/sdk/ios/usr/include/os/clock.h +18 -0
  745. package/sdk/ios/usr/include/os/lock.h +232 -10
  746. package/sdk/ios/usr/include/os/log.h +521 -38
  747. package/sdk/ios/usr/include/os/object.h +320 -3
  748. package/sdk/ios/usr/include/os/trace.h +492 -0
  749. package/sdk/ios/usr/include/os/trace_base.h +167 -0
  750. package/sdk/ios/usr/include/os/workgroup.h +37 -0
  751. package/sdk/ios/usr/include/os/workgroup_base.h +91 -0
  752. package/sdk/ios/usr/include/os/workgroup_interval.h +156 -0
  753. package/sdk/ios/usr/include/os/workgroup_object.h +359 -0
  754. package/sdk/ios/usr/include/os/workgroup_parallel.h +76 -0
  755. package/sdk/ios/usr/include/os.modulemap +6 -0
  756. package/sdk/ios/usr/include/pthread/pthread_impl.h +66 -0
  757. package/sdk/ios/usr/include/pthread/sched.h +46 -0
  758. package/sdk/ios/usr/include/pthread.h +754 -4
  759. package/sdk/ios/usr/include/pwd.h +119 -0
  760. package/sdk/ios/usr/include/sched.h +46 -0
  761. package/sdk/ios/usr/include/secure/_string.h +295 -0
  762. package/sdk/ios/usr/include/secure/_strings.h +96 -0
  763. package/sdk/ios/usr/include/spawn.h +193 -0
  764. package/sdk/ios/usr/include/stddef.h +90 -0
  765. package/sdk/ios/usr/include/stdlib.h +62 -17
  766. package/sdk/ios/usr/include/string.h +62 -8
  767. package/sdk/ios/usr/include/sys/_pthread/_pthread_cond_t.h +32 -0
  768. package/sdk/ios/usr/include/sys/_pthread/_pthread_condattr_t.h +32 -0
  769. package/sdk/ios/usr/include/sys/_pthread/_pthread_key_t.h +32 -0
  770. package/sdk/ios/usr/include/sys/_pthread/_pthread_mutex_t.h +32 -0
  771. package/sdk/ios/usr/include/sys/_pthread/_pthread_mutexattr_t.h +32 -0
  772. package/sdk/ios/usr/include/sys/_pthread/_pthread_once_t.h +32 -0
  773. package/sdk/ios/usr/include/sys/_pthread/_pthread_rwlock_t.h +32 -0
  774. package/sdk/ios/usr/include/sys/_pthread/_pthread_rwlockattr_t.h +32 -0
  775. package/sdk/ios/usr/include/sys/_select.h +57 -0
  776. package/sdk/ios/usr/include/sys/_types/_blkcnt_t.h +32 -0
  777. package/sdk/ios/usr/include/sys/_types/_blksize_t.h +32 -0
  778. package/sdk/ios/usr/include/sys/_types/_caddr_t.h +32 -0
  779. package/sdk/ios/usr/include/sys/_types/_dev_t.h +32 -0
  780. package/sdk/ios/usr/include/sys/_types/_fsblkcnt_t.h +32 -0
  781. package/sdk/ios/usr/include/sys/_types/_fsfilcnt_t.h +32 -0
  782. package/sdk/ios/usr/include/sys/_types/_fsid_t.h +32 -0
  783. package/sdk/ios/usr/include/sys/_types/_fsobj_id_t.h +38 -0
  784. package/sdk/ios/usr/include/sys/_types/_graftdmg_un.h +64 -0
  785. package/sdk/ios/usr/include/sys/_types/_guid_t.h +37 -0
  786. package/sdk/ios/usr/include/sys/_types/_id_t.h +32 -0
  787. package/sdk/ios/usr/include/sys/_types/_ino64_t.h +32 -0
  788. package/sdk/ios/usr/include/sys/_types/_key_t.h +32 -0
  789. package/sdk/ios/usr/include/sys/_types/_mach_port_t.h +51 -0
  790. package/sdk/ios/usr/include/sys/_types/_mbstate_t.h +33 -0
  791. package/sdk/ios/usr/include/sys/_types/_mount_t.h +34 -0
  792. package/sdk/ios/usr/include/sys/_types/_nlink_t.h +32 -0
  793. package/sdk/ios/usr/include/sys/_types/_os_inline.h +34 -0
  794. package/sdk/ios/usr/include/sys/_types/_posix_vdisable.h +30 -0
  795. package/sdk/ios/usr/include/sys/_types/_rsize_t.h +55 -0
  796. package/sdk/ios/usr/include/sys/_types/_suseconds_t.h +32 -0
  797. package/sdk/ios/usr/include/sys/_types/_timeval.h +39 -0
  798. package/sdk/ios/usr/include/sys/_types/_u_char.h +31 -0
  799. package/sdk/ios/usr/include/sys/_types/_u_int.h +31 -0
  800. package/sdk/ios/usr/include/sys/_types/_u_short.h +31 -0
  801. package/sdk/ios/usr/include/sys/_types/_useconds_t.h +32 -0
  802. package/sdk/ios/usr/include/sys/_types/_uuid_t.h +32 -0
  803. package/sdk/ios/usr/include/sys/_types/_vnode_t.h +34 -0
  804. package/sdk/ios/usr/include/sys/acl.h +215 -0
  805. package/sdk/ios/usr/include/sys/attr.h +635 -0
  806. package/sdk/ios/usr/include/sys/cdefs.h +53 -0
  807. package/sdk/ios/usr/include/sys/event.h +388 -0
  808. package/sdk/ios/usr/include/sys/kauth.h +409 -0
  809. package/sdk/ios/usr/include/sys/mount.h +470 -0
  810. package/sdk/ios/usr/include/sys/queue.h +909 -0
  811. package/sdk/ios/usr/include/sys/resource.h +600 -0
  812. package/sdk/ios/usr/include/sys/select.h +134 -0
  813. package/sdk/ios/usr/include/sys/spawn.h +84 -0
  814. package/sdk/ios/usr/include/sys/sysctl.h +803 -57
  815. package/sdk/ios/usr/include/sys/syslimits.h +131 -11
  816. package/sdk/ios/usr/include/sys/types.h +236 -19
  817. package/sdk/ios/usr/include/sys/ucred.h +116 -0
  818. package/sdk/ios/usr/include/sys/un.h +105 -0
  819. package/sdk/ios/usr/include/sys/unistd.h +225 -0
  820. package/sdk/ios/usr/include/sys/vm.h +89 -0
  821. package/sdk/ios/usr/include/sys/wait.h +256 -0
  822. package/sdk/ios/usr/include/sysdir.h +79 -0
  823. package/sdk/ios/usr/include/unistd.h +799 -3
  824. package/sdk/ios/usr/include/uuid/uuid.h +69 -10
  825. package/sdk/ios/usr/include/wchar.h +71 -0
  826. package/sdk/ios/usr/include/wctype.h +35 -0
  827. package/sdk/ios/usr/include/xlocale/___wctype.h +146 -0
  828. package/sdk/ios/usr/include/xlocale/_ctype.h +240 -0
  829. package/sdk/ios/usr/include/xlocale/_stdlib.h +77 -0
  830. package/sdk/ios/usr/include/xlocale/_string.h +43 -0
  831. package/sdk/ios/usr/include/xlocale/_wchar.h +160 -0
  832. package/sdk/ios/usr/include/xlocale/_wctype.h +100 -0
  833. package/sdk/ios/usr/include/xlocale.h +61 -0
  834. package/sdk/ios/usr/include/xpc/availability.h +141 -0
  835. package/sdk/ios/usr/include/xpc/base.h +243 -0
  836. package/sdk/ios/wasm/include/AvailabilityInternal.h +24 -0
  837. package/sdk/ios/wasm/include/TargetConditionals.h +529 -0
  838. package/sdk/ios/wasm/include/_locale.h +3 -0
  839. package/sdk/ios/wasm/include/_locale_posix2008.h +3 -0
  840. package/sdk/ios/wasm/include/_types/_locale_t.h +3 -0
  841. package/sdk/ios/wasm/include/arpa/inet.h +15 -0
  842. package/sdk/ios/wasm/include/dirent.h +52 -0
  843. package/sdk/ios/wasm/include/dlfcn.h +13 -1
  844. package/sdk/ios/wasm/include/errno.h +22 -0
  845. package/sdk/ios/wasm/include/fcntl.h +29 -0
  846. package/sdk/ios/wasm/include/ftw.h +15 -0
  847. package/sdk/ios/wasm/include/libkern/_OSByteOrder.h +6 -0
  848. package/sdk/ios/wasm/include/limits.h +9 -0
  849. package/sdk/ios/wasm/include/mach/machine/boolean.h +1 -1
  850. package/sdk/ios/wasm/include/mach/machine/exception.h +1 -4
  851. package/sdk/ios/wasm/include/mach/machine/kern_return.h +1 -1
  852. package/sdk/ios/wasm/include/mach/machine/processor_info.h +1 -1
  853. package/sdk/ios/wasm/include/mach/machine/rpc.h +1 -1
  854. package/sdk/ios/wasm/include/mach/machine/thread_state.h +1 -2
  855. package/sdk/ios/wasm/include/mach/machine/thread_status.h +1 -2
  856. package/sdk/ios/wasm/include/mach/machine/vm_param.h +1 -2
  857. package/sdk/ios/wasm/include/mach/machine/vm_types.h +1 -17
  858. package/sdk/ios/wasm/include/machine/_endian.h +2 -0
  859. package/sdk/ios/wasm/include/machine/_param.h +2 -0
  860. package/sdk/ios/wasm/include/machine/endian.h +1 -1
  861. package/sdk/ios/wasm/include/machine/limits.h +106 -2
  862. package/sdk/ios/wasm/include/machine/param.h +152 -0
  863. package/sdk/ios/wasm/include/netinet/in.h +11 -0
  864. package/sdk/ios/wasm/include/os/object.h +10 -0
  865. package/sdk/ios/wasm/include/pthread.h +14 -0
  866. package/sdk/ios/wasm/include/stdio.h +12 -0
  867. package/sdk/ios/wasm/include/stdlib.h +13 -0
  868. package/sdk/ios/wasm/include/strings.h +9 -0
  869. package/sdk/ios/wasm/include/sys/_types/_iovec_t.h +6 -0
  870. package/sdk/ios/wasm/include/sys/_types/_mode_t.h +10 -0
  871. package/sdk/ios/wasm/include/sys/mman.h +2 -2
  872. package/sdk/ios/wasm/include/sys/param.h +4 -0
  873. package/sdk/ios/wasm/include/sys/resource.h +43 -0
  874. package/sdk/ios/wasm/include/sys/socket.h +75 -9
  875. package/sdk/ios/wasm/include/sys/stat.h +63 -0
  876. package/sdk/ios/wasm/include/sys/types.h +13 -0
  877. package/sdk/ios/wasm/include/sys/un.h +7 -0
  878. package/sdk/ios/wasm/include/time.h +3 -1
  879. package/sdk/ios/wasm/include/unistd.h +19 -3
  880. package/sdk/ios/wasm/include/xlocale/_stdlib.h +37 -0
  881. package/sdk/ios/wasm/storage-include/TargetConditionals.h +529 -0
  882. package/sdk/ios/wasm/storage-include/mach/machine/boolean.h +2 -0
  883. package/sdk/ios/wasm/storage-include/mach/machine/exception.h +5 -0
  884. package/sdk/ios/wasm/storage-include/mach/machine/kern_return.h +2 -0
  885. package/sdk/ios/wasm/storage-include/mach/machine/processor_info.h +2 -0
  886. package/sdk/ios/wasm/storage-include/mach/machine/rpc.h +2 -0
  887. package/sdk/ios/wasm/storage-include/mach/machine/thread_state.h +3 -0
  888. package/sdk/ios/wasm/storage-include/mach/machine/thread_status.h +3 -0
  889. package/sdk/ios/wasm/storage-include/mach/machine/vm_param.h +3 -0
  890. package/sdk/ios/wasm/storage-include/mach/machine/vm_types.h +18 -0
  891. package/sdk/ios/wasm/storage-include/machine/_endian.h +9 -0
  892. package/sdk/ios/wasm/storage-include/machine/_param.h +8 -0
  893. package/sdk/ios/wasm/storage-include/machine/_types.h +31 -0
  894. package/sdk/ios/wasm/storage-include/machine/endian.h +2 -0
  895. package/sdk/ios/wasm/storage-include/machine/limits.h +2 -0
  896. package/sdk/ios/wasm/storage-include/machine/types.h +15 -0
  897. package/sdk/native-hashes.json +80 -0
  898. package/skills/contrast/SKILL.md +4 -1
  899. package/src/android-root-module.ts +145 -0
  900. package/src/androidRootModuleContract.ts +39 -0
  901. package/src/assetCatalogContract.ts +10 -1
  902. package/src/backend-origin.ts +11 -8
  903. package/src/bridge-constants.ts +7 -0
  904. package/src/bridge-contract.ts +3 -1
  905. package/src/capture-contract.ts +3 -1
  906. package/src/cli-runtime.ts +6 -1
  907. package/src/codex-client.ts +11 -6
  908. package/src/dev-bundle-resolution.ts +124 -48
  909. package/src/device-catalog.ts +10 -4
  910. package/src/expo-discovery-cache.ts +272 -0
  911. package/src/expo-native-workspace.ts +207 -0
  912. package/src/expo-swift-host.ts +824 -33
  913. package/src/expo-swift-ready.ts +56 -38
  914. package/src/expoSwiftContract.ts +4 -1
  915. package/src/generated/swift-c-predefines.json +69 -13
  916. package/src/host/bridge-host.ts +33 -0
  917. package/src/host/fetch-proxy-handler.ts +19 -1
  918. package/src/host/network-policy-proxy.ts +421 -0
  919. package/src/host/network-policy.ts +121 -0
  920. package/src/host/staged-host-files.ts +80 -3
  921. package/src/host/websocket-frame-guard.ts +163 -0
  922. package/src/host/websocket-proxy-headers.ts +29 -0
  923. package/src/host/websocket-proxy.ts +100 -58
  924. package/src/installed-native-build-options.ts +154 -0
  925. package/src/installed-package-versions.ts +70 -50
  926. package/src/material-symbol-fonts.ts +6 -4
  927. package/src/menu.ts +6 -0
  928. package/src/metro-plugin.ts +8 -0
  929. package/src/metro-project-root.ts +44 -33
  930. package/src/native-app-identity-project.ts +5 -0
  931. package/src/native-app-identity.ts +16 -0
  932. package/src/native-dev-bundle-url.ts +0 -18
  933. package/src/native-firebase-config.ts +47 -4
  934. package/src/native-preparation.ts +30 -0
  935. package/src/nativePreparationContract.ts +3 -0
  936. package/src/nitro-adapter.lock.json +1072 -14
  937. package/src/nitro-adapter.ts +33 -24
  938. package/src/nitro-bundle.ts +132 -22
  939. package/src/nitro-compile.ts +47 -7
  940. package/src/nitro-dependencies.ts +226 -0
  941. package/src/nitro-source.ts +200 -40
  942. package/src/nitroAdapterContract.ts +100 -20
  943. package/src/node-http-fetch.ts +116 -0
  944. package/src/packageVersionsContract.ts +79 -0
  945. package/src/react-native-bridge-modules.ts +24 -1
  946. package/src/react-native-host-modules.ts +111 -4
  947. package/src/runtime-assets.ts +10 -0
  948. package/src/serverDiscoveryContract.ts +1 -0
  949. package/src/settingsContract.ts +0 -30
  950. package/src/sim-client.ts +1 -1
  951. package/src/storageSnapshotContract.ts +22 -10
  952. package/src/stub-pattern-matcher.ts +17 -4
  953. package/src/swift-binary-modules.ts +20 -5
  954. package/src/swift-compile.ts +1292 -4123
  955. package/src/swift-compiler-digest.ts +1 -2
  956. package/src/swift-coverage/package.ts +103 -58
  957. package/src/swift-coverage/xcode-assets.ts +26 -5
  958. package/src/swift-coverage/xcode-bridging.ts +1 -12
  959. package/src/swift-coverage/xcode-packages.ts +167 -52
  960. package/src/swift-coverage/xcode.ts +2 -6
  961. package/src/swift-cxx-declarations.ts +205 -0
  962. package/src/swift-cxx-deps.ts +48 -0
  963. package/src/swift-cxx-reachable.ts +297 -0
  964. package/src/swift-cxx-standin.ts +248 -0
  965. package/src/swift-distribution.lock.json +29 -20
  966. package/src/swift-host.ts +229 -24
  967. package/src/swift-objc-compile.ts +638 -219
  968. package/src/swift-objc-import.ts +19 -964
  969. package/src/swift-objc-platform.ts +2 -2
  970. package/src/swift-objc-runtime.ts +7 -0
  971. package/src/swift-objc-standin.ts +314 -64
  972. package/src/swift-package-manifest.ts +179 -38
  973. package/src/swift-package.ts +156 -29
  974. package/src/swift-packages.ts +193 -34
  975. package/src/swift-pdf-raster.ts +114 -0
  976. package/src/swift-shared-sdk.ts +45 -0
  977. package/src/swift-source-file.ts +10 -6
  978. package/src/swift-source-pods.ts +126 -41
  979. package/src/swift-standin-digest.ts +74 -0
  980. package/src/swift-standin-emit.ts +48 -4
  981. package/src/swift-standins.ts +334 -92
  982. package/src/swift-submit.ts +24 -6
  983. package/src/swift-toolchain.ts +49 -9
  984. package/src/swiftContract.ts +58 -29
  985. package/src/vite-plugin.ts +0 -23
  986. package/src/workspace-root.ts +15 -0
  987. package/src/xcode-json-project.ts +52 -1
  988. package/src/xcode-project.ts +355 -65
  989. package/src/settings-flags.ts +0 -107
  990. package/src/swift-objc-export.ts +0 -532
  991. package/src/swift-objc-metadata.ts +0 -534
@@ -1,5 +1,5 @@
1
- /*! peach v0.1.1692 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
- let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
1
+ /*! peach v0.1.1716 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
+ let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
5
5
  var __defProp = Object.defineProperty;
@@ -94,6 +94,16 @@ var init_app_project = __esm({
94
94
  }
95
95
  });
96
96
 
97
+ // cli/internal-child.ts
98
+ var RNX_FORKED_SCRIPT_ENV;
99
+ var init_internal_child = __esm({
100
+ "cli/internal-child.ts"() {
101
+ "use strict";
102
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
103
+ RNX_FORKED_SCRIPT_ENV = "PEACH_RUNS_FORKED_SCRIPTS";
104
+ }
105
+ });
106
+
97
107
  // src/bundleGlobalFooter.ts
98
108
  function findBundleFooter(source, prefix2) {
99
109
  let end = source.length;
@@ -170,7 +180,7 @@ function isTrustedBridgeRequest(headers) {
170
180
  const origin = headers.origin;
171
181
  if (origin === void 0) return true;
172
182
  try {
173
- const { hostname, host } = new URL(String(origin));
183
+ const { hostname, host } = new NativeURL(String(origin));
174
184
  return isLoopbackHost(hostname) || [headers.host, headers[":authority"], headers["x-forwarded-host"]].some(
175
185
  (value) => typeof value === "string" && value.toLowerCase() === host
176
186
  );
@@ -180,16 +190,233 @@ function isTrustedBridgeRequest(headers) {
180
190
  }
181
191
  function loopbackOriginOf(value) {
182
192
  try {
183
- const url = new URL(value);
193
+ const url = new NativeURL(value);
184
194
  return isLoopbackHost(url.hostname) ? url.origin : null;
185
195
  } catch {
186
196
  return null;
187
197
  }
188
198
  }
199
+ var NativeURL;
189
200
  var init_backend_origin = __esm({
190
201
  "src/backend-origin.ts"() {
191
202
  "use strict";
192
203
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
204
+ NativeURL = globalThis.URL;
205
+ }
206
+ });
207
+
208
+ // ../peach-compat/src/version-range.ts
209
+ function compareVersions(left, right) {
210
+ if (left.major !== right.major) return left.major < right.major ? -1 : 1;
211
+ if (left.minor !== right.minor) return left.minor < right.minor ? -1 : 1;
212
+ if (left.patch !== right.patch) return left.patch < right.patch ? -1 : 1;
213
+ if (left.prerelease.length === 0) return right.prerelease.length === 0 ? 0 : 1;
214
+ if (right.prerelease.length === 0) return -1;
215
+ const length = Math.max(left.prerelease.length, right.prerelease.length);
216
+ for (let index = 0; index < length; index++) {
217
+ const leftPart = left.prerelease[index];
218
+ const rightPart = right.prerelease[index];
219
+ if (leftPart === void 0) return -1;
220
+ if (rightPart === void 0) return 1;
221
+ if (leftPart === rightPart) continue;
222
+ const leftNumeric = /^\d+$/.test(leftPart);
223
+ const rightNumeric = /^\d+$/.test(rightPart);
224
+ if (leftNumeric && rightNumeric) return Number(leftPart) < Number(rightPart) ? -1 : 1;
225
+ if (leftNumeric !== rightNumeric) return leftNumeric ? -1 : 1;
226
+ return leftPart < rightPart ? -1 : 1;
227
+ }
228
+ return 0;
229
+ }
230
+ function parseComparator(input) {
231
+ const token = input.trim();
232
+ if (token === "" || token === "*" || token === "x" || token === "X") {
233
+ return ANY_BOUNDS;
234
+ }
235
+ const match = /^(>=|<=|>|<|=|\^|~)?\s*v?(\d+|[xX*])(?:\.(\d+|[xX*]))?(?:\.(\d+|[xX*]))?(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/.exec(
236
+ token
237
+ );
238
+ if (!match) return null;
239
+ const operator = match[1] ?? "=";
240
+ const wildcard = (part) => part === void 0 || part === "x" || part === "X" || part === "*";
241
+ if (wildcard(match[2])) return ANY_BOUNDS;
242
+ const major = Number(match[2]);
243
+ const minor = wildcard(match[3]) ? null : Number(match[3]);
244
+ const patch = wildcard(match[4]) ? null : Number(match[4]);
245
+ const floor = {
246
+ major,
247
+ minor: minor ?? 0,
248
+ patch: patch ?? 0,
249
+ prerelease: match[5] ? match[5].split(".") : []
250
+ };
251
+ if (operator === ">") {
252
+ return { ...ANY_BOUNDS, lower: floor, lowerInclusive: false };
253
+ }
254
+ if (operator === ">=") {
255
+ return { ...ANY_BOUNDS, lower: floor, lowerInclusive: true };
256
+ }
257
+ if (operator === "<") {
258
+ return { ...ANY_BOUNDS, upper: floor, upperInclusive: false };
259
+ }
260
+ if (operator === "<=") {
261
+ return { ...ANY_BOUNDS, upper: floor, upperInclusive: true };
262
+ }
263
+ let upper;
264
+ if (operator === "^") {
265
+ upper = major !== 0 ? { major: major + 1, minor: 0, patch: 0, prerelease: [] } : (minor ?? 0) !== 0 || minor === null ? { major: 0, minor: (minor ?? 0) + 1, patch: 0, prerelease: [] } : { major: 0, minor: 0, patch: (patch ?? 0) + 1, prerelease: [] };
266
+ } else if (operator === "~") {
267
+ upper = minor === null ? { major: major + 1, minor: 0, patch: 0, prerelease: [] } : { major, minor: minor + 1, patch: 0, prerelease: [] };
268
+ } else if (minor === null) {
269
+ upper = { major: major + 1, minor: 0, patch: 0, prerelease: [] };
270
+ } else if (patch === null) {
271
+ upper = { major, minor: minor + 1, patch: 0, prerelease: [] };
272
+ } else {
273
+ return {
274
+ lower: floor,
275
+ lowerInclusive: true,
276
+ upper: floor,
277
+ upperInclusive: true
278
+ };
279
+ }
280
+ return {
281
+ lower: floor,
282
+ lowerInclusive: true,
283
+ upper,
284
+ upperInclusive: false
285
+ };
286
+ }
287
+ function stricterLower(left, right) {
288
+ if (!left.lower) return { lower: right.lower, lowerInclusive: right.lowerInclusive };
289
+ if (!right.lower) return { lower: left.lower, lowerInclusive: left.lowerInclusive };
290
+ const order = compareVersions(left.lower, right.lower);
291
+ if (order > 0) return { lower: left.lower, lowerInclusive: left.lowerInclusive };
292
+ if (order < 0) return { lower: right.lower, lowerInclusive: right.lowerInclusive };
293
+ return {
294
+ lower: left.lower,
295
+ lowerInclusive: left.lowerInclusive && right.lowerInclusive
296
+ };
297
+ }
298
+ function stricterUpper(left, right) {
299
+ if (!left.upper) return { upper: right.upper, upperInclusive: right.upperInclusive };
300
+ if (!right.upper) return { upper: left.upper, upperInclusive: left.upperInclusive };
301
+ const order = compareVersions(left.upper, right.upper);
302
+ if (order < 0) return { upper: left.upper, upperInclusive: left.upperInclusive };
303
+ if (order > 0) return { upper: right.upper, upperInclusive: right.upperInclusive };
304
+ return {
305
+ upper: left.upper,
306
+ upperInclusive: left.upperInclusive && right.upperInclusive
307
+ };
308
+ }
309
+ function hasValues(bounds) {
310
+ if (!bounds.lower || !bounds.upper) return true;
311
+ const order = compareVersions(bounds.lower, bounds.upper);
312
+ return order < 0 || order === 0 && bounds.lowerInclusive && bounds.upperInclusive;
313
+ }
314
+ function parseRange(input) {
315
+ const groups = input.split("||");
316
+ const parsed = [];
317
+ for (const group of groups) {
318
+ const tokens = group.trim().match(COMPARATOR) ?? [];
319
+ if (tokens.length === 0) return null;
320
+ let bounds = ANY_BOUNDS;
321
+ for (const token of tokens) {
322
+ const comparator = parseComparator(token);
323
+ if (!comparator) return null;
324
+ bounds = {
325
+ ...stricterLower(bounds, comparator),
326
+ ...stricterUpper(bounds, comparator)
327
+ };
328
+ }
329
+ if (!hasValues(bounds)) return null;
330
+ parsed.push(bounds);
331
+ }
332
+ return parsed;
333
+ }
334
+ function containsBounds(container, contained) {
335
+ if (container.lower) {
336
+ if (!contained.lower) return false;
337
+ const order = compareVersions(container.lower, contained.lower);
338
+ if (order > 0) return false;
339
+ if (order === 0 && contained.lowerInclusive && !container.lowerInclusive) return false;
340
+ }
341
+ if (container.upper) {
342
+ if (!contained.upper) return false;
343
+ const order = compareVersions(container.upper, contained.upper);
344
+ if (order < 0) return false;
345
+ if (order === 0 && contained.upperInclusive && !container.upperInclusive) return false;
346
+ }
347
+ return true;
348
+ }
349
+ function overlapsBounds(left, right) {
350
+ const intersection = {
351
+ ...stricterLower(left, right),
352
+ ...stricterUpper(left, right)
353
+ };
354
+ return hasValues(intersection);
355
+ }
356
+ function resolveCompatVersionRange(availableRegistryRanges, declaredVersion) {
357
+ const declaredGroups = parseRange(declaredVersion);
358
+ const registryGroups = availableRegistryRanges.map((range) => ({
359
+ range,
360
+ bounds: parseRange(range)
361
+ }));
362
+ if (!declaredGroups || registryGroups.some((candidate) => !candidate.bounds)) {
363
+ return {
364
+ status: "unresolved",
365
+ declaredVersion,
366
+ availableRegistryRanges
367
+ };
368
+ }
369
+ let selectedRange = null;
370
+ for (const declared of declaredGroups) {
371
+ const containing = registryGroups.filter(
372
+ (candidate2) => candidate2.bounds?.length === 1 && containsBounds(candidate2.bounds[0], declared)
373
+ );
374
+ if (containing.length !== 1) {
375
+ const overlaps = registryGroups.some(
376
+ (candidate2) => candidate2.bounds?.some((bounds) => overlapsBounds(bounds, declared))
377
+ );
378
+ return {
379
+ status: overlaps ? "unresolved" : "unmatched",
380
+ declaredVersion,
381
+ availableRegistryRanges
382
+ };
383
+ }
384
+ const candidate = containing[0].range;
385
+ if (selectedRange && selectedRange !== candidate) {
386
+ return {
387
+ status: "unresolved",
388
+ declaredVersion,
389
+ availableRegistryRanges
390
+ };
391
+ }
392
+ selectedRange = candidate;
393
+ }
394
+ if (!selectedRange) {
395
+ return {
396
+ status: "unresolved",
397
+ declaredVersion,
398
+ availableRegistryRanges
399
+ };
400
+ }
401
+ return {
402
+ status: "matched",
403
+ declaredVersion,
404
+ registryRange: selectedRange,
405
+ availableRegistryRanges
406
+ };
407
+ }
408
+ var ANY_BOUNDS, COMPARATOR;
409
+ var init_version_range = __esm({
410
+ "../peach-compat/src/version-range.ts"() {
411
+ "use strict";
412
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
413
+ ANY_BOUNDS = {
414
+ lower: null,
415
+ lowerInclusive: false,
416
+ upper: null,
417
+ upperInclusive: false
418
+ };
419
+ COMPARATOR = /\s*(?:[<>]=?|[=^~])?\s*[^\s]+/g;
193
420
  }
194
421
  });
195
422
 
@@ -425,11 +652,117 @@ var init_config = __esm({
425
652
  }
426
653
  });
427
654
 
655
+ // src/node-http-fetch.ts
656
+ var node_http_fetch_exports = {};
657
+ __export(node_http_fetch_exports, {
658
+ nodeHttpFetch: () => nodeHttpFetch
659
+ });
660
+ function nodeHttpFetch(url, init = {}, redirects = 0) {
661
+ const target = new URL(url);
662
+ const transport = target.protocol === "https:" ? import_node_https.default : import_node_http.default;
663
+ return new Promise((resolve4, reject) => {
664
+ const req = transport.request(
665
+ target,
666
+ { method: "GET", headers: init.headers, signal: init.signal },
667
+ (res) => {
668
+ const status = res.statusCode ?? 0;
669
+ const location = res.headers.location;
670
+ if (status >= 300 && status < 400 && location) {
671
+ res.resume();
672
+ if (redirects >= MAX_REDIRECTS) {
673
+ reject(new Error(`too many redirects from ${url}`));
674
+ return;
675
+ }
676
+ resolve4(nodeHttpFetch(new URL(location, target).href, init, redirects + 1));
677
+ return;
678
+ }
679
+ const headers = new Headers();
680
+ for (const [name2, value] of Object.entries(res.headers)) {
681
+ if (Array.isArray(value)) for (const entry of value) headers.append(name2, entry);
682
+ else if (value !== void 0) headers.set(name2, value);
683
+ }
684
+ if (BODYLESS_STATUS.has(status)) {
685
+ res.resume();
686
+ resolve4(new Response(null, { status, headers }));
687
+ return;
688
+ }
689
+ let source = res;
690
+ const codings = (res.headers["content-encoding"] ?? "").split(",").map((entry) => entry.trim().toLowerCase()).filter((entry) => entry && entry !== "identity");
691
+ if (codings.every((coding) => DECODABLE_CODINGS.has(coding))) {
692
+ for (const coding of codings.reverse()) {
693
+ let decoder;
694
+ if (coding === "br") decoder = import_node_zlib.default.createBrotliDecompress();
695
+ else if (coding === "deflate") {
696
+ let inner;
697
+ decoder = new import_node_stream.Transform({
698
+ transform(chunk, _encoding, done) {
699
+ if (!inner) {
700
+ inner = (chunk[0] & 15) === 8 ? import_node_zlib.default.createInflate(TRUNCATION_TOLERANT) : import_node_zlib.default.createInflateRaw(TRUNCATION_TOLERANT);
701
+ inner.on("data", (data) => decoder.push(data));
702
+ inner.on("error", (error) => decoder.destroy(error));
703
+ }
704
+ inner.write(chunk, done);
705
+ },
706
+ flush(done) {
707
+ if (!inner) return done();
708
+ inner.once("end", () => done());
709
+ inner.end();
710
+ },
711
+ destroy(error, done) {
712
+ inner?.destroy();
713
+ done(error);
714
+ }
715
+ });
716
+ } else decoder = import_node_zlib.default.createGunzip(TRUNCATION_TOLERANT);
717
+ source = (0, import_node_stream.pipeline)(source, decoder, () => {
718
+ });
719
+ }
720
+ }
721
+ const chunks = source[Symbol.asyncIterator]();
722
+ const body = new ReadableStream({
723
+ async pull(controller) {
724
+ try {
725
+ const chunk = await chunks.next();
726
+ if (chunk.done) controller.close();
727
+ else if (chunk.value instanceof Uint8Array) controller.enqueue(chunk.value);
728
+ else controller.error(new Error("HTTP response returned a non-byte chunk"));
729
+ } catch (error) {
730
+ controller.error(error);
731
+ }
732
+ },
733
+ cancel() {
734
+ source.destroy();
735
+ res.destroy();
736
+ }
737
+ });
738
+ resolve4(new Response(body, { status, headers }));
739
+ }
740
+ );
741
+ req.on("error", reject);
742
+ req.end();
743
+ });
744
+ }
745
+ var import_node_http, import_node_https, import_node_stream, import_node_zlib, BODYLESS_STATUS, TRUNCATION_TOLERANT, MAX_REDIRECTS, DECODABLE_CODINGS;
746
+ var init_node_http_fetch = __esm({
747
+ "src/node-http-fetch.ts"() {
748
+ "use strict";
749
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
750
+ import_node_http = __toESM(require("node:http"), 1);
751
+ import_node_https = __toESM(require("node:https"), 1);
752
+ import_node_stream = require("node:stream");
753
+ import_node_zlib = __toESM(require("node:zlib"), 1);
754
+ BODYLESS_STATUS = /* @__PURE__ */ new Set([101, 204, 205, 304]);
755
+ TRUNCATION_TOLERANT = { finishFlush: import_node_zlib.default.constants.Z_SYNC_FLUSH };
756
+ MAX_REDIRECTS = 5;
757
+ DECODABLE_CODINGS = /* @__PURE__ */ new Set(["gzip", "x-gzip", "deflate", "br"]);
758
+ }
759
+ });
760
+
428
761
  // runtime-companion.json
429
762
  var runtime_companion_default;
430
763
  var init_runtime_companion = __esm({
431
764
  "runtime-companion.json"() {
432
- runtime_companion_default = { abi: 1, sha256: "0aa1bb93377f2ed084f869ab161285ff9e1c638510065738c97f0cbe806bb630", file: "node/cli-0aa1bb93377f2ed084f869ab161285ff9e1c638510065738c97f0cbe806bb630.cjs" };
765
+ runtime_companion_default = { abi: 1, sha256: "a0dede25c849ecabd639fbb0a0c4edd8e62a34bf12090932dba19832f2369659", file: "node/cli-a0dede25c849ecabd639fbb0a0c4edd8e62a34bf12090932dba19832f2369659.cjs" };
433
766
  }
434
767
  });
435
768
 
@@ -464,34 +797,44 @@ var init_src = __esm({
464
797
  // src/home-paths.ts
465
798
  function rnxHomeDir() {
466
799
  const override = process.env[PEACH_HOME_ENV];
467
- if (override && override.length > 0) return import_node_path4.default.resolve(override);
468
- return import_node_path4.default.join((0, import_node_os2.homedir)(), ".peach");
800
+ if (override && override.length > 0) return import_node_path7.default.resolve(override);
801
+ return import_node_path7.default.join((0, import_node_os2.homedir)(), ".peach");
469
802
  }
470
803
  function runtimesDir() {
471
- return import_node_path4.default.join(rnxHomeDir(), "runtimes");
804
+ return import_node_path7.default.join(rnxHomeDir(), "runtimes");
472
805
  }
473
806
  function runtimeDir(version) {
474
- return import_node_path4.default.join(runtimesDir(), version);
807
+ return import_node_path7.default.join(runtimesDir(), version);
475
808
  }
476
809
  function activeRuntimeFile() {
477
- return import_node_path4.default.join(runtimesDir(), ACTIVE_RUNTIME_FILE);
810
+ return import_node_path7.default.join(runtimesDir(), ACTIVE_RUNTIME_FILE);
811
+ }
812
+ function cacheDir() {
813
+ return import_node_path7.default.join(rnxHomeDir(), "cache");
814
+ }
815
+ function swiftPackageCacheOptions() {
816
+ const root = import_node_path7.default.join(cacheDir(), "swiftpm");
817
+ return ["cache", "config", "security"].flatMap((name2) => [
818
+ `--${name2}-path`,
819
+ import_node_path7.default.join(root, name2)
820
+ ]);
478
821
  }
479
822
  function readActiveRuntime() {
480
823
  try {
481
- const value = import_node_fs5.default.readFileSync(activeRuntimeFile(), "utf8").trim();
824
+ const value = import_node_fs7.default.readFileSync(activeRuntimeFile(), "utf8").trim();
482
825
  return value.length > 0 ? value : null;
483
826
  } catch {
484
827
  return null;
485
828
  }
486
829
  }
487
- var import_node_fs5, import_node_os2, import_node_path4, PEACH_HOME_ENV, ACTIVE_RUNTIME_FILE, DAEMON_LOCKFILE_MAX_BYTES;
830
+ var import_node_fs7, import_node_os2, import_node_path7, PEACH_HOME_ENV, ACTIVE_RUNTIME_FILE, DAEMON_LOCKFILE_MAX_BYTES;
488
831
  var init_home_paths = __esm({
489
832
  "src/home-paths.ts"() {
490
833
  "use strict";
491
834
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
492
- import_node_fs5 = __toESM(require("node:fs"), 1);
835
+ import_node_fs7 = __toESM(require("node:fs"), 1);
493
836
  import_node_os2 = require("node:os");
494
- import_node_path4 = __toESM(require("node:path"), 1);
837
+ import_node_path7 = __toESM(require("node:path"), 1);
495
838
  PEACH_HOME_ENV = "PEACH_HOME";
496
839
  ACTIVE_RUNTIME_FILE = "active";
497
840
  DAEMON_LOCKFILE_MAX_BYTES = 16 * 1024;
@@ -608,6 +951,11 @@ function serveRuntimeFile(req, res, fullPath) {
608
951
  import_fs3.default.createReadStream(fullPath).pipe(res);
609
952
  return;
610
953
  }
954
+ if (/[?&]sha256=[a-f0-9]{64}(?:&|$)/.test(req?.url ?? "")) {
955
+ res.setHeader("cache-control", "public, max-age=31536000, immutable");
956
+ import_fs3.default.createReadStream(fullPath).pipe(res);
957
+ return;
958
+ }
611
959
  res.setHeader("cache-control", "no-cache");
612
960
  res.setHeader("last-modified", lastModified);
613
961
  if (req?.headers?.["if-modified-since"] === lastModified) {
@@ -713,13 +1061,14 @@ function cliCompanionPath() {
713
1061
  return `node/cli-${runtime_companion_default.sha256}.cjs`;
714
1062
  }
715
1063
  function verifyCliCompanion(root) {
716
- const file = (0, import_node_path5.join)(root, cliCompanionPath());
1064
+ const file = (0, import_node_path8.join)(root, cliCompanionPath());
717
1065
  let bytes;
718
1066
  try {
719
- bytes = (0, import_node_fs6.readFileSync)(file);
1067
+ bytes = (0, import_node_fs8.readFileSync)(file);
720
1068
  } catch (error) {
721
1069
  if (error instanceof Error) {
722
- error.message = `Could not read Peach runtime companion ${file}: ${error.message}`;
1070
+ const missing2 = "code" in error && error.code === "ENOENT" ? "; this runtime has no companion for this CLI (it was published before this CLI, or the file was removed after unpacking), run `peach runtime install` for the latest runtime and check Windows Security protection history if it repeats" : "";
1071
+ error.message = `Could not read Peach runtime companion ${file}: ${error.message}${missing2}`;
723
1072
  }
724
1073
  throw error;
725
1074
  }
@@ -736,7 +1085,7 @@ function getCliRuntime() {
736
1085
  if (!root) throw new Error("No Peach runtime installed; run `peach runtime install`");
737
1086
  verifyCliCompanion(root);
738
1087
  const require2 = (0, import_node_module2.createRequire)(__sootsim_import_meta_url);
739
- const runtime = require2((0, import_node_path5.join)(root, cliCompanionPath()));
1088
+ const runtime = require2((0, import_node_path8.join)(root, cliCompanionPath()));
740
1089
  if (runtime.cliCompanionAbi !== CLI_COMPANION_ABI) {
741
1090
  throw new Error(
742
1091
  "Incompatible Peach runtime companion ABI; run `peach runtime install`"
@@ -745,15 +1094,15 @@ function getCliRuntime() {
745
1094
  loaded = { root, runtime };
746
1095
  return runtime;
747
1096
  }
748
- var import_node_crypto2, import_node_fs6, import_node_module2, import_node_path5, CLI_COMPANION_ABI, loaded;
1097
+ var import_node_crypto2, import_node_fs8, import_node_module2, import_node_path8, CLI_COMPANION_ABI, loaded;
749
1098
  var init_cli_runtime = __esm({
750
1099
  "src/cli-runtime.ts"() {
751
1100
  "use strict";
752
1101
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
753
1102
  import_node_crypto2 = require("node:crypto");
754
- import_node_fs6 = require("node:fs");
1103
+ import_node_fs8 = require("node:fs");
755
1104
  import_node_module2 = require("node:module");
756
- import_node_path5 = require("node:path");
1105
+ import_node_path8 = require("node:path");
757
1106
  init_runtime_companion();
758
1107
  init_runtime_assets();
759
1108
  CLI_COMPANION_ABI = 1;
@@ -761,7 +1110,7 @@ var init_cli_runtime = __esm({
761
1110
  });
762
1111
 
763
1112
  // ../contrast-bundler/src/posixPath.ts
764
- function isAbsolute(p) {
1113
+ function isAbsolute2(p) {
765
1114
  return p.charCodeAt(0) === 47;
766
1115
  }
767
1116
  function normalizeSegments(parts, allowAboveRoot) {
@@ -779,7 +1128,7 @@ function normalizeSegments(parts, allowAboveRoot) {
779
1128
  }
780
1129
  function normalize(p) {
781
1130
  if (p.length === 0) return ".";
782
- const absolute = isAbsolute(p);
1131
+ const absolute = isAbsolute2(p);
783
1132
  const trailingSlash = p.charCodeAt(p.length - 1) === 47;
784
1133
  const segments = normalizeSegments(p.split("/"), !absolute);
785
1134
  let joined = segments.join("/");
@@ -802,7 +1151,7 @@ function resolve2(...parts) {
802
1151
  const part = parts[i];
803
1152
  if (part.length === 0) continue;
804
1153
  resolved = resolved.length > 0 ? `${part}/${resolved}` : part;
805
- absolute = isAbsolute(part);
1154
+ absolute = isAbsolute2(part);
806
1155
  }
807
1156
  if (!absolute)
808
1157
  throw new Error(
@@ -852,7 +1201,7 @@ var init_posixPath = __esm({
852
1201
  posix = {
853
1202
  sep,
854
1203
  delimiter,
855
- isAbsolute,
1204
+ isAbsolute: isAbsolute2,
856
1205
  normalize,
857
1206
  join: join3,
858
1207
  resolve: resolve2,
@@ -1097,16 +1446,16 @@ function sendJavaScript(req, res, source) {
1097
1446
  res.end(req.method === "HEAD" ? void 0 : source);
1098
1447
  }
1099
1448
  function resolveReplacementModuleFile(fromFile, specifier) {
1100
- const base = import_node_path6.default.resolve(import_node_path6.default.dirname(fromFile), specifier);
1449
+ const base = import_node_path9.default.resolve(import_node_path9.default.dirname(fromFile), specifier);
1101
1450
  const candidates = [
1102
1451
  ...REPLACEMENT_MODULE_EXTENSIONS.some(
1103
- (ext) => ext === import_node_path6.default.extname(base).toLowerCase()
1452
+ (ext) => ext === import_node_path9.default.extname(base).toLowerCase()
1104
1453
  ) ? [base] : [],
1105
1454
  ...REPLACEMENT_MODULE_EXTENSIONS.map((ext) => base + ext),
1106
- ...REPLACEMENT_MODULE_EXTENSIONS.map((ext) => import_node_path6.default.join(base, `index${ext}`))
1455
+ ...REPLACEMENT_MODULE_EXTENSIONS.map((ext) => import_node_path9.default.join(base, `index${ext}`))
1107
1456
  ];
1108
1457
  const found = candidates.find(
1109
- (candidate) => (0, import_node_fs7.statSync)(candidate, { throwIfNoEntry: false })?.isFile()
1458
+ (candidate) => (0, import_node_fs9.statSync)(candidate, { throwIfNoEntry: false })?.isFile()
1110
1459
  );
1111
1460
  if (!found) {
1112
1461
  throw new Error(
@@ -1117,8 +1466,8 @@ function resolveReplacementModuleFile(fromFile, specifier) {
1117
1466
  }
1118
1467
  function isInsideAny(roots, file) {
1119
1468
  return roots.some((root) => {
1120
- const relative3 = import_node_path6.default.relative(root, file);
1121
- return !relative3.startsWith("..") && !import_node_path6.default.isAbsolute(relative3);
1469
+ const relative3 = import_node_path9.default.relative(root, file);
1470
+ return !relative3.startsWith("..") && !import_node_path9.default.isAbsolute(relative3);
1122
1471
  });
1123
1472
  }
1124
1473
  function isReplacementModuleRequestUrl(rawUrl) {
@@ -1167,19 +1516,19 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
1167
1516
  res.end("missing path param");
1168
1517
  return true;
1169
1518
  }
1170
- const extension = import_node_path6.default.extname(targetPath).toLowerCase();
1519
+ const extension = import_node_path9.default.extname(targetPath).toLowerCase();
1171
1520
  if (!REPLACEMENT_MODULE_EXTENSIONS.some((allowed) => allowed === extension)) {
1172
1521
  res.writeHead(400, { "Content-Type": "text/plain; charset=utf-8" });
1173
1522
  res.end(`replacement files must be ${REPLACEMENT_MODULE_EXTENSIONS.join(", ")}`);
1174
1523
  return true;
1175
1524
  }
1176
- if (!import_node_path6.default.isAbsolute(targetPath)) {
1525
+ if (!import_node_path9.default.isAbsolute(targetPath)) {
1177
1526
  res.writeHead(400, { "Content-Type": "text/plain; charset=utf-8" });
1178
1527
  res.end("replacement file path must be absolute");
1179
1528
  return true;
1180
1529
  }
1181
1530
  const runtimePackages = new Set(url.searchParams.getAll("runtimePackage"));
1182
- const servedRoots = options.servedRoots?.map((root) => import_node_path6.default.resolve(root));
1531
+ const servedRoots = options.servedRoots?.map((root) => import_node_path9.default.resolve(root));
1183
1532
  if (servedRoots && !isInsideAny(servedRoots, targetPath)) {
1184
1533
  res.writeHead(403, { "Content-Type": "text/plain; charset=utf-8" });
1185
1534
  res.end("replacement file must be inside a folder the bundler serves");
@@ -1231,14 +1580,14 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
1231
1580
  }
1232
1581
  return true;
1233
1582
  }
1234
- var import_node_fs7, import_promises4, import_node_path6, REPLACEMENT_MODULE_ROUTE;
1583
+ var import_node_fs9, import_promises4, import_node_path9, REPLACEMENT_MODULE_ROUTE;
1235
1584
  var init_replacement_module_handler = __esm({
1236
1585
  "src/host/replacement-module-handler.ts"() {
1237
1586
  "use strict";
1238
1587
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
1239
- import_node_fs7 = require("node:fs");
1588
+ import_node_fs9 = require("node:fs");
1240
1589
  import_promises4 = __toESM(require("node:fs/promises"), 1);
1241
- import_node_path6 = __toESM(require("node:path"), 1);
1590
+ import_node_path9 = __toESM(require("node:path"), 1);
1242
1591
  init_replacementModule();
1243
1592
  init_backend_origin();
1244
1593
  REPLACEMENT_MODULE_ROUTE = "/__sootsim-replacement-module";
@@ -2389,21 +2738,38 @@ var init_public_brand = __esm({
2389
2738
  }
2390
2739
  });
2391
2740
 
2741
+ // src/kotlin-toolchain.ts
2742
+ var import_node_child_process5, import_node_util2, run2;
2743
+ var init_kotlin_toolchain = __esm({
2744
+ "src/kotlin-toolchain.ts"() {
2745
+ "use strict";
2746
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
2747
+ import_node_child_process5 = require("node:child_process");
2748
+ import_node_util2 = require("node:util");
2749
+ init_home_paths();
2750
+ init_is_record();
2751
+ run2 = (0, import_node_util2.promisify)(import_node_child_process5.execFile);
2752
+ }
2753
+ });
2754
+
2392
2755
  // src/swift-source-file.ts
2756
+ function relativeInside(root, file) {
2757
+ const relative3 = import_node_path16.default.relative(root, file);
2758
+ return relative3 === ".." || relative3.startsWith(`..${import_node_path16.default.sep}`) || import_node_path16.default.isAbsolute(relative3) ? null : relative3;
2759
+ }
2393
2760
  function packageInputPath(canonicalRoot, file) {
2394
- const canonicalFile = import_node_fs11.default.realpathSync(file);
2395
- const relative3 = import_node_path11.default.relative(canonicalRoot, canonicalFile);
2396
- if (relative3 === ".." || relative3.startsWith(`..${import_node_path11.default.sep}`) || import_node_path11.default.isAbsolute(relative3)) {
2761
+ const canonicalFile = import_node_fs15.default.realpathSync(file);
2762
+ if (relativeInside(canonicalRoot, canonicalFile) === null) {
2397
2763
  throw new Error(`swift input escapes the selected package: ${file}`);
2398
2764
  }
2399
2765
  return canonicalFile;
2400
2766
  }
2401
2767
  function readPackageFile(root, file, maxBytes) {
2402
- const canonicalFile = packageInputPath(import_node_fs11.default.realpathSync(root), file);
2403
- const expected = import_node_fs11.default.statSync(canonicalFile);
2404
- const fd = import_node_fs11.default.openSync(canonicalFile, import_node_fs11.default.constants.O_RDONLY | import_node_fs11.default.constants.O_NOFOLLOW);
2768
+ const canonicalFile = packageInputPath(import_node_fs15.default.realpathSync(root), file);
2769
+ const expected = import_node_fs15.default.statSync(canonicalFile);
2770
+ const fd = import_node_fs15.default.openSync(canonicalFile, import_node_fs15.default.constants.O_RDONLY | import_node_fs15.default.constants.O_NOFOLLOW);
2405
2771
  try {
2406
- const stat = import_node_fs11.default.fstatSync(fd);
2772
+ const stat = import_node_fs15.default.fstatSync(fd);
2407
2773
  if (stat.dev !== expected.dev || stat.ino !== expected.ino) {
2408
2774
  throw new Error(`swift input changed while opening: ${file}`);
2409
2775
  }
@@ -2413,25 +2779,25 @@ function readPackageFile(root, file, maxBytes) {
2413
2779
  const bytes = Buffer.alloc(stat.size + 1);
2414
2780
  let offset = 0;
2415
2781
  while (offset < bytes.length) {
2416
- const count = import_node_fs11.default.readSync(fd, bytes, offset, bytes.length - offset, null);
2782
+ const count = import_node_fs15.default.readSync(fd, bytes, offset, bytes.length - offset, null);
2417
2783
  if (count === 0) break;
2418
2784
  offset += count;
2419
2785
  }
2420
- if (offset !== stat.size || import_node_fs11.default.fstatSync(fd).size !== stat.size) {
2786
+ if (offset !== stat.size || import_node_fs15.default.fstatSync(fd).size !== stat.size) {
2421
2787
  throw new Error(`swift input changed while reading: ${file}`);
2422
2788
  }
2423
2789
  return bytes.subarray(0, offset);
2424
2790
  } finally {
2425
- import_node_fs11.default.closeSync(fd);
2791
+ import_node_fs15.default.closeSync(fd);
2426
2792
  }
2427
2793
  }
2428
- var import_node_fs11, import_node_path11;
2794
+ var import_node_fs15, import_node_path16;
2429
2795
  var init_swift_source_file = __esm({
2430
2796
  "src/swift-source-file.ts"() {
2431
2797
  "use strict";
2432
2798
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
2433
- import_node_fs11 = __toESM(require("node:fs"), 1);
2434
- import_node_path11 = __toESM(require("node:path"), 1);
2799
+ import_node_fs15 = __toESM(require("node:fs"), 1);
2800
+ import_node_path16 = __toESM(require("node:path"), 1);
2435
2801
  }
2436
2802
  });
2437
2803
 
@@ -2464,6 +2830,23 @@ var init_swift_submit = __esm({
2464
2830
  }
2465
2831
  });
2466
2832
 
2833
+ // src/nitro-dependencies.ts
2834
+ var import_node_child_process6, import_node_util3, run3;
2835
+ var init_nitro_dependencies = __esm({
2836
+ "src/nitro-dependencies.ts"() {
2837
+ "use strict";
2838
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
2839
+ import_node_child_process6 = require("node:child_process");
2840
+ import_node_util3 = require("node:util");
2841
+ init_home_paths();
2842
+ init_is_record();
2843
+ init_kotlin_toolchain();
2844
+ init_swift_source_file();
2845
+ init_swift_submit();
2846
+ run3 = (0, import_node_util3.promisify)(import_node_child_process6.execFile);
2847
+ }
2848
+ });
2849
+
2467
2850
  // src/nitro-source.ts
2468
2851
  function object(value) {
2469
2852
  return value !== null && typeof value === "object" && !Array.isArray(value);
@@ -2472,19 +2855,19 @@ function readJson(root, relative3) {
2472
2855
  return JSON.parse(
2473
2856
  readPackageFile(
2474
2857
  root,
2475
- import_node_path12.default.join(root, relative3),
2858
+ import_node_path17.default.join(root, relative3),
2476
2859
  MAX_SWIFT_COMPILE_SOURCE_BYTES
2477
2860
  ).toString("utf8")
2478
2861
  );
2479
2862
  }
2480
2863
  function registrations(root) {
2481
- const directory = import_node_path12.default.join(root, "nitrogen/generated/ios");
2482
- const initializers = import_node_fs12.default.readdirSync(directory).filter((file) => file.endsWith("Autolinking.mm"));
2864
+ const directory = import_node_path17.default.join(root, "nitrogen/generated/ios");
2865
+ const initializers = import_node_fs16.default.readdirSync(directory).filter((file) => file.endsWith("Autolinking.mm"));
2483
2866
  if (initializers.length !== 1)
2484
2867
  throw new Error(`${root}: expected one generated Nitro iOS initializer`);
2485
2868
  const source = readPackageFile(
2486
2869
  root,
2487
- import_node_path12.default.join(directory, initializers[0]),
2870
+ import_node_path17.default.join(directory, initializers[0]),
2488
2871
  MAX_SWIFT_COMPILE_SOURCE_BYTES
2489
2872
  ).toString("utf8");
2490
2873
  const namespaces = [
@@ -2526,12 +2909,12 @@ function registrations(root) {
2526
2909
  return { namespace, swiftModule, classes, views: viewNames(root, classes) };
2527
2910
  }
2528
2911
  function viewNames(root, classes) {
2529
- const directory = import_node_path12.default.join(root, "nitrogen/generated/shared/json");
2530
- if (!import_node_fs12.default.existsSync(directory)) return /* @__PURE__ */ new Set();
2912
+ const directory = import_node_path17.default.join(root, "nitrogen/generated/shared/json");
2913
+ if (!import_node_fs16.default.existsSync(directory)) return /* @__PURE__ */ new Set();
2531
2914
  const views = /* @__PURE__ */ new Set();
2532
- for (const file of import_node_fs12.default.readdirSync(directory)) {
2915
+ for (const file of import_node_fs16.default.readdirSync(directory)) {
2533
2916
  if (!file.endsWith("Config.json")) continue;
2534
- const config = readJson(root, import_node_path12.default.join("nitrogen/generated/shared/json", file));
2917
+ const config = readJson(root, import_node_path17.default.join("nitrogen/generated/shared/json", file));
2535
2918
  const name2 = object(config) ? config.uiViewClassName : void 0;
2536
2919
  if (typeof name2 === "string" && classes.some((entry) => entry.name === name2))
2537
2920
  views.add(name2);
@@ -2539,23 +2922,28 @@ function viewNames(root, classes) {
2539
2922
  return views;
2540
2923
  }
2541
2924
  function hasNitroIosInitializer(root) {
2542
- const generated = import_node_path12.default.join(root, "nitrogen/generated/ios");
2543
- return import_node_fs12.default.existsSync(generated) && import_node_fs12.default.readdirSync(generated).some((file) => file.endsWith("Autolinking.mm"));
2925
+ const generated = import_node_path17.default.join(root, "nitrogen/generated/ios");
2926
+ return import_node_fs16.default.existsSync(generated) && import_node_fs16.default.readdirSync(generated).some((file) => file.endsWith("Autolinking.mm"));
2544
2927
  }
2545
2928
  function nitroRegisteredNames(root) {
2546
2929
  if (!hasNitroIosInitializer(root)) return null;
2547
2930
  const { classes, views } = registrations(root);
2548
2931
  return { names: classes.map(({ name: name2 }) => name2), views: [...views].sort() };
2549
2932
  }
2550
- var import_node_fs12, import_node_path12;
2933
+ var import_node_child_process7, import_node_fs16, import_node_path17, import_node_util4, run4;
2551
2934
  var init_nitro_source = __esm({
2552
2935
  "src/nitro-source.ts"() {
2553
2936
  "use strict";
2554
2937
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
2555
- import_node_fs12 = __toESM(require("node:fs"), 1);
2556
- import_node_path12 = __toESM(require("node:path"), 1);
2938
+ import_node_child_process7 = require("node:child_process");
2939
+ import_node_fs16 = __toESM(require("node:fs"), 1);
2940
+ import_node_path17 = __toESM(require("node:path"), 1);
2941
+ import_node_util4 = require("node:util");
2942
+ init_internal_child();
2943
+ init_nitro_dependencies();
2557
2944
  init_swift_source_file();
2558
2945
  init_swift_submit();
2946
+ run4 = (0, import_node_util4.promisify)(import_node_child_process7.execFile);
2559
2947
  }
2560
2948
  });
2561
2949
 
@@ -2639,17 +3027,17 @@ function visit(node, visitor) {
2639
3027
  } else
2640
3028
  visit_(null, node, visitor_, Object.freeze([]));
2641
3029
  }
2642
- function visit_(key, node, visitor, path17) {
2643
- const ctrl = callVisitor(key, node, visitor, path17);
3030
+ function visit_(key, node, visitor, path21) {
3031
+ const ctrl = callVisitor(key, node, visitor, path21);
2644
3032
  if (isNode(ctrl) || isPair(ctrl)) {
2645
- replaceNode(key, path17, ctrl);
2646
- return visit_(key, ctrl, visitor, path17);
3033
+ replaceNode(key, path21, ctrl);
3034
+ return visit_(key, ctrl, visitor, path21);
2647
3035
  }
2648
3036
  if (typeof ctrl !== "symbol") {
2649
3037
  if (isCollection(node)) {
2650
- path17 = Object.freeze(path17.concat(node));
3038
+ path21 = Object.freeze(path21.concat(node));
2651
3039
  for (let i = 0; i < node.items.length; ++i) {
2652
- const ci = visit_(i, node.items[i], visitor, path17);
3040
+ const ci = visit_(i, node.items[i], visitor, path21);
2653
3041
  if (typeof ci === "number")
2654
3042
  i = ci - 1;
2655
3043
  else if (ci === BREAK)
@@ -2660,13 +3048,13 @@ function visit_(key, node, visitor, path17) {
2660
3048
  }
2661
3049
  }
2662
3050
  } else if (isPair(node)) {
2663
- path17 = Object.freeze(path17.concat(node));
2664
- const ck = visit_("key", node.key, visitor, path17);
3051
+ path21 = Object.freeze(path21.concat(node));
3052
+ const ck = visit_("key", node.key, visitor, path21);
2665
3053
  if (ck === BREAK)
2666
3054
  return BREAK;
2667
3055
  else if (ck === REMOVE)
2668
3056
  node.key = null;
2669
- const cv = visit_("value", node.value, visitor, path17);
3057
+ const cv = visit_("value", node.value, visitor, path21);
2670
3058
  if (cv === BREAK)
2671
3059
  return BREAK;
2672
3060
  else if (cv === REMOVE)
@@ -2684,17 +3072,17 @@ async function visitAsync(node, visitor) {
2684
3072
  } else
2685
3073
  await visitAsync_(null, node, visitor_, Object.freeze([]));
2686
3074
  }
2687
- async function visitAsync_(key, node, visitor, path17) {
2688
- const ctrl = await callVisitor(key, node, visitor, path17);
3075
+ async function visitAsync_(key, node, visitor, path21) {
3076
+ const ctrl = await callVisitor(key, node, visitor, path21);
2689
3077
  if (isNode(ctrl) || isPair(ctrl)) {
2690
- replaceNode(key, path17, ctrl);
2691
- return visitAsync_(key, ctrl, visitor, path17);
3078
+ replaceNode(key, path21, ctrl);
3079
+ return visitAsync_(key, ctrl, visitor, path21);
2692
3080
  }
2693
3081
  if (typeof ctrl !== "symbol") {
2694
3082
  if (isCollection(node)) {
2695
- path17 = Object.freeze(path17.concat(node));
3083
+ path21 = Object.freeze(path21.concat(node));
2696
3084
  for (let i = 0; i < node.items.length; ++i) {
2697
- const ci = await visitAsync_(i, node.items[i], visitor, path17);
3085
+ const ci = await visitAsync_(i, node.items[i], visitor, path21);
2698
3086
  if (typeof ci === "number")
2699
3087
  i = ci - 1;
2700
3088
  else if (ci === BREAK)
@@ -2705,13 +3093,13 @@ async function visitAsync_(key, node, visitor, path17) {
2705
3093
  }
2706
3094
  }
2707
3095
  } else if (isPair(node)) {
2708
- path17 = Object.freeze(path17.concat(node));
2709
- const ck = await visitAsync_("key", node.key, visitor, path17);
3096
+ path21 = Object.freeze(path21.concat(node));
3097
+ const ck = await visitAsync_("key", node.key, visitor, path21);
2710
3098
  if (ck === BREAK)
2711
3099
  return BREAK;
2712
3100
  else if (ck === REMOVE)
2713
3101
  node.key = null;
2714
- const cv = await visitAsync_("value", node.value, visitor, path17);
3102
+ const cv = await visitAsync_("value", node.value, visitor, path21);
2715
3103
  if (cv === BREAK)
2716
3104
  return BREAK;
2717
3105
  else if (cv === REMOVE)
@@ -2738,23 +3126,23 @@ function initVisitor(visitor) {
2738
3126
  }
2739
3127
  return visitor;
2740
3128
  }
2741
- function callVisitor(key, node, visitor, path17) {
3129
+ function callVisitor(key, node, visitor, path21) {
2742
3130
  if (typeof visitor === "function")
2743
- return visitor(key, node, path17);
3131
+ return visitor(key, node, path21);
2744
3132
  if (isMap(node))
2745
- return visitor.Map?.(key, node, path17);
3133
+ return visitor.Map?.(key, node, path21);
2746
3134
  if (isSeq(node))
2747
- return visitor.Seq?.(key, node, path17);
3135
+ return visitor.Seq?.(key, node, path21);
2748
3136
  if (isPair(node))
2749
- return visitor.Pair?.(key, node, path17);
3137
+ return visitor.Pair?.(key, node, path21);
2750
3138
  if (isScalar(node))
2751
- return visitor.Scalar?.(key, node, path17);
3139
+ return visitor.Scalar?.(key, node, path21);
2752
3140
  if (isAlias(node))
2753
- return visitor.Alias?.(key, node, path17);
3141
+ return visitor.Alias?.(key, node, path21);
2754
3142
  return void 0;
2755
3143
  }
2756
- function replaceNode(key, path17, node) {
2757
- const parent = path17[path17.length - 1];
3144
+ function replaceNode(key, path21, node) {
3145
+ const parent = path21[path21.length - 1];
2758
3146
  if (isCollection(parent)) {
2759
3147
  parent.items[key] = node;
2760
3148
  } else if (isPair(parent)) {
@@ -3314,10 +3702,10 @@ var init_createNode = __esm({
3314
3702
  });
3315
3703
 
3316
3704
  // ../../node_modules/yaml/browser/dist/nodes/Collection.js
3317
- function collectionFromPath(schema4, path17, value) {
3705
+ function collectionFromPath(schema4, path21, value) {
3318
3706
  let v = value;
3319
- for (let i = path17.length - 1; i >= 0; --i) {
3320
- const k = path17[i];
3707
+ for (let i = path21.length - 1; i >= 0; --i) {
3708
+ const k = path21[i];
3321
3709
  if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
3322
3710
  const a = [];
3323
3711
  a[k] = v;
@@ -3343,7 +3731,7 @@ var init_Collection = __esm({
3343
3731
  init_createNode();
3344
3732
  init_identity();
3345
3733
  init_Node();
3346
- isEmptyPath = (path17) => path17 == null || typeof path17 === "object" && !!path17[Symbol.iterator]().next().done;
3734
+ isEmptyPath = (path21) => path21 == null || typeof path21 === "object" && !!path21[Symbol.iterator]().next().done;
3347
3735
  Collection = class extends NodeBase {
3348
3736
  constructor(type, schema4) {
3349
3737
  super(type);
@@ -3373,11 +3761,11 @@ var init_Collection = __esm({
3373
3761
  * be a Pair instance or a `{ key, value }` object, which may not have a key
3374
3762
  * that already exists in the map.
3375
3763
  */
3376
- addIn(path17, value) {
3377
- if (isEmptyPath(path17))
3764
+ addIn(path21, value) {
3765
+ if (isEmptyPath(path21))
3378
3766
  this.add(value);
3379
3767
  else {
3380
- const [key, ...rest] = path17;
3768
+ const [key, ...rest] = path21;
3381
3769
  const node = this.get(key, true);
3382
3770
  if (isCollection(node))
3383
3771
  node.addIn(rest, value);
@@ -3391,8 +3779,8 @@ var init_Collection = __esm({
3391
3779
  * Removes a value from the collection.
3392
3780
  * @returns `true` if the item was found and removed.
3393
3781
  */
3394
- deleteIn(path17) {
3395
- const [key, ...rest] = path17;
3782
+ deleteIn(path21) {
3783
+ const [key, ...rest] = path21;
3396
3784
  if (rest.length === 0)
3397
3785
  return this.delete(key);
3398
3786
  const node = this.get(key, true);
@@ -3406,8 +3794,8 @@ var init_Collection = __esm({
3406
3794
  * scalar values from their surrounding node; to disable set `keepScalar` to
3407
3795
  * `true` (collections are always returned intact).
3408
3796
  */
3409
- getIn(path17, keepScalar) {
3410
- const [key, ...rest] = path17;
3797
+ getIn(path21, keepScalar) {
3798
+ const [key, ...rest] = path21;
3411
3799
  const node = this.get(key, true);
3412
3800
  if (rest.length === 0)
3413
3801
  return !keepScalar && isScalar(node) ? node.value : node;
@@ -3425,8 +3813,8 @@ var init_Collection = __esm({
3425
3813
  /**
3426
3814
  * Checks if the collection includes a value with the key `key`.
3427
3815
  */
3428
- hasIn(path17) {
3429
- const [key, ...rest] = path17;
3816
+ hasIn(path21) {
3817
+ const [key, ...rest] = path21;
3430
3818
  if (rest.length === 0)
3431
3819
  return this.has(key);
3432
3820
  const node = this.get(key, true);
@@ -3436,8 +3824,8 @@ var init_Collection = __esm({
3436
3824
  * Sets a value in this collection. For `!!set`, `value` needs to be a
3437
3825
  * boolean to add/remove the item from the set.
3438
3826
  */
3439
- setIn(path17, value) {
3440
- const [key, ...rest] = path17;
3827
+ setIn(path21, value) {
3828
+ const [key, ...rest] = path21;
3441
3829
  if (rest.length === 0) {
3442
3830
  this.set(key, value);
3443
3831
  } else {
@@ -5410,15 +5798,15 @@ function visit2(cst, visitor) {
5410
5798
  cst = { start: cst.start, value: cst.value };
5411
5799
  _visit(Object.freeze([]), cst, visitor);
5412
5800
  }
5413
- function _visit(path17, item, visitor) {
5414
- let ctrl = visitor(item, path17);
5801
+ function _visit(path21, item, visitor) {
5802
+ let ctrl = visitor(item, path21);
5415
5803
  if (typeof ctrl === "symbol")
5416
5804
  return ctrl;
5417
5805
  for (const field of ["key", "value"]) {
5418
5806
  const token = item[field];
5419
5807
  if (token && "items" in token) {
5420
5808
  for (let i = 0; i < token.items.length; ++i) {
5421
- const ci = _visit(Object.freeze(path17.concat([[field, i]])), token.items[i], visitor);
5809
+ const ci = _visit(Object.freeze(path21.concat([[field, i]])), token.items[i], visitor);
5422
5810
  if (typeof ci === "number")
5423
5811
  i = ci - 1;
5424
5812
  else if (ci === BREAK2)
@@ -5429,10 +5817,10 @@ function _visit(path17, item, visitor) {
5429
5817
  }
5430
5818
  }
5431
5819
  if (typeof ctrl === "function" && field === "key")
5432
- ctrl = ctrl(item, path17);
5820
+ ctrl = ctrl(item, path21);
5433
5821
  }
5434
5822
  }
5435
- return typeof ctrl === "function" ? ctrl(item, path17) : ctrl;
5823
+ return typeof ctrl === "function" ? ctrl(item, path21) : ctrl;
5436
5824
  }
5437
5825
  var BREAK2, SKIP2, REMOVE2;
5438
5826
  var init_cst_visit = __esm({
@@ -5444,9 +5832,9 @@ var init_cst_visit = __esm({
5444
5832
  visit2.BREAK = BREAK2;
5445
5833
  visit2.SKIP = SKIP2;
5446
5834
  visit2.REMOVE = REMOVE2;
5447
- visit2.itemAtPath = (cst, path17) => {
5835
+ visit2.itemAtPath = (cst, path21) => {
5448
5836
  let item = cst;
5449
- for (const [field, index] of path17) {
5837
+ for (const [field, index] of path21) {
5450
5838
  const tok = item?.[field];
5451
5839
  if (tok && "items" in tok) {
5452
5840
  item = tok.items[index];
@@ -5455,9 +5843,9 @@ var init_cst_visit = __esm({
5455
5843
  }
5456
5844
  return item;
5457
5845
  };
5458
- visit2.parentCollection = (cst, path17) => {
5459
- const parent = visit2.itemAtPath(cst, path17.slice(0, -1));
5460
- const field = path17[path17.length - 1][0];
5846
+ visit2.parentCollection = (cst, path21) => {
5847
+ const parent = visit2.itemAtPath(cst, path21.slice(0, -1));
5848
+ const field = path21[path21.length - 1][0];
5461
5849
  const coll = parent?.[field];
5462
5850
  if (coll && "items" in coll)
5463
5851
  return coll;
@@ -5552,25 +5940,25 @@ var init_browser = __esm({
5552
5940
  });
5553
5941
 
5554
5942
  // cli/commands/nodeRepoFileReader.ts
5555
- var import_node_fs13, nodeRepoFileReader;
5943
+ var import_node_fs17, nodeRepoFileReader;
5556
5944
  var init_nodeRepoFileReader = __esm({
5557
5945
  "cli/commands/nodeRepoFileReader.ts"() {
5558
5946
  "use strict";
5559
5947
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
5560
- import_node_fs13 = require("node:fs");
5948
+ import_node_fs17 = require("node:fs");
5561
5949
  nodeRepoFileReader = {
5562
- exists: import_node_fs13.existsSync,
5563
- readText: (filePath) => (0, import_node_fs13.readFileSync)(filePath, "utf8"),
5564
- entries: (directory) => (0, import_node_fs13.readdirSync)(directory, { withFileTypes: true }).map((entry) => ({
5950
+ exists: import_node_fs17.existsSync,
5951
+ readText: (filePath) => (0, import_node_fs17.readFileSync)(filePath, "utf8"),
5952
+ entries: (directory) => (0, import_node_fs17.readdirSync)(directory, { withFileTypes: true }).map((entry) => ({
5565
5953
  name: entry.name,
5566
5954
  directory: entry.isDirectory()
5567
5955
  })),
5568
- isDirectory: (filePath) => (0, import_node_fs13.statSync)(filePath).isDirectory(),
5956
+ isDirectory: (filePath) => (0, import_node_fs17.statSync)(filePath).isDirectory(),
5569
5957
  readMetadata(filePath) {
5570
5958
  try {
5571
- const info = (0, import_node_fs13.lstatSync)(filePath);
5959
+ const info = (0, import_node_fs17.lstatSync)(filePath);
5572
5960
  if (!info.isFile() || info.size > 4 * 1024 * 1024) return null;
5573
- return (0, import_node_fs13.readFileSync)(filePath, "utf8");
5961
+ return (0, import_node_fs17.readFileSync)(filePath, "utf8");
5574
5962
  } catch {
5575
5963
  return null;
5576
5964
  }
@@ -5593,7 +5981,7 @@ function scanRepository(root) {
5593
5981
  directories.push(next.dir);
5594
5982
  let handle;
5595
5983
  try {
5596
- handle = (0, import_node_fs14.opendirSync)(next.dir);
5984
+ handle = (0, import_node_fs18.opendirSync)(next.dir);
5597
5985
  } catch {
5598
5986
  unreadable++;
5599
5987
  continue;
@@ -5608,7 +5996,7 @@ function scanRepository(root) {
5608
5996
  truncated = true;
5609
5997
  continue;
5610
5998
  }
5611
- pending.push({ dir: (0, import_node_path13.join)(next.dir, entry.name), depth: next.depth + 1 });
5999
+ pending.push({ dir: (0, import_node_path18.join)(next.dir, entry.name), depth: next.depth + 1 });
5612
6000
  }
5613
6001
  } finally {
5614
6002
  handle.closeSync();
@@ -5627,8 +6015,8 @@ function metadataValue(value, key) {
5627
6015
  if (!value || typeof value !== "object") return void 0;
5628
6016
  return Object.getOwnPropertyDescriptor(value, key)?.value;
5629
6017
  }
5630
- function readProjectJson(path17, files = nodeRepoFileReader) {
5631
- const text2 = readProjectMetadata(path17, files);
6018
+ function readProjectJson(path21, files = nodeRepoFileReader) {
6019
+ const text2 = readProjectMetadata(path21, files);
5632
6020
  if (text2 === null) return null;
5633
6021
  try {
5634
6022
  const value = JSON.parse(text2);
@@ -5638,7 +6026,7 @@ function readProjectJson(path17, files = nodeRepoFileReader) {
5638
6026
  }
5639
6027
  }
5640
6028
  function readProjectManifest(dir, files = nodeRepoFileReader) {
5641
- const parsed = readProjectJson((0, import_node_path13.join)(dir, "package.json"), files);
6029
+ const parsed = readProjectJson((0, import_node_path18.join)(dir, "package.json"), files);
5642
6030
  if (!parsed || typeof parsed !== "object") return null;
5643
6031
  const record = (value) => {
5644
6032
  if (!value || typeof value !== "object") return {};
@@ -5655,13 +6043,13 @@ function readProjectManifest(dir, files = nodeRepoFileReader) {
5655
6043
  devDependencies: record(metadataValue(parsed, "devDependencies"))
5656
6044
  };
5657
6045
  }
5658
- var import_node_fs14, import_node_path13, import_json52, REPORT_SKIP_DIRS;
6046
+ var import_node_fs18, import_node_path18, import_json52, REPORT_SKIP_DIRS, PODFILE_NEW_ARCH_MARK, PODFILE_NEW_ARCH_RUBY;
5659
6047
  var init_detect = __esm({
5660
6048
  "cli/commands/detect.ts"() {
5661
6049
  "use strict";
5662
6050
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
5663
- import_node_fs14 = require("node:fs");
5664
- import_node_path13 = require("node:path");
6051
+ import_node_fs18 = require("node:fs");
6052
+ import_node_path18 = require("node:path");
5665
6053
  import_json52 = __toESM(require_lib(), 1);
5666
6054
  init_browser();
5667
6055
  init_nodeRepoFileReader();
@@ -5682,6 +6070,29 @@ var init_detect = __esm({
5682
6070
  "test-results",
5683
6071
  "playwright-report"
5684
6072
  ]);
6073
+ PODFILE_NEW_ARCH_MARK = "PEACH_RCT_NEW_ARCH ";
6074
+ PODFILE_NEW_ARCH_RUBY = `
6075
+ require 'json'
6076
+ payload = JSON.parse($stdin.read)
6077
+ properties = payload['properties']
6078
+ properties = {} unless properties.is_a?(Hash)
6079
+ podfile_properties = properties
6080
+ ENV.delete('RCT_NEW_ARCH_ENABLED')
6081
+ scope = binding
6082
+ Array(payload['statements']).each do |statement|
6083
+ before = ENV['RCT_NEW_ARCH_ENABLED']
6084
+ scope.eval(statement)
6085
+ after = ENV['RCT_NEW_ARCH_ENABLED']
6086
+ if after == before
6087
+ puts '${PODFILE_NEW_ARCH_MARK}skip'
6088
+ elsif after == '0' || after == '1'
6089
+ puts "${PODFILE_NEW_ARCH_MARK}#{after}"
6090
+ else
6091
+ warn "RCT_NEW_ARCH_ENABLED assigned #{after.inspect}"
6092
+ exit 2
6093
+ end
6094
+ end
6095
+ `;
5685
6096
  }
5686
6097
  });
5687
6098
 
@@ -5716,7 +6127,7 @@ function resolveAppStubs(appDir, config, configDir) {
5716
6127
  const targetDir = stubTarget ? installedPackageDir(appDir, target) : dir;
5717
6128
  const targetVersion = targetDir ? readPackageJson(targetDir)?.version : void 0;
5718
6129
  if (typeof targetVersion !== "string") continue;
5719
- if (versions !== void 0 && (0, import_version_range.resolveCompatVersionRange)([versions], targetVersion).status !== "matched") {
6130
+ if (versions !== void 0 && resolveCompatVersionRange([versions], targetVersion).status !== "matched") {
5720
6131
  skipped.push({
5721
6132
  target,
5722
6133
  provider: name2,
@@ -5773,7 +6184,7 @@ function resolveAppStubs(appDir, config, configDir) {
5773
6184
  const { modules, views, hybridObjects } = expandStubs(appDir, source);
5774
6185
  assertRegisteredHybridObjects(appDir, source, hybridObjects);
5775
6186
  for (const [name2, answer] of Object.entries(hybridObjects))
5776
- nativeHybridObjects[name2] = answer === "unsupported" ? answer : { file: (0, import_node_path14.resolve)(source.baseDir, answer) };
6187
+ nativeHybridObjects[name2] = answer === "unsupported" ? answer : { file: (0, import_node_path19.resolve)(source.baseDir, answer) };
5777
6188
  for (const [name2, stub] of Object.entries(modules))
5778
6189
  nativeModules[name2] = lowerStub(stub, source.baseDir);
5779
6190
  for (const [name2, stub] of Object.entries(views))
@@ -5785,6 +6196,7 @@ function resolveAppStubs(appDir, config, configDir) {
5785
6196
  providerVersion: source.providerVersion,
5786
6197
  modules: Object.keys(modules),
5787
6198
  views: Object.keys(views),
6199
+ hybridObjects: Object.keys(hybridObjects),
5788
6200
  ...Object.values(views).some((value) => typeof value !== "string") ? {
5789
6201
  viewSources: Object.fromEntries(
5790
6202
  Object.entries(views).filter(
@@ -5837,10 +6249,10 @@ function assertRegisteredHybridObjects(appDir, source, hybridObjects) {
5837
6249
  );
5838
6250
  }
5839
6251
  function lowerStub(stub, baseDir) {
5840
- return stub === "noop" ? stub : { file: (0, import_node_path14.resolve)(baseDir, stub) };
6252
+ return stub === "noop" ? stub : { file: (0, import_node_path19.resolve)(baseDir, stub) };
5841
6253
  }
5842
6254
  function readPackageJson(dir) {
5843
- const text2 = readSmallFile((0, import_node_path14.join)(dir, "package.json"));
6255
+ const text2 = readSmallFile((0, import_node_path19.join)(dir, "package.json"));
5844
6256
  if (!text2) return null;
5845
6257
  try {
5846
6258
  const parsed = JSON.parse(text2);
@@ -5852,9 +6264,9 @@ function readPackageJson(dir) {
5852
6264
  function installedPackageDir(appDir, name2) {
5853
6265
  let current = appDir;
5854
6266
  while (true) {
5855
- const dir = (0, import_node_path14.join)(current, "node_modules", name2);
5856
- if ((0, import_node_fs15.existsSync)((0, import_node_path14.join)(dir, "package.json"))) return (0, import_node_fs15.realpathSync)(dir);
5857
- const parent = (0, import_node_path14.dirname)(current);
6267
+ const dir = (0, import_node_path19.join)(current, "node_modules", name2);
6268
+ if ((0, import_node_fs19.existsSync)((0, import_node_path19.join)(dir, "package.json"))) return (0, import_node_fs19.realpathSync)(dir);
6269
+ const parent = (0, import_node_path19.dirname)(current);
5858
6270
  if (parent === current) return null;
5859
6271
  current = parent;
5860
6272
  }
@@ -5946,7 +6358,7 @@ function mergeRequests(previous, next) {
5946
6358
  function packageNativeRequests(dir) {
5947
6359
  const found = /* @__PURE__ */ new Map();
5948
6360
  const directories = scanRepository(dir).directories.filter((sub) => {
5949
- const segments = (0, import_node_path14.relative)(dir, sub).split("/");
6361
+ const segments = (0, import_node_path19.relative)(dir, sub).split("/");
5950
6362
  return !NATIVE_SOURCE_DIRS.has(segments[0]) && !segments.some((segment) => PACKAGE_SKIP_DIRS.has(segment));
5951
6363
  });
5952
6364
  let files = 0;
@@ -5954,14 +6366,13 @@ function packageNativeRequests(dir) {
5954
6366
  for (const name2 of listDir(sub)) {
5955
6367
  if (!SOURCE_FILE.test(name2) || name2.endsWith(".d.ts") || files >= 2e3) continue;
5956
6368
  files++;
5957
- const file = (0, import_node_path14.join)(sub, name2);
6369
+ const file = (0, import_node_path19.join)(sub, name2);
5958
6370
  const text2 = readSmallFile(file);
5959
6371
  if (!text2) continue;
5960
- for (const { line: _line, ...request } of sourceNativeRequests(file, text2, true))
5961
- found.set(
5962
- `${request.kind}:${request.name}`,
5963
- mergeRequests(found.get(`${request.kind}:${request.name}`), request)
5964
- );
6372
+ for (const { line: _line, ...request } of sourceNativeRequests(file, text2, true)) {
6373
+ const key = `${request.kind}:${request.name}:${request.androidOnly}`;
6374
+ found.set(key, mergeRequests(found.get(key), request));
6375
+ }
5965
6376
  }
5966
6377
  }
5967
6378
  return [...found.values()].sort(
@@ -6073,27 +6484,27 @@ function wireSlotMigration(appDir, configPath, wire, kept = []) {
6073
6484
  }
6074
6485
  function listDir(dir) {
6075
6486
  try {
6076
- return (0, import_node_fs15.readdirSync)(dir);
6487
+ return (0, import_node_fs19.readdirSync)(dir);
6077
6488
  } catch {
6078
6489
  return [];
6079
6490
  }
6080
6491
  }
6081
6492
  function readSmallFile(file) {
6082
6493
  try {
6083
- return (0, import_node_fs15.statSync)(file).size <= 1024 * 1024 ? (0, import_node_fs15.readFileSync)(file, "utf8") : null;
6494
+ return (0, import_node_fs19.statSync)(file).size <= 1024 * 1024 ? (0, import_node_fs19.readFileSync)(file, "utf8") : null;
6084
6495
  } catch {
6085
6496
  return null;
6086
6497
  }
6087
6498
  }
6088
6499
  function hasNativeCode(dir, platform) {
6089
- const expoConfig = (0, import_node_path14.join)(dir, "expo-module.config.json");
6500
+ const expoConfig = (0, import_node_path19.join)(dir, "expo-module.config.json");
6090
6501
  const platforms = metadataValue(readProjectJson(expoConfig), "platforms");
6091
6502
  if (Array.isArray(platforms))
6092
6503
  return platforms.includes(platform) || platform === "ios" && platforms.includes("apple");
6093
- if ([platform, "expo-module.config.json"].some((entry) => (0, import_node_fs15.existsSync)((0, import_node_path14.join)(dir, entry))))
6504
+ if ([platform, "expo-module.config.json"].some((entry) => (0, import_node_fs19.existsSync)((0, import_node_path19.join)(dir, entry))))
6094
6505
  return true;
6095
6506
  if (listDir(dir).some((name2) => name2.endsWith(".podspec"))) return true;
6096
- const manifest = readSmallFile((0, import_node_path14.join)(dir, "package.json"));
6507
+ const manifest = readSmallFile((0, import_node_path19.join)(dir, "package.json"));
6097
6508
  return manifest !== null && manifest.includes('"codegenConfig"');
6098
6509
  }
6099
6510
  function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__PURE__ */ new Set(), includeLegacy = false, providers) {
@@ -6106,7 +6517,7 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
6106
6517
  (excluded) => dir === excluded || dir.startsWith(`${excluded}/`)
6107
6518
  ))
6108
6519
  continue;
6109
- if ((0, import_node_fs15.existsSync)((0, import_node_path14.join)(dir, "expo-module.config.json"))) {
6520
+ if ((0, import_node_fs19.existsSync)((0, import_node_path19.join)(dir, "expo-module.config.json"))) {
6110
6521
  if (platform && !hasNativeCode(dir, platform)) {
6111
6522
  excludedModuleDirs.push(dir);
6112
6523
  continue;
@@ -6115,7 +6526,7 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
6115
6526
  }
6116
6527
  for (const name2 of listDir(dir)) {
6117
6528
  if (SOURCE_FILE.test(name2) && !name2.endsWith(".d.ts"))
6118
- sourceFiles.push((0, import_node_path14.join)(dir, name2));
6529
+ sourceFiles.push((0, import_node_path19.join)(dir, name2));
6119
6530
  }
6120
6531
  }
6121
6532
  }
@@ -6125,7 +6536,7 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
6125
6536
  scanRepository(dir).directories.flatMap(
6126
6537
  (sub) => listDir(sub).filter(
6127
6538
  (name2) => NATIVE_SOURCE_FILE.test(name2) && (!platform || (platform === "ios" ? name2.endsWith(".swift") : name2.endsWith(".kt")))
6128
- ).map((name2) => (0, import_node_path14.join)(sub, name2))
6539
+ ).map((name2) => (0, import_node_path19.join)(sub, name2))
6129
6540
  )
6130
6541
  ])
6131
6542
  );
@@ -6134,32 +6545,32 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
6134
6545
  const known = owners.get(dir);
6135
6546
  if (known) return known;
6136
6547
  const name2 = readPackageJson(dir)?.name;
6137
- const parent = (0, import_node_path14.dirname)(dir);
6548
+ const parent = (0, import_node_path19.dirname)(dir);
6138
6549
  const result = typeof name2 === "string" ? name2 : parent === dir ? pkg.name ?? "app" : owner(parent);
6139
6550
  owners.set(dir, result);
6140
6551
  return result;
6141
6552
  };
6142
6553
  const found = /* @__PURE__ */ new Map();
6143
- const add = (kind, name2, file, line, optional = false) => {
6554
+ const add = (kind, name2, file, line, optional = false, declaration = false) => {
6144
6555
  const key = `${kind}:${name2}`;
6145
6556
  const known = found.get(key);
6146
6557
  if (known) {
6147
- known.optional &&= optional;
6558
+ if (!declaration) known.optional &&= optional;
6148
6559
  return;
6149
6560
  }
6150
6561
  providers ??= dependencyNativeOwners(appDir, pkg);
6151
- const packageName = providers.get(key) ?? owner((0, import_node_path14.dirname)(file));
6562
+ const packageName = providers.get(key) ?? owner((0, import_node_path19.dirname)(file));
6152
6563
  if (knownPackages.has(packageName)) return;
6153
6564
  const moduleDir = expoModuleDirs.find((dir) => file.startsWith(`${dir}/`)) ?? null;
6154
6565
  found.set(key, {
6155
6566
  kind,
6156
6567
  name: name2,
6157
6568
  package: packageName,
6158
- path: `${(0, import_node_path14.relative)(appDir, file)}:${line}`,
6159
- expoModule: moduleDir ? (0, import_node_path14.relative)(appDir, moduleDir) || "." : null,
6569
+ path: `${(0, import_node_path19.relative)(appDir, file)}:${line}`,
6570
+ expoModule: moduleDir ? (0, import_node_path19.relative)(appDir, moduleDir) || "." : null,
6160
6571
  optional,
6161
6572
  swift: moduleDir ? (nativeFilesByModule.get(moduleDir) ?? []).some(
6162
- (path17) => path17.endsWith(".swift") && [...(readSmallFile(path17) ?? "").matchAll(/\bName\(\s*"(\w+)"\s*\)/g)].some(
6573
+ (path21) => path21.endsWith(".swift") && [...(readSmallFile(path21) ?? "").matchAll(/\bName\(\s*"(\w+)"\s*\)/g)].some(
6163
6574
  (match) => match[1] === name2
6164
6575
  )
6165
6576
  ) : false,
@@ -6187,7 +6598,14 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
6187
6598
  if (!text2) continue;
6188
6599
  for (const match of text2.matchAll(/\bName\(\s*"(\w+)"\s*\)/g)) {
6189
6600
  if (match[1])
6190
- add("module", match[1], file, text2.slice(0, match.index).split("\n").length);
6601
+ add(
6602
+ "module",
6603
+ match[1],
6604
+ file,
6605
+ text2.slice(0, match.index).split("\n").length,
6606
+ false,
6607
+ true
6608
+ );
6191
6609
  }
6192
6610
  }
6193
6611
  }
@@ -6200,31 +6618,31 @@ function workspacePackageDirs(appDir, pkg) {
6200
6618
  for (const name2 of Object.keys({ ...pkg.dependencies, ...pkg.devDependencies })) {
6201
6619
  let current = appDir;
6202
6620
  while (true) {
6203
- const link = (0, import_node_path14.join)(current, "node_modules", name2);
6204
- if ((0, import_node_fs15.existsSync)(link)) {
6205
- if ((0, import_node_fs15.lstatSync)(link).isSymbolicLink()) {
6206
- const target = (0, import_node_fs15.realpathSync)(link);
6621
+ const link = (0, import_node_path19.join)(current, "node_modules", name2);
6622
+ if ((0, import_node_fs19.existsSync)(link)) {
6623
+ if ((0, import_node_fs19.lstatSync)(link).isSymbolicLink()) {
6624
+ const target = (0, import_node_fs19.realpathSync)(link);
6207
6625
  if (!target.split("/").includes("node_modules") && !target.startsWith(`${appDir}/`)) {
6208
6626
  dirs.add(target);
6209
6627
  }
6210
6628
  }
6211
6629
  break;
6212
6630
  }
6213
- const parent = (0, import_node_path14.dirname)(current);
6631
+ const parent = (0, import_node_path19.dirname)(current);
6214
6632
  if (parent === current) break;
6215
6633
  current = parent;
6216
6634
  }
6217
6635
  }
6218
6636
  return [...dirs];
6219
6637
  }
6220
- var import_node_fs15, import_node_path14, import_version_range, import_oxc_parser2, import_sucrase, SOURCE_FILE, NATIVE_LOOKUP, NATIVE_SOURCE_DIRS, PACKAGE_SKIP_DIRS, NATIVE_SOURCE_FILE;
6638
+ var import_node_fs19, import_node_path19, import_oxc_parser2, import_sucrase, SOURCE_FILE, NATIVE_LOOKUP, NATIVE_SOURCE_DIRS, PACKAGE_SKIP_DIRS, NATIVE_SOURCE_FILE;
6221
6639
  var init_app_stubs = __esm({
6222
6640
  "cli/app-stubs.ts"() {
6223
6641
  "use strict";
6224
6642
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
6225
- import_node_fs15 = require("node:fs");
6226
- import_node_path14 = require("node:path");
6227
- import_version_range = require("@peach/compat/version-range");
6643
+ import_node_fs19 = require("node:fs");
6644
+ import_node_path19 = require("node:path");
6645
+ init_version_range();
6228
6646
  import_oxc_parser2 = require("oxc-parser");
6229
6647
  import_sucrase = require("sucrase");
6230
6648
  init_config();
@@ -6259,12 +6677,12 @@ function resolveFileEntries(entries, configDir) {
6259
6677
  return Object.fromEntries(
6260
6678
  Object.entries(entries).map(([name2, resolution]) => [
6261
6679
  name2,
6262
- resolution && typeof resolution === "object" && "file" in resolution && typeof resolution.file === "string" ? { ...resolution, file: import_node_path15.default.resolve(configDir, resolution.file) } : resolution
6680
+ resolution && typeof resolution === "object" && "file" in resolution && typeof resolution.file === "string" ? { ...resolution, file: import_node_path20.default.resolve(configDir, resolution.file) } : resolution
6263
6681
  ])
6264
6682
  );
6265
6683
  }
6266
6684
  function resolveConfigReplacementFiles(config, configPath) {
6267
- const configDir = import_node_path15.default.dirname(configPath);
6685
+ const configDir = import_node_path20.default.dirname(configPath);
6268
6686
  return {
6269
6687
  ...config,
6270
6688
  modules: resolveFileEntries(config.modules, configDir)
@@ -6280,7 +6698,7 @@ async function loadRNXAppStubs(project) {
6280
6698
  return resolveAppStubs(
6281
6699
  project.appDir,
6282
6700
  config,
6283
- project.configPath ? import_node_path15.default.dirname(project.configPath) : project.appDir
6701
+ project.configPath ? import_node_path20.default.dirname(project.configPath) : project.appDir
6284
6702
  );
6285
6703
  } catch (error) {
6286
6704
  const message = error instanceof Error ? error.message : String(error);
@@ -6299,7 +6717,7 @@ async function loadConfigFile(project) {
6299
6717
  [`${rnxPublicBrand.packageName}/config`]: config_exports
6300
6718
  }
6301
6719
  });
6302
- const loaded3 = project.configPath.endsWith(".json") ? JSON.parse((0, import_node_fs16.readFileSync)(project.configPath, "utf8")) : await jiti.import(project.configPath, { default: true });
6720
+ const loaded3 = project.configPath.endsWith(".json") ? JSON.parse((0, import_node_fs20.readFileSync)(project.configPath, "utf8")) : await jiti.import(project.configPath, { default: true });
6303
6721
  if (!isPeachConfig(loaded3)) {
6304
6722
  throw new Error("the default export must be a peach config object");
6305
6723
  }
@@ -6335,13 +6753,13 @@ async function resolveRNXAppConfig(startDir = process.cwd()) {
6335
6753
  const project = resolveAppProject(startDir);
6336
6754
  return { project, ...await loadRNXAppStubs(project) };
6337
6755
  }
6338
- var import_node_fs16, import_node_path15, import_jiti, WIRE_SLOTS;
6756
+ var import_node_fs20, import_node_path20, import_jiti, WIRE_SLOTS;
6339
6757
  var init_app_config = __esm({
6340
6758
  "cli/app-config.ts"() {
6341
6759
  "use strict";
6342
6760
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
6343
- import_node_fs16 = require("node:fs");
6344
- import_node_path15 = __toESM(require("node:path"), 1);
6761
+ import_node_fs20 = require("node:fs");
6762
+ import_node_path20 = __toESM(require("node:path"), 1);
6345
6763
  import_jiti = require("jiti");
6346
6764
  init_config();
6347
6765
  init_config();
@@ -6438,14 +6856,14 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
6438
6856
  const neededPackages = /* @__PURE__ */ new Set();
6439
6857
  const factories = [];
6440
6858
  const visit3 = (filePath) => {
6441
- const real = import_node_fs17.default.realpathSync(filePath);
6859
+ const real = import_node_fs21.default.realpathSync(filePath);
6442
6860
  const previous = files.get(real);
6443
6861
  if (previous !== void 0) return previous;
6444
6862
  const id = "peach-config-file:" + files.size;
6445
6863
  files.set(real, id);
6446
6864
  const compiled = compileReplacementModule({
6447
6865
  filePath: real,
6448
- source: import_node_fs17.default.readFileSync(real, "utf8"),
6866
+ source: import_node_fs21.default.readFileSync(real, "utf8"),
6449
6867
  runtimePackages,
6450
6868
  localModuleUrl: (specifier) => visit3(resolveReplacementModuleFile(real, specifier))
6451
6869
  });
@@ -6469,7 +6887,7 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
6469
6887
  if (!entries || typeof entries !== "object") continue;
6470
6888
  for (const resolution of Object.values(entries)) {
6471
6889
  if (resolution && typeof resolution === "object" && "file" in resolution && typeof resolution.file === "string") {
6472
- resolution.file = visit3(import_node_path16.default.resolve(resolution.file));
6890
+ resolution.file = visit3(import_node_path21.default.resolve(resolution.file));
6473
6891
  }
6474
6892
  }
6475
6893
  }
@@ -6493,13 +6911,13 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
6493
6911
  const identityStart = findBundleFooter(source, "globalThis.__sootsimModulePaths=");
6494
6912
  return prefix2 + (identityStart < 0 ? source + footer : source.slice(0, identityStart) + footer + source.slice(identityStart));
6495
6913
  }
6496
- var import_node_fs17, import_node_path16, import_sucrase2, import_terser;
6914
+ var import_node_fs21, import_node_path21, import_sucrase2, import_terser;
6497
6915
  var init_configured_bundle_producer = __esm({
6498
6916
  "src/configured-bundle-producer.ts"() {
6499
6917
  "use strict";
6500
6918
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
6501
- import_node_fs17 = __toESM(require("node:fs"), 1);
6502
- import_node_path16 = __toESM(require("node:path"), 1);
6919
+ import_node_fs21 = __toESM(require("node:fs"), 1);
6920
+ import_node_path21 = __toESM(require("node:path"), 1);
6503
6921
  import_sucrase2 = require("sucrase");
6504
6922
  import_terser = require("terser");
6505
6923
  init_dependencies();
@@ -6533,10 +6951,7 @@ var import_node_fs2 = __toESM(require("node:fs"), 1);
6533
6951
  var import_node_module = require("node:module");
6534
6952
  var import_node_path2 = __toESM(require("node:path"), 1);
6535
6953
  var import_node_util = require("node:util");
6536
-
6537
- // cli/internal-child.ts
6538
- init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
6539
- var RNX_FORKED_SCRIPT_ENV = "PEACH_RUNS_FORKED_SCRIPTS";
6954
+ init_internal_child();
6540
6955
 
6541
6956
  // src/androidAutolinkingContract.ts
6542
6957
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
@@ -6606,10 +7021,180 @@ async function collectAndroidAutolinkedPackages(appRoot) {
6606
7021
  return readAndroidAutolinkedPackages(modules.map((entry) => entry.packageName));
6607
7022
  }
6608
7023
 
7024
+ // src/android-root-module.ts
7025
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
7026
+ var import_node_fs3 = __toESM(require("node:fs"), 1);
7027
+ var import_node_path3 = __toESM(require("node:path"), 1);
7028
+
7029
+ // src/android-xml.ts
7030
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
7031
+ var ENTITIES = {
7032
+ quot: '"',
7033
+ apos: "'",
7034
+ amp: "&",
7035
+ lt: "<",
7036
+ gt: ">"
7037
+ };
7038
+ var TAG = /<(\/?)([\w:.-]+)((?:\s+[\w:.-]+\s*=\s*(?:"[^"]*"|'[^']*'))*)\s*(\/?)>/y;
7039
+ var ATTRIBUTE = /([\w:.-]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g;
7040
+ function decodeXmlText(value, file) {
7041
+ return value.replace(/&(#x[0-9a-fA-F]+|#\d+|\w+);/g, (_match, entity) => {
7042
+ if (entity.startsWith("#x"))
7043
+ return String.fromCodePoint(Number.parseInt(entity.slice(2), 16));
7044
+ if (entity.startsWith("#"))
7045
+ return String.fromCodePoint(Number.parseInt(entity.slice(1), 10));
7046
+ const character = ENTITIES[entity];
7047
+ if (character === void 0) throw new Error(`${file}: unknown entity &${entity};`);
7048
+ return character;
7049
+ });
7050
+ }
7051
+ function parseXml(text2, file) {
7052
+ const root = { name: "#document", attributes: {}, children: [], text: "" };
7053
+ const stack = [root];
7054
+ const body = text2.replace(/<!--[\s\S]*?-->/g, "").replace(/<\?[\s\S]*?\?>/g, "");
7055
+ let index = 0;
7056
+ while (index < body.length) {
7057
+ const open = body.indexOf("<", index);
7058
+ const content = body.slice(index, open === -1 ? body.length : open);
7059
+ const parent = stack.at(-1);
7060
+ if (parent && content.trim()) parent.text += decodeXmlText(content, file);
7061
+ if (open === -1) break;
7062
+ TAG.lastIndex = open;
7063
+ const match = TAG.exec(body);
7064
+ if (!match)
7065
+ throw new Error(`${file}: unreadable markup at ${body.slice(open, open + 40)}`);
7066
+ index = TAG.lastIndex;
7067
+ const [, closing, name2, rawAttributes, selfClosing] = match;
7068
+ if (!name2) continue;
7069
+ if (closing) {
7070
+ const element2 = stack.pop();
7071
+ if (element2?.name !== name2)
7072
+ throw new Error(`${file}: </${name2}> closes <${element2?.name}>`);
7073
+ continue;
7074
+ }
7075
+ const attributes = {};
7076
+ for (const [, key, double, single] of (rawAttributes ?? "").matchAll(ATTRIBUTE))
7077
+ if (key) attributes[key] = decodeXmlText(double ?? single ?? "", file);
7078
+ const element = { name: name2, attributes, children: [], text: "" };
7079
+ stack.at(-1)?.children.push(element);
7080
+ if (!selfClosing) stack.push(element);
7081
+ }
7082
+ if (stack.length !== 1)
7083
+ throw new Error(`${file}: <${stack.at(-1)?.name}> is never closed`);
7084
+ return root;
7085
+ }
7086
+
7087
+ // src/android-root-module.ts
7088
+ var STRINGS_AND_COMMENTS = /"(?:\\.|[^"\\])*"|\/\/[^\n]*|\/\*[\s\S]*?\*\//g;
7089
+ var DECLARATION = /\b(?:fun|String)\s+getMainComponentName\s*\(/g;
7090
+ var KOTLIN_LITERAL = /^override\s+fun\s+getMainComponentName\s*\(\s*\)\s*(?::\s*String\s*)?(?:=\s*|\{\s*return\s+)"([^"\\$]+)"(?=\s*(?:;|\}|override\b|fun\b|private\b|public\b|protected\b|@|$))/;
7091
+ var JAVA_LITERAL = /^String\s+getMainComponentName\s*\(\s*\)\s*\{\s*return\s+"([^"\\]+)"\s*;\s*\}/;
7092
+ function readAndroidRootModuleFromActivitySource(source, simpleName) {
7093
+ const code = source.replace(
7094
+ STRINGS_AND_COMMENTS,
7095
+ (match) => match.startsWith('"') ? match : " "
7096
+ );
7097
+ const classes = [...code.matchAll(/\bclass\s+(\w+)/g)];
7098
+ if (classes.length !== 1 || classes[0][1] !== simpleName) return void 0;
7099
+ const declarations = [...code.matchAll(DECLARATION)];
7100
+ if (declarations.length !== 1) return void 0;
7101
+ const rest = code.slice(declarations[0].index);
7102
+ const kotlin = code.slice(code.lastIndexOf("override", declarations[0].index));
7103
+ const literal = (KOTLIN_LITERAL.exec(kotlin) ?? JAVA_LITERAL.exec(rest))?.[1];
7104
+ if (literal === void 0) return void 0;
7105
+ const delegate = /createReactActivityDelegate[\s\S]*/.exec(code)?.[0];
7106
+ if (delegate && !/\b(?:mainComponentName|getMainComponentName\s*\(\s*\))/.test(delegate))
7107
+ return void 0;
7108
+ return literal;
7109
+ }
7110
+ function launcherActivities(application) {
7111
+ return application.children.filter(
7112
+ (element) => (element.name === "activity" || element.name === "activity-alias") && element.children.some(
7113
+ (filter) => filter.name === "intent-filter" && filter.children.some(
7114
+ (child) => child.name === "action" && child.attributes["android:name"] === "android.intent.action.MAIN"
7115
+ ) && filter.children.some(
7116
+ (child) => child.name === "category" && child.attributes["android:name"] === "android.intent.category.LAUNCHER"
7117
+ )
7118
+ )
7119
+ );
7120
+ }
7121
+ function readModuleNamespace(moduleRoot, manifest) {
7122
+ if (manifest.attributes.package) return manifest.attributes.package;
7123
+ for (const name2 of ["build.gradle", "build.gradle.kts"]) {
7124
+ const file = import_node_path3.default.join(moduleRoot, name2);
7125
+ if (!import_node_fs3.default.existsSync(file)) continue;
7126
+ const match = /\bnamespace\s*=?\s*["']([\w.]+)["']/.exec(
7127
+ import_node_fs3.default.readFileSync(file, "utf8")
7128
+ );
7129
+ if (match) return match[1];
7130
+ }
7131
+ return void 0;
7132
+ }
7133
+ function readModuleRootModuleName(moduleRoot) {
7134
+ const sourceSets = import_node_path3.default.join(moduleRoot, "src");
7135
+ const manifestFile = import_node_path3.default.join(sourceSets, "main/AndroidManifest.xml");
7136
+ if (!import_node_fs3.default.existsSync(manifestFile)) return void 0;
7137
+ const document = parseXml(import_node_fs3.default.readFileSync(manifestFile, "utf8"), manifestFile);
7138
+ const manifest = document.children[0];
7139
+ const application = manifest?.children.find((child) => child.name === "application");
7140
+ if (manifest?.name !== "manifest" || !application) return void 0;
7141
+ const launchers = launcherActivities(application);
7142
+ if (launchers.length === 0) return void 0;
7143
+ for (const set2 of import_node_fs3.default.readdirSync(sourceSets, { withFileTypes: true })) {
7144
+ const file = import_node_path3.default.join(sourceSets, set2.name, "AndroidManifest.xml");
7145
+ if (!set2.isDirectory() || set2.name === "main" || !import_node_fs3.default.existsSync(file)) continue;
7146
+ if (import_node_fs3.default.readFileSync(file, "utf8").includes("<activity")) return void 0;
7147
+ }
7148
+ const launcher = launchers[0];
7149
+ const enabled = launcher.attributes["android:enabled"];
7150
+ if (launchers.length !== 1 || launcher.name !== "activity" || enabled !== void 0 && enabled !== "true")
7151
+ return void 0;
7152
+ const namespace = readModuleNamespace(moduleRoot, manifest);
7153
+ const declared = launcher.attributes["android:name"];
7154
+ if (!declared) return void 0;
7155
+ const qualified = declared.startsWith(".") ? namespace && `${namespace}${declared}` : declared.includes(".") ? declared : namespace && `${namespace}.${declared}`;
7156
+ if (!qualified || qualified.includes("$")) return void 0;
7157
+ const relative3 = qualified.split(".").join("/");
7158
+ const files = import_node_fs3.default.readdirSync(sourceSets, { withFileTypes: true }).filter((set2) => set2.isDirectory()).flatMap(
7159
+ (set2) => ["java", "kotlin"].flatMap(
7160
+ (language) => ["kt", "java"].map(
7161
+ (extension) => import_node_path3.default.join(sourceSets, set2.name, language, `${relative3}.${extension}`)
7162
+ )
7163
+ )
7164
+ ).filter((file) => import_node_fs3.default.existsSync(file));
7165
+ if (files.length !== 1) return void 0;
7166
+ return readAndroidRootModuleFromActivitySource(
7167
+ import_node_fs3.default.readFileSync(files[0], "utf8"),
7168
+ qualified.slice(qualified.lastIndexOf(".") + 1)
7169
+ );
7170
+ }
7171
+ function readAndroidLauncherRootModuleName(projectRoot) {
7172
+ const androidRoot = import_node_path3.default.join(projectRoot, "android");
7173
+ if (!import_node_fs3.default.existsSync(androidRoot)) return void 0;
7174
+ const names = import_node_fs3.default.readdirSync(androidRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory()).flatMap((entry) => {
7175
+ const name2 = readModuleRootModuleName(import_node_path3.default.join(androidRoot, entry.name));
7176
+ return name2 === void 0 ? [] : [name2];
7177
+ });
7178
+ return names.length === 1 ? names[0] : void 0;
7179
+ }
7180
+
7181
+ // src/androidRootModuleContract.ts
7182
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
7183
+ init_bundleGlobalFooter();
7184
+ var FOOTER2 = "__peachAndroidRootModule";
7185
+ function readAndroidRootModuleName(value) {
7186
+ if (typeof value !== "string" || value.length === 0)
7187
+ throw new Error("invalid Android root module name");
7188
+ return value;
7189
+ }
7190
+ function insertAndroidRootModuleFooter(source, name2) {
7191
+ return insertBundleGlobalFooter(source, FOOTER2, readAndroidRootModuleName(name2));
7192
+ }
7193
+
6609
7194
  // src/dev-server-open.ts
6610
7195
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
6611
7196
  var import_node_crypto = require("node:crypto");
6612
- var import_node_fs3 = __toESM(require("node:fs"), 1);
7197
+ var import_node_fs4 = __toESM(require("node:fs"), 1);
6613
7198
  function tagRnxBundleForPlugin(bundleUrl, replacementOrigin, replacementToken, projectRoot, appName) {
6614
7199
  const absolute = /^[a-z][a-z\d+.-]*:\/\//i.test(bundleUrl);
6615
7200
  const url = new URL(bundleUrl, absolute ? void 0 : "http://peach.local");
@@ -6617,7 +7202,7 @@ function tagRnxBundleForPlugin(bundleUrl, replacementOrigin, replacementToken, p
6617
7202
  url.searchParams.set("rnxAppName", appName);
6618
7203
  url.searchParams.set(
6619
7204
  "rnxProjectId",
6620
- (0, import_node_crypto.createHash)("sha256").update(import_node_fs3.default.realpathSync(projectRoot)).digest("hex").slice(0, 32)
7205
+ (0, import_node_crypto.createHash)("sha256").update(import_node_fs4.default.realpathSync(projectRoot)).digest("hex").slice(0, 32)
6621
7206
  );
6622
7207
  }
6623
7208
  url.searchParams.set("rnxReplacementOrigin", replacementOrigin);
@@ -6636,8 +7221,9 @@ init_backend_origin();
6636
7221
  // src/packageVersionsContract.ts
6637
7222
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
6638
7223
  init_bundleGlobalFooter();
7224
+ var NATIVE_BUILD_OPTIONS_KEY = "@peach/native-build-options";
6639
7225
  var PACKAGE_VERSIONS_HEADER = "X-Peach-Package-Versions";
6640
- var FOOTER2 = "__peachPackageVersions";
7226
+ var FOOTER3 = "__peachPackageVersions";
6641
7227
  function readPackageVersions(value) {
6642
7228
  if (typeof value !== "object" || value === null || Array.isArray(value)) {
6643
7229
  throw new Error("invalid package versions");
@@ -6652,7 +7238,24 @@ function readPackageVersions(value) {
6652
7238
  return versions;
6653
7239
  }
6654
7240
  function insertPackageVersionsFooter(source, versions) {
6655
- return insertBundleGlobalFooter(source, FOOTER2, readPackageVersions(versions));
7241
+ return insertBundleGlobalFooter(source, FOOTER3, readPackageVersions(versions));
7242
+ }
7243
+ var WORKLETS_STATIC_FLAGS_KEY = "react-native-worklets/staticFlags.json";
7244
+ function isFlagRecord(value) {
7245
+ return typeof value === "object" && value !== null && !Array.isArray(value);
7246
+ }
7247
+ function resolveWorkletsStaticFlags(defaults, appManifest) {
7248
+ if (!isFlagRecord(defaults)) throw new Error("Worklets static flags are malformed");
7249
+ const worklets = isFlagRecord(appManifest) ? appManifest.worklets : void 0;
7250
+ const overrides = isFlagRecord(worklets) ? worklets.staticFeatureFlags : void 0;
7251
+ if (overrides !== void 0 && !isFlagRecord(overrides)) {
7252
+ throw new Error("Worklets static flag overrides are malformed");
7253
+ }
7254
+ const flags = {};
7255
+ for (const [name2, value] of Object.entries({ ...defaults, ...overrides })) {
7256
+ flags[name2] = String(value) === "true";
7257
+ }
7258
+ return JSON.stringify(flags);
6656
7259
  }
6657
7260
 
6658
7261
  // src/host/dev-server-package-versions.ts
@@ -6720,7 +7323,6 @@ var LAZY_STUB_PATTERNS = [
6720
7323
  "@sbaiahmed1/react-native-biometrics/types",
6721
7324
  "@sbaiahmed1/react-native-blur",
6722
7325
  "@shopify/checkout-sheet-kit",
6723
- "@shopify/react-native-skia",
6724
7326
  "@stream-io/video-react-native-sdk",
6725
7327
  "@stripe/stripe-identity-react-native",
6726
7328
  "@stripe/stripe-react-native",
@@ -6739,7 +7341,6 @@ var LAZY_STUB_PATTERNS = [
6739
7341
  "expo-in-app-updates",
6740
7342
  "expo-mesh-gradient",
6741
7343
  "expo-modules-core",
6742
- "expo-share-extension",
6743
7344
  "expo-superwall",
6744
7345
  "freerasp-react-native",
6745
7346
  "klaviyo-react-native-sdk",
@@ -6754,7 +7355,6 @@ var LAZY_STUB_PATTERNS = [
6754
7355
  "react-native-advanced-input-mask",
6755
7356
  "react-native-agora",
6756
7357
  "react-native-android-location-enabler",
6757
- "react-native-android-widget",
6758
7358
  "react-native-animateable-text",
6759
7359
  "react-native-app-clip",
6760
7360
  "react-native-appsflyer",
@@ -6831,7 +7431,6 @@ var LAZY_STUB_PATTERNS = [
6831
7431
  "react-native-share-menu",
6832
7432
  "react-native-shared-element",
6833
7433
  "react-native-simple-toast",
6834
- "react-native-skia",
6835
7434
  "react-native-spinkit",
6836
7435
  "react-native-ssl-public-key-pinning",
6837
7436
  "react-native-star-io10",
@@ -6895,7 +7494,6 @@ var LIGHT_NATIVE_PACKAGE_NAMES = [
6895
7494
  "@allboatsrise/expo-marketingcloudsdk",
6896
7495
  "@ammarahmed/react-native-eventsource",
6897
7496
  "@ammarahmed/react-native-share-extension",
6898
- "@ammarahmed/react-native-sodium",
6899
7497
  "@ammarahmed/react-native-upload",
6900
7498
  "@amplitude/analytics-react-native",
6901
7499
  "@amplitude/experiment-react-native-client",
@@ -7251,7 +7849,6 @@ var LIGHT_NATIVE_PACKAGE_NAMES = [
7251
7849
  "expo-ai-kit",
7252
7850
  "expo-app-blocker",
7253
7851
  "expo-audio-stream-pcm",
7254
- "expo-barcode-scanner",
7255
7852
  "expo-brownfield",
7256
7853
  "expo-check-installed-apps",
7257
7854
  "expo-esim",
@@ -7466,6 +8063,7 @@ var LIGHT_NATIVE_PACKAGE_NAMES = [
7466
8063
  "react-native-kochava-tracker",
7467
8064
  "react-native-launch-navigator",
7468
8065
  "react-native-layout-guides",
8066
+ "react-native-live-audio-stream",
7469
8067
  "react-native-local-resource",
7470
8068
  "react-native-marigold",
7471
8069
  "react-native-marketingcloudsdk",
@@ -8638,6 +9236,7 @@ var NATIVE_RUNTIME_PACKAGE_NAMES = [
8638
9236
  ...NATIVE_STUB_PACKAGE_NAMES,
8639
9237
  ...LIGHT_NATIVE_PACKAGE_NAMES,
8640
9238
  "@ammarahmed/react-native-background-fetch",
9239
+ "@ammarahmed/react-native-sodium",
8641
9240
  "@bsky.app/react-native-uitextview",
8642
9241
  "@bsky.app/video",
8643
9242
  "@datadog/mobile-react-native-webview",
@@ -9479,12 +10078,6 @@ var COMPAT_STUBS = {
9479
10078
  runtimeTier: "none",
9480
10079
  buildResolvers: ["vite"]
9481
10080
  },
9482
- expoShareExtension: {
9483
- specifier: "expo-share-extension",
9484
- stubFile: "noop-sdks-extra/expo-share-extension.ts",
9485
- runtimeTier: "none",
9486
- buildResolvers: ["vite"]
9487
- },
9488
10081
  expoHealthConnect: {
9489
10082
  specifier: "expo-health-connect",
9490
10083
  stubFile: "noop-sdks-extra/expo-health-connect.ts",
@@ -9517,6 +10110,120 @@ var COMPAT_STUBS = {
9517
10110
  }
9518
10111
  };
9519
10112
 
10113
+ // src/installed-native-build-options.ts
10114
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
10115
+ var import_node_fs5 = __toESM(require("node:fs"), 1);
10116
+ var import_node_path4 = __toESM(require("node:path"), 1);
10117
+ init_version_range();
10118
+ var RIVE_PACKAGE = "@rive-app/react-native";
10119
+ var RIVE_05 = [">=0.5.0 <0.6.0"];
10120
+ function missing(error) {
10121
+ return error instanceof Error && "code" in error && error.code === "ENOENT";
10122
+ }
10123
+ function answerSync(step) {
10124
+ try {
10125
+ if (step.type === "realpath") return import_node_fs5.default.realpathSync(step.path);
10126
+ if (step.type === "read") return import_node_fs5.default.readFileSync(step.path, "utf8");
10127
+ if (step.type === "isDirectory") return import_node_fs5.default.statSync(step.path).isDirectory();
10128
+ return import_node_fs5.default.readdirSync(step.path, { withFileTypes: true }).map((entry) => ({
10129
+ name: entry.name,
10130
+ directory: entry.isDirectory(),
10131
+ symbolicLink: entry.isSymbolicLink()
10132
+ }));
10133
+ } catch (error) {
10134
+ if (missing(error)) return null;
10135
+ throw error;
10136
+ }
10137
+ }
10138
+ async function answerAsync(step) {
10139
+ try {
10140
+ if (step.type === "realpath") return await import_node_fs5.default.promises.realpath(step.path);
10141
+ if (step.type === "read") return await import_node_fs5.default.promises.readFile(step.path, "utf8");
10142
+ if (step.type === "isDirectory")
10143
+ return (await import_node_fs5.default.promises.stat(step.path)).isDirectory();
10144
+ return (await import_node_fs5.default.promises.readdir(step.path, { withFileTypes: true })).map(
10145
+ (entry) => ({
10146
+ name: entry.name,
10147
+ directory: entry.isDirectory(),
10148
+ symbolicLink: entry.isSymbolicLink()
10149
+ })
10150
+ );
10151
+ } catch (error) {
10152
+ if (missing(error)) return null;
10153
+ throw error;
10154
+ }
10155
+ }
10156
+ function needsRiveOptions(versions) {
10157
+ const version = versions[RIVE_PACKAGE];
10158
+ return version !== void 0 && resolveCompatVersionRange(RIVE_05, version).status === "matched";
10159
+ }
10160
+ function unsupported(file, line) {
10161
+ throw new Error(
10162
+ `${file}:${line}: unsupported $UseRiveLegacy; use one column-0 literal assignment in ios/Podfile`
10163
+ );
10164
+ }
10165
+ function* rubyFiles(directory, seen, iosRoot = false) {
10166
+ const real = yield { type: "realpath", path: directory };
10167
+ if (real === null) return [];
10168
+ if (typeof real !== "string") throw new Error(`cannot inspect ${directory}`);
10169
+ if (seen.has(real)) return [];
10170
+ seen.add(real);
10171
+ const entries = yield { type: "directory", path: directory };
10172
+ if (entries === null) return [];
10173
+ if (!Array.isArray(entries)) throw new Error(`cannot inspect ${directory}`);
10174
+ const files = [];
10175
+ for (const entry of entries.sort((a, b) => a.name.localeCompare(b.name))) {
10176
+ if (iosRoot && (entry.name === "Pods" || entry.name === "build")) continue;
10177
+ const target = import_node_path4.default.join(directory, entry.name);
10178
+ let isDirectory2 = entry.directory;
10179
+ if (entry.symbolicLink)
10180
+ isDirectory2 = (yield { type: "isDirectory", path: target }) === true;
10181
+ if (isDirectory2) files.push(...yield* rubyFiles(target, seen));
10182
+ else if (entry.name.endsWith(".rb")) files.push(target);
10183
+ }
10184
+ return files;
10185
+ }
10186
+ function* nativeBuildOptionsWalk(projectRoot, versions, environment) {
10187
+ if (!needsRiveOptions(versions)) return {};
10188
+ if (environment.USE_RIVE_LEGACY === "1" || environment.USE_RIVE_LEGACY === "true")
10189
+ return { [RIVE_PACKAGE]: { USE_RIVE_LEGACY: true } };
10190
+ const ios = import_node_path4.default.join(projectRoot, "ios");
10191
+ const podfile = import_node_path4.default.join(ios, "Podfile");
10192
+ const files = [podfile, ...yield* rubyFiles(ios, /* @__PURE__ */ new Set(), true)];
10193
+ let value = false;
10194
+ let assigned = false;
10195
+ for (const file of files) {
10196
+ const source = yield { type: "read", path: file };
10197
+ if (source === null) continue;
10198
+ if (typeof source !== "string") throw new Error(`cannot inspect ${file}`);
10199
+ const lines = source.split(/\r?\n/);
10200
+ for (const [index, line] of lines.entries()) {
10201
+ const occurrences = [...line.matchAll(/\$UseRiveLegacy\b/g)];
10202
+ if (!occurrences.length) continue;
10203
+ const literal = /^\$UseRiveLegacy = (true|false)\s*(?:#.*)?$/.exec(line);
10204
+ if (file !== podfile || occurrences.length !== 1 || !literal || assigned)
10205
+ unsupported(file, index + 1);
10206
+ assigned = true;
10207
+ value = literal[1] === "true";
10208
+ }
10209
+ }
10210
+ return { [RIVE_PACKAGE]: { USE_RIVE_LEGACY: value } };
10211
+ }
10212
+ function readInstalledNativeBuildOptions(projectRoot, versions, environment = process.env) {
10213
+ const walk = nativeBuildOptionsWalk(projectRoot, versions, environment);
10214
+ for (let step = walk.next(); ; ) {
10215
+ if (step.done) return step.value;
10216
+ step = walk.next(answerSync(step.value));
10217
+ }
10218
+ }
10219
+ async function readInstalledNativeBuildOptionsAsync(projectRoot, versions, environment = process.env) {
10220
+ const walk = nativeBuildOptionsWalk(projectRoot, versions, environment);
10221
+ for (let step = walk.next(); ; ) {
10222
+ if (step.done) return step.value;
10223
+ step = walk.next(await answerAsync(step.value));
10224
+ }
10225
+ }
10226
+
9520
10227
  // src/stub-pattern-matcher.ts
9521
10228
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
9522
10229
  function extractPackageFromPath(modulePath) {
@@ -9559,7 +10266,7 @@ function parseManifest(source) {
9559
10266
  function isMissing(error) {
9560
10267
  return error instanceof Error && "code" in error && error.code === "ENOENT";
9561
10268
  }
9562
- function answerSync(step) {
10269
+ function answerSync2(step) {
9563
10270
  if (step.op === "exists") return import_fs.default.existsSync(step.path);
9564
10271
  if (step.op === "realpath") return import_fs.default.realpathSync(step.path);
9565
10272
  try {
@@ -9569,7 +10276,7 @@ function answerSync(step) {
9569
10276
  throw error;
9570
10277
  }
9571
10278
  }
9572
- async function answerAsync(step) {
10279
+ async function answerAsync2(step) {
9573
10280
  if (step.op === "exists")
9574
10281
  return import_fs.default.promises.access(step.path).then(
9575
10282
  () => true,
@@ -9586,13 +10293,15 @@ async function answerAsync(step) {
9586
10293
  function runSync(walk) {
9587
10294
  for (let step = walk.next(); ; ) {
9588
10295
  if (step.done) return step.value;
9589
- step = walk.next(answerSync(step.value));
10296
+ step = walk.next(answerSync2(step.value));
9590
10297
  }
9591
10298
  }
9592
- async function runAsync(walk) {
10299
+ async function runAsync(walk, inputs) {
9593
10300
  for (let step = walk.next(); ; ) {
9594
10301
  if (step.done) return step.value;
9595
- step = walk.next(await answerAsync(step.value));
10302
+ const target = step.value.path;
10303
+ if (!inputs.has(target)) inputs.set(target, await installFingerprint(target));
10304
+ step = walk.next(await answerAsync2(step.value));
9596
10305
  }
9597
10306
  }
9598
10307
  function createInstalledPackageReader() {
@@ -9631,6 +10340,15 @@ function* installedVersionsWalk(projectRoot, names) {
9631
10340
  const installed = yield* readInstalledPackage(projectRoot, name2);
9632
10341
  const version = installed && Reflect.get(installed.manifest, "version");
9633
10342
  if (typeof version === "string" && version.length > 0) versions[name2] = version;
10343
+ if (name2 === "react-native-worklets" && installed) {
10344
+ const defaults = yield* readManifest(
10345
+ import_path.default.join(installed.root, "src/featureFlags/staticFlags.json")
10346
+ );
10347
+ if (defaults) {
10348
+ const app = yield* readManifest(import_path.default.join(projectRoot, "package.json"));
10349
+ versions[WORKLETS_STATIC_FLAGS_KEY] = resolveWorkletsStaticFlags(defaults, app);
10350
+ }
10351
+ }
9634
10352
  }
9635
10353
  return versions;
9636
10354
  }
@@ -9640,12 +10358,17 @@ function readInstalledPackageVersions(projectRoot, modulePaths) {
9640
10358
  const name2 = extractPackageFromPath(modulePath.replaceAll(import_path.default.sep, "/"));
9641
10359
  if (name2) names.add(name2);
9642
10360
  }
9643
- return runSync(installedVersionsWalk(projectRoot, names));
10361
+ const versions = runSync(installedVersionsWalk(projectRoot, names));
10362
+ const options = readInstalledNativeBuildOptions(projectRoot, versions);
10363
+ if (Object.keys(options).length)
10364
+ versions[NATIVE_BUILD_OPTIONS_KEY] = JSON.stringify(options);
10365
+ return versions;
9644
10366
  }
9645
10367
  function* nativePackageVersionsWalk(projectRoot) {
9646
10368
  const appRoot = yield* realpath(projectRoot);
9647
10369
  const nativeNames = /* @__PURE__ */ new Set();
9648
10370
  for (const specifier of [
10371
+ "react",
9649
10372
  "react-native",
9650
10373
  ...NATIVE_RUNTIME_PACKAGE_NAMES,
9651
10374
  ...LAZY_STUB_PATTERNS,
@@ -9685,49 +10408,41 @@ function* nativePackageVersionsWalk(projectRoot) {
9685
10408
  }
9686
10409
  return yield* installedVersionsWalk(projectRoot, needed);
9687
10410
  }
9688
- var INSTALL_RECORD_FILES = [
9689
- "package.json",
9690
- "bun.lock",
9691
- "bun.lockb",
9692
- "package-lock.json",
9693
- "yarn.lock",
9694
- "pnpm-lock.yaml",
9695
- "node_modules",
9696
- "node_modules/.package-lock.json",
9697
- "node_modules/.yarn-integrity",
9698
- "node_modules/.modules.yaml"
9699
- ];
9700
- async function installFingerprint(projectRoot) {
9701
- const appRoot = await import_fs.default.promises.realpath(projectRoot);
9702
- const targets = [];
9703
- for (let dir = appRoot; ; ) {
9704
- if (import_path.default.basename(dir) !== "node_modules")
9705
- for (const file of INSTALL_RECORD_FILES) targets.push(import_path.default.join(dir, file));
9706
- const parent = import_path.default.dirname(dir);
9707
- if (parent === dir) break;
9708
- dir = parent;
9709
- }
9710
- const stats = await Promise.all(
9711
- targets.map(
9712
- (target) => import_fs.default.promises.stat(target).then(
9713
- (stat) => `${stat.ino}:${stat.size}:${stat.mtimeMs}`,
9714
- () => ""
9715
- )
9716
- )
10411
+ async function installFingerprint(target) {
10412
+ return import_fs.default.promises.stat(target).then(
10413
+ (stat) => `${stat.dev}:${stat.ino}:${stat.size}:${stat.mtimeMs}:${stat.ctimeMs}`,
10414
+ () => ""
9717
10415
  );
9718
- return `${appRoot}
9719
- ${stats.join("\n")}`;
9720
10416
  }
9721
10417
  var scans = /* @__PURE__ */ new Map();
9722
10418
  async function readInstalledNativePackageVersionsAsync(projectRoot) {
9723
- const fingerprint = await installFingerprint(projectRoot);
9724
10419
  const cached = scans.get(projectRoot);
9725
- if (cached?.fingerprint === fingerprint) return cached.versions;
9726
- const versions = runAsync(nativePackageVersionsWalk(projectRoot));
9727
- scans.set(projectRoot, { fingerprint, versions });
9728
- versions.catch(() => {
9729
- if (scans.get(projectRoot)?.versions === versions) scans.delete(projectRoot);
9730
- });
10420
+ let scan;
10421
+ if (cached) {
10422
+ await cached.versions;
10423
+ const unchanged = await Promise.all(
10424
+ [...cached.inputs].map(
10425
+ async ([target, fingerprint]) => await installFingerprint(target) === fingerprint
10426
+ )
10427
+ );
10428
+ if (unchanged.every(Boolean)) scan = cached.versions;
10429
+ }
10430
+ if (!scan) {
10431
+ const current = scans.get(projectRoot);
10432
+ if (current && current !== cached) scan = current.versions;
10433
+ else {
10434
+ const inputs = /* @__PURE__ */ new Map();
10435
+ scan = runAsync(nativePackageVersionsWalk(projectRoot), inputs);
10436
+ scans.set(projectRoot, { inputs, versions: scan });
10437
+ scan.catch(() => {
10438
+ if (scans.get(projectRoot)?.versions === scan) scans.delete(projectRoot);
10439
+ });
10440
+ }
10441
+ }
10442
+ const versions = { ...await scan };
10443
+ const options = await readInstalledNativeBuildOptionsAsync(projectRoot, versions);
10444
+ if (Object.keys(options).length)
10445
+ versions[NATIVE_BUILD_OPTIONS_KEY] = JSON.stringify(options);
9731
10446
  return versions;
9732
10447
  }
9733
10448
 
@@ -9738,9 +10453,9 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
9738
10453
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
9739
10454
  var import_child_process = require("child_process");
9740
10455
  var import_promises = require("fs/promises");
9741
- var import_node_fs4 = require("node:fs");
10456
+ var import_node_fs6 = require("node:fs");
9742
10457
  var import_node_os = require("node:os");
9743
- var import_node_path3 = require("node:path");
10458
+ var import_node_path5 = require("node:path");
9744
10459
  init_backend_origin();
9745
10460
  init_config();
9746
10461
 
@@ -9766,7 +10481,93 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
9766
10481
  init_backend_origin();
9767
10482
 
9768
10483
  // src/dev-bundle-resolution.ts
10484
+ function shouldProxyLoopbackProbe(targetUrl, pageOrigin) {
10485
+ try {
10486
+ const target = new URL(targetUrl);
10487
+ const page = new URL(pageOrigin);
10488
+ return isLoopbackHost(target.hostname) && isLoopbackHost(page.hostname) && target.origin !== page.origin;
10489
+ } catch {
10490
+ return false;
10491
+ }
10492
+ }
10493
+ async function fetchDevProbe(targetUrl, pageOrigin, init) {
10494
+ const requestInit = {
10495
+ ...init,
10496
+ cache: init?.cache ?? "no-store"
10497
+ };
10498
+ if (!pageOrigin || !shouldProxyLoopbackProbe(targetUrl, pageOrigin)) {
10499
+ return fetch(targetUrl, requestInit);
10500
+ }
10501
+ return fetch(
10502
+ `${pageOrigin}/__fetch-proxy?url=${encodeURIComponent(targetUrl)}`,
10503
+ requestInit
10504
+ );
10505
+ }
9769
10506
  var MANIFEST_PROBE_TIMEOUT_MS = 3e4;
10507
+ var manifestRequests = /* @__PURE__ */ new Map();
10508
+ async function startDevManifestRequest(normalizedBaseUrl, pageOrigin, signal) {
10509
+ const init = { headers: { "expo-platform": "ios" }, signal };
10510
+ const res = pageOrigin ? await fetchDevProbe(`${normalizedBaseUrl}/`, pageOrigin, init) : await (await Promise.resolve().then(() => (init_node_http_fetch(), node_http_fetch_exports))).nodeHttpFetch(`${normalizedBaseUrl}/`, init);
10511
+ const body = await res.arrayBuffer();
10512
+ return new Response(body.byteLength ? body : null, {
10513
+ status: res.status,
10514
+ headers: res.headers
10515
+ });
10516
+ }
10517
+ async function fetchDevManifest(baseUrl, pageOrigin, options = {}) {
10518
+ options.signal?.throwIfAborted();
10519
+ const normalizedBaseUrl = baseUrl.replace(/\/+$/, "");
10520
+ let request = manifestRequests.get(normalizedBaseUrl);
10521
+ if (!request) {
10522
+ const controller = new AbortController();
10523
+ const promise = startDevManifestRequest(
10524
+ normalizedBaseUrl,
10525
+ pageOrigin,
10526
+ controller.signal
10527
+ ).finally(() => {
10528
+ if (manifestRequests.get(normalizedBaseUrl)?.controller === controller)
10529
+ manifestRequests.delete(normalizedBaseUrl);
10530
+ });
10531
+ request = { promise, controller, clients: 0 };
10532
+ manifestRequests.set(normalizedBaseUrl, request);
10533
+ }
10534
+ const current = request;
10535
+ current.clients++;
10536
+ const waitMs = options.waitMs === void 0 ? MANIFEST_PROBE_TIMEOUT_MS : options.waitMs;
10537
+ let deadline;
10538
+ let onAbort;
10539
+ try {
10540
+ const stopped = new Promise((_, reject) => {
10541
+ onAbort = () => {
10542
+ const reason = options.signal?.reason;
10543
+ reject(
10544
+ reason instanceof Error ? reason : new Error("Metro manifest request canceled", { cause: reason })
10545
+ );
10546
+ };
10547
+ options.signal?.addEventListener("abort", onAbort, { once: true });
10548
+ if (options.signal?.aborted) onAbort();
10549
+ if (waitMs !== null)
10550
+ deadline = setTimeout(
10551
+ () => reject(
10552
+ new Error(
10553
+ `Metro manifest request timed out after ${waitMs / 1e3}s: ${normalizedBaseUrl}/`
10554
+ )
10555
+ ),
10556
+ waitMs
10557
+ );
10558
+ });
10559
+ return (await Promise.race([current.promise, stopped])).clone();
10560
+ } finally {
10561
+ clearTimeout(deadline);
10562
+ if (onAbort) options.signal?.removeEventListener("abort", onAbort);
10563
+ current.clients--;
10564
+ if (options.signal?.aborted && current.clients === 0) {
10565
+ if (manifestRequests.get(normalizedBaseUrl) === current)
10566
+ manifestRequests.delete(normalizedBaseUrl);
10567
+ current.controller.abort(options.signal.reason);
10568
+ }
10569
+ }
10570
+ }
9770
10571
 
9771
10572
  // src/kotlinDiscoveryContract.ts
9772
10573
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
@@ -9792,8 +10593,8 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
9792
10593
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
9793
10594
 
9794
10595
  // scripts/dev-server-scanner.ts
9795
- var LISTENER_LOCK_PATH = (0, import_node_path3.join)((0, import_node_os.tmpdir)(), "peach-listener-scan.lock");
9796
- var LISTENER_RESULT_PATH = (0, import_node_path3.join)((0, import_node_os.tmpdir)(), "peach-listener-scan.result");
10596
+ var LISTENER_LOCK_PATH = (0, import_node_path5.join)((0, import_node_os.tmpdir)(), "peach-listener-scan.lock");
10597
+ var LISTENER_RESULT_PATH = (0, import_node_path5.join)((0, import_node_os.tmpdir)(), "peach-listener-scan.result");
9797
10598
  var LISTENER_LOCK_STALE_MS = 25e3;
9798
10599
  var LISTENER_LOCK_WAIT_MS = 8e3;
9799
10600
  function sleep(ms) {
@@ -9811,8 +10612,8 @@ function pidIsAlive(pid) {
9811
10612
  }
9812
10613
  function readLockOwner() {
9813
10614
  try {
9814
- const raw = (0, import_node_fs4.readFileSync)(LISTENER_LOCK_PATH, "utf8");
9815
- const mtimeMs = (0, import_node_fs4.statSync)(LISTENER_LOCK_PATH).mtimeMs;
10615
+ const raw = (0, import_node_fs6.readFileSync)(LISTENER_LOCK_PATH, "utf8");
10616
+ const mtimeMs = (0, import_node_fs6.statSync)(LISTENER_LOCK_PATH).mtimeMs;
9816
10617
  const pid = Number(raw.split("-")[0]);
9817
10618
  return { raw, pid: Number.isInteger(pid) ? pid : -1, mtimeMs };
9818
10619
  } catch {
@@ -9825,15 +10626,15 @@ function lockIsAbandoned(owner) {
9825
10626
  }
9826
10627
  function clearLock(raw) {
9827
10628
  try {
9828
- if ((0, import_node_fs4.readFileSync)(LISTENER_LOCK_PATH, "utf8") !== raw) return;
9829
- (0, import_node_fs4.unlinkSync)(LISTENER_LOCK_PATH);
10629
+ if ((0, import_node_fs6.readFileSync)(LISTENER_LOCK_PATH, "utf8") !== raw) return;
10630
+ (0, import_node_fs6.unlinkSync)(LISTENER_LOCK_PATH);
9830
10631
  } catch {
9831
10632
  }
9832
10633
  }
9833
10634
  function readResult() {
9834
10635
  try {
9835
10636
  const parsed = JSON.parse(
9836
- (0, import_node_fs4.readFileSync)(LISTENER_RESULT_PATH, "utf8")
10637
+ (0, import_node_fs6.readFileSync)(LISTENER_RESULT_PATH, "utf8")
9837
10638
  );
9838
10639
  if (!parsed || typeof parsed.token !== "string" || typeof parsed.key !== "string")
9839
10640
  return null;
@@ -9844,8 +10645,8 @@ function readResult() {
9844
10645
  }
9845
10646
  function publishResult(payload) {
9846
10647
  const tmp = `${LISTENER_RESULT_PATH}.${process.pid}.tmp`;
9847
- (0, import_node_fs4.writeFileSync)(tmp, JSON.stringify(payload));
9848
- (0, import_node_fs4.renameSync)(tmp, LISTENER_RESULT_PATH);
10648
+ (0, import_node_fs6.writeFileSync)(tmp, JSON.stringify(payload));
10649
+ (0, import_node_fs6.renameSync)(tmp, LISTENER_RESULT_PATH);
9849
10650
  }
9850
10651
  function throwPublished(payload) {
9851
10652
  throw Object.assign(new Error(payload.message || "listener scan failed"), {
@@ -9888,7 +10689,7 @@ async function withListenerLock(key, body) {
9888
10689
  for (; ; ) {
9889
10690
  let fd = null;
9890
10691
  try {
9891
- fd = (0, import_node_fs4.openSync)(LISTENER_LOCK_PATH, "wx");
10692
+ fd = (0, import_node_fs6.openSync)(LISTENER_LOCK_PATH, "wx");
9892
10693
  } catch (error) {
9893
10694
  const code = error instanceof Error && "code" in error ? error.code : "";
9894
10695
  if (code !== "EEXIST") throw error;
@@ -9897,7 +10698,7 @@ async function withListenerLock(key, body) {
9897
10698
  if (owner) clearLock(owner.raw);
9898
10699
  else {
9899
10700
  try {
9900
- (0, import_node_fs4.unlinkSync)(LISTENER_LOCK_PATH);
10701
+ (0, import_node_fs6.unlinkSync)(LISTENER_LOCK_PATH);
9901
10702
  } catch {
9902
10703
  }
9903
10704
  }
@@ -9913,7 +10714,7 @@ async function withListenerLock(key, body) {
9913
10714
  }
9914
10715
  if (fd === null) continue;
9915
10716
  try {
9916
- (0, import_node_fs4.writeSync)(fd, token);
10717
+ (0, import_node_fs6.writeSync)(fd, token);
9917
10718
  try {
9918
10719
  const value = await body();
9919
10720
  publishResult({ token, key, ok: true, value });
@@ -9930,7 +10731,7 @@ async function withListenerLock(key, body) {
9930
10731
  }
9931
10732
  } finally {
9932
10733
  try {
9933
- (0, import_node_fs4.closeSync)(fd);
10734
+ (0, import_node_fs6.closeSync)(fd);
9934
10735
  } catch {
9935
10736
  }
9936
10737
  clearLock(token);
@@ -10233,38 +11034,38 @@ function resolveProcessCwd(pid) {
10233
11034
 
10234
11035
  // src/metro-project-root.ts
10235
11036
  init_backend_origin();
10236
- async function resolveMetroProjectRoot(bundleUrl) {
11037
+ async function resolveMetroProjectRoot(bundleUrl, manifestProjectRoot, options = {}) {
10237
11038
  const origin = loopbackOriginOf(bundleUrl);
10238
11039
  if (!origin) return null;
10239
- const controller = new AbortController();
10240
- const timer = setTimeout(() => controller.abort(), MANIFEST_PROBE_TIMEOUT_MS);
11040
+ options.signal?.throwIfAborted();
11041
+ if (manifestProjectRoot) return manifestProjectRoot;
11042
+ const waitMs = options.waitMs === void 0 ? MANIFEST_PROBE_TIMEOUT_MS : options.waitMs;
11043
+ const deadline = waitMs === null ? void 0 : AbortSignal.timeout(waitMs);
11044
+ const signal = deadline ? options.signal ? AbortSignal.any([options.signal, deadline]) : deadline : options.signal;
11045
+ const { nodeHttpFetch: nodeHttpFetch2 } = await Promise.resolve().then(() => (init_node_http_fetch(), node_http_fetch_exports));
11046
+ const status = await nodeHttpFetch2(`${origin}/status`, { signal });
11047
+ const statusBody = await status.text();
11048
+ const advertisedRoot = status.headers.get("X-React-Native-Project-Root");
11049
+ if (status.ok && advertisedRoot) return decodeURI(advertisedRoot);
11050
+ if (manifestProjectRoot === null) return null;
11051
+ const metroRunning = status.ok && statusBody.trim() === "packager-status:running";
11052
+ const res = await fetchDevManifest(origin, void 0, { waitMs: null, signal });
10241
11053
  let servedManifest = false;
10242
- let metroRunning = false;
10243
- try {
10244
- const status = await fetch(`${origin}/status`, { signal: controller.signal });
10245
- const advertisedRoot = status.headers.get("X-React-Native-Project-Root");
10246
- if (status.ok && advertisedRoot) return decodeURI(advertisedRoot);
10247
- metroRunning = status.ok && (await status.text()).trim() === "packager-status:running";
10248
- const res = await fetch(`${origin}/`, {
10249
- headers: { "expo-platform": "ios", Accept: "application/json" },
10250
- signal: controller.signal
10251
- });
10252
- if (res.ok) {
10253
- const manifest = parseExpoManifestBody(await res.text());
11054
+ if (res.ok) {
11055
+ let manifest;
11056
+ try {
11057
+ manifest = parseExpoManifestBody(await res.text());
10254
11058
  servedManifest = true;
10255
- let root = manifest;
10256
- for (const key of ["extra", "expoClient", "_internal", "projectRoot"]) {
10257
- root = typeof root === "object" && root !== null ? Reflect.get(root, key) : void 0;
10258
- }
10259
- if (typeof root === "string" && root.length > 0) return root;
11059
+ } catch (error) {
11060
+ if (res.headers.get("content-type")?.includes("json")) throw error;
10260
11061
  }
10261
- } catch {
10262
- if (controller.signal.aborted)
10263
- throw new Error(
10264
- `Metro project root request timed out after ${MANIFEST_PROBE_TIMEOUT_MS / 1e3}s: ${origin}. Wait for the dev server to finish starting or pass --project-root.`
10265
- );
10266
- } finally {
10267
- clearTimeout(timer);
11062
+ let root = manifest;
11063
+ for (const key of ["extra", "expoClient", "_internal", "projectRoot"]) {
11064
+ root = typeof root === "object" && root !== null ? Reflect.get(root, key) : void 0;
11065
+ }
11066
+ if (typeof root === "string" && root.length > 0) return root;
11067
+ } else if (res.status !== 404 && res.status !== 405) {
11068
+ throw new Error(`Metro project root request failed: HTTP ${res.status} at ${origin}/`);
10268
11069
  }
10269
11070
  if (servedManifest || !metroRunning) return null;
10270
11071
  const port = Number(new URL(origin).port);
@@ -10421,6 +11222,85 @@ for (const pair of process.env.PEACH_LOOPBACK_PORTS?.split(",").filter(Boolean)
10421
11222
  function projectLoopbackPort(hostname, port) {
10422
11223
  return isLoopbackHost(hostname) ? LOOPBACK_PORTS.get(port) ?? port : port;
10423
11224
  }
11225
+ function projectLoopbackUrl(value) {
11226
+ if (LOOPBACK_PORTS.size === 0) return value;
11227
+ const url = new URL(value);
11228
+ const port = Number(
11229
+ url.port || (url.protocol === "https:" || url.protocol === "wss:" ? 443 : 80)
11230
+ );
11231
+ const projected = projectLoopbackPort(url.hostname, port);
11232
+ if (projected === port) return value;
11233
+ url.port = String(projected);
11234
+ return url.href;
11235
+ }
11236
+
11237
+ // src/host/network-policy.ts
11238
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
11239
+ var import_node_path6 = require("node:path");
11240
+ var import_node_url = require("node:url");
11241
+ var NETWORK_POLICY_TIMEOUT_MS = 1e4;
11242
+ var NetworkPolicyDeniedError = class extends Error {
11243
+ code = "EPOLICY";
11244
+ constructor(what) {
11245
+ super(`network policy denied ${what}`);
11246
+ }
11247
+ };
11248
+ function describeEvent(event) {
11249
+ switch (event.kind) {
11250
+ case "http":
11251
+ return `${event.method} ${new URL(event.url).origin}`;
11252
+ case "websocket":
11253
+ return `websocket ${new URL(event.url).origin}`;
11254
+ case "websocket-frame":
11255
+ return `websocket frame opcode ${event.opcode} (${event.data.byteLength} bytes) to ${new URL(event.url).origin}`;
11256
+ case "tcp":
11257
+ return `tcp ${event.host}:${event.port}`;
11258
+ case "tunnel":
11259
+ return `tunnel ${event.host}:${event.port}`;
11260
+ }
11261
+ }
11262
+ function createNetworkAuthorizer(policy) {
11263
+ if (policy === null) return async () => true;
11264
+ if (policy instanceof Promise) policy.catch(() => {
11265
+ });
11266
+ return async (event) => {
11267
+ let allowed = false;
11268
+ let timer;
11269
+ try {
11270
+ const decide = await policy;
11271
+ allowed = await Promise.race([
11272
+ decide(event),
11273
+ new Promise((_, reject) => {
11274
+ timer = setTimeout(
11275
+ () => reject(new Error("network policy timed out")),
11276
+ NETWORK_POLICY_TIMEOUT_MS
11277
+ );
11278
+ })
11279
+ ]) === true;
11280
+ } catch {
11281
+ allowed = false;
11282
+ } finally {
11283
+ clearTimeout(timer);
11284
+ }
11285
+ if (!allowed) console.error(`peach: network policy denied ${describeEvent(event)}`);
11286
+ return allowed;
11287
+ };
11288
+ }
11289
+ async function loadNetworkPolicy(file) {
11290
+ if (!(0, import_node_path6.isAbsolute)(file)) {
11291
+ throw new Error(`PEACH_NETWORK_POLICY must be an absolute path: ${file}`);
11292
+ }
11293
+ const loaded3 = await import((0, import_node_url.pathToFileURL)(file).href);
11294
+ const decide = Reflect.get(Object(loaded3), "default");
11295
+ if (typeof decide !== "function") {
11296
+ throw new Error(`${file} must default-export a network policy function`);
11297
+ }
11298
+ return (event) => decide(event);
11299
+ }
11300
+ var policyFile = process.env.PEACH_NETWORK_POLICY || null;
11301
+ var authorizeNetwork = createNetworkAuthorizer(
11302
+ policyFile === null ? null : loadNetworkPolicy(policyFile)
11303
+ );
10424
11304
 
10425
11305
  // src/host/rolldown-bundle-forward.ts
10426
11306
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
@@ -10701,6 +11581,14 @@ async function proxyUpstream(req, res, upstreamUrl, reportFailure, route) {
10701
11581
  delete targetHeaders["transfer-encoding"];
10702
11582
  targetHeaders["content-length"] = String(nextBody.byteLength);
10703
11583
  }
11584
+ const allowed = await authorizeNetwork({
11585
+ kind: "http",
11586
+ method,
11587
+ url: projectLoopbackUrl(targetUrl.href),
11588
+ headers: targetHeaders,
11589
+ body: nextBody
11590
+ });
11591
+ if (!allowed) throw new NetworkPolicyDeniedError(`${method} ${targetUrl.origin}`);
10704
11592
  const port = projectLoopbackPort(
10705
11593
  targetUrl.hostname,
10706
11594
  Number(targetUrl.port || (targetUrl.protocol === "https:" ? 443 : 80))
@@ -10816,6 +11704,10 @@ async function proxyUpstream(req, res, upstreamUrl, reportFailure, route) {
10816
11704
  if (!res.headersSent && reportFailure) {
10817
11705
  const code = err?.code;
10818
11706
  res.statusCode = 502;
11707
+ res.removeHeader("content-type");
11708
+ res.removeHeader("content-encoding");
11709
+ res.removeHeader("transfer-encoding");
11710
+ res.setHeader("content-length", "0");
10819
11711
  res.setHeader(
10820
11712
  FETCH_PROXY_FAILURE_HEADER,
10821
11713
  typeof code === "string" ? code : "unknown"
@@ -10916,64 +11808,6 @@ function compileAndroidStringValue(text2, where) {
10916
11808
  return out.map((part) => part.char).join("");
10917
11809
  }
10918
11810
 
10919
- // src/android-xml.ts
10920
- init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
10921
- var ENTITIES = {
10922
- quot: '"',
10923
- apos: "'",
10924
- amp: "&",
10925
- lt: "<",
10926
- gt: ">"
10927
- };
10928
- var TAG = /<(\/?)([\w:.-]+)((?:\s+[\w:.-]+\s*=\s*(?:"[^"]*"|'[^']*'))*)\s*(\/?)>/y;
10929
- var ATTRIBUTE = /([\w:.-]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g;
10930
- function decodeXmlText(value, file) {
10931
- return value.replace(/&(#x[0-9a-fA-F]+|#\d+|\w+);/g, (_match, entity) => {
10932
- if (entity.startsWith("#x"))
10933
- return String.fromCodePoint(Number.parseInt(entity.slice(2), 16));
10934
- if (entity.startsWith("#"))
10935
- return String.fromCodePoint(Number.parseInt(entity.slice(1), 10));
10936
- const character = ENTITIES[entity];
10937
- if (character === void 0) throw new Error(`${file}: unknown entity &${entity};`);
10938
- return character;
10939
- });
10940
- }
10941
- function parseXml(text2, file) {
10942
- const root = { name: "#document", attributes: {}, children: [], text: "" };
10943
- const stack = [root];
10944
- const body = text2.replace(/<!--[\s\S]*?-->/g, "").replace(/<\?[\s\S]*?\?>/g, "");
10945
- let index = 0;
10946
- while (index < body.length) {
10947
- const open = body.indexOf("<", index);
10948
- const content = body.slice(index, open === -1 ? body.length : open);
10949
- const parent = stack.at(-1);
10950
- if (parent && content.trim()) parent.text += decodeXmlText(content, file);
10951
- if (open === -1) break;
10952
- TAG.lastIndex = open;
10953
- const match = TAG.exec(body);
10954
- if (!match)
10955
- throw new Error(`${file}: unreadable markup at ${body.slice(open, open + 40)}`);
10956
- index = TAG.lastIndex;
10957
- const [, closing, name2, rawAttributes, selfClosing] = match;
10958
- if (!name2) continue;
10959
- if (closing) {
10960
- const element2 = stack.pop();
10961
- if (element2?.name !== name2)
10962
- throw new Error(`${file}: </${name2}> closes <${element2?.name}>`);
10963
- continue;
10964
- }
10965
- const attributes = {};
10966
- for (const [, key, double, single] of (rawAttributes ?? "").matchAll(ATTRIBUTE))
10967
- if (key) attributes[key] = decodeXmlText(double ?? single ?? "", file);
10968
- const element = { name: name2, attributes, children: [], text: "" };
10969
- stack.at(-1)?.children.push(element);
10970
- if (!selfClosing) stack.push(element);
10971
- }
10972
- if (stack.length !== 1)
10973
- throw new Error(`${file}: <${stack.at(-1)?.name}> is never closed`);
10974
- return root;
10975
- }
10976
-
10977
11811
  // src/android-app-identity.ts
10978
11812
  function nativeAppIdentityFromAndroidManifest(source, file, files = {}) {
10979
11813
  const document = parseXml(source, file);
@@ -11465,10 +12299,10 @@ function appTargetReleaseSettings(pbxproj, targetName, infoPlistRelativePath) {
11465
12299
  var APP_DELEGATE_PATH_RE = /(?:^|\/)ios\/([^/]+)\/AppDelegate\.(?:swift|mm|m)$/;
11466
12300
  function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri) {
11467
12301
  const pbxprojPath = Object.keys(files).find(
11468
- (path17) => /(?:^|\/)ios\/[^/]+\.xcodeproj\/project\.pbxproj$/.test(path17)
12302
+ (path21) => /(?:^|\/)ios\/[^/]+\.xcodeproj\/project\.pbxproj$/.test(path21)
11469
12303
  ) ?? Object.keys(files).find(
11470
- (path17) => /(?:^|\/)[^/]+\.xcodeproj\/project\.pbxproj$/.test(path17)
11471
- ) ?? Object.keys(files).find((path17) => /(?:^|\/)project\.pbxproj$/.test(path17));
12304
+ (path21) => /(?:^|\/)[^/]+\.xcodeproj\/project\.pbxproj$/.test(path21)
12305
+ ) ?? Object.keys(files).find((path21) => /(?:^|\/)project\.pbxproj$/.test(path21));
11472
12306
  if (!pbxprojPath) return null;
11473
12307
  const pbxproj = files[pbxprojPath];
11474
12308
  let objects = {};
@@ -11510,7 +12344,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
11510
12344
  } else if (applicationTargetNames.size === 1) {
11511
12345
  targetName = [...applicationTargetNames][0];
11512
12346
  } else if (applicationTargetNames.size > 1) {
11513
- const delegateTargets = Object.keys(files).filter((path17) => !path17.includes("/Pods/")).map((path17) => path17.match(APP_DELEGATE_PATH_RE)?.[1]).filter(
12347
+ const delegateTargets = Object.keys(files).filter((path21) => !path21.includes("/Pods/")).map((path21) => path21.match(APP_DELEGATE_PATH_RE)?.[1]).filter(
11514
12348
  (name2) => typeof name2 === "string" && applicationTargetNames.has(name2)
11515
12349
  );
11516
12350
  if (delegateTargets.length === 1) {
@@ -11734,7 +12568,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
11734
12568
  if (Object.hasOwn(files, file)) return [file];
11735
12569
  const prefix2 = file === "" ? "" : `${file.replace(/\/$/, "")}/`;
11736
12570
  return paths.filter(
11737
- (path17) => path17.startsWith(prefix2) && !/(?:^|\/)\./.test(path17.slice(prefix2.length))
12571
+ (path21) => path21.startsWith(prefix2) && !/(?:^|\/)\./.test(path21.slice(prefix2.length))
11738
12572
  );
11739
12573
  },
11740
12574
  join6,
@@ -11745,7 +12579,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
11745
12579
  }
11746
12580
  const rootModuleName = readRootModuleName(
11747
12581
  Object.entries(files).filter(
11748
- ([path17]) => !path17.includes("/Pods/") && (/(?:^|\/)ios\/AppDelegate\.(?:swift|mm|m)$/.test(path17) || path17.match(APP_DELEGATE_PATH_RE)?.[1] === targetName)
12582
+ ([path21]) => !path21.includes("/Pods/") && (/(?:^|\/)ios\/AppDelegate\.(?:swift|mm|m)$/.test(path21) || path21.match(APP_DELEGATE_PATH_RE)?.[1] === targetName)
11749
12583
  ).map(([, source]) => source)
11750
12584
  );
11751
12585
  return {
@@ -11831,17 +12665,17 @@ function extractNativeAppIdentityFromFiles(files, platform, parseInfoPlist, iosT
11831
12665
 
11832
12666
  // src/native-app-identity-project.ts
11833
12667
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
11834
- var import_node_fs9 = __toESM(require("node:fs"), 1);
12668
+ var import_node_fs13 = __toESM(require("node:fs"), 1);
11835
12669
  var import_node_module3 = require("node:module");
11836
- var import_node_path9 = __toESM(require("node:path"), 1);
12670
+ var import_node_path14 = __toESM(require("node:path"), 1);
11837
12671
  init_is_record();
11838
12672
 
11839
12673
  // src/xcode-project.ts
11840
12674
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
11841
- var import_node_child_process2 = require("node:child_process");
12675
+ var import_node_child_process3 = require("node:child_process");
11842
12676
  var import_node_crypto3 = require("node:crypto");
11843
- var import_node_fs8 = __toESM(require("node:fs"), 1);
11844
- var import_node_path8 = __toESM(require("node:path"), 1);
12677
+ var import_node_fs12 = __toESM(require("node:fs"), 1);
12678
+ var import_node_path13 = __toESM(require("node:path"), 1);
11845
12679
  var import_plist3 = __toESM(require("plist"), 1);
11846
12680
 
11847
12681
  // src/swift-coverage/xcode-assets.ts
@@ -11862,7 +12696,7 @@ var assetSymbolSettingKeys = [
11862
12696
  "ASSETCATALOG_COMPILER_LIGHTWEIGHT_ASSET_RUNTIME_MODE",
11863
12697
  "ASSETCATALOG_OTHER_FLAGS"
11864
12698
  ];
11865
- var unprovenAssetSettings = assetSymbolSettingKeys.slice(4);
12699
+ var unprovenAssetSettings = assetSymbolSettingKeys.slice(4).filter((key) => key !== "ASSETCATALOG_OTHER_FLAGS");
11866
12700
 
11867
12701
  // src/swift-package.ts
11868
12702
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
@@ -11881,6 +12715,8 @@ function isSwiftNativeTranslationUnit(file) {
11881
12715
  }
11882
12716
  var SWIFT_NATIVE_SOURCE_EXTENSIONS = [
11883
12717
  ...SWIFT_NATIVE_TRANSLATION_UNIT_EXTENSIONS,
12718
+ ".s",
12719
+ ".S",
11884
12720
  ".h",
11885
12721
  ".hh",
11886
12722
  ".hpp",
@@ -11890,17 +12726,417 @@ var SWIFT_NATIVE_SOURCE_EXTENSIONS = [
11890
12726
  ".inl",
11891
12727
  ".modulemap"
11892
12728
  ];
12729
+ function moduleMapTokens(text2) {
12730
+ return (text2.match(/\/\*[\s\S]*?\*\/|\/\/[^\n]*|"[^"]*"|[\w.*]+|[{}\[\]]/g) ?? []).filter((token) => !token.startsWith("/"));
12731
+ }
11893
12732
  function moduleMapName(text2) {
11894
- return /(?:^|\s)module\s+(\w+)/.exec(text2)?.[1];
12733
+ const tokens = moduleMapTokens(text2);
12734
+ const index = tokens.findIndex(
12735
+ (token, i) => token === "module" && tokens[i - 1] !== "extern"
12736
+ );
12737
+ return index < 0 ? void 0 : tokens[index + 1];
12738
+ }
12739
+ function swiftPackageIdentity(url) {
12740
+ const path21 = url.endsWith("/") ? url.slice(0, -1) : url;
12741
+ return (path21.split("/").pop() ?? path21).replace(/\.git$/, "").toLowerCase();
12742
+ }
12743
+
12744
+ // src/swift-package-manifest.ts
12745
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
12746
+ var import_node_child_process2 = require("node:child_process");
12747
+ var import_node_fs11 = __toESM(require("node:fs"), 1);
12748
+ var import_node_os4 = __toESM(require("node:os"), 1);
12749
+ var import_node_path11 = __toESM(require("node:path"), 1);
12750
+ init_home_paths();
12751
+
12752
+ // src/swift-distribution.lock.json
12753
+ var swift_distribution_lock_default = {
12754
+ id: "d2c6d715951f5e98",
12755
+ release: "swift-6.4.0-RELEASE-custom-ecd2ad9d3fe59329",
12756
+ wasmSdkId: "swift-6.4.0-RELEASE_wasm-peach-cbf01f4b",
12757
+ wasmSdkUrl: "https://r2.sootsim.com/swift-wasm-sdk/swift-6.4.0-RELEASE_wasm-peach-cbf01f4b.artifactbundle.tar.gz",
12758
+ wasmSdkChecksum: "2243db65b12743d577fecc6aa27761363ccef470202f1fef2582e58750c0da4f",
12759
+ source: "723697c8df030077d06e7e760259e494f6a1c5a8",
12760
+ targets: [
12761
+ "ImagePlayground",
12762
+ "QuickLookThumbnailing",
12763
+ "libxml2",
12764
+ "CarPlay",
12765
+ "System",
12766
+ "_LocationEssentials",
12767
+ "GeoToolbox",
12768
+ "DataDetection",
12769
+ "Accessibility",
12770
+ "Contacts",
12771
+ "CoreML",
12772
+ "EventKit",
12773
+ "CloudKit",
12774
+ "IOSurface",
12775
+ "OpenGLES",
12776
+ "ContactsUI",
12777
+ "CoreLocationUI",
12778
+ "MediaPlayer",
12779
+ "MediaAccessibility",
12780
+ "MusicKit",
12781
+ "RealityKit",
12782
+ "SecureElementCredential",
12783
+ "Social",
12784
+ "SceneKit",
12785
+ "CoreBluetooth",
12786
+ "HealthKit",
12787
+ "CoreNFC",
12788
+ "Speech",
12789
+ "Vision",
12790
+ "VisionKit",
12791
+ "WorkoutKit",
12792
+ "_PassKit_SwiftUI",
12793
+ "ExpoModulesCore",
12794
+ "_MapKit_SwiftUI",
12795
+ "PeachJSON",
12796
+ "PeachFoundation",
12797
+ "FoundationNetworking",
12798
+ "DeveloperToolsSupport",
12799
+ "SwiftUI",
12800
+ "DarwinRecords",
12801
+ "Darwin",
12802
+ "MachO",
12803
+ "PeachObjCRuntime",
12804
+ "PeachObjC",
12805
+ "UIUtilities",
12806
+ "UIKitEnums",
12807
+ "UIKitCore",
12808
+ "PeachICU",
12809
+ "PeachCMark",
12810
+ "CoreImage",
12811
+ "QuartzCore",
12812
+ "CoreGraphics",
12813
+ "AppTrackingTransparency",
12814
+ "StoreKit",
12815
+ "_StoreKit_SwiftUI",
12816
+ "WeatherKit",
12817
+ "DeviceCheck",
12818
+ "PassKit",
12819
+ "Translation",
12820
+ "TipKit",
12821
+ "CoreSpotlight",
12822
+ "CoreVideo",
12823
+ "CoreMedia",
12824
+ "VideoToolbox",
12825
+ "AdSupport",
12826
+ "BackgroundTasks",
12827
+ "LocalAuthentication",
12828
+ "CoreMotion",
12829
+ "MessageUI",
12830
+ "GameController",
12831
+ "GameKit",
12832
+ "MetricKit",
12833
+ "Metal",
12834
+ "AuthenticationServices",
12835
+ "os",
12836
+ "Charts",
12837
+ "Symbols",
12838
+ "UniformTypeIdentifiers",
12839
+ "WidgetKit",
12840
+ "ActivityKit",
12841
+ "SwiftData",
12842
+ "UIKit",
12843
+ "React",
12844
+ "Combine",
12845
+ "PeachFoundationCombine",
12846
+ "AppIntents",
12847
+ "PhotosUI",
12848
+ "AVFoundation",
12849
+ "AVFAudio",
12850
+ "UserNotifications",
12851
+ "Network",
12852
+ "NetworkExtension",
12853
+ "OSLog",
12854
+ "PeachSecurityRuntime",
12855
+ "Accelerate",
12856
+ "CoreText",
12857
+ "CFNetwork",
12858
+ "CommonCrypto",
12859
+ "PeachCodec",
12860
+ "Compression",
12861
+ "zlib",
12862
+ "CryptoKit",
12863
+ "TikTokBusinessSDK",
12864
+ "nSure",
12865
+ "Statsig",
12866
+ "TOCropViewController",
12867
+ "RiveRuntime",
12868
+ "AVRouting",
12869
+ "CoreData",
12870
+ "PDFKit",
12871
+ "ModelIOEnums",
12872
+ "ModelIO",
12873
+ "MetalKit",
12874
+ "DatadogCore",
12875
+ "DatadogLogs",
12876
+ "DatadogRUM",
12877
+ "DatadogTrace",
12878
+ "AppLovinSDK",
12879
+ "GoogleMobileAds",
12880
+ "AppsFlyerLib",
12881
+ "FBSDKCoreKit",
12882
+ "FBAEMKit",
12883
+ "FBSDKCoreKit_Basics",
12884
+ "FirebaseCore",
12885
+ "FirebaseSharedSwift",
12886
+ "FirebaseRemoteConfig",
12887
+ "FirebaseFirestoreInternal",
12888
+ "FirebaseAnalytics",
12889
+ "FirebaseAppCheck",
12890
+ "FirebaseAuth",
12891
+ "FirebaseCrashlytics",
12892
+ "FirebaseFirestore",
12893
+ "FirebaseStorage",
12894
+ "Firebase",
12895
+ "Intercom",
12896
+ "FBAudienceNetwork",
12897
+ "NaturalLanguage",
12898
+ "AVKit",
12899
+ "SafariServices",
12900
+ "QuickLook",
12901
+ "CoreHaptics",
12902
+ "WebKit",
12903
+ "Photos",
12904
+ "LinkPresentation",
12905
+ "FoundationModels",
12906
+ "CoreTransferable",
12907
+ "AudioToolbox",
12908
+ "CoreAudioTypes",
12909
+ "AudioUnit",
12910
+ "Intents",
12911
+ "IntentsUI",
12912
+ "WatchConnectivity",
12913
+ "CoreServices",
12914
+ "MobileCoreServices",
12915
+ "CoreTelephony",
12916
+ "SystemConfiguration",
12917
+ "ImageIO",
12918
+ "CoreLocationEnums",
12919
+ "CoreLocation",
12920
+ "MapKit",
12921
+ "One",
12922
+ "simd",
12923
+ "GLKit",
12924
+ "GameplayKit",
12925
+ "SpriteKit",
12926
+ "PeachBox2D"
12927
+ ],
12928
+ systemEnvironment: {
12929
+ scenePhase: ["string:active", "string:inactive", "string:background"],
12930
+ colorScheme: ["string:light", "string:dark"],
12931
+ semanticColors: ["object"],
12932
+ deviceModel: ["string"],
12933
+ systemName: ["string"],
12934
+ systemVersion: ["string"],
12935
+ locale: ["string"],
12936
+ dynamicTypeSize: [
12937
+ "string:xSmall",
12938
+ "string:small",
12939
+ "string:medium",
12940
+ "string:large",
12941
+ "string:xLarge",
12942
+ "string:xxLarge",
12943
+ "string:xxxLarge",
12944
+ "string:accessibility1",
12945
+ "string:accessibility2",
12946
+ "string:accessibility3",
12947
+ "string:accessibility4",
12948
+ "string:accessibility5"
12949
+ ],
12950
+ accessibilityReduceMotion: ["bool"],
12951
+ horizontalSizeClass: ["string:compact", "string:regular"],
12952
+ verticalSizeClass: ["string:compact", "string:regular"],
12953
+ imageAssets: ["object"]
12954
+ },
12955
+ hosts: {
12956
+ "darwin-arm64": {
12957
+ sha256: "3b47173dfa25473dfc3c76e46b1203efdc7c2101eca02eb6c89692d66561e78e",
12958
+ size: 81210958
12959
+ },
12960
+ "linux-x64": {
12961
+ sha256: "d11f5fe29845064c390ec980c641c6a70b0199a7f5b6cd445ddc362ff5a2394f",
12962
+ size: 81209921
12963
+ },
12964
+ "linux-arm64": {
12965
+ sha256: "df9ab4453985dbbaf335610f6ab62a15f6f63175869dd484f359b702f316dfac",
12966
+ size: 81209987
12967
+ }
12968
+ }
12969
+ };
12970
+
12971
+ // src/swift-toolchain.ts
12972
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
12973
+ var import_node_fs10 = __toESM(require("node:fs"), 1);
12974
+ var import_node_os3 = __toESM(require("node:os"), 1);
12975
+ var import_node_path10 = __toESM(require("node:path"), 1);
12976
+ function swiftToolchainBin(release) {
12977
+ if (process.platform === "darwin") {
12978
+ const dirs = [import_node_os3.default.homedir(), "/"].map(
12979
+ (base) => import_node_path10.default.join(base, `Library/Developer/Toolchains/${release}.xctoolchain/usr/bin`)
12980
+ );
12981
+ return dirs.find((dir) => import_node_fs10.default.existsSync(import_node_path10.default.join(dir, "swift"))) ?? dirs[0];
12982
+ }
12983
+ if (process.env.CONTRAST_SWIFT_TOOLCHAINS) {
12984
+ return import_node_path10.default.join(process.env.CONTRAST_SWIFT_TOOLCHAINS, release, "usr/bin");
12985
+ }
12986
+ const image = import_node_path10.default.join("/opt/swift", release, "usr/bin");
12987
+ if (import_node_fs10.default.existsSync(import_node_path10.default.join(image, "swift"))) return image;
12988
+ if (release.includes("-custom-"))
12989
+ return import_node_path10.default.join(peachHome(), "swift", "toolchains", release, "usr/bin");
12990
+ return (process.env.PATH ?? "").split(import_node_path10.default.delimiter).find((dir) => dir && import_node_fs10.default.existsSync(import_node_path10.default.join(dir, "swift"))) ?? image;
12991
+ }
12992
+ function peachHome() {
12993
+ const override = process.env.PEACH_HOME;
12994
+ return override ? import_node_path10.default.resolve(override) : import_node_path10.default.join(import_node_os3.default.homedir(), ".peach");
12995
+ }
12996
+ var scratch;
12997
+ function swiftEnvironment(base = process.env) {
12998
+ if (!scratch) return base;
12999
+ return {
13000
+ ...base,
13001
+ TMPDIR: scratch.directory,
13002
+ XDG_CONFIG_HOME: import_node_path10.default.join(scratch.home, ".config"),
13003
+ XDG_CACHE_HOME: import_node_path10.default.join(scratch.home, ".cache"),
13004
+ XDG_DATA_HOME: import_node_path10.default.join(scratch.home, ".local", "share"),
13005
+ ...process.platform === "linux" ? { HOME: scratch.home } : {}
13006
+ };
13007
+ }
13008
+
13009
+ // src/swift-package-manifest.ts
13010
+ function swiftCommand() {
13011
+ return import_node_path11.default.join(swiftToolchainBin(swift_distribution_lock_default.release), "swift");
13012
+ }
13013
+ var cacheDir2 = import_node_path11.default.join(cacheDir(), "swift-manifests");
13014
+ var requirementClause = (item) => {
13015
+ const url = JSON.stringify(item.url);
13016
+ const requirement = item.requirement;
13017
+ if (requirement.kind === "upToNextMajorVersion")
13018
+ return `.package(url: ${url}, from: ${JSON.stringify(requirement.minimumVersion)})`;
13019
+ if (requirement.kind === "upToNextMinorVersion")
13020
+ return `.package(url: ${url}, .upToNextMinor(from: ${JSON.stringify(requirement.minimumVersion)}))`;
13021
+ if (requirement.kind === "versionRange")
13022
+ return `.package(url: ${url}, ${JSON.stringify(requirement.minimumVersion)}..<${JSON.stringify(requirement.maximumVersion)})`;
13023
+ if (requirement.kind === "exactVersion")
13024
+ return `.package(url: ${url}, exact: ${JSON.stringify(requirement.version)})`;
13025
+ if (requirement.kind === "branch")
13026
+ return `.package(url: ${url}, branch: ${JSON.stringify(requirement.branch)})`;
13027
+ return `.package(url: ${url}, revision: ${JSON.stringify(requirement.revision)})`;
13028
+ };
13029
+ function resolveSwiftPackageRequirements(requirements, destination) {
13030
+ const repository = (url) => url.replace(/(?:\.git)?\/?$/, "");
13031
+ const chosen = /* @__PURE__ */ new Map();
13032
+ for (const item of requirements) {
13033
+ const identity = swiftPackageIdentity(item.url);
13034
+ const previous = chosen.get(identity);
13035
+ if (previous && (repository(previous.url) !== repository(item.url) || JSON.stringify(previous.requirement) !== JSON.stringify(item.requirement)))
13036
+ throw new Error(
13037
+ `conflicting requirements for ${identity}: ${previous.url} ${JSON.stringify(previous.requirement)}; ${item.url} ${JSON.stringify(item.requirement)}`
13038
+ );
13039
+ if (!previous) chosen.set(identity, item);
13040
+ }
13041
+ const clauses = [...chosen.values()].sort(
13042
+ (a, b) => swiftPackageIdentity(a.url).localeCompare(swiftPackageIdentity(b.url))
13043
+ ).map(requirementClause);
13044
+ const manifest = `// swift-tools-version:5.9
13045
+ import PackageDescription
13046
+ let package = Package(
13047
+ name: "Resolve",
13048
+ dependencies: [
13049
+ ${clauses.join(",\n ")},
13050
+ ]
13051
+ )
13052
+ `;
13053
+ const dir = import_node_fs11.default.mkdtempSync(import_node_path11.default.join(import_node_os4.default.tmpdir(), "peach-resolve-"));
13054
+ try {
13055
+ import_node_fs11.default.writeFileSync(import_node_path11.default.join(dir, "Package.swift"), manifest);
13056
+ try {
13057
+ (0, import_node_child_process2.execFileSync)(
13058
+ swiftCommand(),
13059
+ [
13060
+ "package",
13061
+ ...swiftPackageCacheOptions(),
13062
+ "--package-path",
13063
+ dir,
13064
+ "--scratch-path",
13065
+ import_node_path11.default.join(dir, ".build"),
13066
+ "resolve"
13067
+ ],
13068
+ {
13069
+ encoding: "utf8",
13070
+ env: { ...swiftEnvironment(), GIT_TERMINAL_PROMPT: "0" },
13071
+ stdio: ["ignore", "pipe", "pipe"],
13072
+ maxBuffer: 32 * 1024 * 1024
13073
+ }
13074
+ );
13075
+ } catch (error) {
13076
+ const stderr = error instanceof Error && "stderr" in error ? String(error.stderr).trim() : "";
13077
+ throw new Error(
13078
+ `swiftpm could not resolve ${clauses.length} package requirements${stderr ? `: ${stderr}` : ""}`
13079
+ );
13080
+ }
13081
+ const resolved = import_node_path11.default.join(dir, "Package.resolved");
13082
+ if (!import_node_fs11.default.existsSync(resolved))
13083
+ throw new Error("swift package resolve wrote no Package.resolved");
13084
+ import_node_fs11.default.mkdirSync(import_node_path11.default.dirname(destination), { recursive: true });
13085
+ import_node_fs11.default.copyFileSync(resolved, destination);
13086
+ } finally {
13087
+ import_node_fs11.default.rmSync(dir, { recursive: true, force: true });
13088
+ }
11895
13089
  }
11896
13090
 
11897
13091
  // src/xcode-json-project.ts
11898
13092
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
11899
- var import_node_path7 = __toESM(require("node:path"), 1);
13093
+ var import_node_path12 = __toESM(require("node:path"), 1);
11900
13094
  var import_json5 = __toESM(require_lib(), 1);
11901
13095
  var isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
11902
13096
  var text = (value) => typeof value === "string" ? value : void 0;
11903
13097
  var items = (value) => Array.isArray(value) ? value : [];
13098
+ function remoteVersionRequirement(entry) {
13099
+ const revision = text(entry.revision);
13100
+ if (revision !== void 0) return { requirement: { kind: "revision", revision } };
13101
+ const branch = text(entry.branch);
13102
+ if (branch !== void 0) return { requirement: { kind: "branch", branch } };
13103
+ const version = text(entry.version);
13104
+ if (version !== void 0) return { requirement: { kind: "exactVersion", version } };
13105
+ const minor = text(entry["up-to-next-minor-version"]);
13106
+ if (minor !== void 0)
13107
+ return { requirement: { kind: "upToNextMinorVersion", minimumVersion: minor } };
13108
+ const major = text(entry["up-to-next-major-version"]);
13109
+ if (major !== void 0)
13110
+ return { requirement: { kind: "upToNextMajorVersion", minimumVersion: major } };
13111
+ const range = text(entry["version-range"]);
13112
+ if (range !== void 0) {
13113
+ const bounds = range.split("..<");
13114
+ const minimum2 = bounds[0];
13115
+ const maximum2 = bounds[1];
13116
+ if (bounds.length !== 2 || !minimum2 || !maximum2 || bounds[2] !== void 0)
13117
+ throw new Error(
13118
+ `${text(entry.repository) ?? "package"} has a version-range that is not min..<max`
13119
+ );
13120
+ return {
13121
+ requirement: {
13122
+ kind: "versionRange",
13123
+ minimumVersion: minimum2,
13124
+ maximumVersion: maximum2
13125
+ }
13126
+ };
13127
+ }
13128
+ const minimum = text(entry["version-range-min"]);
13129
+ const maximum = text(entry["version-range-max"]);
13130
+ if (minimum !== void 0 && maximum !== void 0)
13131
+ return {
13132
+ requirement: {
13133
+ kind: "versionRange",
13134
+ minimumVersion: minimum,
13135
+ maximumVersion: maximum
13136
+ }
13137
+ };
13138
+ return void 0;
13139
+ }
11904
13140
  var PHASE_ISA = {
11905
13141
  "compile-sources": "PBXSourcesBuildPhase",
11906
13142
  resources: "PBXResourcesBuildPhase",
@@ -11912,7 +13148,7 @@ var PHASE_ISA = {
11912
13148
  function readXcodeJsonProject(xcodeproj, source) {
11913
13149
  const json = import_json5.default.parse(source);
11914
13150
  if (!isJsonObject(json)) throw new Error(`${xcodeproj}/project.xcproj is not an object`);
11915
- const projectDir = import_node_path7.default.dirname(xcodeproj);
13151
+ const projectDir = import_node_path12.default.dirname(xcodeproj);
11916
13152
  const objects = {};
11917
13153
  let next = 0;
11918
13154
  const add = (entry, id) => {
@@ -11925,7 +13161,7 @@ function readXcodeJsonProject(xcodeproj, source) {
11925
13161
  const base = /^<([A-Z]+)>\/(.*)$/.exec(raw);
11926
13162
  if (base) {
11927
13163
  if (base[1] === "PROJECT")
11928
- return { sourceTree: "<absolute>", path: import_node_path7.default.join(projectDir, base[2]) };
13164
+ return { sourceTree: "<absolute>", path: import_node_path12.default.join(projectDir, base[2]) };
11929
13165
  if (base[1] === "PRODUCTS")
11930
13166
  return { sourceTree: "BUILT_PRODUCTS_DIR", path: base[2] };
11931
13167
  return null;
@@ -11933,7 +13169,7 @@ function readXcodeJsonProject(xcodeproj, source) {
11933
13169
  const unescaped = raw.replaceAll("\\<", "<");
11934
13170
  if (unescaped.startsWith("/")) return { sourceTree: "<absolute>", path: unescaped };
11935
13171
  if (unescaped.startsWith("~")) return null;
11936
- return groupDir === null ? null : { sourceTree: "<absolute>", path: import_node_path7.default.join(groupDir, unescaped) };
13172
+ return groupDir === null ? null : { sourceTree: "<absolute>", path: import_node_path12.default.join(groupDir, unescaped) };
11937
13173
  };
11938
13174
  const memberships = [];
11939
13175
  const folders = [];
@@ -11944,7 +13180,7 @@ function readXcodeJsonProject(xcodeproj, source) {
11944
13180
  const kind = text(entry.kind) ?? "file-reference";
11945
13181
  const raw = text(entry.path) ?? "";
11946
13182
  const located = raw === "" ? null : locate(raw, parent.dir);
11947
- const name2 = text(entry.name) ?? import_node_path7.default.basename(raw);
13183
+ const name2 = text(entry.name) ?? import_node_path12.default.basename(raw);
11948
13184
  const node = { id: "", name: name2, dir: null, parent, children: [] };
11949
13185
  if (kind === "group" || kind === "variant-group" || kind === "version-group") {
11950
13186
  node.dir = raw === "" ? parent.dir : located?.sourceTree === "<absolute>" ? located.path : null;
@@ -12065,8 +13301,12 @@ function readXcodeJsonProject(xcodeproj, source) {
12065
13301
  if (!isObject(entry)) continue;
12066
13302
  const repository = text(entry.repository);
12067
13303
  const local = text(entry.path);
12068
- const name2 = local !== void 0 ? import_node_path7.default.basename(import_node_path7.default.resolve(import_node_path7.default.dirname(xcodeproj), local)) : import_node_path7.default.basename(repository ?? "").replace(/\.git$/, "");
12069
- const id = text(entry.kind) === "local" && local !== void 0 ? add({ isa: "XCLocalSwiftPackageReference", relativePath: local }) : add({ isa: "XCRemoteSwiftPackageReference", repositoryURL: repository ?? "" });
13304
+ const name2 = local !== void 0 ? import_node_path12.default.basename(import_node_path12.default.resolve(import_node_path12.default.dirname(xcodeproj), local)) : import_node_path12.default.basename(repository ?? "").replace(/\.git$/, "");
13305
+ const id = text(entry.kind) === "local" && local !== void 0 ? add({ isa: "XCLocalSwiftPackageReference", relativePath: local }) : add({
13306
+ isa: "XCRemoteSwiftPackageReference",
13307
+ repositoryURL: repository ?? "",
13308
+ ...remoteVersionRequirement(entry)
13309
+ });
12070
13310
  packageIds.set(name2.toLowerCase(), id);
12071
13311
  }
12072
13312
  const productDependency = (entry) => add({
@@ -12254,28 +13494,28 @@ var CONDITIONS = {
12254
13494
  variant: "normal"
12255
13495
  };
12256
13496
  function walkFiles(dir) {
12257
- if (!import_node_fs8.default.existsSync(dir)) return [];
13497
+ if (!import_node_fs12.default.existsSync(dir)) return [];
12258
13498
  const out = [];
12259
- for (const entry of import_node_fs8.default.readdirSync(dir, { withFileTypes: true }).sort((left, right) => left.name.localeCompare(right.name))) {
13499
+ for (const entry of import_node_fs12.default.readdirSync(dir, { withFileTypes: true }).sort((left, right) => left.name.localeCompare(right.name))) {
12260
13500
  if (entry.name.startsWith(".")) continue;
12261
- const full = import_node_path8.default.join(dir, entry.name);
13501
+ const full = import_node_path13.default.join(dir, entry.name);
12262
13502
  if (entry.isDirectory()) out.push(...walkFiles(full));
12263
13503
  else if (entry.isFile()) out.push(full);
12264
13504
  }
12265
13505
  return out;
12266
13506
  }
12267
- var isDirectory = (dir) => import_node_fs8.default.existsSync(dir) && import_node_fs8.default.statSync(dir).isDirectory();
13507
+ var isDirectory = (dir) => import_node_fs12.default.existsSync(dir) && import_node_fs12.default.statSync(dir).isDirectory();
12268
13508
  function readXcconfig(file, read) {
12269
- if (read.includes(file) || !import_node_fs8.default.existsSync(file)) return {};
13509
+ if (read.includes(file) || !import_node_fs12.default.existsSync(file)) return {};
12270
13510
  read.push(file);
12271
13511
  const settings = {};
12272
- for (const raw of import_node_fs8.default.readFileSync(file, "utf8").split("\n")) {
13512
+ for (const raw of import_node_fs12.default.readFileSync(file, "utf8").split("\n")) {
12273
13513
  const line = raw.replace(/\/\/.*$/, "").trim();
12274
13514
  const include = /^#include\??\s+"([^"]+)"/.exec(line);
12275
13515
  if (include) {
12276
13516
  Object.assign(
12277
13517
  settings,
12278
- readXcconfig(import_node_path8.default.resolve(import_node_path8.default.dirname(file), include[1]), read)
13518
+ readXcconfig(import_node_path13.default.resolve(import_node_path13.default.dirname(file), include[1]), read)
12279
13519
  );
12280
13520
  continue;
12281
13521
  }
@@ -12325,22 +13565,22 @@ function decodeXml(text2) {
12325
13565
  return text2.replaceAll("&quot;", '"').replaceAll("&apos;", "'").replaceAll("&lt;", "<").replaceAll("&gt;", ">").replaceAll("&amp;", "&");
12326
13566
  }
12327
13567
  function workspaceReferences(workspace) {
12328
- const data = import_node_path8.default.join(workspace, "contents.xcworkspacedata");
12329
- if (!import_node_fs8.default.existsSync(data))
13568
+ const data = import_node_path13.default.join(workspace, "contents.xcworkspacedata");
13569
+ if (!import_node_fs12.default.existsSync(data))
12330
13570
  throw new Error(`${workspace} has no contents.xcworkspacedata`);
12331
- const container = import_node_path8.default.dirname(workspace);
13571
+ const container = import_node_path13.default.dirname(workspace);
12332
13572
  const locate = (location, base) => {
12333
13573
  const colon = location.indexOf(":");
12334
13574
  const kind = location.slice(0, colon);
12335
13575
  const rest = location.slice(colon + 1);
12336
- if (kind === "group") return import_node_path8.default.resolve(base, rest);
12337
- if (kind === "container" || kind === "self") return import_node_path8.default.resolve(container, rest);
12338
- if (kind === "absolute") return import_node_path8.default.resolve(rest);
12339
- throw new Error(`${import_node_path8.default.basename(workspace)} has an unsupported location ${location}`);
13576
+ if (kind === "group") return import_node_path13.default.resolve(base, rest);
13577
+ if (kind === "container" || kind === "self") return import_node_path13.default.resolve(container, rest);
13578
+ if (kind === "absolute") return import_node_path13.default.resolve(rest);
13579
+ throw new Error(`${import_node_path13.default.basename(workspace)} has an unsupported location ${location}`);
12340
13580
  };
12341
13581
  const groups = [container];
12342
13582
  const references = [];
12343
- for (const [, closing, tag, attributes, selfClosing] of import_node_fs8.default.readFileSync(data, "utf8").matchAll(/<(\/?)(Group|FileRef)\b([^>]*?)(\/?)>/g)) {
13583
+ for (const [, closing, tag, attributes, selfClosing] of import_node_fs12.default.readFileSync(data, "utf8").matchAll(/<(\/?)(Group|FileRef)\b([^>]*?)(\/?)>/g)) {
12344
13584
  if (closing) {
12345
13585
  if (tag === "Group") groups.pop();
12346
13586
  continue;
@@ -12353,11 +13593,46 @@ function workspaceReferences(workspace) {
12353
13593
  }
12354
13594
  return references;
12355
13595
  }
13596
+ function versionRequirement(url, requirement) {
13597
+ const kind = str(requirement.kind);
13598
+ const minimum = str(requirement.minimumVersion);
13599
+ const maximum = str(requirement.maximumVersion);
13600
+ const version = str(requirement.version);
13601
+ const branch = str(requirement.branch);
13602
+ const revision = str(requirement.revision);
13603
+ if (kind === "upToNextMajorVersion" && minimum)
13604
+ return { kind: "upToNextMajorVersion", minimumVersion: minimum };
13605
+ if (kind === "upToNextMinorVersion" && minimum)
13606
+ return { kind: "upToNextMinorVersion", minimumVersion: minimum };
13607
+ if (kind === "versionRange" && minimum && maximum)
13608
+ return { kind: "versionRange", minimumVersion: minimum, maximumVersion: maximum };
13609
+ if (kind === "exactVersion" && version) return { kind: "exactVersion", version };
13610
+ if (kind === "branch" && branch) return { kind: "branch", branch };
13611
+ if (kind === "revision" && revision) return { kind: "revision", revision };
13612
+ throw new Error(
13613
+ `${url} has an unsupported package requirement${kind ? ` (${kind})` : ""}`
13614
+ );
13615
+ }
13616
+ function remotePackageRequirements(projects) {
13617
+ const out = [];
13618
+ for (const project of projects) {
13619
+ for (const id of list(project.project.packageReferences)) {
13620
+ const reference = project.object(id);
13621
+ if (reference?.isa !== "XCRemoteSwiftPackageReference") continue;
13622
+ const url = str(reference.repositoryURL);
13623
+ if (!url) continue;
13624
+ const requirement = reference.requirement;
13625
+ if (!isDict(requirement)) throw new Error(`${url} has no version requirement`);
13626
+ out.push({ url, requirement: versionRequirement(url, requirement) });
13627
+ }
13628
+ }
13629
+ return out;
13630
+ }
12356
13631
  var loaded2 = /* @__PURE__ */ new Map();
12357
13632
  function xcodeProjectFile(xcodeproj) {
12358
13633
  for (const name2 of ["project.pbxproj", "project.xcproj"]) {
12359
- const file = import_node_path8.default.join(xcodeproj, name2);
12360
- if (import_node_fs8.default.existsSync(file)) return file;
13634
+ const file = import_node_path13.default.join(xcodeproj, name2);
13635
+ if (import_node_fs12.default.existsSync(file)) return file;
12361
13636
  }
12362
13637
  return null;
12363
13638
  }
@@ -12365,7 +13640,7 @@ function loadProject(xcodeproj) {
12365
13640
  const projectFile = xcodeProjectFile(xcodeproj);
12366
13641
  if (!projectFile)
12367
13642
  throw new Error(`${xcodeproj} has no project.pbxproj or project.xcproj`);
12368
- const source = import_node_fs8.default.readFileSync(projectFile, "utf8");
13643
+ const source = import_node_fs12.default.readFileSync(projectFile, "utf8");
12369
13644
  const digest = (0, import_node_crypto3.createHash)("sha256").update(source).digest("hex");
12370
13645
  const cached = loaded2.get(projectFile);
12371
13646
  if (cached?.digest === digest) return cached.project;
@@ -12382,10 +13657,10 @@ function loadProject(xcodeproj) {
12382
13657
  if (!project || project.isa !== "PBXProject") {
12383
13658
  throw new Error(`${projectFile} has no PBXProject root`);
12384
13659
  }
12385
- const projectDir = import_node_fs8.default.realpathSync(
12386
- import_node_path8.default.resolve(import_node_path8.default.dirname(xcodeproj), str(project.projectDirPath) ?? "")
13660
+ const projectDir = import_node_fs12.default.realpathSync(
13661
+ import_node_path13.default.resolve(import_node_path13.default.dirname(xcodeproj), str(project.projectDirPath) ?? "")
12387
13662
  );
12388
- const resolvePath = xcodePathResolver(objects, projectDir, import_node_path8.default.join);
13663
+ const resolvePath = xcodePathResolver(objects, projectDir, import_node_path13.default.join);
12389
13664
  const result = {
12390
13665
  xcodeproj,
12391
13666
  projectFile,
@@ -12419,8 +13694,8 @@ function targetSettings(ref, configuration, builtins, options = {}, overrides =
12419
13694
  const relative3 = str(config.baseConfigurationReferenceRelativePath);
12420
13695
  const own = isDict(config.buildSettings) ? config.buildSettings : {};
12421
13696
  const directory = anchor ? project.resolvePath(anchor) : null;
12422
- const baseFile = base ? project.resolvePath(base) : directory && relative3 ? import_node_path8.default.resolve(directory, relative3) : null;
12423
- if (options.requireSources !== false && (base || anchor || relative3) && (!baseFile || !import_node_fs8.default.existsSync(baseFile)))
13697
+ const baseFile = base ? project.resolvePath(base) : directory && relative3 ? import_node_path13.default.resolve(directory, relative3) : null;
13698
+ if (options.requireSources !== false && (base || anchor || relative3) && (!baseFile || !import_node_fs12.default.existsSync(baseFile)))
12424
13699
  throw new Error(
12425
13700
  `Unable to open base configuration reference file '${baseFile ?? base ?? relative3 ?? anchor}'`
12426
13701
  );
@@ -12489,33 +13764,36 @@ function targetSettings(ref, configuration, builtins, options = {}, overrides =
12489
13764
  }
12490
13765
  function settingList(value) {
12491
13766
  const items2 = [];
12492
- for (const [, quoted, plain] of value.matchAll(
12493
- /"((?:\\.|[^"\\])*)"|((?:\\.|[^\s"])+)/g
12494
- ))
12495
- items2.push((quoted ?? plain).replace(/\\(.)/g, "$1"));
13767
+ for (const [word] of value.matchAll(/(?:"(?:\\.|[^"\\])*"|\\.|[^\s"\\])+/g))
13768
+ items2.push(
13769
+ word.replace(
13770
+ /"((?:\\.|[^"\\])*)"|\\(.)/g,
13771
+ (_, quoted, escaped) => quoted !== void 0 ? quoted.replace(/\\(.)/g, "$1") : escaped
13772
+ )
13773
+ );
12496
13774
  return items2;
12497
13775
  }
12498
13776
  function expandSearchPath(directory, rules) {
12499
- if (import_node_path8.default.basename(directory) !== "**") return [directory];
13777
+ if (import_node_path13.default.basename(directory) !== "**") return [directory];
12500
13778
  const expanded = [];
12501
13779
  const seen = /* @__PURE__ */ new Set();
12502
- const queue = [import_node_path8.default.dirname(directory)];
13780
+ const queue = [import_node_path13.default.dirname(directory)];
12503
13781
  for (let at = 0; at < queue.length; at++) {
12504
13782
  const current = queue[at];
12505
13783
  let real;
12506
13784
  try {
12507
- real = import_node_fs8.default.realpathSync(current);
13785
+ real = import_node_fs12.default.realpathSync(current);
12508
13786
  } catch {
12509
13787
  continue;
12510
13788
  }
12511
- if (!import_node_fs8.default.statSync(real).isDirectory() || seen.has(real)) continue;
13789
+ if (!import_node_fs12.default.statSync(real).isDirectory() || seen.has(real)) continue;
12512
13790
  seen.add(real);
12513
13791
  expanded.push(current);
12514
- for (const entry of import_node_fs8.default.readdirSync(real, { withFileTypes: true }).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
13792
+ for (const entry of import_node_fs12.default.readdirSync(real, { withFileTypes: true }).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
12515
13793
  if (entry.isSymbolicLink() ? !rules.followLinks : !entry.isDirectory()) continue;
12516
13794
  if (rules.excluded.some((pattern) => pattern.test(entry.name)) && !rules.included.some((pattern) => pattern.test(entry.name)))
12517
13795
  continue;
12518
- queue.push(import_node_path8.default.join(current, entry.name));
13796
+ queue.push(import_node_path13.default.join(current, entry.name));
12519
13797
  }
12520
13798
  }
12521
13799
  return expanded;
@@ -12557,8 +13835,54 @@ function expand(value, lookup) {
12557
13835
  );
12558
13836
  }
12559
13837
  var preparedSourcePhases = /* @__PURE__ */ new Map();
13838
+ function shellCopies(script, settings, projectDir) {
13839
+ const assigned = /* @__PURE__ */ new Map();
13840
+ const copies = [];
13841
+ let resolved = true;
13842
+ const lookup = (name2) => {
13843
+ const value = assigned.get(name2) ?? settings(name2);
13844
+ if (value === "") resolved = false;
13845
+ return value;
13846
+ };
13847
+ const word = (token2) => {
13848
+ if (/\$\{[A-Za-z_][A-Za-z0-9_]*(?::?[-+=?]|[#%/^,])/.test(token2)) return null;
13849
+ resolved = true;
13850
+ const quote = token2[0];
13851
+ const value = quote === "'" ? token2.slice(1, -1) : expand(quote === '"' ? token2.slice(1, -1) : token2, lookup);
13852
+ return resolved && !value.includes("$") ? value : null;
13853
+ };
13854
+ const token = /^(?:"[^"\\`]*"|'[^']*'|[^\s"'`;&|<>()\\]+)$/;
13855
+ for (const raw of script.split(/\r?\n/)) {
13856
+ const line = raw.trim().replace(/^export\s+/, "");
13857
+ if (line === "" || line.startsWith("#") || /^set\s+-[A-Za-z]+(\s+\w+)?$/.test(line))
13858
+ continue;
13859
+ const tokens = line.match(/"[^"]*"|'[^']*'|\S+/g) ?? [];
13860
+ if (!tokens.every(
13861
+ (value, index) => token.test(index === 0 ? value.replace(/^[A-Za-z_][A-Za-z0-9_]*=/, "") : value)
13862
+ ))
13863
+ return [];
13864
+ const assignment = /^([A-Za-z_][A-Za-z0-9_]*)=(.*)$/.exec(line);
13865
+ if (assignment) {
13866
+ const value = tokens.length === 1 ? word(assignment[2]) : null;
13867
+ if (value === null) return [];
13868
+ assigned.set(assignment[1], value);
13869
+ continue;
13870
+ }
13871
+ if (tokens[0] !== "cp" && tokens[0] !== "echo") return [];
13872
+ const operands = tokens.slice(1).map(word);
13873
+ if (operands.includes(null)) return [];
13874
+ if (tokens[0] === "echo") continue;
13875
+ if (operands.length !== 2 || operands.some((operand) => operand.startsWith("-")))
13876
+ return [];
13877
+ copies.push({
13878
+ from: import_node_path13.default.resolve(projectDir, operands[0]),
13879
+ to: import_node_path13.default.resolve(projectDir, operands[1])
13880
+ });
13881
+ }
13882
+ return copies;
13883
+ }
12560
13884
  function fileListEntries(file, absolute) {
12561
- return import_node_fs8.default.readFileSync(file, "utf8").split(/\r?\n/).map((line) => line.trim()).filter((line) => line !== "" && !line.startsWith("#")).map(absolute);
13885
+ return import_node_fs12.default.readFileSync(file, "utf8").split(/\r?\n/).map((line) => line.trim()).filter((line) => line !== "" && !line.startsWith("#")).map(absolute);
12562
13886
  }
12563
13887
  function targetMembers(ref, settings, options, settingKeys, projectInputs) {
12564
13888
  const { project, target, id: targetId } = ref;
@@ -12568,11 +13892,19 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
12568
13892
  const headers = /* @__PURE__ */ new Set();
12569
13893
  const resources = /* @__PURE__ */ new Set();
12570
13894
  const scriptForOutput = /* @__PURE__ */ new Map();
13895
+ const copiedFiles = [];
13896
+ let generatedInfoPlist = false;
13897
+ const declaredInfoPlist = settings("INFOPLIST_FILE");
13898
+ const infoPlistOutput = declaredInfoPlist ? import_node_path13.default.resolve(project.projectDir, declaredInfoPlist) : null;
13899
+ const isPreparedOutput = (file) => file === infoPlistOutput || options.requireSources !== false && file.endsWith(".swift");
12571
13900
  for (const phaseId of list(target.buildPhases)) {
12572
13901
  const phase = project.object(phaseId);
12573
13902
  if (phase?.isa !== "PBXShellScriptBuildPhase") continue;
12574
13903
  const script = str(phase.name) ?? phaseId;
12575
- const absolute = (raw) => import_node_path8.default.resolve(project.projectDir, expand(raw, settings));
13904
+ copiedFiles.push(
13905
+ ...shellCopies(str(phase.shellScript) ?? "", settings, project.projectDir)
13906
+ );
13907
+ const absolute = (raw) => import_node_path13.default.resolve(project.projectDir, expand(raw, settings));
12576
13908
  const inputs = list(phase.inputPaths).map(absolute);
12577
13909
  const outputs = list(phase.outputPaths).map(absolute);
12578
13910
  const fileLists = /* @__PURE__ */ new Map();
@@ -12581,7 +13913,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
12581
13913
  kind === "INPUT" ? phase.inputFileListPaths : phase.outputFileListPaths
12582
13914
  ).map((raw) => {
12583
13915
  const file = absolute(raw);
12584
- if (!import_node_fs8.default.existsSync(file)) {
13916
+ if (!import_node_fs12.default.existsSync(file)) {
12585
13917
  return { file, entries: [] };
12586
13918
  }
12587
13919
  return { file, entries: fileListEntries(file, absolute) };
@@ -12592,6 +13924,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
12592
13924
  ...outputs,
12593
13925
  ...fileLists.get("OUTPUT").flatMap((item) => item.entries)
12594
13926
  ];
13927
+ if (allOutputs.includes(infoPlistOutput)) generatedInfoPlist = true;
12595
13928
  for (const output of allOutputs)
12596
13929
  if (output.endsWith(".swift") && !scriptForOutput.has(output))
12597
13930
  scriptForOutput.set(output, script);
@@ -12600,14 +13933,14 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
12600
13933
  ...fileLists.get("INPUT").flatMap((item) => [item.file, ...item.entries]),
12601
13934
  ...fileLists.get("OUTPUT").map((item) => item.file)
12602
13935
  ];
12603
- if (allOutputs.some((file) => file.endsWith(".swift"))) {
12604
- for (const file of inputFiles) if (import_node_fs8.default.existsSync(file)) projectInputs.add(file);
13936
+ if (allOutputs.some((file) => file.endsWith(".swift") || file === infoPlistOutput)) {
13937
+ for (const file of inputFiles) if (import_node_fs12.default.existsSync(file)) projectInputs.add(file);
12605
13938
  }
12606
- if (options.prepareGeneratedSources && options.requireSources !== false && allOutputs.some((file) => file.endsWith(".swift"))) {
12607
- const phaseDir = import_node_path8.default.join(settings("TARGET_TEMP_DIR"), `Script-${phaseId}`);
13939
+ if (options.prepareGeneratedSources === true && allOutputs.some(isPreparedOutput)) {
13940
+ const phaseDir = import_node_path13.default.join(settings("TARGET_TEMP_DIR"), `Script-${phaseId}`);
12608
13941
  for (const lists of fileLists.values())
12609
13942
  for (const { file } of lists)
12610
- if (!import_node_fs8.default.existsSync(file))
13943
+ if (!import_node_fs12.default.existsSync(file))
12611
13944
  throw new Error(
12612
13945
  `${targetName}: Run Script "${script}" missing file list ${file}`
12613
13946
  );
@@ -12626,7 +13959,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
12626
13959
  const lists = fileLists.get(kind);
12627
13960
  env[`SCRIPT_${kind}_FILE_LIST_COUNT`] = String(lists.length);
12628
13961
  lists.forEach((_item, index) => {
12629
- env[`SCRIPT_${kind}_FILE_LIST_${index}`] = import_node_path8.default.join(
13962
+ env[`SCRIPT_${kind}_FILE_LIST_${index}`] = import_node_path13.default.join(
12630
13963
  phaseDir,
12631
13964
  `${kind}-${index}.xcfilelist`
12632
13965
  );
@@ -12637,53 +13970,53 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
12637
13970
  );
12638
13971
  for (const file of inputFiles) {
12639
13972
  signature.update(file);
12640
- if (import_node_fs8.default.existsSync(file)) {
12641
- const stat = import_node_fs8.default.statSync(file);
13973
+ if (import_node_fs12.default.existsSync(file)) {
13974
+ const stat = import_node_fs12.default.statSync(file);
12642
13975
  signature.update(`${stat.mtimeMs}:${stat.ctimeMs}:${stat.size}`);
12643
13976
  } else signature.update("missing");
12644
13977
  }
12645
13978
  const stamp = signature.digest("hex");
12646
13979
  const key = `${project.projectFile}:${targetId}:${phaseId}:${settings("CONFIGURATION")}`;
12647
- if (preparedSourcePhases.get(key) === stamp && allOutputs.every((file) => import_node_fs8.default.existsSync(file)))
13980
+ if (preparedSourcePhases.get(key) === stamp && allOutputs.every((file) => import_node_fs12.default.existsSync(file)))
12648
13981
  continue;
12649
- import_node_fs8.default.mkdirSync(phaseDir, { recursive: true });
12650
- import_node_fs8.default.mkdirSync(settings("BUILT_PRODUCTS_DIR"), { recursive: true });
12651
- import_node_fs8.default.mkdirSync(settings("DERIVED_FILE_DIR"), { recursive: true });
13982
+ import_node_fs12.default.mkdirSync(phaseDir, { recursive: true });
13983
+ import_node_fs12.default.mkdirSync(settings("BUILT_PRODUCTS_DIR"), { recursive: true });
13984
+ import_node_fs12.default.mkdirSync(settings("DERIVED_FILE_DIR"), { recursive: true });
12652
13985
  for (const output of allOutputs)
12653
- import_node_fs8.default.mkdirSync(import_node_path8.default.dirname(output), { recursive: true });
13986
+ import_node_fs12.default.mkdirSync(import_node_path13.default.dirname(output), { recursive: true });
12654
13987
  for (const [kind, lists] of fileLists)
12655
13988
  lists.forEach((item, index) => {
12656
- import_node_fs8.default.writeFileSync(
13989
+ import_node_fs12.default.writeFileSync(
12657
13990
  env[`SCRIPT_${kind}_FILE_LIST_${index}`],
12658
13991
  `${item.entries.join("\n")}
12659
13992
  `
12660
13993
  );
12661
13994
  });
12662
13995
  try {
12663
- (0, import_node_child_process2.execFileSync)(
13996
+ (0, import_node_child_process3.execFileSync)(
12664
13997
  str(phase.shellPath) ?? "/bin/sh",
12665
13998
  ["-c", str(phase.shellScript) ?? ""],
12666
13999
  {
12667
14000
  cwd: project.projectDir,
12668
14001
  env,
12669
14002
  stdio: ["ignore", "pipe", "pipe"],
12670
- timeout: 12e4
14003
+ maxBuffer: Infinity
12671
14004
  }
12672
14005
  );
12673
14006
  } catch (error) {
12674
14007
  const output = error instanceof Error ? `${error.message}
12675
14008
  ${"stdout" in error ? String(error.stdout) : ""}${"stderr" in error ? String(error.stderr) : ""}` : String(error);
12676
14009
  throw new Error(
12677
- `${targetName}: Run Script "${script}" failed preparing generated Swift sources:
14010
+ `${targetName}: Run Script "${script}" failed preparing generated outputs:
12678
14011
  ${output}`
12679
14012
  );
12680
14013
  }
12681
- const missing = allOutputs.filter(
12682
- (file) => file.endsWith(".swift") && !import_node_fs8.default.existsSync(file)
14014
+ const missing2 = allOutputs.filter(
14015
+ (file) => file === infoPlistOutput && !import_node_fs12.default.existsSync(file)
12683
14016
  );
12684
- if (missing.length > 0)
14017
+ if (missing2.length > 0)
12685
14018
  throw new Error(
12686
- `${targetName}: Run Script "${script}" did not produce ${missing.join(", ")}`
14019
+ `${targetName}: Run Script "${script}" did not produce ${missing2.join(", ")}`
12687
14020
  );
12688
14021
  preparedSourcePhases.set(key, stamp);
12689
14022
  }
@@ -12692,8 +14025,8 @@ ${output}`
12692
14025
  project.objects,
12693
14026
  targetId,
12694
14027
  project.resolvePath,
12695
- (file) => isDirectory(file) ? walkFiles(file) : import_node_fs8.default.existsSync(file) ? [file] : [],
12696
- import_node_path8.default.join,
14028
+ (file) => isDirectory(file) ? walkFiles(file) : import_node_fs12.default.existsSync(file) ? [file] : [],
14029
+ import_node_path13.default.join,
12697
14030
  (file, kind) => {
12698
14031
  if (kind === "header") {
12699
14032
  headers.add(file);
@@ -12703,9 +14036,9 @@ ${output}`
12703
14036
  resources.add(file);
12704
14037
  return;
12705
14038
  }
12706
- if (!import_node_fs8.default.existsSync(file)) {
14039
+ if (!import_node_fs12.default.existsSync(file)) {
12707
14040
  if (options.requireSources === false) return;
12708
- const script = scriptForOutput.get(import_node_path8.default.normalize(file));
14041
+ const script = scriptForOutput.get(import_node_path13.default.normalize(file));
12709
14042
  throw new Error(
12710
14043
  script ? `${targetName}: missing generated source ${file} (Run Script "${script}" declares it in outputPaths; run the script or check in its output)` : `${targetName}: missing source ${file}`
12711
14044
  );
@@ -12714,20 +14047,19 @@ ${output}`
12714
14047
  if (file.endsWith(".swift")) sources.add(file);
12715
14048
  }
12716
14049
  );
12717
- for (const [file, script] of scriptForOutput) {
14050
+ for (const [file] of scriptForOutput) {
12718
14051
  if (sources.has(file) || allSources.has(file)) continue;
12719
- if (!import_node_fs8.default.existsSync(file)) {
12720
- if (options.requireSources === false) continue;
12721
- throw new Error(
12722
- `${targetName}: missing generated source ${file} (Run Script "${script}" declares it in outputPaths; run the script or check in its output)`
12723
- );
12724
- }
12725
- allSources.add(file);
12726
- sources.add(file);
14052
+ if (!import_node_fs12.default.existsSync(file)) continue;
14053
+ const canonical = import_node_fs12.default.realpathSync(file);
14054
+ if (sources.has(canonical) || allSources.has(canonical)) continue;
14055
+ allSources.add(canonical);
14056
+ sources.add(canonical);
12727
14057
  }
12728
14058
  return {
12729
14059
  sources: [...sources].sort(),
12730
14060
  resources: [...resources].sort(),
14061
+ copiedFiles,
14062
+ generatedInfoPlist,
12731
14063
  allSources: [...allSources].sort(),
12732
14064
  headers: [...headers].sort()
12733
14065
  };
@@ -12735,37 +14067,37 @@ ${output}`
12735
14067
  function commonAncestor(dirs) {
12736
14068
  let common = dirs[0];
12737
14069
  for (const dir of dirs) {
12738
- while (common !== import_node_path8.default.dirname(common) && import_node_path8.default.relative(common, dir).startsWith(".."))
12739
- common = import_node_path8.default.dirname(common);
14070
+ while (common !== import_node_path13.default.dirname(common) && import_node_path13.default.relative(common, dir).startsWith(".."))
14071
+ common = import_node_path13.default.dirname(common);
12740
14072
  }
12741
14073
  return common;
12742
14074
  }
12743
- var isPodsProject = (xcodeproj) => import_node_path8.default.basename(xcodeproj) === "Pods.xcodeproj" && import_node_path8.default.basename(import_node_path8.default.dirname(xcodeproj)) === "Pods";
14075
+ var isPodsProject = (xcodeproj) => import_node_path13.default.basename(xcodeproj) === "Pods.xcodeproj" && import_node_path13.default.basename(import_node_path13.default.dirname(xcodeproj)) === "Pods";
12744
14076
  function installedPodsSandbox(pods) {
12745
- const podfileLock = import_node_path8.default.join(import_node_path8.default.dirname(pods), "Podfile.lock");
12746
- const manifestLock = import_node_path8.default.join(pods, "Manifest.lock");
12747
- if (!import_node_fs8.default.existsSync(podfileLock))
14077
+ const podfileLock = import_node_path13.default.join(import_node_path13.default.dirname(pods), "Podfile.lock");
14078
+ const manifestLock = import_node_path13.default.join(pods, "Manifest.lock");
14079
+ if (!import_node_fs12.default.existsSync(podfileLock))
12748
14080
  throw new Error(
12749
- `${pods} has no ${podfileLock}: run \`pod install\` in ${import_node_path8.default.dirname(pods)}`
14081
+ `${pods} has no ${podfileLock}: run \`pod install\` in ${import_node_path13.default.dirname(pods)}`
12750
14082
  );
12751
- if (!import_node_fs8.default.existsSync(manifestLock) || !import_node_fs8.default.readFileSync(manifestLock).equals(import_node_fs8.default.readFileSync(podfileLock)))
14083
+ if (!import_node_fs12.default.existsSync(manifestLock) || !import_node_fs12.default.readFileSync(manifestLock).equals(import_node_fs12.default.readFileSync(podfileLock)))
12752
14084
  throw new Error(
12753
- `The sandbox is not in sync with the Podfile.lock: ${manifestLock} differs from ${podfileLock}. Run \`pod install\` in ${import_node_path8.default.dirname(pods)}`
14085
+ `The sandbox is not in sync with the Podfile.lock: ${manifestLock} differs from ${podfileLock}. Run \`pod install\` in ${import_node_path13.default.dirname(pods)}`
12754
14086
  );
12755
14087
  const specChecksums = {};
12756
- const lines = import_node_fs8.default.readFileSync(manifestLock, "utf8").split("\n");
14088
+ const lines = import_node_fs12.default.readFileSync(manifestLock, "utf8").split("\n");
12757
14089
  const start = lines.indexOf("SPEC CHECKSUMS:");
12758
14090
  for (const line of start === -1 ? [] : lines.slice(start + 1)) {
12759
14091
  const entry = /^ {2}"?([^":]+)"?: ([0-9a-f]+)$/.exec(line);
12760
14092
  if (!entry) break;
12761
14093
  specChecksums[entry[1]] = entry[2];
12762
14094
  }
12763
- const specs = import_node_path8.default.join(pods, "Local Podspecs");
14095
+ const specs = import_node_path13.default.join(pods, "Local Podspecs");
12764
14096
  return {
12765
14097
  podfileLock,
12766
14098
  manifestLock,
12767
14099
  specChecksums,
12768
- localPodspecs: isDirectory(specs) ? import_node_fs8.default.readdirSync(specs).filter((name2) => name2.endsWith(".podspec.json")).sort().map((name2) => import_node_path8.default.join(specs, name2)) : []
14100
+ localPodspecs: isDirectory(specs) ? import_node_fs12.default.readdirSync(specs).filter((name2) => name2.endsWith(".podspec.json")).sort().map((name2) => import_node_path13.default.join(specs, name2)) : []
12769
14101
  };
12770
14102
  }
12771
14103
  function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
@@ -12777,14 +14109,14 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
12777
14109
  if (!xcodeProjectFile(xcodeproj)) {
12778
14110
  if (installedPods && isPodsProject(xcodeproj))
12779
14111
  throw new Error(
12780
- `${import_node_path8.default.basename(xcodeprojOrWorkspace)} builds ${xcodeproj}, which is not installed: run \`pod install\` in ${import_node_path8.default.dirname(import_node_path8.default.dirname(xcodeproj))}`
14112
+ `${import_node_path13.default.basename(xcodeprojOrWorkspace)} builds ${xcodeproj}, which is not installed: run \`pod install\` in ${import_node_path13.default.dirname(import_node_path13.default.dirname(xcodeproj))}`
12781
14113
  );
12782
14114
  return;
12783
14115
  }
12784
- const key = import_node_fs8.default.realpathSync(xcodeproj);
12785
- if (projectAt.has(key) || !installedPods && key.split(import_node_path8.default.sep).includes("Pods"))
14116
+ const key = import_node_fs12.default.realpathSync(xcodeproj);
14117
+ if (projectAt.has(key) || !installedPods && key.split(import_node_path13.default.sep).includes("Pods"))
12786
14118
  return;
12787
- if (isPodsProject(key)) cocoapods = installedPodsSandbox(import_node_path8.default.dirname(key));
14119
+ if (isPodsProject(key)) cocoapods = installedPodsSandbox(import_node_path13.default.dirname(key));
12788
14120
  const project = loadProject(key);
12789
14121
  projectAt.set(key, project);
12790
14122
  projects.push(project);
@@ -12800,12 +14132,12 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
12800
14132
  for (const reference of listed)
12801
14133
  if (reference.endsWith(".xcodeproj")) addProject(reference);
12802
14134
  if (projects.length === 0) {
12803
- throw new Error(`${import_node_path8.default.basename(xcodeprojOrWorkspace)} lists no Xcode project`);
14135
+ throw new Error(`${import_node_path13.default.basename(xcodeprojOrWorkspace)} lists no Xcode project`);
12804
14136
  }
12805
- const podfile = import_node_path8.default.join(import_node_path8.default.dirname(xcodeprojOrWorkspace), "Podfile");
12806
- if (installedPods && !cocoapods && import_node_fs8.default.existsSync(podfile))
14137
+ const podfile = import_node_path13.default.join(import_node_path13.default.dirname(xcodeprojOrWorkspace), "Podfile");
14138
+ if (installedPods && !cocoapods && import_node_fs12.default.existsSync(podfile))
12807
14139
  throw new Error(
12808
- `${podfile} is not installed into ${import_node_path8.default.basename(xcodeprojOrWorkspace)}: run \`pod install\` in ${import_node_path8.default.dirname(podfile)} and open the workspace it writes`
14140
+ `${podfile} is not installed into ${import_node_path13.default.basename(xcodeprojOrWorkspace)}: run \`pod install\` in ${import_node_path13.default.dirname(podfile)} and open the workspace it writes`
12809
14141
  );
12810
14142
  return { listed, projects, projectAt, cocoapods };
12811
14143
  }
@@ -12841,7 +14173,7 @@ function listXcodeAppTargets(xcodeprojOrWorkspace, options = {}) {
12841
14173
  return workspaceProjects(xcodeprojOrWorkspace).projects.flatMap(projectTargets).filter((ref) => isIosAppTarget(ref, options)).map((ref) => str(ref.target.name) ?? ref.id);
12842
14174
  }
12843
14175
  function readXcodeAppTarget(input, targetName, configurationName, options = {}) {
12844
- const xcodeprojOrWorkspace = import_node_fs8.default.realpathSync(input);
14176
+ const xcodeprojOrWorkspace = import_node_fs12.default.realpathSync(input);
12845
14177
  const workspace = xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : null;
12846
14178
  const { listed, projects, projectAt, cocoapods } = workspaceProjects(
12847
14179
  xcodeprojOrWorkspace,
@@ -12850,7 +14182,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
12850
14182
  const allTargets = projects.flatMap(projectTargets);
12851
14183
  const appTargets = allTargets.filter((ref) => isIosAppTarget(ref, options));
12852
14184
  const appTargetNames = appTargets.map((ref) => str(ref.target.name) ?? ref.id);
12853
- const container = import_node_path8.default.basename(xcodeprojOrWorkspace);
14185
+ const container = import_node_path13.default.basename(xcodeprojOrWorkspace);
12854
14186
  const named = targetName ? appTargets.filter((ref) => ref.target.name === targetName) : appTargets;
12855
14187
  if (named.length !== 1) {
12856
14188
  throw new Error(
@@ -12863,15 +14195,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
12863
14195
  for (const ref of allTargets) {
12864
14196
  const product = ref.project.object(str(ref.target.productReference));
12865
14197
  const file = str(product?.path);
12866
- if (file && !byProduct.has(import_node_path8.default.basename(file)))
12867
- byProduct.set(import_node_path8.default.basename(file), ref);
14198
+ if (file && !byProduct.has(import_node_path13.default.basename(file)))
14199
+ byProduct.set(import_node_path13.default.basename(file), ref);
12868
14200
  }
12869
14201
  const proxied = (project, proxyId) => {
12870
14202
  const proxy = project.object(proxyId);
12871
14203
  if (proxy?.isa !== "PBXContainerItemProxy") return void 0;
12872
14204
  const portal = str(proxy.containerPortal);
12873
14205
  const portalPath = project.resolvePath(portal ?? "");
12874
- const owner = project.object(portal)?.isa === "PBXProject" ? project : portalPath && import_node_fs8.default.existsSync(portalPath) ? projectAt.get(import_node_fs8.default.realpathSync(portalPath)) : void 0;
14206
+ const owner = project.object(portal)?.isa === "PBXProject" ? project : portalPath && import_node_fs12.default.existsSync(portalPath) ? projectAt.get(import_node_fs12.default.realpathSync(portalPath)) : void 0;
12875
14207
  const remote = str(proxy.remoteGlobalIDString);
12876
14208
  if (!owner || !remote) return void 0;
12877
14209
  return projectTargets(owner).find(
@@ -12892,7 +14224,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
12892
14224
  if (phase?.isa !== "PBXFrameworksBuildPhase") continue;
12893
14225
  for (const buildFileId of list(phase.files)) {
12894
14226
  const file = project.object(str(project.object(buildFileId)?.fileRef));
12895
- const resolved = file?.isa === "PBXReferenceProxy" ? proxied(project, str(file.remoteRef)) : file && str(file.sourceTree) === "BUILT_PRODUCTS_DIR" ? byProduct.get(import_node_path8.default.basename(str(file.path) ?? "")) : void 0;
14227
+ const resolved = file?.isa === "PBXReferenceProxy" ? proxied(project, str(file.remoteRef)) : file && str(file.sourceTree) === "BUILT_PRODUCTS_DIR" ? byProduct.get(import_node_path13.default.basename(str(file.path) ?? "")) : void 0;
12896
14228
  if (resolved) found.push(resolved);
12897
14229
  }
12898
14230
  }
@@ -12931,38 +14263,68 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
12931
14263
  { TARGET_NAME: str(ref.target.name) ?? ref.id },
12932
14264
  options
12933
14265
  ).get("PRODUCT_NAME");
14266
+ const syncHeaderCache = /* @__PURE__ */ new Map();
14267
+ const synchronizedHeaders = (ref) => {
14268
+ const key = `${ref.project.xcodeproj}\0${ref.id}`;
14269
+ const cached = syncHeaderCache.get(key);
14270
+ if (cached) return cached;
14271
+ const found = [];
14272
+ visitXcodeTargetMembers(
14273
+ ref.project.objects,
14274
+ ref.id,
14275
+ ref.project.resolvePath,
14276
+ (file) => isDirectory(file) ? walkFiles(file) : import_node_fs12.default.existsSync(file) ? [file] : [],
14277
+ import_node_path13.default.join,
14278
+ (file, kind) => {
14279
+ if (kind === "header") found.push(file);
14280
+ }
14281
+ );
14282
+ syncHeaderCache.set(key, found);
14283
+ return found;
14284
+ };
12934
14285
  const projectHeaderMaps = /* @__PURE__ */ new Map();
12935
14286
  const projectHeaderMap = (project) => {
12936
14287
  const cached = projectHeaderMaps.get(project);
12937
14288
  if (cached) return cached;
12938
14289
  const entries = /* @__PURE__ */ new Map();
12939
14290
  for (const ref of projectTargets(project)) {
12940
- const framework = FRAMEWORK_PRODUCTS.has(str(ref.target.productType) ?? "");
12941
- const product = framework ? productName(ref) : "";
14291
+ const product = productName(ref);
12942
14292
  for (const { file, visibility } of headerPhase(ref)) {
12943
- const name2 = import_node_path8.default.basename(file);
14293
+ const name2 = import_node_path13.default.basename(file);
12944
14294
  if (!entries.has(name2))
12945
- entries.set(
12946
- name2,
12947
- framework && visibility !== "Project" ? `${product}/${name2}` : file
12948
- );
14295
+ entries.set(name2, visibility !== "Project" ? `${product}/${name2}` : file);
14296
+ }
14297
+ for (const file of synchronizedHeaders(ref)) {
14298
+ const name2 = import_node_path13.default.basename(file);
14299
+ if (!entries.has(name2)) entries.set(name2, file);
14300
+ }
14301
+ }
14302
+ for (const ref of projectTargets(project)) {
14303
+ for (const groupId of list(ref.target.fileSystemSynchronizedGroups)) {
14304
+ const folder = project.resolvePath(groupId);
14305
+ if (folder === null) continue;
14306
+ for (const file of walkFiles(folder)) {
14307
+ if (!HEADER_FILE.test(file)) continue;
14308
+ const name2 = import_node_path13.default.basename(file);
14309
+ if (!entries.has(name2)) entries.set(name2, file);
14310
+ }
12949
14311
  }
12950
14312
  }
12951
14313
  for (const id of Object.keys(project.objects)) {
12952
14314
  if (project.object(id)?.isa !== "PBXFileReference") continue;
12953
14315
  const file = project.resolvePath(id);
12954
- if (file && HEADER_FILE.test(file) && !entries.has(import_node_path8.default.basename(file)))
12955
- entries.set(import_node_path8.default.basename(file), file);
14316
+ if (file && HEADER_FILE.test(file) && !entries.has(import_node_path13.default.basename(file)))
14317
+ entries.set(import_node_path13.default.basename(file), file);
12956
14318
  }
12957
14319
  const map2 = [...entries];
12958
14320
  projectHeaderMaps.set(project, map2);
12959
14321
  return map2;
12960
14322
  };
12961
14323
  const xcconfigs = /* @__PURE__ */ new Set();
12962
- const buildDir = (project) => import_node_path8.default.join(project.projectDir, ".build/peach-xcode/Build");
14324
+ const buildDir = (project) => import_node_path13.default.join(project.projectDir, ".build/peach-xcode/Build");
12963
14325
  const podsBuild = {
12964
- SYMROOT: import_node_path8.default.join(buildDir(app.project), "Products"),
12965
- OBJROOT: import_node_path8.default.join(buildDir(app.project), "Intermediates.noindex")
14326
+ SYMROOT: import_node_path13.default.join(buildDir(app.project), "Products"),
14327
+ OBJROOT: import_node_path13.default.join(buildDir(app.project), "Intermediates.noindex")
12966
14328
  };
12967
14329
  const moduleTarget = (ref) => {
12968
14330
  const name2 = str(ref.target.name) ?? ref.id;
@@ -12977,15 +14339,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
12977
14339
  TARGET_NAME: name2,
12978
14340
  TARGETNAME: "$(TARGET_NAME)",
12979
14341
  PROJECT: "$(PROJECT_NAME)",
12980
- PROJECT_NAME: import_node_path8.default.basename(ref.project.xcodeproj, ".xcodeproj"),
14342
+ PROJECT_NAME: import_node_path13.default.basename(ref.project.xcodeproj, ".xcodeproj"),
12981
14343
  PROJECT_FILE_PATH: ref.project.xcodeproj,
12982
14344
  SRCROOT: ref.project.projectDir,
12983
14345
  SOURCE_ROOT: ref.project.projectDir,
12984
14346
  PROJECT_DIR: ref.project.projectDir,
12985
- SYMROOT: import_node_path8.default.join(buildDir(ref.project), "Products"),
14347
+ SYMROOT: import_node_path13.default.join(buildDir(ref.project), "Products"),
12986
14348
  BUILD_DIR: "$(SYMROOT)",
12987
14349
  BUILD_ROOT: "$(SYMROOT)",
12988
- OBJROOT: import_node_path8.default.join(buildDir(ref.project), "Intermediates.noindex"),
14350
+ OBJROOT: import_node_path13.default.join(buildDir(ref.project), "Intermediates.noindex"),
12989
14351
  CONFIGURATION_BUILD_DIR: "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)",
12990
14352
  BUILT_PRODUCTS_DIR: "$(CONFIGURATION_BUILD_DIR)",
12991
14353
  TARGET_BUILD_DIR: "$(CONFIGURATION_BUILD_DIR)",
@@ -12998,6 +14360,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
12998
14360
  TEMP_ROOT: "$(OBJROOT)",
12999
14361
  DERIVED_FILE_DIR: "$(TARGET_TEMP_DIR)/DerivedSources",
13000
14362
  DERIVED_FILES_DIR: "$(DERIVED_FILE_DIR)",
14363
+ DERIVED_SOURCES_DIR: "$(DERIVED_FILE_DIR)",
13001
14364
  PLATFORM_NAME: "iphonesimulator",
13002
14365
  EFFECTIVE_PLATFORM_NAME: "-iphonesimulator",
13003
14366
  CURRENT_ARCH: "arm64",
@@ -13018,11 +14381,38 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13018
14381
  xcconfigs
13019
14382
  );
13020
14383
  const searchRules = recursiveSearchRules(settings2);
13021
- const absolute = (file) => import_node_path8.default.resolve(ref.project.projectDir, file);
14384
+ const absolute = (file) => import_node_path13.default.resolve(ref.project.projectDir, file);
13022
14385
  const framework = FRAMEWORK_PRODUCTS.has(str(ref.target.productType) ?? "");
13023
14386
  const product = settings2("PRODUCT_NAME");
14387
+ const moduleName = applyOperator(settings2("PRODUCT_MODULE_NAME"), "c99extidentifier");
14388
+ const compatibilityPhases = list(ref.target.buildPhases).flatMap((id) => {
14389
+ const phase = ref.project.object(id);
14390
+ if (phase?.isa !== "PBXShellScriptBuildPhase" || str(phase.name) !== "Copy generated compatibility header")
14391
+ return [];
14392
+ const inputs = list(phase.inputPaths).map(
14393
+ (file) => absolute(expand(file, settings2))
14394
+ );
14395
+ const outputs = list(phase.outputPaths).map(
14396
+ (file) => absolute(expand(file, settings2))
14397
+ );
14398
+ const moduleMap2 = inputs.find((file) => file.endsWith(".modulemap"));
14399
+ const umbrella = inputs.find((file) => file.endsWith("-umbrella.h"));
14400
+ const outputModuleMap = outputs.find((file) => file.endsWith(".modulemap"));
14401
+ const outputUmbrella = outputs.find((file) => file.endsWith("-umbrella.h"));
14402
+ const outputHeader = outputs.find((file) => file.endsWith(`/${moduleName}-Swift.h`));
14403
+ if (!moduleMap2 || !umbrella || !outputModuleMap || !outputUmbrella || !outputHeader)
14404
+ throw new Error(`${name2}: incomplete CocoaPods Swift compatibility header phase`);
14405
+ return [{ id, moduleMap: moduleMap2, umbrella, outputModuleMap, outputUmbrella, outputHeader }];
14406
+ });
14407
+ if (compatibilityPhases.length > 1)
14408
+ throw new Error(`${name2}: multiple CocoaPods Swift compatibility header phases`);
14409
+ const compatibility = compatibilityPhases[0];
14410
+ if (compatibility && members.sources.length === 0)
14411
+ throw new Error(
14412
+ `${name2}: Swift compatibility header phase has no Swift producer sources`
14413
+ );
13024
14414
  const building = options.prepareGeneratedSources && options.requireSources !== false;
13025
- const versioning = building && allSources.length > 0 && settings2("VERSIONING_SYSTEM") === "apple-generic" ? import_node_path8.default.join(settings2("DERIVED_FILE_DIR"), `${product}_vers.c`) : null;
14415
+ const versioning = building && allSources.length > 0 && settings2("VERSIONING_SYSTEM") === "apple-generic" ? import_node_path13.default.join(settings2("DERIVED_FILE_DIR"), `${product}_vers.c`) : null;
13026
14416
  if (versioning) {
13027
14417
  const version = settings2("CURRENT_PROJECT_VERSION");
13028
14418
  const custom = [
@@ -13035,7 +14425,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13035
14425
  ].filter((key) => settings2(key));
13036
14426
  if (custom.length)
13037
14427
  throw new Error(
13038
- `${name2}: Xcode generates ${import_node_path8.default.basename(versioning)} with ${custom.join(", ")}; peach does not model VERSION_INFO_* overrides`
14428
+ `${name2}: Xcode generates ${import_node_path13.default.basename(versioning)} with ${custom.join(", ")}; peach does not model VERSION_INFO_* overrides`
13039
14429
  );
13040
14430
  const symbol = product.replace(/^[^A-Za-z_]/, "_").replace(/[^A-Za-z0-9_]/g, "_");
13041
14431
  const [major, minor] = version.split(".");
@@ -13048,29 +14438,18 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13048
14438
  ` const double ${symbol}VersionNumber __attribute__ ((used)) = (double)${number};`,
13049
14439
  ""
13050
14440
  ].join("\n");
13051
- if (!import_node_fs8.default.existsSync(versioning) || import_node_fs8.default.readFileSync(versioning, "utf8") !== unit) {
13052
- import_node_fs8.default.mkdirSync(import_node_path8.default.dirname(versioning), { recursive: true });
13053
- import_node_fs8.default.writeFileSync(versioning, unit);
14441
+ if (!import_node_fs12.default.existsSync(versioning) || import_node_fs12.default.readFileSync(versioning, "utf8") !== unit) {
14442
+ import_node_fs12.default.mkdirSync(import_node_path13.default.dirname(versioning), { recursive: true });
14443
+ import_node_fs12.default.writeFileSync(versioning, unit);
13054
14444
  }
13055
14445
  allSources.push(versioning);
13056
14446
  }
13057
14447
  const implementations = allSources.filter(isSwiftNativeTranslationUnit);
13058
14448
  const native = implementations.length > 0;
13059
14449
  if (native && building) {
13060
- const generatedHeaders = list(ref.target.buildPhases).flatMap((phaseId) => {
13061
- const phase = ref.project.object(phaseId);
13062
- return phase?.isa === "PBXShellScriptBuildPhase" ? list(phase.outputPaths).filter((output) => HEADER_FILE.test(output)) : [];
13063
- });
13064
- if (generatedHeaders.length > 0 || list(ref.target.buildRules).length > 0)
13065
- throw new Error(
13066
- `${name2}: Xcode's generated-files header map, which lists headers its build rules and Run Script phases generate (${generatedHeaders.join(", ") || "build rules"}), is not modeled`
13067
- );
13068
- const nonFramework = projectTargets(ref.project).find(
13069
- (other) => !FRAMEWORK_PRODUCTS.has(str(other.target.productType) ?? "") && headerPhase(other).length > 0
13070
- );
13071
- if (nonFramework && settings2("USE_HEADERMAP") !== "NO")
14450
+ if (list(ref.target.buildRules).length > 0)
13072
14451
  throw new Error(
13073
- `${name2}: Xcode's all-non-framework-target-headers map, which lists the headers of ${str(nonFramework.target.name) ?? nonFramework.id}, is not modeled`
14452
+ `${name2}: Xcode's generated-files header map for build rules is not modeled`
13074
14453
  );
13075
14454
  if (settings2("ALWAYS_SEARCH_USER_PATHS") === "YES" && settings2("USER_HEADER_SEARCH_PATHS").trim())
13076
14455
  throw new Error(
@@ -13080,15 +14459,37 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13080
14459
  const headerFiles = headerPhase(ref);
13081
14460
  const ownHeaders = /* @__PURE__ */ new Map();
13082
14461
  for (const { file, visibility } of headerFiles) {
13083
- const name3 = import_node_path8.default.basename(file);
13084
- const published = framework && visibility !== "Project";
14462
+ const name3 = import_node_path13.default.basename(file);
14463
+ const published = visibility !== "Project";
13085
14464
  if (!ownHeaders.has(name3))
13086
14465
  ownHeaders.set(name3, published ? `${product}/${name3}` : file);
13087
- if (framework && !published && !ownHeaders.has(`${product}/${name3}`))
14466
+ if (!published && !ownHeaders.has(`${product}/${name3}`))
13088
14467
  ownHeaders.set(`${product}/${name3}`, file);
13089
14468
  }
13090
- const wrapper = import_node_path8.default.join(settings2("BUILT_PRODUCTS_DIR"), `${product}.framework`);
13091
- const moduleMap = settings2("DEFINES_MODULE") === "YES" && settings2("MODULEMAP_FILE") ? absolute(settings2("MODULEMAP_FILE")) : null;
14469
+ for (const file of synchronizedHeaders(ref)) {
14470
+ const name3 = import_node_path13.default.basename(file);
14471
+ if (ownHeaders.has(name3)) continue;
14472
+ ownHeaders.set(name3, file);
14473
+ const qualified = `${product}/${name3}`;
14474
+ if (!ownHeaders.has(qualified)) ownHeaders.set(qualified, file);
14475
+ }
14476
+ const nonFrameworkHeaders = /* @__PURE__ */ new Map();
14477
+ for (const other of projectTargets(ref.project)) {
14478
+ if (FRAMEWORK_PRODUCTS.has(str(other.target.productType) ?? "")) continue;
14479
+ const otherProduct = productName(other);
14480
+ for (const { file, visibility } of headerPhase(other)) {
14481
+ if (visibility === "Project") continue;
14482
+ const key = `${otherProduct}/${import_node_path13.default.basename(file)}`;
14483
+ if (!nonFrameworkHeaders.has(key)) nonFrameworkHeaders.set(key, file);
14484
+ }
14485
+ }
14486
+ const wrapper = import_node_path13.default.join(settings2("BUILT_PRODUCTS_DIR"), `${product}.framework`);
14487
+ const moduleMap = (settings2("DEFINES_MODULE") === "YES" || !framework) && settings2("MODULEMAP_FILE") ? absolute(settings2("MODULEMAP_FILE")) : null;
14488
+ const podHeaders = !framework && isPodsProject(ref.project.xcodeproj) && moduleMap && import_node_path13.default.relative(import_node_path13.default.join(ref.project.projectDir, "Headers", "Public"), moduleMap).split(import_node_path13.default.sep)[0] !== ".." && import_node_fs12.default.existsSync(moduleMap) ? import_node_fs12.default.readdirSync(import_node_path13.default.dirname(moduleMap)).flatMap((entry) => {
14489
+ if (!/\.(h|hh|hpp|hxx|modulemap)$/.test(entry)) return [];
14490
+ const file = import_node_path13.default.join(import_node_path13.default.dirname(moduleMap), entry);
14491
+ return import_node_fs12.default.existsSync(file) ? [file] : [];
14492
+ }) : [];
13092
14493
  const fileFlags = {};
13093
14494
  for (const phaseId of list(ref.target.buildPhases)) {
13094
14495
  const phase = ref.project.object(phaseId);
@@ -13110,7 +14511,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13110
14511
  keys,
13111
14512
  module: {
13112
14513
  name: name2,
13113
- moduleName: applyOperator(settings2("PRODUCT_MODULE_NAME"), "c99extidentifier"),
14514
+ moduleName,
13114
14515
  ...members,
13115
14516
  allSources,
13116
14517
  languageMode: swiftVersion >= 6 ? 6 : 5,
@@ -13125,17 +14526,34 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13125
14526
  )
13126
14527
  )
13127
14528
  },
14529
+ packageProducts: Array(),
14530
+ ...members.sources.length > 0 ? {
14531
+ swift: {
14532
+ flags: settingList(settings2("OTHER_SWIFT_FLAGS")),
14533
+ includePaths: settingList(settings2("SWIFT_INCLUDE_PATHS")).map(absolute),
14534
+ compatibility: compatibility ? {
14535
+ moduleMap: compatibility.moduleMap,
14536
+ umbrella: compatibility.umbrella,
14537
+ outputModuleMap: compatibility.outputModuleMap,
14538
+ outputUmbrella: compatibility.outputUmbrella,
14539
+ outputHeader: compatibility.outputHeader
14540
+ } : null
14541
+ }
14542
+ } : {},
13128
14543
  ...native ? {
13129
14544
  objc: {
13130
- publicHeaders: headerFiles.flatMap(
13131
- ({ file, visibility }) => visibility === "Public" ? [file] : []
13132
- ),
14545
+ publicHeaders: [
14546
+ ...headerFiles.flatMap(
14547
+ ({ file, visibility }) => visibility === "Public" ? [file] : []
14548
+ ),
14549
+ ...podHeaders.filter((file) => HEADER_FILE.test(file))
14550
+ ],
13133
14551
  headers: [
13134
14552
  .../* @__PURE__ */ new Set([
13135
14553
  ...headers,
13136
14554
  ...Object.keys(ref.project.objects).flatMap((id) => {
13137
14555
  const file = ref.project.resolvePath(id);
13138
- return file && HEADER_FILE.test(file) && import_node_fs8.default.existsSync(file) ? [file] : [];
14556
+ return file && HEADER_FILE.test(file) && import_node_fs12.default.existsSync(file) ? [file] : [];
13139
14557
  })
13140
14558
  ])
13141
14559
  ],
@@ -13144,15 +14562,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13144
14562
  // xcode searches its products' include directory before
13145
14563
  // HEADER_SEARCH_PATHS and the target's derived sources after.
13146
14564
  headerSearchPaths: [
13147
- import_node_path8.default.join(settings2("BUILT_PRODUCTS_DIR"), "include"),
14565
+ import_node_path13.default.join(settings2("BUILT_PRODUCTS_DIR"), "include"),
13148
14566
  ...settingList(settings2("HEADER_SEARCH_PATHS")).flatMap(
13149
14567
  (raw) => expandSearchPath(absolute(raw), searchRules)
13150
14568
  ),
13151
- import_node_path8.default.join(
14569
+ import_node_path13.default.join(
13152
14570
  `${settings2("DERIVED_FILE_DIR")}-normal`,
13153
14571
  settings2("CURRENT_ARCH")
13154
14572
  ),
13155
- import_node_path8.default.join(settings2("DERIVED_FILE_DIR"), settings2("CURRENT_ARCH")),
14573
+ import_node_path13.default.join(settings2("DERIVED_FILE_DIR"), settings2("CURRENT_ARCH")),
13156
14574
  settings2("DERIVED_FILE_DIR")
13157
14575
  ],
13158
14576
  userHeaderSearchPaths: settingList(
@@ -13182,6 +14600,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13182
14600
  fileFlags,
13183
14601
  headerMaps: settings2("USE_HEADERMAP") === "NO" ? [] : [
13184
14602
  { flag: "-I", entries: [...ownHeaders] },
14603
+ { flag: "-I", entries: [...nonFrameworkHeaders] },
13185
14604
  {
13186
14605
  flag: "-iquote",
13187
14606
  entries: projectHeaderMap(ref.project)
@@ -13191,17 +14610,17 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13191
14610
  ...headerFiles.flatMap(
13192
14611
  ({ file, visibility }) => visibility === "Project" ? [] : [
13193
14612
  [
13194
- import_node_path8.default.join(
14613
+ import_node_path13.default.join(
13195
14614
  wrapper,
13196
14615
  visibility === "Public" ? "Headers" : "PrivateHeaders",
13197
- import_node_path8.default.basename(file)
14616
+ import_node_path13.default.basename(file)
13198
14617
  ),
13199
14618
  file
13200
14619
  ]
13201
14620
  ]
13202
14621
  ),
13203
- ...moduleMap ? [[import_node_path8.default.join(wrapper, "Modules", "module.modulemap"), moduleMap]] : []
13204
- ]) : {}
14622
+ ...moduleMap ? [[import_node_path13.default.join(wrapper, "Modules", "module.modulemap"), moduleMap]] : []
14623
+ ]) : Object.fromEntries(podHeaders.map((file) => [file, file]))
13205
14624
  }
13206
14625
  } : {}
13207
14626
  }
@@ -13212,7 +14631,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13212
14631
  const frameworkTargets = builtTargets.slice(0, -1).filter(({ ref }) => ref.target.isa === "PBXNativeTarget").map(({ ref, module: module3 }) => ({ ref, framework: module3 }));
13213
14632
  const frameworks = frameworkTargets.map(({ framework }) => framework);
13214
14633
  const podSourceDirs = frameworkTargets.flatMap(
13215
- ({ ref, framework }) => isPodsProject(ref.project.xcodeproj) ? [...framework.allSources, ...framework.objc?.headers ?? []].map((file) => import_node_path8.default.dirname(file)).filter((dir) => import_node_fs8.default.existsSync(dir)) : []
14634
+ ({ ref, framework }) => isPodsProject(ref.project.xcodeproj) ? [...framework.allSources, ...framework.objc?.headers ?? []].map((file) => import_node_path13.default.dirname(file)).filter((dir) => import_node_fs12.default.existsSync(dir)) : []
13216
14635
  );
13217
14636
  const expandValue = (value) => {
13218
14637
  if (typeof value === "string") return expand(value, settings);
@@ -13224,8 +14643,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13224
14643
  }
13225
14644
  return value;
13226
14645
  };
13227
- const infoPlistFile = settings("INFOPLIST_FILE") ? import_node_path8.default.resolve(app.project.projectDir, settings("INFOPLIST_FILE")) : null;
13228
- const sourceInfo = infoPlistFile ? import_plist3.default.parse(import_node_fs8.default.readFileSync(infoPlistFile, "utf8")) : {};
14646
+ const infoPlistFile = settings("INFOPLIST_FILE") ? import_node_path13.default.resolve(app.project.projectDir, settings("INFOPLIST_FILE")) : null;
14647
+ const infoPlistPending = module2.generatedInfoPlist && !options.prepareGeneratedSources;
14648
+ const sourceInfo = infoPlistFile && !infoPlistPending ? import_plist3.default.parse(import_node_fs12.default.readFileSync(infoPlistFile, "utf8")) : {};
13229
14649
  if (!sourceInfo || typeof sourceInfo !== "object" || Array.isArray(sourceInfo) || sourceInfo instanceof Date || Buffer.isBuffer(sourceInfo)) {
13230
14650
  throw new Error(`${module2.name} Info.plist must contain a dictionary`);
13231
14651
  }
@@ -13253,7 +14673,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13253
14673
  };
13254
14674
  }
13255
14675
  const localPackageDirs = [
13256
- ...listed.filter((reference) => import_node_fs8.default.existsSync(import_node_path8.default.join(reference, "Package.swift"))),
14676
+ ...listed.filter((reference) => import_node_fs12.default.existsSync(import_node_path13.default.join(reference, "Package.swift"))),
13257
14677
  ...projects.flatMap(
13258
14678
  (project) => Object.entries(project.objects).flatMap(([id, entry]) => {
13259
14679
  if (!isDict(entry)) return [];
@@ -13263,19 +14683,19 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13263
14683
  const packages = [];
13264
14684
  while (pending.length > 0) {
13265
14685
  const dir = pending.pop();
13266
- if (import_node_fs8.default.existsSync(import_node_path8.default.join(dir, "Package.swift"))) {
14686
+ if (import_node_fs12.default.existsSync(import_node_path13.default.join(dir, "Package.swift"))) {
13267
14687
  packages.push(dir);
13268
14688
  continue;
13269
14689
  }
13270
14690
  if (!isDirectory(dir)) continue;
13271
- for (const child of import_node_fs8.default.readdirSync(dir, { withFileTypes: true }))
14691
+ for (const child of import_node_fs12.default.readdirSync(dir, { withFileTypes: true }))
13272
14692
  if (child.isDirectory() && !child.name.startsWith("."))
13273
- pending.push(import_node_path8.default.join(dir, child.name));
14693
+ pending.push(import_node_path13.default.join(dir, child.name));
13274
14694
  }
13275
14695
  return packages;
13276
14696
  }
13277
- const candidate = entry.isa === "XCLocalSwiftPackageReference" ? import_node_path8.default.resolve(project.projectDir, str(entry.relativePath) ?? "") : entry.isa === "PBXFileReference" ? project.resolvePath(id) : null;
13278
- return candidate && import_node_fs8.default.existsSync(import_node_path8.default.join(candidate, "Package.swift")) ? [candidate] : [];
14697
+ const candidate = entry.isa === "XCLocalSwiftPackageReference" ? import_node_path13.default.resolve(project.projectDir, str(entry.relativePath) ?? "") : entry.isa === "PBXFileReference" ? project.resolvePath(id) : null;
14698
+ return candidate && import_node_fs12.default.existsSync(import_node_path13.default.join(candidate, "Package.swift")) ? [candidate] : [];
13279
14699
  })
13280
14700
  )
13281
14701
  ];
@@ -13296,12 +14716,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13296
14716
  const linkedProductKeys = /* @__PURE__ */ new Set();
13297
14717
  const binaryFrameworks = /* @__PURE__ */ new Map();
13298
14718
  for (const { ref, settings: settings2 } of builtTargets) {
13299
- const absolute = (raw) => import_node_path8.default.resolve(ref.project.projectDir, expand(raw, settings2));
14719
+ const absolute = (raw) => import_node_path13.default.resolve(ref.project.projectDir, expand(raw, settings2));
13300
14720
  for (const raw of settingList(settings2("SWIFT_INCLUDE_PATHS"))) {
13301
14721
  const dir = absolute(raw);
13302
- const modulemap = import_node_path8.default.join(dir, "module.modulemap");
13303
- if (!import_node_fs8.default.existsSync(modulemap)) continue;
13304
- const name2 = moduleMapName(import_node_fs8.default.readFileSync(modulemap, "utf8"));
14722
+ const modulemap = import_node_path13.default.join(dir, "module.modulemap");
14723
+ if (!import_node_fs12.default.existsSync(modulemap)) continue;
14724
+ const name2 = moduleMapName(import_node_fs12.default.readFileSync(modulemap, "utf8"));
13305
14725
  if (name2 && !binaryFrameworks.has(name2)) binaryFrameworks.set(name2, dir);
13306
14726
  }
13307
14727
  for (const phaseId of list(ref.target.buildPhases)) {
@@ -13310,7 +14730,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13310
14730
  const inputs = list(phase.inputPaths).map(absolute);
13311
14731
  for (const raw of list(phase.inputFileListPaths)) {
13312
14732
  const file = absolute(raw);
13313
- if (!import_node_fs8.default.existsSync(file)) continue;
14733
+ if (!import_node_fs12.default.existsSync(file)) continue;
13314
14734
  xcconfigs.add(file);
13315
14735
  inputs.push(...fileListEntries(file, absolute));
13316
14736
  }
@@ -13320,10 +14740,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13320
14740
  }
13321
14741
  }
13322
14742
  }
13323
- for (const { project, target } of order) {
14743
+ const productsByTarget = /* @__PURE__ */ new Map();
14744
+ for (const ref of order) {
14745
+ const { project, target } = ref;
13324
14746
  const productRef = (id) => {
13325
- const ref = str(project.object(id)?.productRef);
13326
- return ref ? [ref] : [];
14747
+ const ref2 = str(project.object(id)?.productRef);
14748
+ return ref2 ? [ref2] : [];
13327
14749
  };
13328
14750
  const productDependencies = [
13329
14751
  ...list(target.packageProductDependencies),
@@ -13333,6 +14755,8 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13333
14755
  return phase?.isa === "PBXFrameworksBuildPhase" ? list(phase.files).flatMap(productRef) : [];
13334
14756
  })
13335
14757
  ];
14758
+ const ownProducts = [];
14759
+ const ownKeys = /* @__PURE__ */ new Set();
13336
14760
  for (const dependencyId of new Set(productDependencies)) {
13337
14761
  const dependency = project.object(dependencyId);
13338
14762
  const product = str(dependency?.productName)?.replace(/^plugin:/, "");
@@ -13345,7 +14769,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13345
14769
  product,
13346
14770
  source: reference?.isa === "XCRemoteSwiftPackageReference" ? { kind: "remote", url: str(reference.repositoryURL) ?? "" } : reference?.isa === "XCLocalSwiftPackageReference" ? {
13347
14771
  kind: "local",
13348
- dir: import_node_path8.default.resolve(
14772
+ dir: import_node_path13.default.resolve(
13349
14773
  project.projectDir,
13350
14774
  str(reference.relativePath) ?? ""
13351
14775
  )
@@ -13354,7 +14778,13 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13354
14778
  productReferences.push({ project: project.projectFile, linked });
13355
14779
  if (linked.source.kind !== "unnamed")
13356
14780
  qualifiedProductKeys.add(`${project.projectFile}\0${product}`);
14781
+ const key = JSON.stringify(linked);
14782
+ if (!ownKeys.has(key)) {
14783
+ ownKeys.add(key);
14784
+ ownProducts.push(linked);
14785
+ }
13357
14786
  }
14787
+ productsByTarget.set(ref, ownProducts);
13358
14788
  for (const phaseId of list(target.buildPhases)) {
13359
14789
  const phase = project.object(phaseId);
13360
14790
  if (phase?.isa !== "PBXFrameworksBuildPhase") continue;
@@ -13379,26 +14809,35 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13379
14809
  linkedProductKeys.add(key);
13380
14810
  linkedProducts.push(linked);
13381
14811
  }
13382
- const resolvedFile = import_node_path8.default.join(
13383
- workspace ?? import_node_path8.default.join(xcodeprojOrWorkspace, "project.xcworkspace"),
14812
+ for (const built of builtTargets)
14813
+ built.module.packageProducts = productsByTarget.get(built.ref) ?? [];
14814
+ const resolvedFile = import_node_path13.default.join(
14815
+ workspace ?? import_node_path13.default.join(xcodeprojOrWorkspace, "project.xcworkspace"),
13384
14816
  "xcshareddata",
13385
14817
  "swiftpm",
13386
14818
  "Package.resolved"
13387
14819
  );
13388
- const packageResolved = import_node_fs8.default.existsSync(resolvedFile) ? [import_node_fs8.default.realpathSync(resolvedFile)] : [...new Set(localPackageDirs.map((dir) => import_node_path8.default.join(dir, "Package.resolved")))].filter((file) => import_node_fs8.default.existsSync(file)).map((file) => import_node_fs8.default.realpathSync(file)).sort();
14820
+ let packageResolved = import_node_fs12.default.existsSync(resolvedFile) ? [import_node_fs12.default.realpathSync(resolvedFile)] : [...new Set(localPackageDirs.map((dir) => import_node_path13.default.join(dir, "Package.resolved")))].filter((file) => import_node_fs12.default.existsSync(file)).map((file) => import_node_fs12.default.realpathSync(file)).sort();
14821
+ if (packageResolved.length === 0) {
14822
+ const requirements = remotePackageRequirements(projects);
14823
+ if (requirements.length > 0) {
14824
+ resolveSwiftPackageRequirements(requirements, resolvedFile);
14825
+ packageResolved = [import_node_fs12.default.realpathSync(resolvedFile)];
14826
+ }
14827
+ }
13389
14828
  const used = order.map((ref) => ref.project);
13390
14829
  return {
13391
14830
  ...module2,
13392
14831
  rootDir: commonAncestor(
13393
14832
  [
13394
- workspace ? import_node_path8.default.dirname(workspace) : app.project.projectDir,
14833
+ workspace ? import_node_path13.default.dirname(workspace) : app.project.projectDir,
13395
14834
  ...used.map((project) => project.projectDir),
13396
14835
  ...localPackageDirs,
13397
14836
  ...linkedProducts.flatMap(
13398
- ({ source }) => source.kind === "local" && import_node_fs8.default.existsSync(source.dir) ? [source.dir] : []
14837
+ ({ source }) => source.kind === "local" && import_node_fs12.default.existsSync(source.dir) ? [source.dir] : []
13399
14838
  ),
13400
14839
  ...new Set(podSourceDirs)
13401
- ].map((dir) => import_node_fs8.default.realpathSync(dir))
14840
+ ].map((dir) => import_node_fs12.default.realpathSync(dir))
13402
14841
  ),
13403
14842
  projectFiles: [
13404
14843
  .../* @__PURE__ */ new Set([
@@ -13409,12 +14848,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13409
14848
  ].sort(),
13410
14849
  projectDirs: [...new Set(used.map((project) => project.projectDir))].sort(),
13411
14850
  appIconName: settings("ASSETCATALOG_COMPILER_APPICON_NAME"),
13412
- infoPlist: import_plist3.default.build(info),
14851
+ infoPlist: infoPlistPending ? null : import_plist3.default.build(info),
13413
14852
  infoPlistFile,
13414
14853
  frameworks,
13415
14854
  linkedProducts,
13416
14855
  localPackageDirs: [
13417
- ...new Set(localPackageDirs.map((dir) => import_node_fs8.default.realpathSync(dir)))
14856
+ ...new Set(localPackageDirs.map((dir) => import_node_fs12.default.realpathSync(dir)))
13418
14857
  ].sort(),
13419
14858
  binaryFrameworks: [...binaryFrameworks].map(([name2, file]) => ({ name: name2, path: file })).sort((left, right) => left.name.localeCompare(right.name)),
13420
14859
  packageResolved,
@@ -13430,6 +14869,10 @@ function nonEmptyString2(value) {
13430
14869
  return typeof value === "string" && value.length > 0 ? value : void 0;
13431
14870
  }
13432
14871
  function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSource) {
14872
+ if (app.infoPlist === null)
14873
+ throw new Error(
14874
+ "native app Info.plist is generated by a build phase and was not prepared"
14875
+ );
13433
14876
  const dictionary = parseInfoPlist(app.infoPlist);
13434
14877
  if (!isRecord(dictionary)) throw new Error("native app Info.plist is not a dictionary");
13435
14878
  const settings = app.settings;
@@ -13489,7 +14932,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
13489
14932
  const rtcAppGroupIdentifier = nonEmptyString2(dictionary.RTCAppGroupIdentifier);
13490
14933
  const screenShareExtensionBundleId = typeof dictionary.ScreenShareExtensionBundleId === "string" ? dictionary.ScreenShareExtensionBundleId : void 0;
13491
14934
  const rootModuleName = readRootModuleName(
13492
- app.allSources.filter((file) => /\.(?:swift|mm|m)$/.test(file) && import_node_fs9.default.existsSync(file)).map((file) => import_node_fs9.default.readFileSync(file, "utf8"))
14935
+ app.allSources.filter((file) => /\.(?:swift|mm|m)$/.test(file) && import_node_fs13.default.existsSync(file)).map((file) => import_node_fs13.default.readFileSync(file, "utf8"))
13493
14936
  );
13494
14937
  return {
13495
14938
  applicationName,
@@ -13510,7 +14953,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
13510
14953
  googleSignIn: readGoogleSignInConfiguration(
13511
14954
  dictionary,
13512
14955
  Object.fromEntries(
13513
- app.resources.filter((file) => file.endsWith(".plist")).map((file) => [file, parseInfoPlist(import_node_fs9.default.readFileSync(file, "utf8"))])
14956
+ app.resources.filter((file) => file.endsWith(".plist")).map((file) => [file, parseInfoPlist(import_node_fs13.default.readFileSync(file, "utf8"))])
13514
14957
  )
13515
14958
  ),
13516
14959
  supportedInterfaceOrientations,
@@ -13519,11 +14962,11 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
13519
14962
  alternateIconNames: [...alternateIconNames],
13520
14963
  appIconArtwork: resolveNativeAppIconArtwork(
13521
14964
  app.resources,
13522
- (file) => import_node_fs9.default.readFileSync(file, "utf8"),
14965
+ (file) => import_node_fs13.default.readFileSync(file, "utf8"),
13523
14966
  (file) => {
13524
- const extension = import_node_path9.default.extname(file).toLowerCase();
14967
+ const extension = import_node_path14.default.extname(file).toLowerCase();
13525
14968
  const contentType = extension === ".jpg" || extension === ".jpeg" ? "image/jpeg" : extension === ".webp" ? "image/webp" : "image/png";
13526
- return `data:${contentType};base64,${import_node_fs9.default.readFileSync(file).toString("base64")}`;
14969
+ return `data:${contentType};base64,${import_node_fs13.default.readFileSync(file).toString("base64")}`;
13527
14970
  },
13528
14971
  icons,
13529
14972
  app.appIconName,
@@ -13554,22 +14997,22 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
13554
14997
  const read = selectNativeAppIdentityReader(platform, {
13555
14998
  android: () => null,
13556
14999
  ios: () => {
13557
- const iosRoot = import_node_path9.default.join(projectRoot, "ios");
13558
- if (!import_node_fs9.default.existsSync(iosRoot)) return null;
15000
+ const iosRoot = import_node_path14.default.join(projectRoot, "ios");
15001
+ if (!import_node_fs13.default.existsSync(iosRoot)) return null;
13559
15002
  const files = {};
13560
- for (const entry of import_node_fs9.default.readdirSync(iosRoot, { withFileTypes: true })) {
15003
+ for (const entry of import_node_fs13.default.readdirSync(iosRoot, { withFileTypes: true })) {
13561
15004
  if (entry.name === "Pods") continue;
13562
15005
  if (entry.isDirectory()) {
13563
15006
  const names = entry.name.endsWith(".xcodeproj") ? ["project.pbxproj"] : ["Info.plist", "AppDelegate.swift", "AppDelegate.mm", "AppDelegate.m"];
13564
15007
  for (const name2 of names) {
13565
15008
  const relative3 = `ios/${entry.name}/${name2}`;
13566
- const file = import_node_path9.default.join(projectRoot, relative3);
13567
- if (import_node_fs9.default.existsSync(file)) files[relative3] = import_node_fs9.default.readFileSync(file, "utf8");
15009
+ const file = import_node_path14.default.join(projectRoot, relative3);
15010
+ if (import_node_fs13.default.existsSync(file)) files[relative3] = import_node_fs13.default.readFileSync(file, "utf8");
13568
15011
  }
13569
15012
  } else if (/AppDelegate\.(?:swift|mm|m)$/.test(entry.name)) {
13570
15013
  const relative3 = `ios/${entry.name}`;
13571
- const file = import_node_path9.default.join(projectRoot, relative3);
13572
- if (import_node_fs9.default.existsSync(file)) files[relative3] = import_node_fs9.default.readFileSync(file, "utf8");
15014
+ const file = import_node_path14.default.join(projectRoot, relative3);
15015
+ if (import_node_fs13.default.existsSync(file)) files[relative3] = import_node_fs13.default.readFileSync(file, "utf8");
13573
15016
  }
13574
15017
  }
13575
15018
  return extractNativeAppIdentityFromFiles(files, "ios", parseInfoPlist, iosTarget);
@@ -13580,41 +15023,41 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
13580
15023
  function readAndroidNativeAppIdentity(projectRoot, androidMergedManifest) {
13581
15024
  const files = {};
13582
15025
  if (androidMergedManifest) {
13583
- const file = import_node_path9.default.resolve(projectRoot, androidMergedManifest);
13584
- if (!import_node_fs9.default.existsSync(file)) return null;
13585
- files[androidMergedManifest] = import_node_fs9.default.readFileSync(file, "utf8");
15026
+ const file = import_node_path14.default.resolve(projectRoot, androidMergedManifest);
15027
+ if (!import_node_fs13.default.existsSync(file)) return null;
15028
+ files[androidMergedManifest] = import_node_fs13.default.readFileSync(file, "utf8");
13586
15029
  } else {
13587
- const androidRoot = import_node_path9.default.join(projectRoot, "android");
13588
- if (!import_node_fs9.default.existsSync(androidRoot)) return null;
15030
+ const androidRoot = import_node_path14.default.join(projectRoot, "android");
15031
+ if (!import_node_fs13.default.existsSync(androidRoot)) return null;
13589
15032
  const collect = (directory) => {
13590
- for (const entry of import_node_fs9.default.readdirSync(directory, { withFileTypes: true })) {
13591
- const file = import_node_path9.default.join(directory, entry.name);
15033
+ for (const entry of import_node_fs13.default.readdirSync(directory, { withFileTypes: true })) {
15034
+ const file = import_node_path14.default.join(directory, entry.name);
13592
15035
  if (entry.isDirectory()) collect(file);
13593
15036
  else if (entry.isFile() && entry.name === "AndroidManifest.xml")
13594
- files[import_node_path9.default.relative(projectRoot, file).split(import_node_path9.default.sep).join("/")] = import_node_fs9.default.readFileSync(file, "utf8");
15037
+ files[import_node_path14.default.relative(projectRoot, file).split(import_node_path14.default.sep).join("/")] = import_node_fs13.default.readFileSync(file, "utf8");
13595
15038
  }
13596
15039
  };
13597
- for (const module2 of import_node_fs9.default.readdirSync(androidRoot, { withFileTypes: true })) {
15040
+ for (const module2 of import_node_fs13.default.readdirSync(androidRoot, { withFileTypes: true })) {
13598
15041
  if (!module2.isDirectory()) continue;
13599
- const outputs = import_node_path9.default.join(
15042
+ const outputs = import_node_path14.default.join(
13600
15043
  androidRoot,
13601
15044
  module2.name,
13602
15045
  "build/intermediates/merged_manifests"
13603
15046
  );
13604
- if (import_node_fs9.default.existsSync(outputs)) collect(outputs);
15047
+ if (import_node_fs13.default.existsSync(outputs)) collect(outputs);
13605
15048
  }
13606
15049
  }
13607
15050
  for (const manifest of Object.keys(files)) {
13608
15051
  const resourceDirectory = androidMergedResourceValuesDirectory(manifest);
13609
15052
  if (!resourceDirectory) continue;
13610
- const absolute = import_node_path9.default.resolve(projectRoot, resourceDirectory);
13611
- if (!import_node_fs9.default.existsSync(absolute)) continue;
13612
- for (const entry of import_node_fs9.default.readdirSync(absolute, { withFileTypes: true })) {
15053
+ const absolute = import_node_path14.default.resolve(projectRoot, resourceDirectory);
15054
+ if (!import_node_fs13.default.existsSync(absolute)) continue;
15055
+ for (const entry of import_node_fs13.default.readdirSync(absolute, { withFileTypes: true })) {
13613
15056
  if (!entry.isDirectory() || !/^values(?:-|$)/.test(entry.name)) continue;
13614
- for (const resource of import_node_fs9.default.readdirSync(import_node_path9.default.join(absolute, entry.name))) {
15057
+ for (const resource of import_node_fs13.default.readdirSync(import_node_path14.default.join(absolute, entry.name))) {
13615
15058
  if (!resource.endsWith(".xml")) continue;
13616
15059
  const file = `${resourceDirectory}/${entry.name}/${resource}`;
13617
- files[file] = import_node_fs9.default.readFileSync(import_node_path9.default.resolve(projectRoot, file), "utf8");
15060
+ files[file] = import_node_fs13.default.readFileSync(import_node_path14.default.resolve(projectRoot, file), "utf8");
13618
15061
  }
13619
15062
  }
13620
15063
  }
@@ -13631,7 +15074,7 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget) {
13631
15074
  const app = readIosAppTarget(projectRoot, iosTarget);
13632
15075
  if (!app) return null;
13633
15076
  const identity = readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist);
13634
- const projectManifestPath = import_node_path9.default.join(projectRoot, "package.json");
15077
+ const projectManifestPath = import_node_path14.default.join(projectRoot, "package.json");
13635
15078
  const projectRequire = (0, import_node_module3.createRequire)(projectManifestPath);
13636
15079
  let reanimatedManifestPath;
13637
15080
  try {
@@ -13645,22 +15088,22 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget) {
13645
15088
  throw error;
13646
15089
  }
13647
15090
  const installedManifest = JSON.parse(
13648
- import_node_fs9.default.readFileSync(reanimatedManifestPath, "utf8")
15091
+ import_node_fs13.default.readFileSync(reanimatedManifestPath, "utf8")
13649
15092
  );
13650
15093
  const installedVersion = isRecord(installedManifest) ? nonEmptyString2(installedManifest.version) : void 0;
13651
15094
  if (!installedVersion) throw new Error("Reanimated package version is malformed");
13652
15095
  if (Number.parseInt(installedVersion, 10) < 4) return identity;
13653
15096
  const defaults = JSON.parse(
13654
- import_node_fs9.default.readFileSync(
13655
- import_node_path9.default.join(
13656
- import_node_path9.default.dirname(reanimatedManifestPath),
15097
+ import_node_fs13.default.readFileSync(
15098
+ import_node_path14.default.join(
15099
+ import_node_path14.default.dirname(reanimatedManifestPath),
13657
15100
  "src/featureFlags/staticFlags.json"
13658
15101
  ),
13659
15102
  "utf8"
13660
15103
  )
13661
15104
  );
13662
15105
  if (!isRecord(defaults)) throw new Error("Reanimated static flags are malformed");
13663
- const manifest = JSON.parse(import_node_fs9.default.readFileSync(projectManifestPath, "utf8"));
15106
+ const manifest = JSON.parse(import_node_fs13.default.readFileSync(projectManifestPath, "utf8"));
13664
15107
  const reanimated = isRecord(manifest) ? manifest.reanimated : void 0;
13665
15108
  const overrides = isRecord(reanimated) ? reanimated.staticFeatureFlags : void 0;
13666
15109
  if (overrides !== void 0 && !isRecord(overrides)) {
@@ -13683,9 +15126,9 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget) {
13683
15126
  return { ...identity, reanimatedStaticFeatureFlags: flags };
13684
15127
  }
13685
15128
  function readIosAppTarget(projectRoot, iosTarget) {
13686
- const iosRoot = import_node_path9.default.join(projectRoot, "ios");
13687
- if (!import_node_fs9.default.existsSync(iosRoot)) return null;
13688
- const projects = import_node_fs9.default.readdirSync(iosRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj"));
15129
+ const iosRoot = import_node_path14.default.join(projectRoot, "ios");
15130
+ if (!import_node_fs13.default.existsSync(iosRoot)) return null;
15131
+ const projects = import_node_fs13.default.readdirSync(iosRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj"));
13689
15132
  if (projects.length === 0) return null;
13690
15133
  if (projects.length > 1 && !iosTarget) {
13691
15134
  throw new NativeAppTargetSelectionError(
@@ -13695,7 +15138,7 @@ function readIosAppTarget(projectRoot, iosTarget) {
13695
15138
  let project = projects[0];
13696
15139
  if (iosTarget && projects.length > 1) {
13697
15140
  const matches = projects.filter(
13698
- (entry) => listXcodeAppTargets(import_node_path9.default.join(iosRoot, entry.name), {
15141
+ (entry) => listXcodeAppTargets(import_node_path14.default.join(iosRoot, entry.name), {
13699
15142
  requireSources: false
13700
15143
  }).includes(iosTarget)
13701
15144
  );
@@ -13709,7 +15152,7 @@ function readIosAppTarget(projectRoot, iosTarget) {
13709
15152
  }
13710
15153
  project = matches[0];
13711
15154
  }
13712
- const xcodeproj = import_node_path9.default.join(iosRoot, project.name);
15155
+ const xcodeproj = import_node_path14.default.join(iosRoot, project.name);
13713
15156
  const appTargets = listXcodeAppTargets(xcodeproj, { requireSources: false });
13714
15157
  if (!iosTarget && appTargets.length > 1) {
13715
15158
  throw new NativeAppTargetSelectionError(
@@ -13717,16 +15160,17 @@ function readIosAppTarget(projectRoot, iosTarget) {
13717
15160
  );
13718
15161
  }
13719
15162
  return readXcodeAppTarget(xcodeproj, iosTarget ?? appTargets[0], "Release", {
13720
- requireSources: false
15163
+ requireSources: false,
15164
+ prepareGeneratedSources: true
13721
15165
  });
13722
15166
  }
13723
15167
 
13724
15168
  // src/native-firebase-config.ts
13725
15169
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
13726
- var import_node_child_process3 = require("node:child_process");
13727
- var import_node_fs10 = __toESM(require("node:fs"), 1);
13728
- var import_node_os3 = __toESM(require("node:os"), 1);
13729
- var import_node_path10 = __toESM(require("node:path"), 1);
15170
+ var import_node_child_process4 = require("node:child_process");
15171
+ var import_node_fs14 = __toESM(require("node:fs"), 1);
15172
+ var import_node_os5 = __toESM(require("node:os"), 1);
15173
+ var import_node_path15 = __toESM(require("node:path"), 1);
13730
15174
  init_is_record();
13731
15175
  var EXPO_CONFIG_SCRIPT = `const { createRequire } = require('node:module');
13732
15176
  const { writeFileSync } = require('node:fs');
@@ -13737,13 +15181,13 @@ const result = JSON.stringify(getConfig(root, { skipSDKVersionRequirement: true
13737
15181
  if (Buffer.byteLength(result) > 1024 * 1024) throw new Error('Expo native configuration exceeds 1 MiB.');
13738
15182
  writeFileSync(process.argv[2], result, { mode: 0o600 });`;
13739
15183
  function hasExpoConfig(projectRoot) {
13740
- const appJsonPath = import_node_path10.default.join(projectRoot, "app.json");
13741
- const appJson = import_node_fs10.default.existsSync(appJsonPath) ? JSON.parse(import_node_fs10.default.readFileSync(appJsonPath, "utf8")) : null;
15184
+ const appJsonPath = import_node_path15.default.join(projectRoot, "app.json");
15185
+ const appJson = import_node_fs14.default.existsSync(appJsonPath) ? JSON.parse(import_node_fs14.default.readFileSync(appJsonPath, "utf8")) : null;
13742
15186
  const staticExpo = isRecord(appJson) && (isRecord(appJson.expo) || [appJson.ios, appJson.android].some(
13743
15187
  (value) => isRecord(value) && typeof value.googleServicesFile === "string"
13744
15188
  ));
13745
15189
  return staticExpo || ["app.config.js", "app.config.ts", "app.config.cjs", "app.config.mjs"].some(
13746
- (name2) => import_node_fs10.default.existsSync(import_node_path10.default.join(projectRoot, name2))
15190
+ (name2) => import_node_fs14.default.existsSync(import_node_path15.default.join(projectRoot, name2))
13747
15191
  );
13748
15192
  }
13749
15193
  function expoConfigArgs(projectRoot, resultPath) {
@@ -13751,24 +15195,24 @@ function expoConfigArgs(projectRoot, resultPath) {
13751
15195
  "--input-type=commonjs",
13752
15196
  "-e",
13753
15197
  EXPO_CONFIG_SCRIPT,
13754
- import_node_path10.default.resolve(projectRoot),
15198
+ import_node_path15.default.resolve(projectRoot),
13755
15199
  resultPath
13756
15200
  ];
13757
15201
  }
13758
15202
  function readExpoConfigResult(resultPath, status, stderr) {
13759
15203
  if (status !== 0)
13760
15204
  throw new Error(stderr || "Expo native configuration evaluation failed.");
13761
- const resolved = JSON.parse(import_node_fs10.default.readFileSync(resultPath, "utf8"));
15205
+ const resolved = JSON.parse(import_node_fs14.default.readFileSync(resultPath, "utf8"));
13762
15206
  if (!isRecord(resolved)) throw new Error("Expo native configuration is unavailable.");
13763
15207
  return resolved;
13764
15208
  }
13765
- var resultDirectory = () => import_node_fs10.default.mkdtempSync(import_node_path10.default.join(import_node_os3.default.tmpdir(), "peach-expo-config-"));
15209
+ var resultDirectory = () => import_node_fs14.default.mkdtempSync(import_node_path15.default.join(import_node_os5.default.tmpdir(), "peach-expo-config-"));
13766
15210
  function readExpoConfig(projectRoot) {
13767
15211
  if (!hasExpoConfig(projectRoot)) return {};
13768
15212
  const directory = resultDirectory();
13769
- const resultPath = import_node_path10.default.join(directory, "config.json");
15213
+ const resultPath = import_node_path15.default.join(directory, "config.json");
13770
15214
  try {
13771
- const child = (0, import_node_child_process3.spawnSync)("node", expoConfigArgs(projectRoot, resultPath), {
15215
+ const child = (0, import_node_child_process4.spawnSync)("node", expoConfigArgs(projectRoot, resultPath), {
13772
15216
  cwd: projectRoot,
13773
15217
  encoding: "utf8",
13774
15218
  stdio: ["ignore", "ignore", "pipe"],
@@ -13778,7 +15222,7 @@ function readExpoConfig(projectRoot) {
13778
15222
  if (child.error) throw child.error;
13779
15223
  return readExpoConfigResult(resultPath, child.status, child.stderr);
13780
15224
  } finally {
13781
- import_node_fs10.default.rmSync(directory, { recursive: true, force: true });
15225
+ import_node_fs14.default.rmSync(directory, { recursive: true, force: true });
13782
15226
  }
13783
15227
  }
13784
15228
  function evaluateFirebaseGuard(header, resources) {
@@ -13800,7 +15244,7 @@ function evaluateFirebaseGuard(header, resources) {
13800
15244
  }
13801
15245
  clauses.push(condition.slice(start).trim());
13802
15246
  const sources = resources.filter(
13803
- (file) => import_node_path10.default.basename(file) === "GoogleService-Info.plist"
15247
+ (file) => import_node_path15.default.basename(file) === "GoogleService-Info.plist"
13804
15248
  );
13805
15249
  const bound = /* @__PURE__ */ new Map();
13806
15250
  for (const clause of clauses) {
@@ -13816,7 +15260,7 @@ function evaluateFirebaseGuard(header, resources) {
13816
15260
  const dictionary = /^let\s+(\w+)\s*=\s*NSDictionary\s*\(\s*contentsOfFile:\s*(\w+)\s*\)$/.exec(clause);
13817
15261
  if (dictionary && typeof bound.get(dictionary[2]) === "string") {
13818
15262
  const parsed = parsePlistSource(
13819
- import_node_fs10.default.readFileSync(String(bound.get(dictionary[2])), "utf8")
15263
+ import_node_fs14.default.readFileSync(String(bound.get(dictionary[2])), "utf8")
13820
15264
  );
13821
15265
  if (!isRecord(parsed)) return false;
13822
15266
  bound.set(dictionary[1], parsed);
@@ -13898,7 +15342,7 @@ function findDefaultConfigureCall(body, sources) {
13898
15342
  const [, type, name2] = call;
13899
15343
  for (const file of sources) {
13900
15344
  if (!file.endsWith(".swift")) continue;
13901
- const source = blankSwiftObjcLiterals(import_node_fs10.default.readFileSync(file, "utf8"));
15345
+ const source = blankSwiftObjcLiterals(import_node_fs14.default.readFileSync(file, "utf8"));
13902
15346
  const declaration = new RegExp(
13903
15347
  `\\b(?:enum|struct|class)\\s+${type}\\b[^{]*\\{`
13904
15348
  ).exec(source);
@@ -13914,15 +15358,16 @@ function findDefaultConfigureCall(body, sources) {
13914
15358
  }
13915
15359
  return null;
13916
15360
  }
13917
- function readTargetGoogleServicesFile(projectRoot, xcodeproj, target) {
15361
+ function readTargetGoogleServicesFile(projectRoot, xcodeproj, target, prepareGeneratedSources = false) {
13918
15362
  const app = readXcodeAppTarget(xcodeproj, target, void 0, {
13919
- requireSources: false
15363
+ requireSources: false,
15364
+ prepareGeneratedSources
13920
15365
  });
13921
15366
  const delegates = app.allSources.filter(
13922
- (file) => /^AppDelegate\.(swift|mm|m)$/.test(import_node_path10.default.basename(file))
15367
+ (file) => /^AppDelegate\.(swift|mm|m)$/.test(import_node_path15.default.basename(file))
13923
15368
  );
13924
15369
  const defaultConfigured = delegates.some((file) => {
13925
- const raw = import_node_fs10.default.readFileSync(file, "utf8");
15370
+ const raw = import_node_fs14.default.readFileSync(file, "utf8");
13926
15371
  const source = blankSwiftObjcLiterals(raw);
13927
15372
  const launch = /(?:\bfunc\s+application\s*\([\s\S]*?didFinishLaunchingWithOptions[\s\S]*?\)\s*->\s*Bool|^-\s*\(BOOL\)\s*application\s*:[\s\S]*?didFinishLaunchingWithOptions[^{]*)\s*\{/m.exec(
13928
15373
  source
@@ -13987,32 +15432,56 @@ function readTargetGoogleServicesFile(projectRoot, xcodeproj, target) {
13987
15432
  return guarded;
13988
15433
  });
13989
15434
  if (!defaultConfigured) return null;
13990
- const resources = app.resources.filter(
13991
- (file) => /^GoogleService-Info\.plist$/.test(import_node_path10.default.basename(file))
15435
+ const bundle = import_node_path15.default.join(
15436
+ app.settings("BUILT_PRODUCTS_DIR"),
15437
+ app.settings("WRAPPER_NAME") || `${app.settings("PRODUCT_NAME")}.app`
13992
15438
  );
15439
+ const staged = app.copiedFiles.filter(
15440
+ ({ from, to }) => to === import_node_path15.default.join(bundle, "GoogleService-Info.plist") && import_node_fs14.default.existsSync(from)
15441
+ ).map(({ from }) => import_node_fs14.default.realpathSync(from));
15442
+ const resources = [
15443
+ .../* @__PURE__ */ new Set([
15444
+ ...app.resources.filter(
15445
+ (file) => /^GoogleService-Info\.plist$/.test(import_node_path15.default.basename(file))
15446
+ ),
15447
+ ...staged
15448
+ ])
15449
+ ];
13993
15450
  if (resources.length !== 1)
13994
15451
  throw new Error(
13995
15452
  "native Firebase default initialization requires one GoogleService-Info.plist build resource"
13996
15453
  );
13997
- return import_node_path10.default.relative(import_node_fs10.default.realpathSync(projectRoot), resources[0]);
15454
+ return import_node_path15.default.relative(import_node_fs14.default.realpathSync(projectRoot), resources[0]);
13998
15455
  }
13999
- function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"], iosTarget, config = readExpoConfig(projectRoot)) {
15456
+ function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"], iosTarget, config = readExpoConfig(projectRoot), prepareGeneratedSources = false) {
14000
15457
  const result = {};
14001
15458
  const ios = config.ios;
14002
15459
  if (platforms.includes("ios") && (!isRecord(ios) || typeof ios.googleServicesFile !== "string")) {
14003
- const iosRoot = import_node_path10.default.join(projectRoot, "ios");
14004
- if (import_node_fs10.default.existsSync(iosRoot)) {
14005
- const projects = import_node_fs10.default.readdirSync(iosRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj"));
15460
+ const iosRoot = import_node_path15.default.join(projectRoot, "ios");
15461
+ if (import_node_fs14.default.existsSync(iosRoot)) {
15462
+ const projects = import_node_fs14.default.readdirSync(iosRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj"));
14006
15463
  if (projects.length > 1)
14007
15464
  throw new Error(
14008
15465
  `native Firebase configuration requires a selected Xcode project; set withPeach's iosTarget to an app target in one of: ${projects.map((entry) => entry.name).join(", ")}`
14009
15466
  );
14010
15467
  if (projects.length === 1) {
14011
- const xcodeproj = import_node_path10.default.join(iosRoot, projects[0].name);
15468
+ const xcodeproj = import_node_path15.default.join(iosRoot, projects[0].name);
14012
15469
  const appTargets = listXcodeAppTargets(xcodeproj, { requireSources: false });
15470
+ const bundleId = isRecord(ios) && typeof ios.bundleIdentifier === "string" ? ios.bundleIdentifier : null;
15471
+ const matching = bundleId ? appTargets.filter(
15472
+ (target) => readXcodeAppTarget(xcodeproj, target, void 0, {
15473
+ requireSources: false,
15474
+ prepareGeneratedSources
15475
+ }).settings("PRODUCT_BUNDLE_IDENTIFIER") === bundleId
15476
+ ) : [];
14013
15477
  const files = new Set(
14014
- (iosTarget ? [iosTarget] : appTargets).map(
14015
- (target) => readTargetGoogleServicesFile(projectRoot, xcodeproj, target)
15478
+ (iosTarget ? [iosTarget] : matching.length > 0 ? matching : appTargets).map(
15479
+ (target) => readTargetGoogleServicesFile(
15480
+ projectRoot,
15481
+ xcodeproj,
15482
+ target,
15483
+ prepareGeneratedSources
15484
+ )
14016
15485
  )
14017
15486
  );
14018
15487
  if (files.size > 1)
@@ -14028,8 +15497,8 @@ function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"], i
14028
15497
  const native = config[platform];
14029
15498
  if (!isRecord(native) || typeof native.googleServicesFile !== "string") continue;
14030
15499
  try {
14031
- const source = import_node_fs10.default.readFileSync(
14032
- import_node_path10.default.resolve(projectRoot, native.googleServicesFile),
15500
+ const source = import_node_fs14.default.readFileSync(
15501
+ import_node_path15.default.resolve(projectRoot, native.googleServicesFile),
14033
15502
  "utf8"
14034
15503
  );
14035
15504
  const parsed = platform === "ios" ? parsePlistSource(source) : JSON.parse(source);
@@ -14350,6 +15819,13 @@ function withPeach(config, options = {}) {
14350
15819
  annotated,
14351
15820
  (code) => insertAndroidAutolinkingFooter(code, androidAutolinkedPackages)
14352
15821
  );
15822
+ const rootModuleName = readAndroidLauncherRootModuleName(cfgProjectRoot);
15823
+ if (rootModuleName !== void 0) {
15824
+ annotated = await mapMetroSerializerCode(
15825
+ annotated,
15826
+ (code) => insertAndroidRootModuleFooter(code, rootModuleName)
15827
+ );
15828
+ }
14353
15829
  }
14354
15830
  const identity = readNativeAppIdentityFromProject(
14355
15831
  cfgProjectRoot,