peachsim 0.1.1700 → 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 (871) 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/cloud-client.ts +6 -3
  9. package/cli/commands/control.ts +123 -40
  10. package/cli/commands/coverage-swift.ts +19 -1
  11. package/cli/commands/detect.ts +84 -37
  12. package/cli/commands/doctor.ts +159 -20
  13. package/cli/commands/flow.ts +4 -1
  14. package/cli/commands/inspect/core.ts +176 -17
  15. package/cli/commands/inspect/settling.ts +17 -5
  16. package/cli/commands/inspect/wait-ready.ts +7 -5
  17. package/cli/commands/inspect.ts +8 -2
  18. package/cli/commands/record.ts +263 -32
  19. package/cli/commands/screenshot.ts +2 -13
  20. package/cli/commands/test.ts +49 -101
  21. package/cli/current-sim.ts +4 -4
  22. package/cli/hints.ts +1 -6
  23. package/cli/main.ts +8 -1
  24. package/cli/metro-bundle-assets.ts +77 -0
  25. package/cli/outbound-endpoints.ts +6 -2
  26. package/cli/run-registry.ts +0 -8
  27. package/cli/scene-video.ts +5 -3
  28. package/cli/ws-bridge.ts +56 -14
  29. package/detox/index.ts +68 -10
  30. package/detox/launch-permissions.ts +183 -27
  31. package/dist-lib/agent-daemon-client.cjs +1 -1
  32. package/dist-lib/agent-events.cjs +1 -1
  33. package/dist-lib/attached-projects.cjs +1 -1
  34. package/dist-lib/auth/shared-session.cjs +1 -1
  35. package/dist-lib/backend-origin.cjs +10 -9
  36. package/dist-lib/beta.cjs +1 -1
  37. package/dist-lib/beta.mjs +1 -1
  38. package/dist-lib/bridge-constants.cjs +5 -1
  39. package/dist-lib/bridge-contract-input.cjs +1 -1
  40. package/dist-lib/bridge-contract-input.mjs +1 -1
  41. package/dist-lib/bridge-contract.cjs +1 -1
  42. package/dist-lib/bridge-contract.mjs +1 -1
  43. package/dist-lib/bundle-channel.cjs +20275 -20082
  44. package/dist-lib/capture-contract.cjs +1 -1
  45. package/dist-lib/capture-contract.mjs +1 -1
  46. package/dist-lib/cloud-contract.cjs +1 -1
  47. package/dist-lib/cloud-contract.mjs +1 -1
  48. package/dist-lib/cloud-test-args.cjs +1 -1
  49. package/dist-lib/cloud-test-args.mjs +1 -1
  50. package/dist-lib/cloud.cjs +2 -1
  51. package/dist-lib/cloud.mjs +2 -1
  52. package/dist-lib/config.cjs +1 -1
  53. package/dist-lib/config.mjs +1 -1
  54. package/dist-lib/detox/index.cjs +166 -25
  55. package/dist-lib/dev-bundle-resolution.cjs +2 -8
  56. package/dist-lib/expo-swift-bundle.cjs +15190 -22541
  57. package/dist-lib/expo-swift-metadata.cjs +1 -1
  58. package/dist-lib/expo-swift-metadata.mjs +1 -1
  59. package/dist-lib/home-paths.cjs +1 -1
  60. package/dist-lib/host/bridge-host.cjs +20783 -20206
  61. package/dist-lib/host/fetch-proxy-handler.cjs +467 -77
  62. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  63. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  64. package/dist-lib/host/replacement-module-handler.cjs +2 -1
  65. package/dist-lib/host/websocket-proxy.cjs +311 -45
  66. package/dist-lib/index.cjs +1956 -574
  67. package/dist-lib/jump-to-source-babel.cjs +1 -1
  68. package/dist-lib/jump-to-source-native.cjs +1 -1
  69. package/dist-lib/kotlin-host.cjs +1 -1
  70. package/dist-lib/menu.cjs +4 -1
  71. package/dist-lib/menu.mjs +3 -1
  72. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  73. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  74. package/dist-lib/metro-production-bundle.cjs +1 -1
  75. package/dist-lib/metro-production-bundle.mjs +1 -1
  76. package/dist-lib/metro.cjs +1803 -547
  77. package/dist-lib/native-app-identity-project.cjs +823 -203
  78. package/dist-lib/native-app-identity-project.mjs +832 -206
  79. package/dist-lib/native-app-identity.cjs +14 -1
  80. package/dist-lib/native-app-identity.mjs +12 -1
  81. package/dist-lib/native-firebase-metadata.cjs +1 -1
  82. package/dist-lib/native-firebase-metadata.mjs +1 -1
  83. package/dist-lib/plist.cjs +1 -1
  84. package/dist-lib/plist.mjs +1 -1
  85. package/dist-lib/profiles.cjs +1 -1
  86. package/dist-lib/public-brand.cjs +1 -1
  87. package/dist-lib/public-origins-lib-esm.json +31 -101
  88. package/dist-lib/public-origins-lib.json +259 -383
  89. package/dist-lib/react-native-host-modules.cjs +97 -3
  90. package/dist-lib/react-native-host-modules.mjs +96 -3
  91. package/dist-lib/reap-browser.cjs +1 -1
  92. package/dist-lib/scripts/dev-server-scanner.cjs +20 -45
  93. package/dist-lib/sdk.cjs +145 -18
  94. package/dist-lib/sdk.mjs +139 -18
  95. package/dist-lib/skills.cjs +13204 -11702
  96. package/dist-lib/swift-compile.cjs +6034 -16894
  97. package/dist-lib/swift-compile.mjs +6099 -16966
  98. package/dist-lib/swift-package.cjs +81 -3
  99. package/dist-lib/swift-package.mjs +77 -3
  100. package/dist-lib/swift-submit.cjs +14 -4
  101. package/dist-lib/swift-submit.mjs +14 -4
  102. package/dist-lib/swift-toolchain.cjs +12 -10
  103. package/dist-lib/swift.cjs +1 -1
  104. package/dist-lib/vite-swift.cjs +16850 -24974
  105. package/dist-lib/vite.cjs +541 -117
  106. package/dist-lib/worklet-executable.cjs +1 -1
  107. package/dist-lib/worklet-executable.mjs +1 -1
  108. package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-gesture-handler.d.ts +2 -0
  109. package/dist-types/packages/peach-compat/src/stubs/screen-transition-math.d.ts +1 -1
  110. package/dist-types/packages/peach-engine/src/capture/lockstep-clockContract.d.ts +1 -0
  111. package/dist-types/packages/peach-engine/src/engine/fiber-debug-metadata.d.ts +4 -0
  112. package/dist-types/packages/peach-engine/src/engine/font-config.d.ts +1 -1
  113. package/dist-types/packages/peach-engine/src/engine/fontDataContract.d.ts +1 -0
  114. package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +2 -0
  115. package/dist-types/packages/peach-engine/src/engine/lottie-types.d.ts +3 -0
  116. package/dist-types/packages/peach-engine/src/engine/node.d.ts +5 -3
  117. package/dist-types/packages/peach-engine/src/engine/riveContract.d.ts +5 -0
  118. package/dist-types/packages/peach-engine/src/guest-module-overrides.d.ts +3 -0
  119. package/dist-types/packages/peach-engine/src/ios/chrome-metrics.d.ts +2 -1
  120. package/dist-types/packages/peach-engine/src/permissions/system-permission-types.d.ts +2 -1
  121. package/dist-types/packages/peach-engine/src/react-native/host-services.d.ts +1 -0
  122. package/dist-types/packages/peach-engine/src/react-native/platform-colors.d.ts +1 -0
  123. package/dist-types/packages/peach-engine/src/remote-stream/cloud-display.d.ts +6 -2
  124. package/dist-types/packages/peach-engine/src/remote-stream/scene-recording.d.ts +4 -0
  125. package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +16 -0
  126. package/dist-types/packages/peach-engine/src/render-worker/host-service-protocol.d.ts +15 -2
  127. package/dist-types/packages/peach-engine/src/render-worker/live-frame-mirror.d.ts +11 -0
  128. package/dist-types/packages/peach-engine/src/render-worker/native-ui-protocol.d.ts +10 -1
  129. package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +10 -0
  130. package/dist-types/packages/peach-engine/src/render-worker/shell-protocol.d.ts +5 -0
  131. package/dist-types/packages/peach-engine/src/render-worker/shell-tree-wire.d.ts +5 -0
  132. package/dist-types/packages/peach-engine/src/render-worker/tree-sync-port.d.ts +5 -0
  133. package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime-kind.d.ts +5 -1
  134. package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +6 -4
  135. package/dist-types/packages/peach-engine/src/render-worker/workletThreadIdentityContract.d.ts +4 -0
  136. package/dist-types/packages/peach-globals/src/guestExecutionContract.d.ts +30 -0
  137. package/dist-types/packages/peach-globals/src/index.d.ts +6 -4
  138. package/dist-types/packages/peach-globals/src/nativeBuildOptionsContract.d.ts +1 -0
  139. package/dist-types/packages/peach-globals/src/permissionsBridgeContract.d.ts +11 -0
  140. package/dist-types/packages/peach-globals/src/recordingBridgeContract.d.ts +22 -1
  141. package/dist-types/packages/peach-globals/src/sceneStreamBridgeContract.d.ts +10 -0
  142. package/dist-types/packages/peach-globals/src/shellHostBridgeContract.d.ts +8 -2
  143. package/dist-types/packages/peach-globals/src/testBridgeContract.d.ts +3 -0
  144. package/dist-types/packages/peach-kit/src/capabilities.d.ts +1 -0
  145. package/package.json +3 -1
  146. package/runtime-companion.json +1 -1
  147. package/scripts/dev-server-scanner.ts +57 -70
  148. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBATTRequest.h +69 -0
  149. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBAdvertisementData.h +94 -0
  150. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBAttribute.h +34 -0
  151. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBCentral.h +41 -0
  152. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBCentralManager.h +394 -0
  153. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBCentralManagerConstants.h +224 -0
  154. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBCharacteristic.h +187 -0
  155. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBDefines.h +16 -0
  156. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBDescriptor.h +78 -0
  157. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBError.h +75 -0
  158. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBL2CAPChannel.h +50 -0
  159. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBManager.h +88 -0
  160. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBPeer.h +28 -0
  161. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBPeripheral.h +530 -0
  162. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBPeripheralManager.h +489 -0
  163. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBPeripheralManagerConstants.h +63 -0
  164. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBService.h +100 -0
  165. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBUUID.h +144 -0
  166. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CoreBluetooth.apinotes +7 -0
  167. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Headers/CoreBluetooth.h +32 -0
  168. package/sdk/ios/System/Library/Frameworks/CoreBluetooth.framework/Modules/module.modulemap +5 -0
  169. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCGTypes.h +131 -0
  170. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h +8 -0
  171. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBase.h +359 -2
  172. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGeometry.h +328 -0
  173. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h +1 -60
  174. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/CoreNFC.apinotes +258 -0
  175. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/CoreNFC.h +31 -0
  176. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/NFCError.h +103 -0
  177. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/NFCFeliCaTag.h +267 -0
  178. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/NFCISO15693ReaderSession.h +59 -0
  179. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/NFCISO15693Tag.h +739 -0
  180. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/NFCISO7816Tag.h +159 -0
  181. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/NFCMiFareTag.h +94 -0
  182. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/NFCNDEFMessage.h +60 -0
  183. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/NFCNDEFPayload.h +121 -0
  184. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/NFCNDEFReaderSession.h +169 -0
  185. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/NFCNDEFTag.h +93 -0
  186. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/NFCPaymentTagReaderSession.h +58 -0
  187. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/NFCReaderSession.h +156 -0
  188. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/NFCTag.h +127 -0
  189. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/NFCTagReaderSession.h +201 -0
  190. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/NFCVASReaderSession.h +237 -0
  191. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Headers/NSUserActivity+CoreNFC.h +35 -0
  192. package/sdk/ios/System/Library/Frameworks/CoreNFC.framework/Modules/module.modulemap +21 -0
  193. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTCall.h +53 -0
  194. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTCallCenter.h +45 -0
  195. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTCarrier.h +87 -0
  196. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTCellularData.h +39 -0
  197. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTCellularPlanProperties.h +46 -0
  198. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTCellularPlanProvisioning.h +33 -0
  199. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTCellularPlanProvisioningRequest.h +36 -0
  200. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTCellularPlanStatus.h +57 -0
  201. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTQuickSwitch.h +53 -0
  202. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTSubscriber.h +107 -0
  203. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTSubscriberInfo.h +34 -0
  204. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTTelephonyNetworkInfo.h +161 -0
  205. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CoreTelephonyDefines.h +39 -0
  206. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Modules/module.modulemap +5 -0
  207. package/sdk/ios/System/Library/Frameworks/CoreText.framework/Headers/CTDefines.h +92 -0
  208. package/sdk/ios/System/Library/Frameworks/CoreText.framework/Headers/CTFontDescriptor.h +634 -0
  209. package/sdk/ios/System/Library/Frameworks/CoreText.framework/Headers/CTFontTraits.h +118 -0
  210. package/sdk/ios/System/Library/Frameworks/CoreText.framework/Headers/CoreText.h +1 -0
  211. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes +2497 -0
  212. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +2898 -369
  213. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKAccessPoint.h +110 -0
  214. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKAchievement.h +64 -0
  215. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKAchievementDescription.h +88 -0
  216. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKAchievementViewController.h +30 -0
  217. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKBasePlayer.h +15 -0
  218. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKChallenge.h +199 -0
  219. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKChallengeDefinition.h +71 -0
  220. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKChallengeEventHandler.h +43 -0
  221. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKChallengesViewController.h +33 -0
  222. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKCloudPlayer.h +19 -0
  223. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKDefines.h +17 -0
  224. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKDialogController.h +35 -0
  225. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKError.h +52 -0
  226. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKEventListener.h +36 -0
  227. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKFriendRequestComposeViewController.h +60 -0
  228. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKGameActivity.h +201 -0
  229. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKGameActivityDefinition.h +98 -0
  230. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKGameActivityListener.h +28 -0
  231. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKGameActivityPlayStyle.h +17 -0
  232. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKGameActivityState.h +22 -0
  233. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKGameCenterViewController.h +102 -0
  234. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKGameSession.h +87 -0
  235. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKGameSessionError.h +26 -0
  236. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKGameSessionEventListener.h +25 -0
  237. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKGameSessionSharingViewController.h +33 -0
  238. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKLeaderboard.h +205 -0
  239. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKLeaderboardEntry.h +23 -0
  240. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKLeaderboardScore.h +25 -0
  241. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKLeaderboardSet.h +64 -0
  242. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKLeaderboardViewController.h +34 -0
  243. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKLocalPlayer.h +321 -0
  244. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKMatch.h +94 -0
  245. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKMatchmaker.h +229 -0
  246. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKMatchmakerViewController.h +100 -0
  247. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKNotificationBanner.h +20 -0
  248. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKPeerPickerController.h +93 -0
  249. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKPlayer.h +82 -0
  250. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKPublicConstants.h +57 -0
  251. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKPublicProtocols.h +71 -0
  252. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKReleaseState.h +16 -0
  253. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKSavedGame.h +41 -0
  254. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKSavedGameListener.h +22 -0
  255. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKScore.h +73 -0
  256. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKSession.h +87 -0
  257. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKSessionError.h +30 -0
  258. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKTurnBasedMatch.h +314 -0
  259. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKTurnBasedMatchmakerViewController.h +69 -0
  260. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKVoiceChat.h +48 -0
  261. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GKVoiceChatService.h +145 -0
  262. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GameKit.apinotes +307 -0
  263. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Headers/GameKit.h +79 -0
  264. package/sdk/ios/System/Library/Frameworks/GameKit.framework/Modules/module.modulemap +6 -0
  265. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKActivitySummary.h +122 -0
  266. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKActivitySummaryQuery.h +48 -0
  267. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKAnchoredObjectQuery.h +93 -0
  268. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKAppleSleepingBreathingDisturbancesClassification.h +39 -0
  269. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKAppleWalkingSteadinessClassification.h +49 -0
  270. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKAttachment.h +74 -0
  271. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKAttachmentStore.h +95 -0
  272. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKAudiogramSample.h +66 -0
  273. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKAudiogramSensitivityPoint.h +82 -0
  274. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKAudiogramSensitivityPointClampingRange.h +54 -0
  275. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKAudiogramSensitivityTest.h +101 -0
  276. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKCDADocumentSample.h +131 -0
  277. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKCategorySample.h +92 -0
  278. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKCategoryValues.h +279 -0
  279. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKCharacteristicObjects.h +79 -0
  280. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKCharacteristicValues.h +87 -0
  281. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKClinicalCoding.h +55 -0
  282. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKClinicalRecord.h +53 -0
  283. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKClinicalType.h +68 -0
  284. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKContactsLensSpecification.h +59 -0
  285. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKContactsPrescription.h +74 -0
  286. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKCorrelation.h +85 -0
  287. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKCorrelationQuery.h +57 -0
  288. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKCumulativeQuantitySample.h +36 -0
  289. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKCumulativeQuantitySeriesSample.h +23 -0
  290. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKDefines.h +114 -0
  291. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKDeletedObject.h +40 -0
  292. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKDevice.h +164 -0
  293. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKDiscreteQuantitySample.h +67 -0
  294. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKDocumentQuery.h +83 -0
  295. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKDocumentSample.h +29 -0
  296. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKElectrocardiogram.h +109 -0
  297. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKElectrocardiogramQuery.h +68 -0
  298. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKFHIRRelease.h +35 -0
  299. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKFHIRResource.h +81 -0
  300. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKFHIRVersion.h +50 -0
  301. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKGAD7Assessment.h +73 -0
  302. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKGlassesLensSpecification.h +81 -0
  303. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKGlassesPrescription.h +66 -0
  304. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKHealthConceptIdentifier.h +46 -0
  305. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKHealthStore.h +470 -0
  306. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKHeartbeatSeriesBuilder.h +104 -0
  307. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKHeartbeatSeriesQuery.h +47 -0
  308. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKHeartbeatSeriesSample.h +26 -0
  309. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKLensSpecification.h +53 -0
  310. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKLiveWorkoutBuilder.h +131 -0
  311. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKLiveWorkoutDataSource.h +67 -0
  312. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKLiveWorkoutZoneUpdate.h +25 -0
  313. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKMedicationConcept.h +95 -0
  314. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKMedicationDoseEvent.h +113 -0
  315. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKMetadata.h +583 -0
  316. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKMetadataEnums.h +250 -0
  317. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKObject.h +64 -0
  318. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKObjectType.h +294 -0
  319. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKObserverQuery.h +48 -0
  320. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKPHQ9Assessment.h +77 -0
  321. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKQuantity.h +55 -0
  322. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKQuantityAggregationStyle.h +30 -0
  323. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKQuantitySample.h +83 -0
  324. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKQuantitySeriesSampleBuilder.h +184 -0
  325. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKQuantitySeriesSampleQuery.h +90 -0
  326. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKQuery.h +722 -0
  327. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKQueryAnchor.h +33 -0
  328. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKQueryDescriptor.h +46 -0
  329. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKSample.h +48 -0
  330. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKSampleQuery.h +95 -0
  331. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKScoredAssessment.h +31 -0
  332. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKSeriesBuilder.h +40 -0
  333. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKSeriesSample.h +32 -0
  334. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKSource.h +45 -0
  335. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKSourceQuery.h +42 -0
  336. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKSourceRevision.h +78 -0
  337. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKStateOfMind.h +157 -0
  338. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKStatistics.h +166 -0
  339. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKStatisticsCollectionQuery.h +80 -0
  340. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKStatisticsQuery.h +37 -0
  341. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKTypeIdentifiers.h +359 -0
  342. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKUnit.h +287 -0
  343. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKUserAnnotatedMedication.h +60 -0
  344. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKUserAnnotatedMedicationQuery.h +38 -0
  345. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKVerifiableClinicalRecord.h +131 -0
  346. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKVerifiableClinicalRecordQuery.h +76 -0
  347. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKVerifiableClinicalRecordSubject.h +39 -0
  348. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKVisionPrescription.h +76 -0
  349. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKVisionPrism.h +123 -0
  350. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKWorkout.h +341 -0
  351. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKWorkoutActivity.h +127 -0
  352. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKWorkoutActivityType.h +147 -0
  353. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKWorkoutBuilder.h +264 -0
  354. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKWorkoutConfiguration.h +62 -0
  355. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKWorkoutEffortRelationshipQuery.h +80 -0
  356. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKWorkoutRoute.h +20 -0
  357. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKWorkoutRouteBuilder.h +102 -0
  358. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKWorkoutRouteQuery.h +67 -0
  359. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HKWorkoutSession.h +364 -0
  360. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HealthKit.apinotes +5 -0
  361. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Headers/HealthKit.h +101 -0
  362. package/sdk/ios/System/Library/Frameworks/HealthKit.framework/Modules/module.modulemap +5 -0
  363. package/sdk/ios/System/Library/Frameworks/MediaAccessibility.framework/Headers/MAAudibleMedia.h +41 -0
  364. package/sdk/ios/System/Library/Frameworks/MediaAccessibility.framework/Headers/MACaptionAppearance.h +406 -0
  365. package/sdk/ios/System/Library/Frameworks/MediaAccessibility.framework/Headers/MADefinitions.h +38 -0
  366. package/sdk/ios/System/Library/Frameworks/MediaAccessibility.framework/Headers/MAFlashingLightsProcessing.h +53 -0
  367. package/sdk/ios/System/Library/Frameworks/MediaAccessibility.framework/Headers/MAImageCaptioning.h +55 -0
  368. package/sdk/ios/System/Library/Frameworks/MediaAccessibility.framework/Headers/MAMusicHaptics.h +69 -0
  369. package/sdk/ios/System/Library/Frameworks/MediaAccessibility.framework/Headers/MAVideoAccommodations.h +34 -0
  370. package/sdk/ios/System/Library/Frameworks/MediaAccessibility.framework/Headers/MediaAccessibility.h +14 -0
  371. package/sdk/ios/System/Library/Frameworks/MediaAccessibility.framework/Modules/module.modulemap +11 -0
  372. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEAppProxyFlow.h +142 -0
  373. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEAppProxyProvider.h +93 -0
  374. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEAppProxyProviderManager.h +40 -0
  375. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEAppProxyTCPFlow.h +63 -0
  376. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEAppProxyUDPFlow.h +86 -0
  377. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEAppPushManager.h +208 -0
  378. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEAppPushProvider.h +87 -0
  379. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEAppRule.h +80 -0
  380. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEDNSProxyManager.h +109 -0
  381. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEDNSProxyProvider.h +98 -0
  382. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEDNSProxyProviderProtocol.h +45 -0
  383. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEDNSSettings.h +124 -0
  384. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEDNSSettingsManager.h +116 -0
  385. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEEthernetTunnelNetworkSettings.h +45 -0
  386. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEEthernetTunnelProvider.h +31 -0
  387. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFilterControlProvider.h +80 -0
  388. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFilterDataProvider.h +235 -0
  389. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFilterFlow.h +177 -0
  390. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFilterManager.h +138 -0
  391. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFilterPacketProvider.h +99 -0
  392. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFilterProvider.h +335 -0
  393. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFilterProviderConfiguration.h +94 -0
  394. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFilterRule.h +46 -0
  395. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFilterSettings.h +56 -0
  396. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFlowMetaData.h +45 -0
  397. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEHotspotConfigurationManager.h +493 -0
  398. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEHotspotHelper.h +529 -0
  399. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEHotspotNetwork.h +87 -0
  400. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEIPv4Settings.h +122 -0
  401. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEIPv6Settings.h +121 -0
  402. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NENetworkRule.h +218 -0
  403. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEOnDemandRule.h +210 -0
  404. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEPacket.h +67 -0
  405. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEPacketTunnelFlow.h +62 -0
  406. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEPacketTunnelNetworkSettings.h +135 -0
  407. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEPacketTunnelProvider.h +97 -0
  408. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEProvider.h +160 -0
  409. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEProxySettings.h +140 -0
  410. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NERelay.h +83 -0
  411. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NERelayManager.h +195 -0
  412. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NETransparentProxyManager.h +39 -0
  413. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NETransparentProxyNetworkSettings.h +62 -0
  414. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NETransparentProxyProvider.h +33 -0
  415. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NETunnelNetworkSettings.h +57 -0
  416. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NETunnelProvider.h +113 -0
  417. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NETunnelProviderManager.h +108 -0
  418. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NETunnelProviderProtocol.h +44 -0
  419. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NETunnelProviderSession.h +55 -0
  420. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEURLFilter.h +51 -0
  421. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEVPNConnection.h +162 -0
  422. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEVPNManager.h +153 -0
  423. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEVPNProtocol.h +135 -0
  424. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEVPNProtocolIKEv2.h +357 -0
  425. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NEVPNProtocolIPSec.h +71 -0
  426. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NWBonjourServiceEndpoint.h +82 -0
  427. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NWEndpoint.h +40 -0
  428. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NWHostEndpoint.h +68 -0
  429. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NWPath.h +93 -0
  430. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NWTCPConnection.h +335 -0
  431. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NWTLSParameters.h +70 -0
  432. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NWUDPSession.h +207 -0
  433. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NetworkExtension.apinotes +351 -0
  434. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Headers/NetworkExtension.h +74 -0
  435. package/sdk/ios/System/Library/Frameworks/NetworkExtension.framework/Modules/module.modulemap +5 -0
  436. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/ModelIO.h +84 -0
  437. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNAction.h +197 -0
  438. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNAnimation.h +428 -0
  439. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNAudioSource.h +170 -0
  440. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNBoundingVolume.h +50 -0
  441. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNCAAnimationExtensions.h +58 -0
  442. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNCamera.h +356 -0
  443. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNCameraController.h +124 -0
  444. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNConstraint.h +431 -0
  445. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNGeometry.h +591 -0
  446. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNHitTest.h +101 -0
  447. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNJavascript.h +58 -0
  448. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNLevelOfDetail.h +56 -0
  449. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNLight.h +350 -0
  450. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNMaterial.h +349 -0
  451. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNMaterialProperty.h +149 -0
  452. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNMorpher.h +79 -0
  453. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNNode.h +695 -0
  454. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNParametricGeometry.h +727 -0
  455. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNParticleSystem.h +462 -0
  456. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNPhysicsBehavior.h +219 -0
  457. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNPhysicsBody.h +148 -0
  458. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNPhysicsContact.h +34 -0
  459. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNPhysicsField.h +124 -0
  460. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNPhysicsShape.h +58 -0
  461. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNPhysicsWorld.h +90 -0
  462. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNReferenceNode.h +80 -0
  463. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNRenderer.h +102 -0
  464. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNScene.h +250 -0
  465. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNSceneRenderer.h +389 -0
  466. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNSceneSource.h +348 -0
  467. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNShadable.h +573 -0
  468. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNSkinner.h +84 -0
  469. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNTechnique.h +320 -0
  470. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNTransaction.h +64 -0
  471. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SCNView.h +170 -0
  472. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SceneKit.apinotes +423 -0
  473. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SceneKit.h +58 -0
  474. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SceneKitAvailability.h +10 -0
  475. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SceneKitDeprecated.h +88 -0
  476. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/SceneKitTypes.h +264 -0
  477. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Headers/scn_metal +75 -0
  478. package/sdk/ios/System/Library/Frameworks/SceneKit.framework/Modules/module.modulemap +12 -0
  479. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/CipherSuite.h +281 -0
  480. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecAccessControl.h +133 -0
  481. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecIdentity.h +232 -0
  482. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecKey.h +1616 -0
  483. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecProtocolMetadata.h +429 -0
  484. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecProtocolObject.h +71 -0
  485. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecProtocolOptions.h +775 -0
  486. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecProtocolTypes.h +327 -0
  487. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecRandom.h +84 -0
  488. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/Security.h +9 -0
  489. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h +19 -0
  490. package/sdk/ios/usr/include/AvailabilityInternal.h +23 -0
  491. package/sdk/ios/usr/include/Block.h +56 -0
  492. package/sdk/ios/usr/include/CommonCrypto/CommonCrypto.h +34 -0
  493. package/sdk/ios/usr/include/CommonCrypto/CommonCryptoError.h +78 -0
  494. package/sdk/ios/usr/include/CommonCrypto/CommonCryptor.h +763 -0
  495. package/sdk/ios/usr/include/CommonCrypto/CommonDigest.h +254 -47
  496. package/sdk/ios/usr/include/CommonCrypto/CommonHMAC.h +162 -0
  497. package/sdk/ios/usr/include/CommonCrypto/CommonKeyDerivation.h +136 -0
  498. package/sdk/ios/usr/include/CommonCrypto/CommonRandom.h +63 -0
  499. package/sdk/ios/usr/include/CommonCrypto/CommonSymmetricKeywrap.h +162 -0
  500. package/sdk/ios/usr/include/CommonCrypto/module.modulemap +15 -0
  501. package/sdk/ios/usr/include/ObjectiveC.apinotes +437 -0
  502. package/sdk/ios/usr/include/TargetConditionals.h +525 -14
  503. package/sdk/ios/usr/include/___wctype.h +193 -0
  504. package/sdk/ios/usr/include/__wctype.h +43 -0
  505. package/sdk/ios/usr/include/_abort.h +36 -0
  506. package/sdk/ios/usr/include/_assert.h +80 -0
  507. package/sdk/ios/usr/include/_static_assert.h +33 -0
  508. package/sdk/ios/usr/include/_stdlib.h +403 -0
  509. package/sdk/ios/usr/include/_string.h +231 -0
  510. package/sdk/ios/usr/include/_strings.h +101 -0
  511. package/sdk/ios/usr/include/_types/_wctrans_t.h +33 -0
  512. package/sdk/ios/usr/include/_types/_wctype_t.h +33 -0
  513. package/sdk/ios/usr/include/_wchar.h +263 -0
  514. package/sdk/ios/usr/include/_wctype.h +129 -0
  515. package/sdk/ios/usr/include/_xlocale.h +47 -0
  516. package/sdk/ios/usr/include/alloca.h +46 -0
  517. package/sdk/ios/usr/include/architecture/byte_order.h +381 -0
  518. package/sdk/ios/usr/include/arm/_limits.h +13 -0
  519. package/sdk/ios/usr/include/arm/arch.h +71 -0
  520. package/sdk/ios/usr/include/arm/limits.h +136 -0
  521. package/sdk/ios/usr/include/arpa/inet.h +100 -0
  522. package/sdk/ios/usr/include/assert.h +77 -10
  523. package/sdk/ios/usr/include/bsm/audit.h +434 -0
  524. package/sdk/ios/usr/include/crt_externs.h +50 -0
  525. package/sdk/ios/usr/include/dispatch/base.h +369 -0
  526. package/sdk/ios/usr/include/dispatch/block.h +509 -0
  527. package/sdk/ios/usr/include/dispatch/data.h +290 -0
  528. package/sdk/ios/usr/include/dispatch/dispatch.h +68 -172
  529. package/sdk/ios/usr/include/dispatch/dispatch_swift_shims.h +61 -0
  530. package/sdk/ios/usr/include/dispatch/group.h +289 -0
  531. package/sdk/ios/usr/include/dispatch/introspection.h +190 -0
  532. package/sdk/ios/usr/include/dispatch/io.h +617 -0
  533. package/sdk/ios/usr/include/dispatch/object.h +680 -0
  534. package/sdk/ios/usr/include/dispatch/once.h +128 -0
  535. package/sdk/ios/usr/include/dispatch/queue.h +1824 -0
  536. package/sdk/ios/usr/include/dispatch/semaphore.h +124 -0
  537. package/sdk/ios/usr/include/dispatch/source.h +803 -0
  538. package/sdk/ios/usr/include/dispatch/time.h +144 -0
  539. package/sdk/ios/usr/include/dispatch/workloop.h +178 -0
  540. package/sdk/ios/usr/include/dlfcn.h +320 -7
  541. package/sdk/ios/usr/include/execinfo.h +100 -10
  542. package/sdk/ios/usr/include/ftw.h +63 -0
  543. package/sdk/ios/usr/include/gethostuuid.h +45 -0
  544. package/sdk/ios/usr/include/libkern/arm/OSByteOrder.h +195 -0
  545. package/sdk/ios/usr/include/limits.h +167 -4
  546. package/sdk/ios/usr/include/mach/arm/boolean.h +74 -0
  547. package/sdk/ios/usr/include/mach/arm/exception.h +86 -0
  548. package/sdk/ios/usr/include/mach/arm/kern_return.h +78 -0
  549. package/sdk/ios/usr/include/mach/arm/processor_info.h +76 -0
  550. package/sdk/ios/usr/include/mach/arm/rpc.h +39 -0
  551. package/sdk/ios/usr/include/mach/arm/thread_state.h +42 -0
  552. package/sdk/ios/usr/include/mach/arm/thread_status.h +302 -0
  553. package/sdk/ios/usr/include/mach/arm/vm_param.h +118 -0
  554. package/sdk/ios/usr/include/mach/arm/vm_types.h +162 -0
  555. package/sdk/ios/usr/include/mach/boolean.h +88 -4
  556. package/sdk/ios/usr/include/mach/clock.h +249 -0
  557. package/sdk/ios/usr/include/mach/clock_priv.h +203 -0
  558. package/sdk/ios/usr/include/mach/clock_types.h +127 -0
  559. package/sdk/ios/usr/include/mach/dyld_kernel.h +66 -0
  560. package/sdk/ios/usr/include/mach/error.h +117 -0
  561. package/sdk/ios/usr/include/mach/exc.h +285 -0
  562. package/sdk/ios/usr/include/mach/exception_types.h +204 -25
  563. package/sdk/ios/usr/include/mach/host_info.h +136 -51
  564. package/sdk/ios/usr/include/mach/host_notify.h +39 -0
  565. package/sdk/ios/usr/include/mach/host_priv.h +1167 -0
  566. package/sdk/ios/usr/include/mach/host_security.h +225 -0
  567. package/sdk/ios/usr/include/mach/host_special_ports.h +315 -0
  568. package/sdk/ios/usr/include/mach/kern_return.h +291 -2
  569. package/sdk/ios/usr/include/mach/kmod.h +180 -0
  570. package/sdk/ios/usr/include/mach/mach.h +237 -12
  571. package/sdk/ios/usr/include/mach/mach_error.h +93 -10
  572. package/sdk/ios/usr/include/mach/mach_host.h +1329 -5
  573. package/sdk/ios/usr/include/mach/mach_init.h +112 -13
  574. package/sdk/ios/usr/include/mach/mach_interface.h +52 -0
  575. package/sdk/ios/usr/include/mach/mach_port.h +1935 -4
  576. package/sdk/ios/usr/include/mach/mach_time.h +77 -14
  577. package/sdk/ios/usr/include/mach/mach_traps.h +311 -0
  578. package/sdk/ios/usr/include/mach/mach_types.h +297 -20
  579. package/sdk/ios/usr/include/mach/mach_voucher_types.h +259 -0
  580. package/sdk/ios/usr/include/mach/machine/boolean.h +40 -0
  581. package/sdk/ios/usr/include/mach/machine/exception.h +40 -0
  582. package/sdk/ios/usr/include/mach/machine/kern_return.h +40 -0
  583. package/sdk/ios/usr/include/mach/machine/processor_info.h +40 -0
  584. package/sdk/ios/usr/include/mach/machine/rpc.h +40 -0
  585. package/sdk/ios/usr/include/mach/machine/thread_state.h +44 -0
  586. package/sdk/ios/usr/include/mach/machine/thread_status.h +40 -0
  587. package/sdk/ios/usr/include/mach/machine/vm_param.h +40 -0
  588. package/sdk/ios/usr/include/mach/machine/vm_types.h +40 -0
  589. package/sdk/ios/usr/include/mach/machine.h +456 -142
  590. package/sdk/ios/usr/include/mach/memory_object_types.h +312 -0
  591. package/sdk/ios/usr/include/mach/message.h +972 -0
  592. package/sdk/ios/usr/include/mach/mig.h +180 -0
  593. package/sdk/ios/usr/include/mach/mig_errors.h +125 -0
  594. package/sdk/ios/usr/include/mach/mig_strncpy_zerofill_support.h +35 -0
  595. package/sdk/ios/usr/include/mach/ndr.h +207 -0
  596. package/sdk/ios/usr/include/mach/notify.h +141 -0
  597. package/sdk/ios/usr/include/mach/policy.h +235 -0
  598. package/sdk/ios/usr/include/mach/port.h +648 -0
  599. package/sdk/ios/usr/include/mach/processor.h +364 -0
  600. package/sdk/ios/usr/include/mach/processor_info.h +171 -0
  601. package/sdk/ios/usr/include/mach/processor_set.h +589 -0
  602. package/sdk/ios/usr/include/mach/rpc.h +135 -0
  603. package/sdk/ios/usr/include/mach/semaphore.h +78 -0
  604. package/sdk/ios/usr/include/mach/std_types.h +75 -0
  605. package/sdk/ios/usr/include/mach/sync_policy.h +47 -0
  606. package/sdk/ios/usr/include/mach/task.h +2887 -7
  607. package/sdk/ios/usr/include/mach/task_info.h +584 -19
  608. package/sdk/ios/usr/include/mach/task_inspect.h +57 -0
  609. package/sdk/ios/usr/include/mach/task_policy.h +182 -26
  610. package/sdk/ios/usr/include/mach/task_special_ports.h +135 -0
  611. package/sdk/ios/usr/include/mach/thread_act.h +1550 -5
  612. package/sdk/ios/usr/include/mach/thread_info.h +206 -28
  613. package/sdk/ios/usr/include/mach/thread_policy.h +268 -0
  614. package/sdk/ios/usr/include/mach/thread_special_ports.h +87 -0
  615. package/sdk/ios/usr/include/mach/thread_status.h +100 -0
  616. package/sdk/ios/usr/include/mach/thread_switch.h +77 -0
  617. package/sdk/ios/usr/include/mach/time_value.h +96 -4
  618. package/sdk/ios/usr/include/mach/vm_attributes.h +99 -0
  619. package/sdk/ios/usr/include/mach/vm_behavior.h +86 -0
  620. package/sdk/ios/usr/include/mach/vm_inherit.h +93 -0
  621. package/sdk/ios/usr/include/mach/vm_map.h +1558 -0
  622. package/sdk/ios/usr/include/mach/vm_page_size.h +68 -0
  623. package/sdk/ios/usr/include/mach/vm_prot.h +183 -7
  624. package/sdk/ios/usr/include/mach/vm_purgable.h +166 -0
  625. package/sdk/ios/usr/include/mach/vm_region.h +400 -36
  626. package/sdk/ios/usr/include/mach/vm_statistics.h +387 -96
  627. package/sdk/ios/usr/include/mach/vm_sync.h +84 -0
  628. package/sdk/ios/usr/include/mach/vm_types.h +194 -7
  629. package/sdk/ios/usr/include/mach-o/arch.h +154 -16
  630. package/sdk/ios/usr/include/mach-o/fat.h +89 -0
  631. package/sdk/ios/usr/include/mach-o/getsect.h +146 -12
  632. package/sdk/ios/usr/include/mach-o/loader.h +1679 -139
  633. package/sdk/ios/usr/include/mach_debug/hash_info.h +75 -0
  634. package/sdk/ios/usr/include/mach_debug/ipc_info.h +199 -0
  635. package/sdk/ios/usr/include/mach_debug/lockgroup_info.h +74 -0
  636. package/sdk/ios/usr/include/mach_debug/mach_debug_types.h +200 -0
  637. package/sdk/ios/usr/include/mach_debug/page_info.h +64 -0
  638. package/sdk/ios/usr/include/mach_debug/vm_info.h +149 -0
  639. package/sdk/ios/usr/include/mach_debug/zone_info.h +209 -0
  640. package/sdk/ios/usr/include/machine/limits.h +14 -0
  641. package/sdk/ios/usr/include/module.modulemap +4 -0
  642. package/sdk/ios/usr/include/net/if_types.h +152 -0
  643. package/sdk/ios/usr/include/objc/NSObjCRuntime.h +10 -0
  644. package/sdk/ios/usr/include/objc/NSObject.h +23 -25
  645. package/sdk/ios/usr/include/objc/objc-api.h +310 -0
  646. package/sdk/ios/usr/include/objc/objc.h +243 -0
  647. package/sdk/ios/usr/include/objc/runtime.h +1933 -0
  648. package/sdk/ios/usr/include/os.modulemap +6 -0
  649. package/sdk/ios/usr/include/pthread/pthread_impl.h +66 -0
  650. package/sdk/ios/usr/include/pthread/sched.h +46 -0
  651. package/sdk/ios/usr/include/pthread.h +754 -4
  652. package/sdk/ios/usr/include/pwd.h +119 -0
  653. package/sdk/ios/usr/include/sched.h +46 -0
  654. package/sdk/ios/usr/include/secure/_string.h +295 -0
  655. package/sdk/ios/usr/include/secure/_strings.h +96 -0
  656. package/sdk/ios/usr/include/spawn.h +193 -0
  657. package/sdk/ios/usr/include/stddef.h +90 -0
  658. package/sdk/ios/usr/include/stdlib.h +62 -17
  659. package/sdk/ios/usr/include/string.h +62 -8
  660. package/sdk/ios/usr/include/sys/_pthread/_pthread_cond_t.h +32 -0
  661. package/sdk/ios/usr/include/sys/_pthread/_pthread_condattr_t.h +32 -0
  662. package/sdk/ios/usr/include/sys/_pthread/_pthread_key_t.h +32 -0
  663. package/sdk/ios/usr/include/sys/_pthread/_pthread_mutex_t.h +32 -0
  664. package/sdk/ios/usr/include/sys/_pthread/_pthread_mutexattr_t.h +32 -0
  665. package/sdk/ios/usr/include/sys/_pthread/_pthread_once_t.h +32 -0
  666. package/sdk/ios/usr/include/sys/_pthread/_pthread_rwlock_t.h +32 -0
  667. package/sdk/ios/usr/include/sys/_pthread/_pthread_rwlockattr_t.h +32 -0
  668. package/sdk/ios/usr/include/sys/_select.h +57 -0
  669. package/sdk/ios/usr/include/sys/_types/_blkcnt_t.h +32 -0
  670. package/sdk/ios/usr/include/sys/_types/_blksize_t.h +32 -0
  671. package/sdk/ios/usr/include/sys/_types/_caddr_t.h +32 -0
  672. package/sdk/ios/usr/include/sys/_types/_dev_t.h +32 -0
  673. package/sdk/ios/usr/include/sys/_types/_fsblkcnt_t.h +32 -0
  674. package/sdk/ios/usr/include/sys/_types/_fsfilcnt_t.h +32 -0
  675. package/sdk/ios/usr/include/sys/_types/_fsid_t.h +32 -0
  676. package/sdk/ios/usr/include/sys/_types/_fsobj_id_t.h +38 -0
  677. package/sdk/ios/usr/include/sys/_types/_graftdmg_un.h +64 -0
  678. package/sdk/ios/usr/include/sys/_types/_guid_t.h +37 -0
  679. package/sdk/ios/usr/include/sys/_types/_id_t.h +32 -0
  680. package/sdk/ios/usr/include/sys/_types/_ino64_t.h +32 -0
  681. package/sdk/ios/usr/include/sys/_types/_key_t.h +32 -0
  682. package/sdk/ios/usr/include/sys/_types/_mach_port_t.h +51 -0
  683. package/sdk/ios/usr/include/sys/_types/_mbstate_t.h +33 -0
  684. package/sdk/ios/usr/include/sys/_types/_mount_t.h +34 -0
  685. package/sdk/ios/usr/include/sys/_types/_nlink_t.h +32 -0
  686. package/sdk/ios/usr/include/sys/_types/_os_inline.h +34 -0
  687. package/sdk/ios/usr/include/sys/_types/_posix_vdisable.h +30 -0
  688. package/sdk/ios/usr/include/sys/_types/_rsize_t.h +55 -0
  689. package/sdk/ios/usr/include/sys/_types/_suseconds_t.h +32 -0
  690. package/sdk/ios/usr/include/sys/_types/_timeval.h +39 -0
  691. package/sdk/ios/usr/include/sys/_types/_u_char.h +31 -0
  692. package/sdk/ios/usr/include/sys/_types/_u_int.h +31 -0
  693. package/sdk/ios/usr/include/sys/_types/_u_short.h +31 -0
  694. package/sdk/ios/usr/include/sys/_types/_useconds_t.h +32 -0
  695. package/sdk/ios/usr/include/sys/_types/_uuid_t.h +32 -0
  696. package/sdk/ios/usr/include/sys/_types/_vnode_t.h +34 -0
  697. package/sdk/ios/usr/include/sys/acl.h +215 -0
  698. package/sdk/ios/usr/include/sys/attr.h +635 -0
  699. package/sdk/ios/usr/include/sys/cdefs.h +15 -0
  700. package/sdk/ios/usr/include/sys/event.h +388 -0
  701. package/sdk/ios/usr/include/sys/kauth.h +409 -0
  702. package/sdk/ios/usr/include/sys/mount.h +470 -0
  703. package/sdk/ios/usr/include/sys/queue.h +909 -0
  704. package/sdk/ios/usr/include/sys/resource.h +600 -0
  705. package/sdk/ios/usr/include/sys/select.h +134 -0
  706. package/sdk/ios/usr/include/sys/spawn.h +84 -0
  707. package/sdk/ios/usr/include/sys/sysctl.h +803 -57
  708. package/sdk/ios/usr/include/sys/syslimits.h +131 -11
  709. package/sdk/ios/usr/include/sys/types.h +236 -19
  710. package/sdk/ios/usr/include/sys/ucred.h +116 -0
  711. package/sdk/ios/usr/include/sys/un.h +105 -0
  712. package/sdk/ios/usr/include/sys/unistd.h +225 -0
  713. package/sdk/ios/usr/include/sys/vm.h +89 -0
  714. package/sdk/ios/usr/include/sys/wait.h +256 -0
  715. package/sdk/ios/usr/include/sysdir.h +79 -0
  716. package/sdk/ios/usr/include/unistd.h +799 -3
  717. package/sdk/ios/usr/include/uuid/uuid.h +69 -10
  718. package/sdk/ios/usr/include/wchar.h +71 -0
  719. package/sdk/ios/usr/include/wctype.h +35 -0
  720. package/sdk/ios/usr/include/xlocale/___wctype.h +146 -0
  721. package/sdk/ios/usr/include/xlocale/_ctype.h +240 -0
  722. package/sdk/ios/usr/include/xlocale/_stdlib.h +77 -0
  723. package/sdk/ios/usr/include/xlocale/_string.h +43 -0
  724. package/sdk/ios/usr/include/xlocale/_wchar.h +160 -0
  725. package/sdk/ios/usr/include/xlocale/_wctype.h +100 -0
  726. package/sdk/ios/usr/include/xlocale.h +61 -0
  727. package/sdk/ios/usr/include/xpc/availability.h +141 -0
  728. package/sdk/ios/usr/include/xpc/base.h +243 -0
  729. package/sdk/ios/wasm/include/AvailabilityInternal.h +24 -0
  730. package/sdk/ios/wasm/include/TargetConditionals.h +529 -0
  731. package/sdk/ios/wasm/include/_locale.h +3 -0
  732. package/sdk/ios/wasm/include/_locale_posix2008.h +3 -0
  733. package/sdk/ios/wasm/include/_types/_locale_t.h +3 -0
  734. package/sdk/ios/wasm/include/arpa/inet.h +15 -0
  735. package/sdk/ios/wasm/include/dirent.h +52 -0
  736. package/sdk/ios/wasm/include/dlfcn.h +13 -1
  737. package/sdk/ios/wasm/include/errno.h +22 -0
  738. package/sdk/ios/wasm/include/fcntl.h +29 -0
  739. package/sdk/ios/wasm/include/ftw.h +15 -0
  740. package/sdk/ios/wasm/include/libkern/_OSByteOrder.h +6 -0
  741. package/sdk/ios/wasm/include/limits.h +9 -0
  742. package/sdk/ios/wasm/include/mach/machine/boolean.h +1 -1
  743. package/sdk/ios/wasm/include/mach/machine/exception.h +1 -4
  744. package/sdk/ios/wasm/include/mach/machine/kern_return.h +1 -1
  745. package/sdk/ios/wasm/include/mach/machine/processor_info.h +1 -1
  746. package/sdk/ios/wasm/include/mach/machine/rpc.h +1 -1
  747. package/sdk/ios/wasm/include/mach/machine/thread_state.h +1 -2
  748. package/sdk/ios/wasm/include/mach/machine/thread_status.h +1 -2
  749. package/sdk/ios/wasm/include/mach/machine/vm_param.h +1 -2
  750. package/sdk/ios/wasm/include/mach/machine/vm_types.h +1 -17
  751. package/sdk/ios/wasm/include/machine/_endian.h +2 -0
  752. package/sdk/ios/wasm/include/machine/_param.h +2 -0
  753. package/sdk/ios/wasm/include/machine/endian.h +1 -1
  754. package/sdk/ios/wasm/include/machine/limits.h +106 -2
  755. package/sdk/ios/wasm/include/machine/param.h +152 -0
  756. package/sdk/ios/wasm/include/netinet/in.h +11 -0
  757. package/sdk/ios/wasm/include/os/object.h +10 -0
  758. package/sdk/ios/wasm/include/pthread.h +14 -0
  759. package/sdk/ios/wasm/include/stdio.h +12 -0
  760. package/sdk/ios/wasm/include/stdlib.h +13 -0
  761. package/sdk/ios/wasm/include/strings.h +9 -0
  762. package/sdk/ios/wasm/include/sys/_types/_iovec_t.h +6 -0
  763. package/sdk/ios/wasm/include/sys/_types/_mode_t.h +10 -0
  764. package/sdk/ios/wasm/include/sys/mman.h +2 -2
  765. package/sdk/ios/wasm/include/sys/param.h +4 -0
  766. package/sdk/ios/wasm/include/sys/resource.h +43 -0
  767. package/sdk/ios/wasm/include/sys/socket.h +75 -9
  768. package/sdk/ios/wasm/include/sys/stat.h +63 -0
  769. package/sdk/ios/wasm/include/sys/types.h +13 -0
  770. package/sdk/ios/wasm/include/sys/un.h +7 -0
  771. package/sdk/ios/wasm/include/time.h +3 -1
  772. package/sdk/ios/wasm/include/unistd.h +16 -3
  773. package/sdk/ios/wasm/include/xlocale/_stdlib.h +37 -0
  774. package/sdk/ios/wasm/storage-include/TargetConditionals.h +529 -0
  775. package/sdk/ios/wasm/storage-include/mach/machine/boolean.h +2 -0
  776. package/sdk/ios/wasm/storage-include/mach/machine/exception.h +5 -0
  777. package/sdk/ios/wasm/storage-include/mach/machine/kern_return.h +2 -0
  778. package/sdk/ios/wasm/storage-include/mach/machine/processor_info.h +2 -0
  779. package/sdk/ios/wasm/storage-include/mach/machine/rpc.h +2 -0
  780. package/sdk/ios/wasm/storage-include/mach/machine/thread_state.h +3 -0
  781. package/sdk/ios/wasm/storage-include/mach/machine/thread_status.h +3 -0
  782. package/sdk/ios/wasm/storage-include/mach/machine/vm_param.h +3 -0
  783. package/sdk/ios/wasm/storage-include/mach/machine/vm_types.h +18 -0
  784. package/sdk/ios/wasm/storage-include/machine/_endian.h +9 -0
  785. package/sdk/ios/wasm/storage-include/machine/_param.h +8 -0
  786. package/sdk/ios/wasm/storage-include/machine/_types.h +31 -0
  787. package/sdk/ios/wasm/storage-include/machine/endian.h +2 -0
  788. package/sdk/ios/wasm/storage-include/machine/limits.h +2 -0
  789. package/sdk/ios/wasm/storage-include/machine/types.h +15 -0
  790. package/sdk/native-hashes.json +80 -0
  791. package/skills/contrast/SKILL.md +1 -1
  792. package/src/android-root-module.ts +145 -0
  793. package/src/androidRootModuleContract.ts +39 -0
  794. package/src/assetCatalogContract.ts +10 -1
  795. package/src/backend-origin.ts +11 -8
  796. package/src/bridge-constants.ts +7 -0
  797. package/src/bridge-contract.ts +3 -1
  798. package/src/capture-contract.ts +3 -1
  799. package/src/cli-runtime.ts +6 -1
  800. package/src/device-catalog.ts +10 -4
  801. package/src/expo-discovery-cache.ts +272 -0
  802. package/src/expo-native-workspace.ts +62 -31
  803. package/src/expo-swift-host.ts +679 -23
  804. package/src/expo-swift-ready.ts +43 -11
  805. package/src/generated/swift-c-predefines.json +1 -1
  806. package/src/host/bridge-host.ts +28 -0
  807. package/src/host/fetch-proxy-handler.ts +19 -1
  808. package/src/host/network-policy-proxy.ts +421 -0
  809. package/src/host/network-policy.ts +121 -0
  810. package/src/host/staged-host-files.ts +80 -3
  811. package/src/host/websocket-frame-guard.ts +163 -0
  812. package/src/host/websocket-proxy-headers.ts +29 -0
  813. package/src/host/websocket-proxy.ts +100 -58
  814. package/src/installed-native-build-options.ts +154 -0
  815. package/src/installed-package-versions.ts +56 -49
  816. package/src/material-symbol-fonts.ts +6 -4
  817. package/src/menu.ts +6 -0
  818. package/src/metro-plugin.ts +8 -0
  819. package/src/native-app-identity-project.ts +4 -0
  820. package/src/native-app-identity.ts +16 -0
  821. package/src/native-dev-bundle-url.ts +0 -18
  822. package/src/native-firebase-config.ts +47 -4
  823. package/src/native-preparation.ts +30 -0
  824. package/src/nativePreparationContract.ts +3 -0
  825. package/src/nitro-adapter.lock.json +384 -232
  826. package/src/nitro-bundle.ts +25 -1
  827. package/src/nitro-compile.ts +15 -2
  828. package/src/nitro-dependencies.ts +226 -0
  829. package/src/nitro-source.ts +187 -37
  830. package/src/packageVersionsContract.ts +33 -0
  831. package/src/react-native-bridge-modules.ts +24 -1
  832. package/src/react-native-host-modules.ts +111 -4
  833. package/src/runtime-assets.ts +10 -0
  834. package/src/sim-client.ts +1 -1
  835. package/src/storageSnapshotContract.ts +22 -10
  836. package/src/stub-pattern-matcher.ts +17 -4
  837. package/src/swift-compile.ts +1197 -4148
  838. package/src/swift-compiler-digest.ts +1 -2
  839. package/src/swift-coverage/package.ts +103 -58
  840. package/src/swift-coverage/xcode-assets.ts +22 -2
  841. package/src/swift-coverage/xcode-bridging.ts +1 -12
  842. package/src/swift-coverage/xcode-packages.ts +167 -52
  843. package/src/swift-coverage/xcode.ts +2 -6
  844. package/src/swift-cxx-declarations.ts +205 -0
  845. package/src/swift-cxx-deps.ts +48 -0
  846. package/src/swift-cxx-reachable.ts +297 -0
  847. package/src/swift-cxx-standin.ts +248 -0
  848. package/src/swift-distribution.lock.json +29 -20
  849. package/src/swift-host.ts +215 -21
  850. package/src/swift-objc-compile.ts +626 -234
  851. package/src/swift-objc-import.ts +19 -964
  852. package/src/swift-objc-runtime.ts +7 -0
  853. package/src/swift-objc-standin.ts +278 -58
  854. package/src/swift-package-manifest.ts +179 -38
  855. package/src/swift-package.ts +123 -3
  856. package/src/swift-packages.ts +193 -34
  857. package/src/swift-pdf-raster.ts +114 -0
  858. package/src/swift-shared-sdk.ts +45 -0
  859. package/src/swift-source-file.ts +10 -6
  860. package/src/swift-standin-digest.ts +12 -15
  861. package/src/swift-standin-emit.ts +8 -0
  862. package/src/swift-standins.ts +266 -73
  863. package/src/swift-submit.ts +24 -6
  864. package/src/swift-toolchain.ts +11 -9
  865. package/src/swiftContract.ts +50 -29
  866. package/src/vite-plugin.ts +0 -13
  867. package/src/workspace-root.ts +15 -0
  868. package/src/xcode-json-project.ts +52 -1
  869. package/src/xcode-project.ts +295 -25
  870. package/src/swift-objc-export.ts +0 -532
  871. package/src/swift-objc-metadata.ts +0 -534
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1700 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1716 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
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;
@@ -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
 
@@ -535,7 +762,7 @@ var init_node_http_fetch = __esm({
535
762
  var runtime_companion_default;
536
763
  var init_runtime_companion = __esm({
537
764
  "runtime-companion.json"() {
538
- runtime_companion_default = { abi: 1, sha256: "1f3d4b48d9b79b8579197585654c7ea6f1a69bcc5f4cb2dad706f31aa88d791b", file: "node/cli-1f3d4b48d9b79b8579197585654c7ea6f1a69bcc5f4cb2dad706f31aa88d791b.cjs" };
765
+ runtime_companion_default = { abi: 1, sha256: "a0dede25c849ecabd639fbb0a0c4edd8e62a34bf12090932dba19832f2369659", file: "node/cli-a0dede25c849ecabd639fbb0a0c4edd8e62a34bf12090932dba19832f2369659.cjs" };
539
766
  }
540
767
  });
541
768
 
@@ -570,34 +797,44 @@ var init_src = __esm({
570
797
  // src/home-paths.ts
571
798
  function rnxHomeDir() {
572
799
  const override = process.env[PEACH_HOME_ENV];
573
- if (override && override.length > 0) return import_node_path4.default.resolve(override);
574
- 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");
575
802
  }
576
803
  function runtimesDir() {
577
- return import_node_path4.default.join(rnxHomeDir(), "runtimes");
804
+ return import_node_path7.default.join(rnxHomeDir(), "runtimes");
578
805
  }
579
806
  function runtimeDir(version) {
580
- return import_node_path4.default.join(runtimesDir(), version);
807
+ return import_node_path7.default.join(runtimesDir(), version);
581
808
  }
582
809
  function activeRuntimeFile() {
583
- 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
+ ]);
584
821
  }
585
822
  function readActiveRuntime() {
586
823
  try {
587
- const value = import_node_fs5.default.readFileSync(activeRuntimeFile(), "utf8").trim();
824
+ const value = import_node_fs7.default.readFileSync(activeRuntimeFile(), "utf8").trim();
588
825
  return value.length > 0 ? value : null;
589
826
  } catch {
590
827
  return null;
591
828
  }
592
829
  }
593
- 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;
594
831
  var init_home_paths = __esm({
595
832
  "src/home-paths.ts"() {
596
833
  "use strict";
597
834
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
598
- import_node_fs5 = __toESM(require("node:fs"), 1);
835
+ import_node_fs7 = __toESM(require("node:fs"), 1);
599
836
  import_node_os2 = require("node:os");
600
- import_node_path4 = __toESM(require("node:path"), 1);
837
+ import_node_path7 = __toESM(require("node:path"), 1);
601
838
  PEACH_HOME_ENV = "PEACH_HOME";
602
839
  ACTIVE_RUNTIME_FILE = "active";
603
840
  DAEMON_LOCKFILE_MAX_BYTES = 16 * 1024;
@@ -714,6 +951,11 @@ function serveRuntimeFile(req, res, fullPath) {
714
951
  import_fs3.default.createReadStream(fullPath).pipe(res);
715
952
  return;
716
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
+ }
717
959
  res.setHeader("cache-control", "no-cache");
718
960
  res.setHeader("last-modified", lastModified);
719
961
  if (req?.headers?.["if-modified-since"] === lastModified) {
@@ -819,13 +1061,14 @@ function cliCompanionPath() {
819
1061
  return `node/cli-${runtime_companion_default.sha256}.cjs`;
820
1062
  }
821
1063
  function verifyCliCompanion(root) {
822
- const file = (0, import_node_path5.join)(root, cliCompanionPath());
1064
+ const file = (0, import_node_path8.join)(root, cliCompanionPath());
823
1065
  let bytes;
824
1066
  try {
825
- bytes = (0, import_node_fs6.readFileSync)(file);
1067
+ bytes = (0, import_node_fs8.readFileSync)(file);
826
1068
  } catch (error) {
827
1069
  if (error instanceof Error) {
828
- 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}`;
829
1072
  }
830
1073
  throw error;
831
1074
  }
@@ -842,7 +1085,7 @@ function getCliRuntime() {
842
1085
  if (!root) throw new Error("No Peach runtime installed; run `peach runtime install`");
843
1086
  verifyCliCompanion(root);
844
1087
  const require2 = (0, import_node_module2.createRequire)(__sootsim_import_meta_url);
845
- const runtime = require2((0, import_node_path5.join)(root, cliCompanionPath()));
1088
+ const runtime = require2((0, import_node_path8.join)(root, cliCompanionPath()));
846
1089
  if (runtime.cliCompanionAbi !== CLI_COMPANION_ABI) {
847
1090
  throw new Error(
848
1091
  "Incompatible Peach runtime companion ABI; run `peach runtime install`"
@@ -851,15 +1094,15 @@ function getCliRuntime() {
851
1094
  loaded = { root, runtime };
852
1095
  return runtime;
853
1096
  }
854
- 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;
855
1098
  var init_cli_runtime = __esm({
856
1099
  "src/cli-runtime.ts"() {
857
1100
  "use strict";
858
1101
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
859
1102
  import_node_crypto2 = require("node:crypto");
860
- import_node_fs6 = require("node:fs");
1103
+ import_node_fs8 = require("node:fs");
861
1104
  import_node_module2 = require("node:module");
862
- import_node_path5 = require("node:path");
1105
+ import_node_path8 = require("node:path");
863
1106
  init_runtime_companion();
864
1107
  init_runtime_assets();
865
1108
  CLI_COMPANION_ABI = 1;
@@ -867,7 +1110,7 @@ var init_cli_runtime = __esm({
867
1110
  });
868
1111
 
869
1112
  // ../contrast-bundler/src/posixPath.ts
870
- function isAbsolute(p) {
1113
+ function isAbsolute2(p) {
871
1114
  return p.charCodeAt(0) === 47;
872
1115
  }
873
1116
  function normalizeSegments(parts, allowAboveRoot) {
@@ -885,7 +1128,7 @@ function normalizeSegments(parts, allowAboveRoot) {
885
1128
  }
886
1129
  function normalize(p) {
887
1130
  if (p.length === 0) return ".";
888
- const absolute = isAbsolute(p);
1131
+ const absolute = isAbsolute2(p);
889
1132
  const trailingSlash = p.charCodeAt(p.length - 1) === 47;
890
1133
  const segments = normalizeSegments(p.split("/"), !absolute);
891
1134
  let joined = segments.join("/");
@@ -908,7 +1151,7 @@ function resolve2(...parts) {
908
1151
  const part = parts[i];
909
1152
  if (part.length === 0) continue;
910
1153
  resolved = resolved.length > 0 ? `${part}/${resolved}` : part;
911
- absolute = isAbsolute(part);
1154
+ absolute = isAbsolute2(part);
912
1155
  }
913
1156
  if (!absolute)
914
1157
  throw new Error(
@@ -958,7 +1201,7 @@ var init_posixPath = __esm({
958
1201
  posix = {
959
1202
  sep,
960
1203
  delimiter,
961
- isAbsolute,
1204
+ isAbsolute: isAbsolute2,
962
1205
  normalize,
963
1206
  join: join3,
964
1207
  resolve: resolve2,
@@ -1203,16 +1446,16 @@ function sendJavaScript(req, res, source) {
1203
1446
  res.end(req.method === "HEAD" ? void 0 : source);
1204
1447
  }
1205
1448
  function resolveReplacementModuleFile(fromFile, specifier) {
1206
- 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);
1207
1450
  const candidates = [
1208
1451
  ...REPLACEMENT_MODULE_EXTENSIONS.some(
1209
- (ext) => ext === import_node_path6.default.extname(base).toLowerCase()
1452
+ (ext) => ext === import_node_path9.default.extname(base).toLowerCase()
1210
1453
  ) ? [base] : [],
1211
1454
  ...REPLACEMENT_MODULE_EXTENSIONS.map((ext) => base + ext),
1212
- ...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}`))
1213
1456
  ];
1214
1457
  const found = candidates.find(
1215
- (candidate) => (0, import_node_fs7.statSync)(candidate, { throwIfNoEntry: false })?.isFile()
1458
+ (candidate) => (0, import_node_fs9.statSync)(candidate, { throwIfNoEntry: false })?.isFile()
1216
1459
  );
1217
1460
  if (!found) {
1218
1461
  throw new Error(
@@ -1223,8 +1466,8 @@ function resolveReplacementModuleFile(fromFile, specifier) {
1223
1466
  }
1224
1467
  function isInsideAny(roots, file) {
1225
1468
  return roots.some((root) => {
1226
- const relative3 = import_node_path6.default.relative(root, file);
1227
- 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);
1228
1471
  });
1229
1472
  }
1230
1473
  function isReplacementModuleRequestUrl(rawUrl) {
@@ -1273,19 +1516,19 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
1273
1516
  res.end("missing path param");
1274
1517
  return true;
1275
1518
  }
1276
- const extension = import_node_path6.default.extname(targetPath).toLowerCase();
1519
+ const extension = import_node_path9.default.extname(targetPath).toLowerCase();
1277
1520
  if (!REPLACEMENT_MODULE_EXTENSIONS.some((allowed) => allowed === extension)) {
1278
1521
  res.writeHead(400, { "Content-Type": "text/plain; charset=utf-8" });
1279
1522
  res.end(`replacement files must be ${REPLACEMENT_MODULE_EXTENSIONS.join(", ")}`);
1280
1523
  return true;
1281
1524
  }
1282
- if (!import_node_path6.default.isAbsolute(targetPath)) {
1525
+ if (!import_node_path9.default.isAbsolute(targetPath)) {
1283
1526
  res.writeHead(400, { "Content-Type": "text/plain; charset=utf-8" });
1284
1527
  res.end("replacement file path must be absolute");
1285
1528
  return true;
1286
1529
  }
1287
1530
  const runtimePackages = new Set(url.searchParams.getAll("runtimePackage"));
1288
- 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));
1289
1532
  if (servedRoots && !isInsideAny(servedRoots, targetPath)) {
1290
1533
  res.writeHead(403, { "Content-Type": "text/plain; charset=utf-8" });
1291
1534
  res.end("replacement file must be inside a folder the bundler serves");
@@ -1337,14 +1580,14 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
1337
1580
  }
1338
1581
  return true;
1339
1582
  }
1340
- 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;
1341
1584
  var init_replacement_module_handler = __esm({
1342
1585
  "src/host/replacement-module-handler.ts"() {
1343
1586
  "use strict";
1344
1587
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
1345
- import_node_fs7 = require("node:fs");
1588
+ import_node_fs9 = require("node:fs");
1346
1589
  import_promises4 = __toESM(require("node:fs/promises"), 1);
1347
- import_node_path6 = __toESM(require("node:path"), 1);
1590
+ import_node_path9 = __toESM(require("node:path"), 1);
1348
1591
  init_replacementModule();
1349
1592
  init_backend_origin();
1350
1593
  REPLACEMENT_MODULE_ROUTE = "/__sootsim-replacement-module";
@@ -2495,21 +2738,38 @@ var init_public_brand = __esm({
2495
2738
  }
2496
2739
  });
2497
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
+
2498
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
+ }
2499
2760
  function packageInputPath(canonicalRoot, file) {
2500
- const canonicalFile = import_node_fs11.default.realpathSync(file);
2501
- const relative3 = import_node_path11.default.relative(canonicalRoot, canonicalFile);
2502
- 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) {
2503
2763
  throw new Error(`swift input escapes the selected package: ${file}`);
2504
2764
  }
2505
2765
  return canonicalFile;
2506
2766
  }
2507
2767
  function readPackageFile(root, file, maxBytes) {
2508
- const canonicalFile = packageInputPath(import_node_fs11.default.realpathSync(root), file);
2509
- const expected = import_node_fs11.default.statSync(canonicalFile);
2510
- 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);
2511
2771
  try {
2512
- const stat = import_node_fs11.default.fstatSync(fd);
2772
+ const stat = import_node_fs15.default.fstatSync(fd);
2513
2773
  if (stat.dev !== expected.dev || stat.ino !== expected.ino) {
2514
2774
  throw new Error(`swift input changed while opening: ${file}`);
2515
2775
  }
@@ -2519,25 +2779,25 @@ function readPackageFile(root, file, maxBytes) {
2519
2779
  const bytes = Buffer.alloc(stat.size + 1);
2520
2780
  let offset = 0;
2521
2781
  while (offset < bytes.length) {
2522
- 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);
2523
2783
  if (count === 0) break;
2524
2784
  offset += count;
2525
2785
  }
2526
- 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) {
2527
2787
  throw new Error(`swift input changed while reading: ${file}`);
2528
2788
  }
2529
2789
  return bytes.subarray(0, offset);
2530
2790
  } finally {
2531
- import_node_fs11.default.closeSync(fd);
2791
+ import_node_fs15.default.closeSync(fd);
2532
2792
  }
2533
2793
  }
2534
- var import_node_fs11, import_node_path11;
2794
+ var import_node_fs15, import_node_path16;
2535
2795
  var init_swift_source_file = __esm({
2536
2796
  "src/swift-source-file.ts"() {
2537
2797
  "use strict";
2538
2798
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
2539
- import_node_fs11 = __toESM(require("node:fs"), 1);
2540
- 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);
2541
2801
  }
2542
2802
  });
2543
2803
 
@@ -2570,6 +2830,23 @@ var init_swift_submit = __esm({
2570
2830
  }
2571
2831
  });
2572
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
+
2573
2850
  // src/nitro-source.ts
2574
2851
  function object(value) {
2575
2852
  return value !== null && typeof value === "object" && !Array.isArray(value);
@@ -2578,19 +2855,19 @@ function readJson(root, relative3) {
2578
2855
  return JSON.parse(
2579
2856
  readPackageFile(
2580
2857
  root,
2581
- import_node_path12.default.join(root, relative3),
2858
+ import_node_path17.default.join(root, relative3),
2582
2859
  MAX_SWIFT_COMPILE_SOURCE_BYTES
2583
2860
  ).toString("utf8")
2584
2861
  );
2585
2862
  }
2586
2863
  function registrations(root) {
2587
- const directory = import_node_path12.default.join(root, "nitrogen/generated/ios");
2588
- 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"));
2589
2866
  if (initializers.length !== 1)
2590
2867
  throw new Error(`${root}: expected one generated Nitro iOS initializer`);
2591
2868
  const source = readPackageFile(
2592
2869
  root,
2593
- import_node_path12.default.join(directory, initializers[0]),
2870
+ import_node_path17.default.join(directory, initializers[0]),
2594
2871
  MAX_SWIFT_COMPILE_SOURCE_BYTES
2595
2872
  ).toString("utf8");
2596
2873
  const namespaces = [
@@ -2632,12 +2909,12 @@ function registrations(root) {
2632
2909
  return { namespace, swiftModule, classes, views: viewNames(root, classes) };
2633
2910
  }
2634
2911
  function viewNames(root, classes) {
2635
- const directory = import_node_path12.default.join(root, "nitrogen/generated/shared/json");
2636
- 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();
2637
2914
  const views = /* @__PURE__ */ new Set();
2638
- for (const file of import_node_fs12.default.readdirSync(directory)) {
2915
+ for (const file of import_node_fs16.default.readdirSync(directory)) {
2639
2916
  if (!file.endsWith("Config.json")) continue;
2640
- 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));
2641
2918
  const name2 = object(config) ? config.uiViewClassName : void 0;
2642
2919
  if (typeof name2 === "string" && classes.some((entry) => entry.name === name2))
2643
2920
  views.add(name2);
@@ -2645,23 +2922,28 @@ function viewNames(root, classes) {
2645
2922
  return views;
2646
2923
  }
2647
2924
  function hasNitroIosInitializer(root) {
2648
- const generated = import_node_path12.default.join(root, "nitrogen/generated/ios");
2649
- 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"));
2650
2927
  }
2651
2928
  function nitroRegisteredNames(root) {
2652
2929
  if (!hasNitroIosInitializer(root)) return null;
2653
2930
  const { classes, views } = registrations(root);
2654
2931
  return { names: classes.map(({ name: name2 }) => name2), views: [...views].sort() };
2655
2932
  }
2656
- var import_node_fs12, import_node_path12;
2933
+ var import_node_child_process7, import_node_fs16, import_node_path17, import_node_util4, run4;
2657
2934
  var init_nitro_source = __esm({
2658
2935
  "src/nitro-source.ts"() {
2659
2936
  "use strict";
2660
2937
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
2661
- import_node_fs12 = __toESM(require("node:fs"), 1);
2662
- 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();
2663
2944
  init_swift_source_file();
2664
2945
  init_swift_submit();
2946
+ run4 = (0, import_node_util4.promisify)(import_node_child_process7.execFile);
2665
2947
  }
2666
2948
  });
2667
2949
 
@@ -2745,17 +3027,17 @@ function visit(node, visitor) {
2745
3027
  } else
2746
3028
  visit_(null, node, visitor_, Object.freeze([]));
2747
3029
  }
2748
- function visit_(key, node, visitor, path17) {
2749
- const ctrl = callVisitor(key, node, visitor, path17);
3030
+ function visit_(key, node, visitor, path21) {
3031
+ const ctrl = callVisitor(key, node, visitor, path21);
2750
3032
  if (isNode(ctrl) || isPair(ctrl)) {
2751
- replaceNode(key, path17, ctrl);
2752
- return visit_(key, ctrl, visitor, path17);
3033
+ replaceNode(key, path21, ctrl);
3034
+ return visit_(key, ctrl, visitor, path21);
2753
3035
  }
2754
3036
  if (typeof ctrl !== "symbol") {
2755
3037
  if (isCollection(node)) {
2756
- path17 = Object.freeze(path17.concat(node));
3038
+ path21 = Object.freeze(path21.concat(node));
2757
3039
  for (let i = 0; i < node.items.length; ++i) {
2758
- const ci = visit_(i, node.items[i], visitor, path17);
3040
+ const ci = visit_(i, node.items[i], visitor, path21);
2759
3041
  if (typeof ci === "number")
2760
3042
  i = ci - 1;
2761
3043
  else if (ci === BREAK)
@@ -2766,13 +3048,13 @@ function visit_(key, node, visitor, path17) {
2766
3048
  }
2767
3049
  }
2768
3050
  } else if (isPair(node)) {
2769
- path17 = Object.freeze(path17.concat(node));
2770
- const ck = visit_("key", node.key, visitor, path17);
3051
+ path21 = Object.freeze(path21.concat(node));
3052
+ const ck = visit_("key", node.key, visitor, path21);
2771
3053
  if (ck === BREAK)
2772
3054
  return BREAK;
2773
3055
  else if (ck === REMOVE)
2774
3056
  node.key = null;
2775
- const cv = visit_("value", node.value, visitor, path17);
3057
+ const cv = visit_("value", node.value, visitor, path21);
2776
3058
  if (cv === BREAK)
2777
3059
  return BREAK;
2778
3060
  else if (cv === REMOVE)
@@ -2790,17 +3072,17 @@ async function visitAsync(node, visitor) {
2790
3072
  } else
2791
3073
  await visitAsync_(null, node, visitor_, Object.freeze([]));
2792
3074
  }
2793
- async function visitAsync_(key, node, visitor, path17) {
2794
- 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);
2795
3077
  if (isNode(ctrl) || isPair(ctrl)) {
2796
- replaceNode(key, path17, ctrl);
2797
- return visitAsync_(key, ctrl, visitor, path17);
3078
+ replaceNode(key, path21, ctrl);
3079
+ return visitAsync_(key, ctrl, visitor, path21);
2798
3080
  }
2799
3081
  if (typeof ctrl !== "symbol") {
2800
3082
  if (isCollection(node)) {
2801
- path17 = Object.freeze(path17.concat(node));
3083
+ path21 = Object.freeze(path21.concat(node));
2802
3084
  for (let i = 0; i < node.items.length; ++i) {
2803
- const ci = await visitAsync_(i, node.items[i], visitor, path17);
3085
+ const ci = await visitAsync_(i, node.items[i], visitor, path21);
2804
3086
  if (typeof ci === "number")
2805
3087
  i = ci - 1;
2806
3088
  else if (ci === BREAK)
@@ -2811,13 +3093,13 @@ async function visitAsync_(key, node, visitor, path17) {
2811
3093
  }
2812
3094
  }
2813
3095
  } else if (isPair(node)) {
2814
- path17 = Object.freeze(path17.concat(node));
2815
- 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);
2816
3098
  if (ck === BREAK)
2817
3099
  return BREAK;
2818
3100
  else if (ck === REMOVE)
2819
3101
  node.key = null;
2820
- const cv = await visitAsync_("value", node.value, visitor, path17);
3102
+ const cv = await visitAsync_("value", node.value, visitor, path21);
2821
3103
  if (cv === BREAK)
2822
3104
  return BREAK;
2823
3105
  else if (cv === REMOVE)
@@ -2844,23 +3126,23 @@ function initVisitor(visitor) {
2844
3126
  }
2845
3127
  return visitor;
2846
3128
  }
2847
- function callVisitor(key, node, visitor, path17) {
3129
+ function callVisitor(key, node, visitor, path21) {
2848
3130
  if (typeof visitor === "function")
2849
- return visitor(key, node, path17);
3131
+ return visitor(key, node, path21);
2850
3132
  if (isMap(node))
2851
- return visitor.Map?.(key, node, path17);
3133
+ return visitor.Map?.(key, node, path21);
2852
3134
  if (isSeq(node))
2853
- return visitor.Seq?.(key, node, path17);
3135
+ return visitor.Seq?.(key, node, path21);
2854
3136
  if (isPair(node))
2855
- return visitor.Pair?.(key, node, path17);
3137
+ return visitor.Pair?.(key, node, path21);
2856
3138
  if (isScalar(node))
2857
- return visitor.Scalar?.(key, node, path17);
3139
+ return visitor.Scalar?.(key, node, path21);
2858
3140
  if (isAlias(node))
2859
- return visitor.Alias?.(key, node, path17);
3141
+ return visitor.Alias?.(key, node, path21);
2860
3142
  return void 0;
2861
3143
  }
2862
- function replaceNode(key, path17, node) {
2863
- const parent = path17[path17.length - 1];
3144
+ function replaceNode(key, path21, node) {
3145
+ const parent = path21[path21.length - 1];
2864
3146
  if (isCollection(parent)) {
2865
3147
  parent.items[key] = node;
2866
3148
  } else if (isPair(parent)) {
@@ -3420,10 +3702,10 @@ var init_createNode = __esm({
3420
3702
  });
3421
3703
 
3422
3704
  // ../../node_modules/yaml/browser/dist/nodes/Collection.js
3423
- function collectionFromPath(schema4, path17, value) {
3705
+ function collectionFromPath(schema4, path21, value) {
3424
3706
  let v = value;
3425
- for (let i = path17.length - 1; i >= 0; --i) {
3426
- const k = path17[i];
3707
+ for (let i = path21.length - 1; i >= 0; --i) {
3708
+ const k = path21[i];
3427
3709
  if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
3428
3710
  const a = [];
3429
3711
  a[k] = v;
@@ -3449,7 +3731,7 @@ var init_Collection = __esm({
3449
3731
  init_createNode();
3450
3732
  init_identity();
3451
3733
  init_Node();
3452
- 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;
3453
3735
  Collection = class extends NodeBase {
3454
3736
  constructor(type, schema4) {
3455
3737
  super(type);
@@ -3479,11 +3761,11 @@ var init_Collection = __esm({
3479
3761
  * be a Pair instance or a `{ key, value }` object, which may not have a key
3480
3762
  * that already exists in the map.
3481
3763
  */
3482
- addIn(path17, value) {
3483
- if (isEmptyPath(path17))
3764
+ addIn(path21, value) {
3765
+ if (isEmptyPath(path21))
3484
3766
  this.add(value);
3485
3767
  else {
3486
- const [key, ...rest] = path17;
3768
+ const [key, ...rest] = path21;
3487
3769
  const node = this.get(key, true);
3488
3770
  if (isCollection(node))
3489
3771
  node.addIn(rest, value);
@@ -3497,8 +3779,8 @@ var init_Collection = __esm({
3497
3779
  * Removes a value from the collection.
3498
3780
  * @returns `true` if the item was found and removed.
3499
3781
  */
3500
- deleteIn(path17) {
3501
- const [key, ...rest] = path17;
3782
+ deleteIn(path21) {
3783
+ const [key, ...rest] = path21;
3502
3784
  if (rest.length === 0)
3503
3785
  return this.delete(key);
3504
3786
  const node = this.get(key, true);
@@ -3512,8 +3794,8 @@ var init_Collection = __esm({
3512
3794
  * scalar values from their surrounding node; to disable set `keepScalar` to
3513
3795
  * `true` (collections are always returned intact).
3514
3796
  */
3515
- getIn(path17, keepScalar) {
3516
- const [key, ...rest] = path17;
3797
+ getIn(path21, keepScalar) {
3798
+ const [key, ...rest] = path21;
3517
3799
  const node = this.get(key, true);
3518
3800
  if (rest.length === 0)
3519
3801
  return !keepScalar && isScalar(node) ? node.value : node;
@@ -3531,8 +3813,8 @@ var init_Collection = __esm({
3531
3813
  /**
3532
3814
  * Checks if the collection includes a value with the key `key`.
3533
3815
  */
3534
- hasIn(path17) {
3535
- const [key, ...rest] = path17;
3816
+ hasIn(path21) {
3817
+ const [key, ...rest] = path21;
3536
3818
  if (rest.length === 0)
3537
3819
  return this.has(key);
3538
3820
  const node = this.get(key, true);
@@ -3542,8 +3824,8 @@ var init_Collection = __esm({
3542
3824
  * Sets a value in this collection. For `!!set`, `value` needs to be a
3543
3825
  * boolean to add/remove the item from the set.
3544
3826
  */
3545
- setIn(path17, value) {
3546
- const [key, ...rest] = path17;
3827
+ setIn(path21, value) {
3828
+ const [key, ...rest] = path21;
3547
3829
  if (rest.length === 0) {
3548
3830
  this.set(key, value);
3549
3831
  } else {
@@ -5516,15 +5798,15 @@ function visit2(cst, visitor) {
5516
5798
  cst = { start: cst.start, value: cst.value };
5517
5799
  _visit(Object.freeze([]), cst, visitor);
5518
5800
  }
5519
- function _visit(path17, item, visitor) {
5520
- let ctrl = visitor(item, path17);
5801
+ function _visit(path21, item, visitor) {
5802
+ let ctrl = visitor(item, path21);
5521
5803
  if (typeof ctrl === "symbol")
5522
5804
  return ctrl;
5523
5805
  for (const field of ["key", "value"]) {
5524
5806
  const token = item[field];
5525
5807
  if (token && "items" in token) {
5526
5808
  for (let i = 0; i < token.items.length; ++i) {
5527
- 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);
5528
5810
  if (typeof ci === "number")
5529
5811
  i = ci - 1;
5530
5812
  else if (ci === BREAK2)
@@ -5535,10 +5817,10 @@ function _visit(path17, item, visitor) {
5535
5817
  }
5536
5818
  }
5537
5819
  if (typeof ctrl === "function" && field === "key")
5538
- ctrl = ctrl(item, path17);
5820
+ ctrl = ctrl(item, path21);
5539
5821
  }
5540
5822
  }
5541
- return typeof ctrl === "function" ? ctrl(item, path17) : ctrl;
5823
+ return typeof ctrl === "function" ? ctrl(item, path21) : ctrl;
5542
5824
  }
5543
5825
  var BREAK2, SKIP2, REMOVE2;
5544
5826
  var init_cst_visit = __esm({
@@ -5550,9 +5832,9 @@ var init_cst_visit = __esm({
5550
5832
  visit2.BREAK = BREAK2;
5551
5833
  visit2.SKIP = SKIP2;
5552
5834
  visit2.REMOVE = REMOVE2;
5553
- visit2.itemAtPath = (cst, path17) => {
5835
+ visit2.itemAtPath = (cst, path21) => {
5554
5836
  let item = cst;
5555
- for (const [field, index] of path17) {
5837
+ for (const [field, index] of path21) {
5556
5838
  const tok = item?.[field];
5557
5839
  if (tok && "items" in tok) {
5558
5840
  item = tok.items[index];
@@ -5561,9 +5843,9 @@ var init_cst_visit = __esm({
5561
5843
  }
5562
5844
  return item;
5563
5845
  };
5564
- visit2.parentCollection = (cst, path17) => {
5565
- const parent = visit2.itemAtPath(cst, path17.slice(0, -1));
5566
- 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];
5567
5849
  const coll = parent?.[field];
5568
5850
  if (coll && "items" in coll)
5569
5851
  return coll;
@@ -5658,25 +5940,25 @@ var init_browser = __esm({
5658
5940
  });
5659
5941
 
5660
5942
  // cli/commands/nodeRepoFileReader.ts
5661
- var import_node_fs13, nodeRepoFileReader;
5943
+ var import_node_fs17, nodeRepoFileReader;
5662
5944
  var init_nodeRepoFileReader = __esm({
5663
5945
  "cli/commands/nodeRepoFileReader.ts"() {
5664
5946
  "use strict";
5665
5947
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
5666
- import_node_fs13 = require("node:fs");
5948
+ import_node_fs17 = require("node:fs");
5667
5949
  nodeRepoFileReader = {
5668
- exists: import_node_fs13.existsSync,
5669
- readText: (filePath) => (0, import_node_fs13.readFileSync)(filePath, "utf8"),
5670
- 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) => ({
5671
5953
  name: entry.name,
5672
5954
  directory: entry.isDirectory()
5673
5955
  })),
5674
- isDirectory: (filePath) => (0, import_node_fs13.statSync)(filePath).isDirectory(),
5956
+ isDirectory: (filePath) => (0, import_node_fs17.statSync)(filePath).isDirectory(),
5675
5957
  readMetadata(filePath) {
5676
5958
  try {
5677
- const info = (0, import_node_fs13.lstatSync)(filePath);
5959
+ const info = (0, import_node_fs17.lstatSync)(filePath);
5678
5960
  if (!info.isFile() || info.size > 4 * 1024 * 1024) return null;
5679
- return (0, import_node_fs13.readFileSync)(filePath, "utf8");
5961
+ return (0, import_node_fs17.readFileSync)(filePath, "utf8");
5680
5962
  } catch {
5681
5963
  return null;
5682
5964
  }
@@ -5699,7 +5981,7 @@ function scanRepository(root) {
5699
5981
  directories.push(next.dir);
5700
5982
  let handle;
5701
5983
  try {
5702
- handle = (0, import_node_fs14.opendirSync)(next.dir);
5984
+ handle = (0, import_node_fs18.opendirSync)(next.dir);
5703
5985
  } catch {
5704
5986
  unreadable++;
5705
5987
  continue;
@@ -5714,7 +5996,7 @@ function scanRepository(root) {
5714
5996
  truncated = true;
5715
5997
  continue;
5716
5998
  }
5717
- 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 });
5718
6000
  }
5719
6001
  } finally {
5720
6002
  handle.closeSync();
@@ -5733,8 +6015,8 @@ function metadataValue(value, key) {
5733
6015
  if (!value || typeof value !== "object") return void 0;
5734
6016
  return Object.getOwnPropertyDescriptor(value, key)?.value;
5735
6017
  }
5736
- function readProjectJson(path17, files = nodeRepoFileReader) {
5737
- const text2 = readProjectMetadata(path17, files);
6018
+ function readProjectJson(path21, files = nodeRepoFileReader) {
6019
+ const text2 = readProjectMetadata(path21, files);
5738
6020
  if (text2 === null) return null;
5739
6021
  try {
5740
6022
  const value = JSON.parse(text2);
@@ -5744,7 +6026,7 @@ function readProjectJson(path17, files = nodeRepoFileReader) {
5744
6026
  }
5745
6027
  }
5746
6028
  function readProjectManifest(dir, files = nodeRepoFileReader) {
5747
- 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);
5748
6030
  if (!parsed || typeof parsed !== "object") return null;
5749
6031
  const record = (value) => {
5750
6032
  if (!value || typeof value !== "object") return {};
@@ -5761,13 +6043,13 @@ function readProjectManifest(dir, files = nodeRepoFileReader) {
5761
6043
  devDependencies: record(metadataValue(parsed, "devDependencies"))
5762
6044
  };
5763
6045
  }
5764
- 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;
5765
6047
  var init_detect = __esm({
5766
6048
  "cli/commands/detect.ts"() {
5767
6049
  "use strict";
5768
6050
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
5769
- import_node_fs14 = require("node:fs");
5770
- import_node_path13 = require("node:path");
6051
+ import_node_fs18 = require("node:fs");
6052
+ import_node_path18 = require("node:path");
5771
6053
  import_json52 = __toESM(require_lib(), 1);
5772
6054
  init_browser();
5773
6055
  init_nodeRepoFileReader();
@@ -5788,6 +6070,29 @@ var init_detect = __esm({
5788
6070
  "test-results",
5789
6071
  "playwright-report"
5790
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
+ `;
5791
6096
  }
5792
6097
  });
5793
6098
 
@@ -5822,7 +6127,7 @@ function resolveAppStubs(appDir, config, configDir) {
5822
6127
  const targetDir = stubTarget ? installedPackageDir(appDir, target) : dir;
5823
6128
  const targetVersion = targetDir ? readPackageJson(targetDir)?.version : void 0;
5824
6129
  if (typeof targetVersion !== "string") continue;
5825
- if (versions !== void 0 && (0, import_version_range.resolveCompatVersionRange)([versions], targetVersion).status !== "matched") {
6130
+ if (versions !== void 0 && resolveCompatVersionRange([versions], targetVersion).status !== "matched") {
5826
6131
  skipped.push({
5827
6132
  target,
5828
6133
  provider: name2,
@@ -5879,7 +6184,7 @@ function resolveAppStubs(appDir, config, configDir) {
5879
6184
  const { modules, views, hybridObjects } = expandStubs(appDir, source);
5880
6185
  assertRegisteredHybridObjects(appDir, source, hybridObjects);
5881
6186
  for (const [name2, answer] of Object.entries(hybridObjects))
5882
- 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) };
5883
6188
  for (const [name2, stub] of Object.entries(modules))
5884
6189
  nativeModules[name2] = lowerStub(stub, source.baseDir);
5885
6190
  for (const [name2, stub] of Object.entries(views))
@@ -5891,6 +6196,7 @@ function resolveAppStubs(appDir, config, configDir) {
5891
6196
  providerVersion: source.providerVersion,
5892
6197
  modules: Object.keys(modules),
5893
6198
  views: Object.keys(views),
6199
+ hybridObjects: Object.keys(hybridObjects),
5894
6200
  ...Object.values(views).some((value) => typeof value !== "string") ? {
5895
6201
  viewSources: Object.fromEntries(
5896
6202
  Object.entries(views).filter(
@@ -5943,10 +6249,10 @@ function assertRegisteredHybridObjects(appDir, source, hybridObjects) {
5943
6249
  );
5944
6250
  }
5945
6251
  function lowerStub(stub, baseDir) {
5946
- 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) };
5947
6253
  }
5948
6254
  function readPackageJson(dir) {
5949
- const text2 = readSmallFile((0, import_node_path14.join)(dir, "package.json"));
6255
+ const text2 = readSmallFile((0, import_node_path19.join)(dir, "package.json"));
5950
6256
  if (!text2) return null;
5951
6257
  try {
5952
6258
  const parsed = JSON.parse(text2);
@@ -5958,9 +6264,9 @@ function readPackageJson(dir) {
5958
6264
  function installedPackageDir(appDir, name2) {
5959
6265
  let current = appDir;
5960
6266
  while (true) {
5961
- const dir = (0, import_node_path14.join)(current, "node_modules", name2);
5962
- if ((0, import_node_fs15.existsSync)((0, import_node_path14.join)(dir, "package.json"))) return (0, import_node_fs15.realpathSync)(dir);
5963
- 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);
5964
6270
  if (parent === current) return null;
5965
6271
  current = parent;
5966
6272
  }
@@ -6052,7 +6358,7 @@ function mergeRequests(previous, next) {
6052
6358
  function packageNativeRequests(dir) {
6053
6359
  const found = /* @__PURE__ */ new Map();
6054
6360
  const directories = scanRepository(dir).directories.filter((sub) => {
6055
- const segments = (0, import_node_path14.relative)(dir, sub).split("/");
6361
+ const segments = (0, import_node_path19.relative)(dir, sub).split("/");
6056
6362
  return !NATIVE_SOURCE_DIRS.has(segments[0]) && !segments.some((segment) => PACKAGE_SKIP_DIRS.has(segment));
6057
6363
  });
6058
6364
  let files = 0;
@@ -6060,14 +6366,13 @@ function packageNativeRequests(dir) {
6060
6366
  for (const name2 of listDir(sub)) {
6061
6367
  if (!SOURCE_FILE.test(name2) || name2.endsWith(".d.ts") || files >= 2e3) continue;
6062
6368
  files++;
6063
- const file = (0, import_node_path14.join)(sub, name2);
6369
+ const file = (0, import_node_path19.join)(sub, name2);
6064
6370
  const text2 = readSmallFile(file);
6065
6371
  if (!text2) continue;
6066
- for (const { line: _line, ...request } of sourceNativeRequests(file, text2, true))
6067
- found.set(
6068
- `${request.kind}:${request.name}`,
6069
- mergeRequests(found.get(`${request.kind}:${request.name}`), request)
6070
- );
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
+ }
6071
6376
  }
6072
6377
  }
6073
6378
  return [...found.values()].sort(
@@ -6179,27 +6484,27 @@ function wireSlotMigration(appDir, configPath, wire, kept = []) {
6179
6484
  }
6180
6485
  function listDir(dir) {
6181
6486
  try {
6182
- return (0, import_node_fs15.readdirSync)(dir);
6487
+ return (0, import_node_fs19.readdirSync)(dir);
6183
6488
  } catch {
6184
6489
  return [];
6185
6490
  }
6186
6491
  }
6187
6492
  function readSmallFile(file) {
6188
6493
  try {
6189
- 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;
6190
6495
  } catch {
6191
6496
  return null;
6192
6497
  }
6193
6498
  }
6194
6499
  function hasNativeCode(dir, platform) {
6195
- 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");
6196
6501
  const platforms = metadataValue(readProjectJson(expoConfig), "platforms");
6197
6502
  if (Array.isArray(platforms))
6198
6503
  return platforms.includes(platform) || platform === "ios" && platforms.includes("apple");
6199
- 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))))
6200
6505
  return true;
6201
6506
  if (listDir(dir).some((name2) => name2.endsWith(".podspec"))) return true;
6202
- const manifest = readSmallFile((0, import_node_path14.join)(dir, "package.json"));
6507
+ const manifest = readSmallFile((0, import_node_path19.join)(dir, "package.json"));
6203
6508
  return manifest !== null && manifest.includes('"codegenConfig"');
6204
6509
  }
6205
6510
  function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__PURE__ */ new Set(), includeLegacy = false, providers) {
@@ -6212,7 +6517,7 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
6212
6517
  (excluded) => dir === excluded || dir.startsWith(`${excluded}/`)
6213
6518
  ))
6214
6519
  continue;
6215
- 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"))) {
6216
6521
  if (platform && !hasNativeCode(dir, platform)) {
6217
6522
  excludedModuleDirs.push(dir);
6218
6523
  continue;
@@ -6221,7 +6526,7 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
6221
6526
  }
6222
6527
  for (const name2 of listDir(dir)) {
6223
6528
  if (SOURCE_FILE.test(name2) && !name2.endsWith(".d.ts"))
6224
- sourceFiles.push((0, import_node_path14.join)(dir, name2));
6529
+ sourceFiles.push((0, import_node_path19.join)(dir, name2));
6225
6530
  }
6226
6531
  }
6227
6532
  }
@@ -6231,7 +6536,7 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
6231
6536
  scanRepository(dir).directories.flatMap(
6232
6537
  (sub) => listDir(sub).filter(
6233
6538
  (name2) => NATIVE_SOURCE_FILE.test(name2) && (!platform || (platform === "ios" ? name2.endsWith(".swift") : name2.endsWith(".kt")))
6234
- ).map((name2) => (0, import_node_path14.join)(sub, name2))
6539
+ ).map((name2) => (0, import_node_path19.join)(sub, name2))
6235
6540
  )
6236
6541
  ])
6237
6542
  );
@@ -6240,32 +6545,32 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
6240
6545
  const known = owners.get(dir);
6241
6546
  if (known) return known;
6242
6547
  const name2 = readPackageJson(dir)?.name;
6243
- const parent = (0, import_node_path14.dirname)(dir);
6548
+ const parent = (0, import_node_path19.dirname)(dir);
6244
6549
  const result = typeof name2 === "string" ? name2 : parent === dir ? pkg.name ?? "app" : owner(parent);
6245
6550
  owners.set(dir, result);
6246
6551
  return result;
6247
6552
  };
6248
6553
  const found = /* @__PURE__ */ new Map();
6249
- const add = (kind, name2, file, line, optional = false) => {
6554
+ const add = (kind, name2, file, line, optional = false, declaration = false) => {
6250
6555
  const key = `${kind}:${name2}`;
6251
6556
  const known = found.get(key);
6252
6557
  if (known) {
6253
- known.optional &&= optional;
6558
+ if (!declaration) known.optional &&= optional;
6254
6559
  return;
6255
6560
  }
6256
6561
  providers ??= dependencyNativeOwners(appDir, pkg);
6257
- 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));
6258
6563
  if (knownPackages.has(packageName)) return;
6259
6564
  const moduleDir = expoModuleDirs.find((dir) => file.startsWith(`${dir}/`)) ?? null;
6260
6565
  found.set(key, {
6261
6566
  kind,
6262
6567
  name: name2,
6263
6568
  package: packageName,
6264
- path: `${(0, import_node_path14.relative)(appDir, file)}:${line}`,
6265
- 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,
6266
6571
  optional,
6267
6572
  swift: moduleDir ? (nativeFilesByModule.get(moduleDir) ?? []).some(
6268
- (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(
6269
6574
  (match) => match[1] === name2
6270
6575
  )
6271
6576
  ) : false,
@@ -6293,7 +6598,14 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
6293
6598
  if (!text2) continue;
6294
6599
  for (const match of text2.matchAll(/\bName\(\s*"(\w+)"\s*\)/g)) {
6295
6600
  if (match[1])
6296
- 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
+ );
6297
6609
  }
6298
6610
  }
6299
6611
  }
@@ -6306,31 +6618,31 @@ function workspacePackageDirs(appDir, pkg) {
6306
6618
  for (const name2 of Object.keys({ ...pkg.dependencies, ...pkg.devDependencies })) {
6307
6619
  let current = appDir;
6308
6620
  while (true) {
6309
- const link = (0, import_node_path14.join)(current, "node_modules", name2);
6310
- if ((0, import_node_fs15.existsSync)(link)) {
6311
- if ((0, import_node_fs15.lstatSync)(link).isSymbolicLink()) {
6312
- 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);
6313
6625
  if (!target.split("/").includes("node_modules") && !target.startsWith(`${appDir}/`)) {
6314
6626
  dirs.add(target);
6315
6627
  }
6316
6628
  }
6317
6629
  break;
6318
6630
  }
6319
- const parent = (0, import_node_path14.dirname)(current);
6631
+ const parent = (0, import_node_path19.dirname)(current);
6320
6632
  if (parent === current) break;
6321
6633
  current = parent;
6322
6634
  }
6323
6635
  }
6324
6636
  return [...dirs];
6325
6637
  }
6326
- 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;
6327
6639
  var init_app_stubs = __esm({
6328
6640
  "cli/app-stubs.ts"() {
6329
6641
  "use strict";
6330
6642
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
6331
- import_node_fs15 = require("node:fs");
6332
- import_node_path14 = require("node:path");
6333
- 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();
6334
6646
  import_oxc_parser2 = require("oxc-parser");
6335
6647
  import_sucrase = require("sucrase");
6336
6648
  init_config();
@@ -6365,12 +6677,12 @@ function resolveFileEntries(entries, configDir) {
6365
6677
  return Object.fromEntries(
6366
6678
  Object.entries(entries).map(([name2, resolution]) => [
6367
6679
  name2,
6368
- 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
6369
6681
  ])
6370
6682
  );
6371
6683
  }
6372
6684
  function resolveConfigReplacementFiles(config, configPath) {
6373
- const configDir = import_node_path15.default.dirname(configPath);
6685
+ const configDir = import_node_path20.default.dirname(configPath);
6374
6686
  return {
6375
6687
  ...config,
6376
6688
  modules: resolveFileEntries(config.modules, configDir)
@@ -6386,7 +6698,7 @@ async function loadRNXAppStubs(project) {
6386
6698
  return resolveAppStubs(
6387
6699
  project.appDir,
6388
6700
  config,
6389
- project.configPath ? import_node_path15.default.dirname(project.configPath) : project.appDir
6701
+ project.configPath ? import_node_path20.default.dirname(project.configPath) : project.appDir
6390
6702
  );
6391
6703
  } catch (error) {
6392
6704
  const message = error instanceof Error ? error.message : String(error);
@@ -6405,7 +6717,7 @@ async function loadConfigFile(project) {
6405
6717
  [`${rnxPublicBrand.packageName}/config`]: config_exports
6406
6718
  }
6407
6719
  });
6408
- 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 });
6409
6721
  if (!isPeachConfig(loaded3)) {
6410
6722
  throw new Error("the default export must be a peach config object");
6411
6723
  }
@@ -6441,13 +6753,13 @@ async function resolveRNXAppConfig(startDir = process.cwd()) {
6441
6753
  const project = resolveAppProject(startDir);
6442
6754
  return { project, ...await loadRNXAppStubs(project) };
6443
6755
  }
6444
- var import_node_fs16, import_node_path15, import_jiti, WIRE_SLOTS;
6756
+ var import_node_fs20, import_node_path20, import_jiti, WIRE_SLOTS;
6445
6757
  var init_app_config = __esm({
6446
6758
  "cli/app-config.ts"() {
6447
6759
  "use strict";
6448
6760
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
6449
- import_node_fs16 = require("node:fs");
6450
- import_node_path15 = __toESM(require("node:path"), 1);
6761
+ import_node_fs20 = require("node:fs");
6762
+ import_node_path20 = __toESM(require("node:path"), 1);
6451
6763
  import_jiti = require("jiti");
6452
6764
  init_config();
6453
6765
  init_config();
@@ -6544,14 +6856,14 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
6544
6856
  const neededPackages = /* @__PURE__ */ new Set();
6545
6857
  const factories = [];
6546
6858
  const visit3 = (filePath) => {
6547
- const real = import_node_fs17.default.realpathSync(filePath);
6859
+ const real = import_node_fs21.default.realpathSync(filePath);
6548
6860
  const previous = files.get(real);
6549
6861
  if (previous !== void 0) return previous;
6550
6862
  const id = "peach-config-file:" + files.size;
6551
6863
  files.set(real, id);
6552
6864
  const compiled = compileReplacementModule({
6553
6865
  filePath: real,
6554
- source: import_node_fs17.default.readFileSync(real, "utf8"),
6866
+ source: import_node_fs21.default.readFileSync(real, "utf8"),
6555
6867
  runtimePackages,
6556
6868
  localModuleUrl: (specifier) => visit3(resolveReplacementModuleFile(real, specifier))
6557
6869
  });
@@ -6575,7 +6887,7 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
6575
6887
  if (!entries || typeof entries !== "object") continue;
6576
6888
  for (const resolution of Object.values(entries)) {
6577
6889
  if (resolution && typeof resolution === "object" && "file" in resolution && typeof resolution.file === "string") {
6578
- resolution.file = visit3(import_node_path16.default.resolve(resolution.file));
6890
+ resolution.file = visit3(import_node_path21.default.resolve(resolution.file));
6579
6891
  }
6580
6892
  }
6581
6893
  }
@@ -6599,13 +6911,13 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
6599
6911
  const identityStart = findBundleFooter(source, "globalThis.__sootsimModulePaths=");
6600
6912
  return prefix2 + (identityStart < 0 ? source + footer : source.slice(0, identityStart) + footer + source.slice(identityStart));
6601
6913
  }
6602
- var import_node_fs17, import_node_path16, import_sucrase2, import_terser;
6914
+ var import_node_fs21, import_node_path21, import_sucrase2, import_terser;
6603
6915
  var init_configured_bundle_producer = __esm({
6604
6916
  "src/configured-bundle-producer.ts"() {
6605
6917
  "use strict";
6606
6918
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
6607
- import_node_fs17 = __toESM(require("node:fs"), 1);
6608
- 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);
6609
6921
  import_sucrase2 = require("sucrase");
6610
6922
  import_terser = require("terser");
6611
6923
  init_dependencies();
@@ -6639,10 +6951,7 @@ var import_node_fs2 = __toESM(require("node:fs"), 1);
6639
6951
  var import_node_module = require("node:module");
6640
6952
  var import_node_path2 = __toESM(require("node:path"), 1);
6641
6953
  var import_node_util = require("node:util");
6642
-
6643
- // cli/internal-child.ts
6644
- init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
6645
- var RNX_FORKED_SCRIPT_ENV = "PEACH_RUNS_FORKED_SCRIPTS";
6954
+ init_internal_child();
6646
6955
 
6647
6956
  // src/androidAutolinkingContract.ts
6648
6957
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
@@ -6712,10 +7021,180 @@ async function collectAndroidAutolinkedPackages(appRoot) {
6712
7021
  return readAndroidAutolinkedPackages(modules.map((entry) => entry.packageName));
6713
7022
  }
6714
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
+
6715
7194
  // src/dev-server-open.ts
6716
7195
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
6717
7196
  var import_node_crypto = require("node:crypto");
6718
- var import_node_fs3 = __toESM(require("node:fs"), 1);
7197
+ var import_node_fs4 = __toESM(require("node:fs"), 1);
6719
7198
  function tagRnxBundleForPlugin(bundleUrl, replacementOrigin, replacementToken, projectRoot, appName) {
6720
7199
  const absolute = /^[a-z][a-z\d+.-]*:\/\//i.test(bundleUrl);
6721
7200
  const url = new URL(bundleUrl, absolute ? void 0 : "http://peach.local");
@@ -6723,7 +7202,7 @@ function tagRnxBundleForPlugin(bundleUrl, replacementOrigin, replacementToken, p
6723
7202
  url.searchParams.set("rnxAppName", appName);
6724
7203
  url.searchParams.set(
6725
7204
  "rnxProjectId",
6726
- (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)
6727
7206
  );
6728
7207
  }
6729
7208
  url.searchParams.set("rnxReplacementOrigin", replacementOrigin);
@@ -6742,8 +7221,9 @@ init_backend_origin();
6742
7221
  // src/packageVersionsContract.ts
6743
7222
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
6744
7223
  init_bundleGlobalFooter();
7224
+ var NATIVE_BUILD_OPTIONS_KEY = "@peach/native-build-options";
6745
7225
  var PACKAGE_VERSIONS_HEADER = "X-Peach-Package-Versions";
6746
- var FOOTER2 = "__peachPackageVersions";
7226
+ var FOOTER3 = "__peachPackageVersions";
6747
7227
  function readPackageVersions(value) {
6748
7228
  if (typeof value !== "object" || value === null || Array.isArray(value)) {
6749
7229
  throw new Error("invalid package versions");
@@ -6758,7 +7238,7 @@ function readPackageVersions(value) {
6758
7238
  return versions;
6759
7239
  }
6760
7240
  function insertPackageVersionsFooter(source, versions) {
6761
- return insertBundleGlobalFooter(source, FOOTER2, readPackageVersions(versions));
7241
+ return insertBundleGlobalFooter(source, FOOTER3, readPackageVersions(versions));
6762
7242
  }
6763
7243
  var WORKLETS_STATIC_FLAGS_KEY = "react-native-worklets/staticFlags.json";
6764
7244
  function isFlagRecord(value) {
@@ -6875,7 +7355,6 @@ var LAZY_STUB_PATTERNS = [
6875
7355
  "react-native-advanced-input-mask",
6876
7356
  "react-native-agora",
6877
7357
  "react-native-android-location-enabler",
6878
- "react-native-android-widget",
6879
7358
  "react-native-animateable-text",
6880
7359
  "react-native-app-clip",
6881
7360
  "react-native-appsflyer",
@@ -7015,7 +7494,6 @@ var LIGHT_NATIVE_PACKAGE_NAMES = [
7015
7494
  "@allboatsrise/expo-marketingcloudsdk",
7016
7495
  "@ammarahmed/react-native-eventsource",
7017
7496
  "@ammarahmed/react-native-share-extension",
7018
- "@ammarahmed/react-native-sodium",
7019
7497
  "@ammarahmed/react-native-upload",
7020
7498
  "@amplitude/analytics-react-native",
7021
7499
  "@amplitude/experiment-react-native-client",
@@ -7371,7 +7849,6 @@ var LIGHT_NATIVE_PACKAGE_NAMES = [
7371
7849
  "expo-ai-kit",
7372
7850
  "expo-app-blocker",
7373
7851
  "expo-audio-stream-pcm",
7374
- "expo-barcode-scanner",
7375
7852
  "expo-brownfield",
7376
7853
  "expo-check-installed-apps",
7377
7854
  "expo-esim",
@@ -7586,6 +8063,7 @@ var LIGHT_NATIVE_PACKAGE_NAMES = [
7586
8063
  "react-native-kochava-tracker",
7587
8064
  "react-native-launch-navigator",
7588
8065
  "react-native-layout-guides",
8066
+ "react-native-live-audio-stream",
7589
8067
  "react-native-local-resource",
7590
8068
  "react-native-marigold",
7591
8069
  "react-native-marketingcloudsdk",
@@ -8758,6 +9236,7 @@ var NATIVE_RUNTIME_PACKAGE_NAMES = [
8758
9236
  ...NATIVE_STUB_PACKAGE_NAMES,
8759
9237
  ...LIGHT_NATIVE_PACKAGE_NAMES,
8760
9238
  "@ammarahmed/react-native-background-fetch",
9239
+ "@ammarahmed/react-native-sodium",
8761
9240
  "@bsky.app/react-native-uitextview",
8762
9241
  "@bsky.app/video",
8763
9242
  "@datadog/mobile-react-native-webview",
@@ -9631,6 +10110,120 @@ var COMPAT_STUBS = {
9631
10110
  }
9632
10111
  };
9633
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
+
9634
10227
  // src/stub-pattern-matcher.ts
9635
10228
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
9636
10229
  function extractPackageFromPath(modulePath) {
@@ -9673,7 +10266,7 @@ function parseManifest(source) {
9673
10266
  function isMissing(error) {
9674
10267
  return error instanceof Error && "code" in error && error.code === "ENOENT";
9675
10268
  }
9676
- function answerSync(step) {
10269
+ function answerSync2(step) {
9677
10270
  if (step.op === "exists") return import_fs.default.existsSync(step.path);
9678
10271
  if (step.op === "realpath") return import_fs.default.realpathSync(step.path);
9679
10272
  try {
@@ -9683,7 +10276,7 @@ function answerSync(step) {
9683
10276
  throw error;
9684
10277
  }
9685
10278
  }
9686
- async function answerAsync(step) {
10279
+ async function answerAsync2(step) {
9687
10280
  if (step.op === "exists")
9688
10281
  return import_fs.default.promises.access(step.path).then(
9689
10282
  () => true,
@@ -9700,13 +10293,15 @@ async function answerAsync(step) {
9700
10293
  function runSync(walk) {
9701
10294
  for (let step = walk.next(); ; ) {
9702
10295
  if (step.done) return step.value;
9703
- step = walk.next(answerSync(step.value));
10296
+ step = walk.next(answerSync2(step.value));
9704
10297
  }
9705
10298
  }
9706
- async function runAsync(walk) {
10299
+ async function runAsync(walk, inputs) {
9707
10300
  for (let step = walk.next(); ; ) {
9708
10301
  if (step.done) return step.value;
9709
- 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));
9710
10305
  }
9711
10306
  }
9712
10307
  function createInstalledPackageReader() {
@@ -9763,12 +10358,17 @@ function readInstalledPackageVersions(projectRoot, modulePaths) {
9763
10358
  const name2 = extractPackageFromPath(modulePath.replaceAll(import_path.default.sep, "/"));
9764
10359
  if (name2) names.add(name2);
9765
10360
  }
9766
- 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;
9767
10366
  }
9768
10367
  function* nativePackageVersionsWalk(projectRoot) {
9769
10368
  const appRoot = yield* realpath(projectRoot);
9770
10369
  const nativeNames = /* @__PURE__ */ new Set();
9771
10370
  for (const specifier of [
10371
+ "react",
9772
10372
  "react-native",
9773
10373
  ...NATIVE_RUNTIME_PACKAGE_NAMES,
9774
10374
  ...LAZY_STUB_PATTERNS,
@@ -9808,49 +10408,41 @@ function* nativePackageVersionsWalk(projectRoot) {
9808
10408
  }
9809
10409
  return yield* installedVersionsWalk(projectRoot, needed);
9810
10410
  }
9811
- var INSTALL_RECORD_FILES = [
9812
- "package.json",
9813
- "bun.lock",
9814
- "bun.lockb",
9815
- "package-lock.json",
9816
- "yarn.lock",
9817
- "pnpm-lock.yaml",
9818
- "node_modules",
9819
- "node_modules/.package-lock.json",
9820
- "node_modules/.yarn-integrity",
9821
- "node_modules/.modules.yaml"
9822
- ];
9823
- async function installFingerprint(projectRoot) {
9824
- const appRoot = await import_fs.default.promises.realpath(projectRoot);
9825
- const targets = [];
9826
- for (let dir = appRoot; ; ) {
9827
- if (import_path.default.basename(dir) !== "node_modules")
9828
- for (const file of INSTALL_RECORD_FILES) targets.push(import_path.default.join(dir, file));
9829
- const parent = import_path.default.dirname(dir);
9830
- if (parent === dir) break;
9831
- dir = parent;
9832
- }
9833
- const stats = await Promise.all(
9834
- targets.map(
9835
- (target) => import_fs.default.promises.stat(target).then(
9836
- (stat) => `${stat.ino}:${stat.size}:${stat.mtimeMs}`,
9837
- () => ""
9838
- )
9839
- )
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
+ () => ""
9840
10415
  );
9841
- return `${appRoot}
9842
- ${stats.join("\n")}`;
9843
10416
  }
9844
10417
  var scans = /* @__PURE__ */ new Map();
9845
10418
  async function readInstalledNativePackageVersionsAsync(projectRoot) {
9846
- const fingerprint = await installFingerprint(projectRoot);
9847
10419
  const cached = scans.get(projectRoot);
9848
- if (cached?.fingerprint === fingerprint) return cached.versions;
9849
- const versions = runAsync(nativePackageVersionsWalk(projectRoot));
9850
- scans.set(projectRoot, { fingerprint, versions });
9851
- versions.catch(() => {
9852
- if (scans.get(projectRoot)?.versions === versions) scans.delete(projectRoot);
9853
- });
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);
9854
10446
  return versions;
9855
10447
  }
9856
10448
 
@@ -9861,9 +10453,9 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
9861
10453
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
9862
10454
  var import_child_process = require("child_process");
9863
10455
  var import_promises = require("fs/promises");
9864
- var import_node_fs4 = require("node:fs");
10456
+ var import_node_fs6 = require("node:fs");
9865
10457
  var import_node_os = require("node:os");
9866
- var import_node_path3 = require("node:path");
10458
+ var import_node_path5 = require("node:path");
9867
10459
  init_backend_origin();
9868
10460
  init_config();
9869
10461
 
@@ -10001,8 +10593,8 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
10001
10593
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
10002
10594
 
10003
10595
  // scripts/dev-server-scanner.ts
10004
- var LISTENER_LOCK_PATH = (0, import_node_path3.join)((0, import_node_os.tmpdir)(), "peach-listener-scan.lock");
10005
- 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");
10006
10598
  var LISTENER_LOCK_STALE_MS = 25e3;
10007
10599
  var LISTENER_LOCK_WAIT_MS = 8e3;
10008
10600
  function sleep(ms) {
@@ -10020,8 +10612,8 @@ function pidIsAlive(pid) {
10020
10612
  }
10021
10613
  function readLockOwner() {
10022
10614
  try {
10023
- const raw = (0, import_node_fs4.readFileSync)(LISTENER_LOCK_PATH, "utf8");
10024
- 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;
10025
10617
  const pid = Number(raw.split("-")[0]);
10026
10618
  return { raw, pid: Number.isInteger(pid) ? pid : -1, mtimeMs };
10027
10619
  } catch {
@@ -10034,15 +10626,15 @@ function lockIsAbandoned(owner) {
10034
10626
  }
10035
10627
  function clearLock(raw) {
10036
10628
  try {
10037
- if ((0, import_node_fs4.readFileSync)(LISTENER_LOCK_PATH, "utf8") !== raw) return;
10038
- (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);
10039
10631
  } catch {
10040
10632
  }
10041
10633
  }
10042
10634
  function readResult() {
10043
10635
  try {
10044
10636
  const parsed = JSON.parse(
10045
- (0, import_node_fs4.readFileSync)(LISTENER_RESULT_PATH, "utf8")
10637
+ (0, import_node_fs6.readFileSync)(LISTENER_RESULT_PATH, "utf8")
10046
10638
  );
10047
10639
  if (!parsed || typeof parsed.token !== "string" || typeof parsed.key !== "string")
10048
10640
  return null;
@@ -10053,8 +10645,8 @@ function readResult() {
10053
10645
  }
10054
10646
  function publishResult(payload) {
10055
10647
  const tmp = `${LISTENER_RESULT_PATH}.${process.pid}.tmp`;
10056
- (0, import_node_fs4.writeFileSync)(tmp, JSON.stringify(payload));
10057
- (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);
10058
10650
  }
10059
10651
  function throwPublished(payload) {
10060
10652
  throw Object.assign(new Error(payload.message || "listener scan failed"), {
@@ -10097,7 +10689,7 @@ async function withListenerLock(key, body) {
10097
10689
  for (; ; ) {
10098
10690
  let fd = null;
10099
10691
  try {
10100
- fd = (0, import_node_fs4.openSync)(LISTENER_LOCK_PATH, "wx");
10692
+ fd = (0, import_node_fs6.openSync)(LISTENER_LOCK_PATH, "wx");
10101
10693
  } catch (error) {
10102
10694
  const code = error instanceof Error && "code" in error ? error.code : "";
10103
10695
  if (code !== "EEXIST") throw error;
@@ -10106,7 +10698,7 @@ async function withListenerLock(key, body) {
10106
10698
  if (owner) clearLock(owner.raw);
10107
10699
  else {
10108
10700
  try {
10109
- (0, import_node_fs4.unlinkSync)(LISTENER_LOCK_PATH);
10701
+ (0, import_node_fs6.unlinkSync)(LISTENER_LOCK_PATH);
10110
10702
  } catch {
10111
10703
  }
10112
10704
  }
@@ -10122,7 +10714,7 @@ async function withListenerLock(key, body) {
10122
10714
  }
10123
10715
  if (fd === null) continue;
10124
10716
  try {
10125
- (0, import_node_fs4.writeSync)(fd, token);
10717
+ (0, import_node_fs6.writeSync)(fd, token);
10126
10718
  try {
10127
10719
  const value = await body();
10128
10720
  publishResult({ token, key, ok: true, value });
@@ -10139,7 +10731,7 @@ async function withListenerLock(key, body) {
10139
10731
  }
10140
10732
  } finally {
10141
10733
  try {
10142
- (0, import_node_fs4.closeSync)(fd);
10734
+ (0, import_node_fs6.closeSync)(fd);
10143
10735
  } catch {
10144
10736
  }
10145
10737
  clearLock(token);
@@ -10630,6 +11222,85 @@ for (const pair of process.env.PEACH_LOOPBACK_PORTS?.split(",").filter(Boolean)
10630
11222
  function projectLoopbackPort(hostname, port) {
10631
11223
  return isLoopbackHost(hostname) ? LOOPBACK_PORTS.get(port) ?? port : port;
10632
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
+ );
10633
11304
 
10634
11305
  // src/host/rolldown-bundle-forward.ts
10635
11306
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
@@ -10910,6 +11581,14 @@ async function proxyUpstream(req, res, upstreamUrl, reportFailure, route) {
10910
11581
  delete targetHeaders["transfer-encoding"];
10911
11582
  targetHeaders["content-length"] = String(nextBody.byteLength);
10912
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}`);
10913
11592
  const port = projectLoopbackPort(
10914
11593
  targetUrl.hostname,
10915
11594
  Number(targetUrl.port || (targetUrl.protocol === "https:" ? 443 : 80))
@@ -11025,6 +11704,10 @@ async function proxyUpstream(req, res, upstreamUrl, reportFailure, route) {
11025
11704
  if (!res.headersSent && reportFailure) {
11026
11705
  const code = err?.code;
11027
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");
11028
11711
  res.setHeader(
11029
11712
  FETCH_PROXY_FAILURE_HEADER,
11030
11713
  typeof code === "string" ? code : "unknown"
@@ -11125,64 +11808,6 @@ function compileAndroidStringValue(text2, where) {
11125
11808
  return out.map((part) => part.char).join("");
11126
11809
  }
11127
11810
 
11128
- // src/android-xml.ts
11129
- init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
11130
- var ENTITIES = {
11131
- quot: '"',
11132
- apos: "'",
11133
- amp: "&",
11134
- lt: "<",
11135
- gt: ">"
11136
- };
11137
- var TAG = /<(\/?)([\w:.-]+)((?:\s+[\w:.-]+\s*=\s*(?:"[^"]*"|'[^']*'))*)\s*(\/?)>/y;
11138
- var ATTRIBUTE = /([\w:.-]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g;
11139
- function decodeXmlText(value, file) {
11140
- return value.replace(/&(#x[0-9a-fA-F]+|#\d+|\w+);/g, (_match, entity) => {
11141
- if (entity.startsWith("#x"))
11142
- return String.fromCodePoint(Number.parseInt(entity.slice(2), 16));
11143
- if (entity.startsWith("#"))
11144
- return String.fromCodePoint(Number.parseInt(entity.slice(1), 10));
11145
- const character = ENTITIES[entity];
11146
- if (character === void 0) throw new Error(`${file}: unknown entity &${entity};`);
11147
- return character;
11148
- });
11149
- }
11150
- function parseXml(text2, file) {
11151
- const root = { name: "#document", attributes: {}, children: [], text: "" };
11152
- const stack = [root];
11153
- const body = text2.replace(/<!--[\s\S]*?-->/g, "").replace(/<\?[\s\S]*?\?>/g, "");
11154
- let index = 0;
11155
- while (index < body.length) {
11156
- const open = body.indexOf("<", index);
11157
- const content = body.slice(index, open === -1 ? body.length : open);
11158
- const parent = stack.at(-1);
11159
- if (parent && content.trim()) parent.text += decodeXmlText(content, file);
11160
- if (open === -1) break;
11161
- TAG.lastIndex = open;
11162
- const match = TAG.exec(body);
11163
- if (!match)
11164
- throw new Error(`${file}: unreadable markup at ${body.slice(open, open + 40)}`);
11165
- index = TAG.lastIndex;
11166
- const [, closing, name2, rawAttributes, selfClosing] = match;
11167
- if (!name2) continue;
11168
- if (closing) {
11169
- const element2 = stack.pop();
11170
- if (element2?.name !== name2)
11171
- throw new Error(`${file}: </${name2}> closes <${element2?.name}>`);
11172
- continue;
11173
- }
11174
- const attributes = {};
11175
- for (const [, key, double, single] of (rawAttributes ?? "").matchAll(ATTRIBUTE))
11176
- if (key) attributes[key] = decodeXmlText(double ?? single ?? "", file);
11177
- const element = { name: name2, attributes, children: [], text: "" };
11178
- stack.at(-1)?.children.push(element);
11179
- if (!selfClosing) stack.push(element);
11180
- }
11181
- if (stack.length !== 1)
11182
- throw new Error(`${file}: <${stack.at(-1)?.name}> is never closed`);
11183
- return root;
11184
- }
11185
-
11186
11811
  // src/android-app-identity.ts
11187
11812
  function nativeAppIdentityFromAndroidManifest(source, file, files = {}) {
11188
11813
  const document = parseXml(source, file);
@@ -11674,10 +12299,10 @@ function appTargetReleaseSettings(pbxproj, targetName, infoPlistRelativePath) {
11674
12299
  var APP_DELEGATE_PATH_RE = /(?:^|\/)ios\/([^/]+)\/AppDelegate\.(?:swift|mm|m)$/;
11675
12300
  function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri) {
11676
12301
  const pbxprojPath = Object.keys(files).find(
11677
- (path17) => /(?:^|\/)ios\/[^/]+\.xcodeproj\/project\.pbxproj$/.test(path17)
12302
+ (path21) => /(?:^|\/)ios\/[^/]+\.xcodeproj\/project\.pbxproj$/.test(path21)
11678
12303
  ) ?? Object.keys(files).find(
11679
- (path17) => /(?:^|\/)[^/]+\.xcodeproj\/project\.pbxproj$/.test(path17)
11680
- ) ?? 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));
11681
12306
  if (!pbxprojPath) return null;
11682
12307
  const pbxproj = files[pbxprojPath];
11683
12308
  let objects = {};
@@ -11719,7 +12344,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
11719
12344
  } else if (applicationTargetNames.size === 1) {
11720
12345
  targetName = [...applicationTargetNames][0];
11721
12346
  } else if (applicationTargetNames.size > 1) {
11722
- 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(
11723
12348
  (name2) => typeof name2 === "string" && applicationTargetNames.has(name2)
11724
12349
  );
11725
12350
  if (delegateTargets.length === 1) {
@@ -11943,7 +12568,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
11943
12568
  if (Object.hasOwn(files, file)) return [file];
11944
12569
  const prefix2 = file === "" ? "" : `${file.replace(/\/$/, "")}/`;
11945
12570
  return paths.filter(
11946
- (path17) => path17.startsWith(prefix2) && !/(?:^|\/)\./.test(path17.slice(prefix2.length))
12571
+ (path21) => path21.startsWith(prefix2) && !/(?:^|\/)\./.test(path21.slice(prefix2.length))
11947
12572
  );
11948
12573
  },
11949
12574
  join6,
@@ -11954,7 +12579,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
11954
12579
  }
11955
12580
  const rootModuleName = readRootModuleName(
11956
12581
  Object.entries(files).filter(
11957
- ([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)
11958
12583
  ).map(([, source]) => source)
11959
12584
  );
11960
12585
  return {
@@ -12040,17 +12665,17 @@ function extractNativeAppIdentityFromFiles(files, platform, parseInfoPlist, iosT
12040
12665
 
12041
12666
  // src/native-app-identity-project.ts
12042
12667
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
12043
- var import_node_fs9 = __toESM(require("node:fs"), 1);
12668
+ var import_node_fs13 = __toESM(require("node:fs"), 1);
12044
12669
  var import_node_module3 = require("node:module");
12045
- var import_node_path9 = __toESM(require("node:path"), 1);
12670
+ var import_node_path14 = __toESM(require("node:path"), 1);
12046
12671
  init_is_record();
12047
12672
 
12048
12673
  // src/xcode-project.ts
12049
12674
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
12050
- var import_node_child_process2 = require("node:child_process");
12675
+ var import_node_child_process3 = require("node:child_process");
12051
12676
  var import_node_crypto3 = require("node:crypto");
12052
- var import_node_fs8 = __toESM(require("node:fs"), 1);
12053
- 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);
12054
12679
  var import_plist3 = __toESM(require("plist"), 1);
12055
12680
 
12056
12681
  // src/swift-coverage/xcode-assets.ts
@@ -12071,7 +12696,7 @@ var assetSymbolSettingKeys = [
12071
12696
  "ASSETCATALOG_COMPILER_LIGHTWEIGHT_ASSET_RUNTIME_MODE",
12072
12697
  "ASSETCATALOG_OTHER_FLAGS"
12073
12698
  ];
12074
- var unprovenAssetSettings = assetSymbolSettingKeys.slice(4);
12699
+ var unprovenAssetSettings = assetSymbolSettingKeys.slice(4).filter((key) => key !== "ASSETCATALOG_OTHER_FLAGS");
12075
12700
 
12076
12701
  // src/swift-package.ts
12077
12702
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
@@ -12090,6 +12715,8 @@ function isSwiftNativeTranslationUnit(file) {
12090
12715
  }
12091
12716
  var SWIFT_NATIVE_SOURCE_EXTENSIONS = [
12092
12717
  ...SWIFT_NATIVE_TRANSLATION_UNIT_EXTENSIONS,
12718
+ ".s",
12719
+ ".S",
12093
12720
  ".h",
12094
12721
  ".hh",
12095
12722
  ".hpp",
@@ -12099,17 +12726,417 @@ var SWIFT_NATIVE_SOURCE_EXTENSIONS = [
12099
12726
  ".inl",
12100
12727
  ".modulemap"
12101
12728
  ];
12729
+ function moduleMapTokens(text2) {
12730
+ return (text2.match(/\/\*[\s\S]*?\*\/|\/\/[^\n]*|"[^"]*"|[\w.*]+|[{}\[\]]/g) ?? []).filter((token) => !token.startsWith("/"));
12731
+ }
12102
12732
  function moduleMapName(text2) {
12103
- 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
+ }
12104
13089
  }
12105
13090
 
12106
13091
  // src/xcode-json-project.ts
12107
13092
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
12108
- var import_node_path7 = __toESM(require("node:path"), 1);
13093
+ var import_node_path12 = __toESM(require("node:path"), 1);
12109
13094
  var import_json5 = __toESM(require_lib(), 1);
12110
13095
  var isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
12111
13096
  var text = (value) => typeof value === "string" ? value : void 0;
12112
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
+ }
12113
13140
  var PHASE_ISA = {
12114
13141
  "compile-sources": "PBXSourcesBuildPhase",
12115
13142
  resources: "PBXResourcesBuildPhase",
@@ -12121,7 +13148,7 @@ var PHASE_ISA = {
12121
13148
  function readXcodeJsonProject(xcodeproj, source) {
12122
13149
  const json = import_json5.default.parse(source);
12123
13150
  if (!isJsonObject(json)) throw new Error(`${xcodeproj}/project.xcproj is not an object`);
12124
- const projectDir = import_node_path7.default.dirname(xcodeproj);
13151
+ const projectDir = import_node_path12.default.dirname(xcodeproj);
12125
13152
  const objects = {};
12126
13153
  let next = 0;
12127
13154
  const add = (entry, id) => {
@@ -12134,7 +13161,7 @@ function readXcodeJsonProject(xcodeproj, source) {
12134
13161
  const base = /^<([A-Z]+)>\/(.*)$/.exec(raw);
12135
13162
  if (base) {
12136
13163
  if (base[1] === "PROJECT")
12137
- 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]) };
12138
13165
  if (base[1] === "PRODUCTS")
12139
13166
  return { sourceTree: "BUILT_PRODUCTS_DIR", path: base[2] };
12140
13167
  return null;
@@ -12142,7 +13169,7 @@ function readXcodeJsonProject(xcodeproj, source) {
12142
13169
  const unescaped = raw.replaceAll("\\<", "<");
12143
13170
  if (unescaped.startsWith("/")) return { sourceTree: "<absolute>", path: unescaped };
12144
13171
  if (unescaped.startsWith("~")) return null;
12145
- 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) };
12146
13173
  };
12147
13174
  const memberships = [];
12148
13175
  const folders = [];
@@ -12153,7 +13180,7 @@ function readXcodeJsonProject(xcodeproj, source) {
12153
13180
  const kind = text(entry.kind) ?? "file-reference";
12154
13181
  const raw = text(entry.path) ?? "";
12155
13182
  const located = raw === "" ? null : locate(raw, parent.dir);
12156
- const name2 = text(entry.name) ?? import_node_path7.default.basename(raw);
13183
+ const name2 = text(entry.name) ?? import_node_path12.default.basename(raw);
12157
13184
  const node = { id: "", name: name2, dir: null, parent, children: [] };
12158
13185
  if (kind === "group" || kind === "variant-group" || kind === "version-group") {
12159
13186
  node.dir = raw === "" ? parent.dir : located?.sourceTree === "<absolute>" ? located.path : null;
@@ -12274,8 +13301,12 @@ function readXcodeJsonProject(xcodeproj, source) {
12274
13301
  if (!isObject(entry)) continue;
12275
13302
  const repository = text(entry.repository);
12276
13303
  const local = text(entry.path);
12277
- 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$/, "");
12278
- 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
+ });
12279
13310
  packageIds.set(name2.toLowerCase(), id);
12280
13311
  }
12281
13312
  const productDependency = (entry) => add({
@@ -12463,28 +13494,28 @@ var CONDITIONS = {
12463
13494
  variant: "normal"
12464
13495
  };
12465
13496
  function walkFiles(dir) {
12466
- if (!import_node_fs8.default.existsSync(dir)) return [];
13497
+ if (!import_node_fs12.default.existsSync(dir)) return [];
12467
13498
  const out = [];
12468
- 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))) {
12469
13500
  if (entry.name.startsWith(".")) continue;
12470
- const full = import_node_path8.default.join(dir, entry.name);
13501
+ const full = import_node_path13.default.join(dir, entry.name);
12471
13502
  if (entry.isDirectory()) out.push(...walkFiles(full));
12472
13503
  else if (entry.isFile()) out.push(full);
12473
13504
  }
12474
13505
  return out;
12475
13506
  }
12476
- 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();
12477
13508
  function readXcconfig(file, read) {
12478
- if (read.includes(file) || !import_node_fs8.default.existsSync(file)) return {};
13509
+ if (read.includes(file) || !import_node_fs12.default.existsSync(file)) return {};
12479
13510
  read.push(file);
12480
13511
  const settings = {};
12481
- 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")) {
12482
13513
  const line = raw.replace(/\/\/.*$/, "").trim();
12483
13514
  const include = /^#include\??\s+"([^"]+)"/.exec(line);
12484
13515
  if (include) {
12485
13516
  Object.assign(
12486
13517
  settings,
12487
- 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)
12488
13519
  );
12489
13520
  continue;
12490
13521
  }
@@ -12534,22 +13565,22 @@ function decodeXml(text2) {
12534
13565
  return text2.replaceAll("&quot;", '"').replaceAll("&apos;", "'").replaceAll("&lt;", "<").replaceAll("&gt;", ">").replaceAll("&amp;", "&");
12535
13566
  }
12536
13567
  function workspaceReferences(workspace) {
12537
- const data = import_node_path8.default.join(workspace, "contents.xcworkspacedata");
12538
- 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))
12539
13570
  throw new Error(`${workspace} has no contents.xcworkspacedata`);
12540
- const container = import_node_path8.default.dirname(workspace);
13571
+ const container = import_node_path13.default.dirname(workspace);
12541
13572
  const locate = (location, base) => {
12542
13573
  const colon = location.indexOf(":");
12543
13574
  const kind = location.slice(0, colon);
12544
13575
  const rest = location.slice(colon + 1);
12545
- if (kind === "group") return import_node_path8.default.resolve(base, rest);
12546
- if (kind === "container" || kind === "self") return import_node_path8.default.resolve(container, rest);
12547
- if (kind === "absolute") return import_node_path8.default.resolve(rest);
12548
- 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}`);
12549
13580
  };
12550
13581
  const groups = [container];
12551
13582
  const references = [];
12552
- 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)) {
12553
13584
  if (closing) {
12554
13585
  if (tag === "Group") groups.pop();
12555
13586
  continue;
@@ -12562,11 +13593,46 @@ function workspaceReferences(workspace) {
12562
13593
  }
12563
13594
  return references;
12564
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
+ }
12565
13631
  var loaded2 = /* @__PURE__ */ new Map();
12566
13632
  function xcodeProjectFile(xcodeproj) {
12567
13633
  for (const name2 of ["project.pbxproj", "project.xcproj"]) {
12568
- const file = import_node_path8.default.join(xcodeproj, name2);
12569
- 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;
12570
13636
  }
12571
13637
  return null;
12572
13638
  }
@@ -12574,7 +13640,7 @@ function loadProject(xcodeproj) {
12574
13640
  const projectFile = xcodeProjectFile(xcodeproj);
12575
13641
  if (!projectFile)
12576
13642
  throw new Error(`${xcodeproj} has no project.pbxproj or project.xcproj`);
12577
- const source = import_node_fs8.default.readFileSync(projectFile, "utf8");
13643
+ const source = import_node_fs12.default.readFileSync(projectFile, "utf8");
12578
13644
  const digest = (0, import_node_crypto3.createHash)("sha256").update(source).digest("hex");
12579
13645
  const cached = loaded2.get(projectFile);
12580
13646
  if (cached?.digest === digest) return cached.project;
@@ -12591,10 +13657,10 @@ function loadProject(xcodeproj) {
12591
13657
  if (!project || project.isa !== "PBXProject") {
12592
13658
  throw new Error(`${projectFile} has no PBXProject root`);
12593
13659
  }
12594
- const projectDir = import_node_fs8.default.realpathSync(
12595
- 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) ?? "")
12596
13662
  );
12597
- const resolvePath = xcodePathResolver(objects, projectDir, import_node_path8.default.join);
13663
+ const resolvePath = xcodePathResolver(objects, projectDir, import_node_path13.default.join);
12598
13664
  const result = {
12599
13665
  xcodeproj,
12600
13666
  projectFile,
@@ -12628,8 +13694,8 @@ function targetSettings(ref, configuration, builtins, options = {}, overrides =
12628
13694
  const relative3 = str(config.baseConfigurationReferenceRelativePath);
12629
13695
  const own = isDict(config.buildSettings) ? config.buildSettings : {};
12630
13696
  const directory = anchor ? project.resolvePath(anchor) : null;
12631
- const baseFile = base ? project.resolvePath(base) : directory && relative3 ? import_node_path8.default.resolve(directory, relative3) : null;
12632
- 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)))
12633
13699
  throw new Error(
12634
13700
  `Unable to open base configuration reference file '${baseFile ?? base ?? relative3 ?? anchor}'`
12635
13701
  );
@@ -12708,26 +13774,26 @@ function settingList(value) {
12708
13774
  return items2;
12709
13775
  }
12710
13776
  function expandSearchPath(directory, rules) {
12711
- if (import_node_path8.default.basename(directory) !== "**") return [directory];
13777
+ if (import_node_path13.default.basename(directory) !== "**") return [directory];
12712
13778
  const expanded = [];
12713
13779
  const seen = /* @__PURE__ */ new Set();
12714
- const queue = [import_node_path8.default.dirname(directory)];
13780
+ const queue = [import_node_path13.default.dirname(directory)];
12715
13781
  for (let at = 0; at < queue.length; at++) {
12716
13782
  const current = queue[at];
12717
13783
  let real;
12718
13784
  try {
12719
- real = import_node_fs8.default.realpathSync(current);
13785
+ real = import_node_fs12.default.realpathSync(current);
12720
13786
  } catch {
12721
13787
  continue;
12722
13788
  }
12723
- 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;
12724
13790
  seen.add(real);
12725
13791
  expanded.push(current);
12726
- 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)) {
12727
13793
  if (entry.isSymbolicLink() ? !rules.followLinks : !entry.isDirectory()) continue;
12728
13794
  if (rules.excluded.some((pattern) => pattern.test(entry.name)) && !rules.included.some((pattern) => pattern.test(entry.name)))
12729
13795
  continue;
12730
- queue.push(import_node_path8.default.join(current, entry.name));
13796
+ queue.push(import_node_path13.default.join(current, entry.name));
12731
13797
  }
12732
13798
  }
12733
13799
  return expanded;
@@ -12769,8 +13835,54 @@ function expand(value, lookup) {
12769
13835
  );
12770
13836
  }
12771
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
+ }
12772
13884
  function fileListEntries(file, absolute) {
12773
- 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);
12774
13886
  }
12775
13887
  function targetMembers(ref, settings, options, settingKeys, projectInputs) {
12776
13888
  const { project, target, id: targetId } = ref;
@@ -12780,14 +13892,19 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
12780
13892
  const headers = /* @__PURE__ */ new Set();
12781
13893
  const resources = /* @__PURE__ */ new Set();
12782
13894
  const scriptForOutput = /* @__PURE__ */ new Map();
13895
+ const copiedFiles = [];
13896
+ let generatedInfoPlist = false;
12783
13897
  const declaredInfoPlist = settings("INFOPLIST_FILE");
12784
- const infoPlistOutput = declaredInfoPlist ? import_node_path8.default.resolve(project.projectDir, declaredInfoPlist) : null;
13898
+ const infoPlistOutput = declaredInfoPlist ? import_node_path13.default.resolve(project.projectDir, declaredInfoPlist) : null;
12785
13899
  const isPreparedOutput = (file) => file === infoPlistOutput || options.requireSources !== false && file.endsWith(".swift");
12786
13900
  for (const phaseId of list(target.buildPhases)) {
12787
13901
  const phase = project.object(phaseId);
12788
13902
  if (phase?.isa !== "PBXShellScriptBuildPhase") continue;
12789
13903
  const script = str(phase.name) ?? phaseId;
12790
- 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));
12791
13908
  const inputs = list(phase.inputPaths).map(absolute);
12792
13909
  const outputs = list(phase.outputPaths).map(absolute);
12793
13910
  const fileLists = /* @__PURE__ */ new Map();
@@ -12796,7 +13913,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
12796
13913
  kind === "INPUT" ? phase.inputFileListPaths : phase.outputFileListPaths
12797
13914
  ).map((raw) => {
12798
13915
  const file = absolute(raw);
12799
- if (!import_node_fs8.default.existsSync(file)) {
13916
+ if (!import_node_fs12.default.existsSync(file)) {
12800
13917
  return { file, entries: [] };
12801
13918
  }
12802
13919
  return { file, entries: fileListEntries(file, absolute) };
@@ -12807,6 +13924,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
12807
13924
  ...outputs,
12808
13925
  ...fileLists.get("OUTPUT").flatMap((item) => item.entries)
12809
13926
  ];
13927
+ if (allOutputs.includes(infoPlistOutput)) generatedInfoPlist = true;
12810
13928
  for (const output of allOutputs)
12811
13929
  if (output.endsWith(".swift") && !scriptForOutput.has(output))
12812
13930
  scriptForOutput.set(output, script);
@@ -12816,13 +13934,13 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
12816
13934
  ...fileLists.get("OUTPUT").map((item) => item.file)
12817
13935
  ];
12818
13936
  if (allOutputs.some((file) => file.endsWith(".swift") || file === infoPlistOutput)) {
12819
- for (const file of inputFiles) if (import_node_fs8.default.existsSync(file)) projectInputs.add(file);
13937
+ for (const file of inputFiles) if (import_node_fs12.default.existsSync(file)) projectInputs.add(file);
12820
13938
  }
12821
- if (options.prepareGeneratedSources && allOutputs.some(isPreparedOutput)) {
12822
- 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}`);
12823
13941
  for (const lists of fileLists.values())
12824
13942
  for (const { file } of lists)
12825
- if (!import_node_fs8.default.existsSync(file))
13943
+ if (!import_node_fs12.default.existsSync(file))
12826
13944
  throw new Error(
12827
13945
  `${targetName}: Run Script "${script}" missing file list ${file}`
12828
13946
  );
@@ -12841,7 +13959,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
12841
13959
  const lists = fileLists.get(kind);
12842
13960
  env[`SCRIPT_${kind}_FILE_LIST_COUNT`] = String(lists.length);
12843
13961
  lists.forEach((_item, index) => {
12844
- env[`SCRIPT_${kind}_FILE_LIST_${index}`] = import_node_path8.default.join(
13962
+ env[`SCRIPT_${kind}_FILE_LIST_${index}`] = import_node_path13.default.join(
12845
13963
  phaseDir,
12846
13964
  `${kind}-${index}.xcfilelist`
12847
13965
  );
@@ -12852,37 +13970,37 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
12852
13970
  );
12853
13971
  for (const file of inputFiles) {
12854
13972
  signature.update(file);
12855
- if (import_node_fs8.default.existsSync(file)) {
12856
- 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);
12857
13975
  signature.update(`${stat.mtimeMs}:${stat.ctimeMs}:${stat.size}`);
12858
13976
  } else signature.update("missing");
12859
13977
  }
12860
13978
  const stamp = signature.digest("hex");
12861
13979
  const key = `${project.projectFile}:${targetId}:${phaseId}:${settings("CONFIGURATION")}`;
12862
- 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)))
12863
13981
  continue;
12864
- import_node_fs8.default.mkdirSync(phaseDir, { recursive: true });
12865
- import_node_fs8.default.mkdirSync(settings("BUILT_PRODUCTS_DIR"), { recursive: true });
12866
- 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 });
12867
13985
  for (const output of allOutputs)
12868
- 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 });
12869
13987
  for (const [kind, lists] of fileLists)
12870
13988
  lists.forEach((item, index) => {
12871
- import_node_fs8.default.writeFileSync(
13989
+ import_node_fs12.default.writeFileSync(
12872
13990
  env[`SCRIPT_${kind}_FILE_LIST_${index}`],
12873
13991
  `${item.entries.join("\n")}
12874
13992
  `
12875
13993
  );
12876
13994
  });
12877
13995
  try {
12878
- (0, import_node_child_process2.execFileSync)(
13996
+ (0, import_node_child_process3.execFileSync)(
12879
13997
  str(phase.shellPath) ?? "/bin/sh",
12880
13998
  ["-c", str(phase.shellScript) ?? ""],
12881
13999
  {
12882
14000
  cwd: project.projectDir,
12883
14001
  env,
12884
14002
  stdio: ["ignore", "pipe", "pipe"],
12885
- timeout: 12e4
14003
+ maxBuffer: Infinity
12886
14004
  }
12887
14005
  );
12888
14006
  } catch (error) {
@@ -12893,12 +14011,12 @@ ${"stdout" in error ? String(error.stdout) : ""}${"stderr" in error ? String(err
12893
14011
  ${output}`
12894
14012
  );
12895
14013
  }
12896
- const missing = allOutputs.filter(
12897
- (file) => isPreparedOutput(file) && !import_node_fs8.default.existsSync(file)
14014
+ const missing2 = allOutputs.filter(
14015
+ (file) => file === infoPlistOutput && !import_node_fs12.default.existsSync(file)
12898
14016
  );
12899
- if (missing.length > 0)
14017
+ if (missing2.length > 0)
12900
14018
  throw new Error(
12901
- `${targetName}: Run Script "${script}" did not produce ${missing.join(", ")}`
14019
+ `${targetName}: Run Script "${script}" did not produce ${missing2.join(", ")}`
12902
14020
  );
12903
14021
  preparedSourcePhases.set(key, stamp);
12904
14022
  }
@@ -12907,8 +14025,8 @@ ${output}`
12907
14025
  project.objects,
12908
14026
  targetId,
12909
14027
  project.resolvePath,
12910
- (file) => isDirectory(file) ? walkFiles(file) : import_node_fs8.default.existsSync(file) ? [file] : [],
12911
- import_node_path8.default.join,
14028
+ (file) => isDirectory(file) ? walkFiles(file) : import_node_fs12.default.existsSync(file) ? [file] : [],
14029
+ import_node_path13.default.join,
12912
14030
  (file, kind) => {
12913
14031
  if (kind === "header") {
12914
14032
  headers.add(file);
@@ -12918,9 +14036,9 @@ ${output}`
12918
14036
  resources.add(file);
12919
14037
  return;
12920
14038
  }
12921
- if (!import_node_fs8.default.existsSync(file)) {
14039
+ if (!import_node_fs12.default.existsSync(file)) {
12922
14040
  if (options.requireSources === false) return;
12923
- const script = scriptForOutput.get(import_node_path8.default.normalize(file));
14041
+ const script = scriptForOutput.get(import_node_path13.default.normalize(file));
12924
14042
  throw new Error(
12925
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}`
12926
14044
  );
@@ -12929,20 +14047,19 @@ ${output}`
12929
14047
  if (file.endsWith(".swift")) sources.add(file);
12930
14048
  }
12931
14049
  );
12932
- for (const [file, script] of scriptForOutput) {
14050
+ for (const [file] of scriptForOutput) {
12933
14051
  if (sources.has(file) || allSources.has(file)) continue;
12934
- if (!import_node_fs8.default.existsSync(file)) {
12935
- if (options.requireSources === false) continue;
12936
- throw new Error(
12937
- `${targetName}: missing generated source ${file} (Run Script "${script}" declares it in outputPaths; run the script or check in its output)`
12938
- );
12939
- }
12940
- allSources.add(file);
12941
- 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);
12942
14057
  }
12943
14058
  return {
12944
14059
  sources: [...sources].sort(),
12945
14060
  resources: [...resources].sort(),
14061
+ copiedFiles,
14062
+ generatedInfoPlist,
12946
14063
  allSources: [...allSources].sort(),
12947
14064
  headers: [...headers].sort()
12948
14065
  };
@@ -12950,37 +14067,37 @@ ${output}`
12950
14067
  function commonAncestor(dirs) {
12951
14068
  let common = dirs[0];
12952
14069
  for (const dir of dirs) {
12953
- while (common !== import_node_path8.default.dirname(common) && import_node_path8.default.relative(common, dir).startsWith(".."))
12954
- 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);
12955
14072
  }
12956
14073
  return common;
12957
14074
  }
12958
- 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";
12959
14076
  function installedPodsSandbox(pods) {
12960
- const podfileLock = import_node_path8.default.join(import_node_path8.default.dirname(pods), "Podfile.lock");
12961
- const manifestLock = import_node_path8.default.join(pods, "Manifest.lock");
12962
- 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))
12963
14080
  throw new Error(
12964
- `${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)}`
12965
14082
  );
12966
- 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)))
12967
14084
  throw new Error(
12968
- `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)}`
12969
14086
  );
12970
14087
  const specChecksums = {};
12971
- const lines = import_node_fs8.default.readFileSync(manifestLock, "utf8").split("\n");
14088
+ const lines = import_node_fs12.default.readFileSync(manifestLock, "utf8").split("\n");
12972
14089
  const start = lines.indexOf("SPEC CHECKSUMS:");
12973
14090
  for (const line of start === -1 ? [] : lines.slice(start + 1)) {
12974
14091
  const entry = /^ {2}"?([^":]+)"?: ([0-9a-f]+)$/.exec(line);
12975
14092
  if (!entry) break;
12976
14093
  specChecksums[entry[1]] = entry[2];
12977
14094
  }
12978
- const specs = import_node_path8.default.join(pods, "Local Podspecs");
14095
+ const specs = import_node_path13.default.join(pods, "Local Podspecs");
12979
14096
  return {
12980
14097
  podfileLock,
12981
14098
  manifestLock,
12982
14099
  specChecksums,
12983
- 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)) : []
12984
14101
  };
12985
14102
  }
12986
14103
  function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
@@ -12992,14 +14109,14 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
12992
14109
  if (!xcodeProjectFile(xcodeproj)) {
12993
14110
  if (installedPods && isPodsProject(xcodeproj))
12994
14111
  throw new Error(
12995
- `${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))}`
12996
14113
  );
12997
14114
  return;
12998
14115
  }
12999
- const key = import_node_fs8.default.realpathSync(xcodeproj);
13000
- 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"))
13001
14118
  return;
13002
- if (isPodsProject(key)) cocoapods = installedPodsSandbox(import_node_path8.default.dirname(key));
14119
+ if (isPodsProject(key)) cocoapods = installedPodsSandbox(import_node_path13.default.dirname(key));
13003
14120
  const project = loadProject(key);
13004
14121
  projectAt.set(key, project);
13005
14122
  projects.push(project);
@@ -13015,12 +14132,12 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
13015
14132
  for (const reference of listed)
13016
14133
  if (reference.endsWith(".xcodeproj")) addProject(reference);
13017
14134
  if (projects.length === 0) {
13018
- 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`);
13019
14136
  }
13020
- const podfile = import_node_path8.default.join(import_node_path8.default.dirname(xcodeprojOrWorkspace), "Podfile");
13021
- 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))
13022
14139
  throw new Error(
13023
- `${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`
13024
14141
  );
13025
14142
  return { listed, projects, projectAt, cocoapods };
13026
14143
  }
@@ -13056,7 +14173,7 @@ function listXcodeAppTargets(xcodeprojOrWorkspace, options = {}) {
13056
14173
  return workspaceProjects(xcodeprojOrWorkspace).projects.flatMap(projectTargets).filter((ref) => isIosAppTarget(ref, options)).map((ref) => str(ref.target.name) ?? ref.id);
13057
14174
  }
13058
14175
  function readXcodeAppTarget(input, targetName, configurationName, options = {}) {
13059
- const xcodeprojOrWorkspace = import_node_fs8.default.realpathSync(input);
14176
+ const xcodeprojOrWorkspace = import_node_fs12.default.realpathSync(input);
13060
14177
  const workspace = xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : null;
13061
14178
  const { listed, projects, projectAt, cocoapods } = workspaceProjects(
13062
14179
  xcodeprojOrWorkspace,
@@ -13065,7 +14182,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13065
14182
  const allTargets = projects.flatMap(projectTargets);
13066
14183
  const appTargets = allTargets.filter((ref) => isIosAppTarget(ref, options));
13067
14184
  const appTargetNames = appTargets.map((ref) => str(ref.target.name) ?? ref.id);
13068
- const container = import_node_path8.default.basename(xcodeprojOrWorkspace);
14185
+ const container = import_node_path13.default.basename(xcodeprojOrWorkspace);
13069
14186
  const named = targetName ? appTargets.filter((ref) => ref.target.name === targetName) : appTargets;
13070
14187
  if (named.length !== 1) {
13071
14188
  throw new Error(
@@ -13078,15 +14195,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13078
14195
  for (const ref of allTargets) {
13079
14196
  const product = ref.project.object(str(ref.target.productReference));
13080
14197
  const file = str(product?.path);
13081
- if (file && !byProduct.has(import_node_path8.default.basename(file)))
13082
- 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);
13083
14200
  }
13084
14201
  const proxied = (project, proxyId) => {
13085
14202
  const proxy = project.object(proxyId);
13086
14203
  if (proxy?.isa !== "PBXContainerItemProxy") return void 0;
13087
14204
  const portal = str(proxy.containerPortal);
13088
14205
  const portalPath = project.resolvePath(portal ?? "");
13089
- 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;
13090
14207
  const remote = str(proxy.remoteGlobalIDString);
13091
14208
  if (!owner || !remote) return void 0;
13092
14209
  return projectTargets(owner).find(
@@ -13107,7 +14224,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13107
14224
  if (phase?.isa !== "PBXFrameworksBuildPhase") continue;
13108
14225
  for (const buildFileId of list(phase.files)) {
13109
14226
  const file = project.object(str(project.object(buildFileId)?.fileRef));
13110
- 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;
13111
14228
  if (resolved) found.push(resolved);
13112
14229
  }
13113
14230
  }
@@ -13146,6 +14263,25 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13146
14263
  { TARGET_NAME: str(ref.target.name) ?? ref.id },
13147
14264
  options
13148
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
+ };
13149
14285
  const projectHeaderMaps = /* @__PURE__ */ new Map();
13150
14286
  const projectHeaderMap = (project) => {
13151
14287
  const cached = projectHeaderMaps.get(project);
@@ -13154,26 +14290,41 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13154
14290
  for (const ref of projectTargets(project)) {
13155
14291
  const product = productName(ref);
13156
14292
  for (const { file, visibility } of headerPhase(ref)) {
13157
- const name2 = import_node_path8.default.basename(file);
14293
+ const name2 = import_node_path13.default.basename(file);
13158
14294
  if (!entries.has(name2))
13159
14295
  entries.set(name2, visibility !== "Project" ? `${product}/${name2}` : file);
13160
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
+ }
14311
+ }
13161
14312
  }
13162
14313
  for (const id of Object.keys(project.objects)) {
13163
14314
  if (project.object(id)?.isa !== "PBXFileReference") continue;
13164
14315
  const file = project.resolvePath(id);
13165
- if (file && HEADER_FILE.test(file) && !entries.has(import_node_path8.default.basename(file)))
13166
- 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);
13167
14318
  }
13168
14319
  const map2 = [...entries];
13169
14320
  projectHeaderMaps.set(project, map2);
13170
14321
  return map2;
13171
14322
  };
13172
14323
  const xcconfigs = /* @__PURE__ */ new Set();
13173
- 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");
13174
14325
  const podsBuild = {
13175
- SYMROOT: import_node_path8.default.join(buildDir(app.project), "Products"),
13176
- 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")
13177
14328
  };
13178
14329
  const moduleTarget = (ref) => {
13179
14330
  const name2 = str(ref.target.name) ?? ref.id;
@@ -13188,15 +14339,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13188
14339
  TARGET_NAME: name2,
13189
14340
  TARGETNAME: "$(TARGET_NAME)",
13190
14341
  PROJECT: "$(PROJECT_NAME)",
13191
- PROJECT_NAME: import_node_path8.default.basename(ref.project.xcodeproj, ".xcodeproj"),
14342
+ PROJECT_NAME: import_node_path13.default.basename(ref.project.xcodeproj, ".xcodeproj"),
13192
14343
  PROJECT_FILE_PATH: ref.project.xcodeproj,
13193
14344
  SRCROOT: ref.project.projectDir,
13194
14345
  SOURCE_ROOT: ref.project.projectDir,
13195
14346
  PROJECT_DIR: ref.project.projectDir,
13196
- SYMROOT: import_node_path8.default.join(buildDir(ref.project), "Products"),
14347
+ SYMROOT: import_node_path13.default.join(buildDir(ref.project), "Products"),
13197
14348
  BUILD_DIR: "$(SYMROOT)",
13198
14349
  BUILD_ROOT: "$(SYMROOT)",
13199
- OBJROOT: import_node_path8.default.join(buildDir(ref.project), "Intermediates.noindex"),
14350
+ OBJROOT: import_node_path13.default.join(buildDir(ref.project), "Intermediates.noindex"),
13200
14351
  CONFIGURATION_BUILD_DIR: "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)",
13201
14352
  BUILT_PRODUCTS_DIR: "$(CONFIGURATION_BUILD_DIR)",
13202
14353
  TARGET_BUILD_DIR: "$(CONFIGURATION_BUILD_DIR)",
@@ -13209,6 +14360,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13209
14360
  TEMP_ROOT: "$(OBJROOT)",
13210
14361
  DERIVED_FILE_DIR: "$(TARGET_TEMP_DIR)/DerivedSources",
13211
14362
  DERIVED_FILES_DIR: "$(DERIVED_FILE_DIR)",
14363
+ DERIVED_SOURCES_DIR: "$(DERIVED_FILE_DIR)",
13212
14364
  PLATFORM_NAME: "iphonesimulator",
13213
14365
  EFFECTIVE_PLATFORM_NAME: "-iphonesimulator",
13214
14366
  CURRENT_ARCH: "arm64",
@@ -13229,11 +14381,38 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13229
14381
  xcconfigs
13230
14382
  );
13231
14383
  const searchRules = recursiveSearchRules(settings2);
13232
- 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);
13233
14385
  const framework = FRAMEWORK_PRODUCTS.has(str(ref.target.productType) ?? "");
13234
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
+ );
13235
14414
  const building = options.prepareGeneratedSources && options.requireSources !== false;
13236
- 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;
13237
14416
  if (versioning) {
13238
14417
  const version = settings2("CURRENT_PROJECT_VERSION");
13239
14418
  const custom = [
@@ -13246,7 +14425,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13246
14425
  ].filter((key) => settings2(key));
13247
14426
  if (custom.length)
13248
14427
  throw new Error(
13249
- `${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`
13250
14429
  );
13251
14430
  const symbol = product.replace(/^[^A-Za-z_]/, "_").replace(/[^A-Za-z0-9_]/g, "_");
13252
14431
  const [major, minor] = version.split(".");
@@ -13259,9 +14438,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13259
14438
  ` const double ${symbol}VersionNumber __attribute__ ((used)) = (double)${number};`,
13260
14439
  ""
13261
14440
  ].join("\n");
13262
- if (!import_node_fs8.default.existsSync(versioning) || import_node_fs8.default.readFileSync(versioning, "utf8") !== unit) {
13263
- import_node_fs8.default.mkdirSync(import_node_path8.default.dirname(versioning), { recursive: true });
13264
- 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);
13265
14444
  }
13266
14445
  allSources.push(versioning);
13267
14446
  }
@@ -13280,29 +14459,36 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13280
14459
  const headerFiles = headerPhase(ref);
13281
14460
  const ownHeaders = /* @__PURE__ */ new Map();
13282
14461
  for (const { file, visibility } of headerFiles) {
13283
- const name3 = import_node_path8.default.basename(file);
14462
+ const name3 = import_node_path13.default.basename(file);
13284
14463
  const published = visibility !== "Project";
13285
14464
  if (!ownHeaders.has(name3))
13286
14465
  ownHeaders.set(name3, published ? `${product}/${name3}` : file);
13287
14466
  if (!published && !ownHeaders.has(`${product}/${name3}`))
13288
14467
  ownHeaders.set(`${product}/${name3}`, file);
13289
14468
  }
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
+ }
13290
14476
  const nonFrameworkHeaders = /* @__PURE__ */ new Map();
13291
14477
  for (const other of projectTargets(ref.project)) {
13292
14478
  if (FRAMEWORK_PRODUCTS.has(str(other.target.productType) ?? "")) continue;
13293
14479
  const otherProduct = productName(other);
13294
14480
  for (const { file, visibility } of headerPhase(other)) {
13295
14481
  if (visibility === "Project") continue;
13296
- const key = `${otherProduct}/${import_node_path8.default.basename(file)}`;
14482
+ const key = `${otherProduct}/${import_node_path13.default.basename(file)}`;
13297
14483
  if (!nonFrameworkHeaders.has(key)) nonFrameworkHeaders.set(key, file);
13298
14484
  }
13299
14485
  }
13300
- const wrapper = import_node_path8.default.join(settings2("BUILT_PRODUCTS_DIR"), `${product}.framework`);
14486
+ const wrapper = import_node_path13.default.join(settings2("BUILT_PRODUCTS_DIR"), `${product}.framework`);
13301
14487
  const moduleMap = (settings2("DEFINES_MODULE") === "YES" || !framework) && settings2("MODULEMAP_FILE") ? absolute(settings2("MODULEMAP_FILE")) : null;
13302
- const podHeaders = !framework && isPodsProject(ref.project.xcodeproj) && moduleMap && import_node_path8.default.relative(import_node_path8.default.join(ref.project.projectDir, "Headers", "Public"), moduleMap).split(import_node_path8.default.sep)[0] !== ".." && import_node_fs8.default.existsSync(moduleMap) ? import_node_fs8.default.readdirSync(import_node_path8.default.dirname(moduleMap)).flatMap((entry) => {
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) => {
13303
14489
  if (!/\.(h|hh|hpp|hxx|modulemap)$/.test(entry)) return [];
13304
- const file = import_node_path8.default.join(import_node_path8.default.dirname(moduleMap), entry);
13305
- return import_node_fs8.default.existsSync(file) ? [file] : [];
14490
+ const file = import_node_path13.default.join(import_node_path13.default.dirname(moduleMap), entry);
14491
+ return import_node_fs12.default.existsSync(file) ? [file] : [];
13306
14492
  }) : [];
13307
14493
  const fileFlags = {};
13308
14494
  for (const phaseId of list(ref.target.buildPhases)) {
@@ -13325,7 +14511,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13325
14511
  keys,
13326
14512
  module: {
13327
14513
  name: name2,
13328
- moduleName: applyOperator(settings2("PRODUCT_MODULE_NAME"), "c99extidentifier"),
14514
+ moduleName,
13329
14515
  ...members,
13330
14516
  allSources,
13331
14517
  languageMode: swiftVersion >= 6 ? 6 : 5,
@@ -13340,6 +14526,20 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13340
14526
  )
13341
14527
  )
13342
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
+ } : {},
13343
14543
  ...native ? {
13344
14544
  objc: {
13345
14545
  publicHeaders: [
@@ -13353,7 +14553,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13353
14553
  ...headers,
13354
14554
  ...Object.keys(ref.project.objects).flatMap((id) => {
13355
14555
  const file = ref.project.resolvePath(id);
13356
- 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] : [];
13357
14557
  })
13358
14558
  ])
13359
14559
  ],
@@ -13362,15 +14562,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13362
14562
  // xcode searches its products' include directory before
13363
14563
  // HEADER_SEARCH_PATHS and the target's derived sources after.
13364
14564
  headerSearchPaths: [
13365
- import_node_path8.default.join(settings2("BUILT_PRODUCTS_DIR"), "include"),
14565
+ import_node_path13.default.join(settings2("BUILT_PRODUCTS_DIR"), "include"),
13366
14566
  ...settingList(settings2("HEADER_SEARCH_PATHS")).flatMap(
13367
14567
  (raw) => expandSearchPath(absolute(raw), searchRules)
13368
14568
  ),
13369
- import_node_path8.default.join(
14569
+ import_node_path13.default.join(
13370
14570
  `${settings2("DERIVED_FILE_DIR")}-normal`,
13371
14571
  settings2("CURRENT_ARCH")
13372
14572
  ),
13373
- 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")),
13374
14574
  settings2("DERIVED_FILE_DIR")
13375
14575
  ],
13376
14576
  userHeaderSearchPaths: settingList(
@@ -13410,16 +14610,16 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13410
14610
  ...headerFiles.flatMap(
13411
14611
  ({ file, visibility }) => visibility === "Project" ? [] : [
13412
14612
  [
13413
- import_node_path8.default.join(
14613
+ import_node_path13.default.join(
13414
14614
  wrapper,
13415
14615
  visibility === "Public" ? "Headers" : "PrivateHeaders",
13416
- import_node_path8.default.basename(file)
14616
+ import_node_path13.default.basename(file)
13417
14617
  ),
13418
14618
  file
13419
14619
  ]
13420
14620
  ]
13421
14621
  ),
13422
- ...moduleMap ? [[import_node_path8.default.join(wrapper, "Modules", "module.modulemap"), moduleMap]] : []
14622
+ ...moduleMap ? [[import_node_path13.default.join(wrapper, "Modules", "module.modulemap"), moduleMap]] : []
13423
14623
  ]) : Object.fromEntries(podHeaders.map((file) => [file, file]))
13424
14624
  }
13425
14625
  } : {}
@@ -13431,7 +14631,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13431
14631
  const frameworkTargets = builtTargets.slice(0, -1).filter(({ ref }) => ref.target.isa === "PBXNativeTarget").map(({ ref, module: module3 }) => ({ ref, framework: module3 }));
13432
14632
  const frameworks = frameworkTargets.map(({ framework }) => framework);
13433
14633
  const podSourceDirs = frameworkTargets.flatMap(
13434
- ({ 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)) : []
13435
14635
  );
13436
14636
  const expandValue = (value) => {
13437
14637
  if (typeof value === "string") return expand(value, settings);
@@ -13443,8 +14643,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13443
14643
  }
13444
14644
  return value;
13445
14645
  };
13446
- const infoPlistFile = settings("INFOPLIST_FILE") ? import_node_path8.default.resolve(app.project.projectDir, settings("INFOPLIST_FILE")) : null;
13447
- 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")) : {};
13448
14649
  if (!sourceInfo || typeof sourceInfo !== "object" || Array.isArray(sourceInfo) || sourceInfo instanceof Date || Buffer.isBuffer(sourceInfo)) {
13449
14650
  throw new Error(`${module2.name} Info.plist must contain a dictionary`);
13450
14651
  }
@@ -13472,7 +14673,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13472
14673
  };
13473
14674
  }
13474
14675
  const localPackageDirs = [
13475
- ...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"))),
13476
14677
  ...projects.flatMap(
13477
14678
  (project) => Object.entries(project.objects).flatMap(([id, entry]) => {
13478
14679
  if (!isDict(entry)) return [];
@@ -13482,19 +14683,19 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13482
14683
  const packages = [];
13483
14684
  while (pending.length > 0) {
13484
14685
  const dir = pending.pop();
13485
- 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"))) {
13486
14687
  packages.push(dir);
13487
14688
  continue;
13488
14689
  }
13489
14690
  if (!isDirectory(dir)) continue;
13490
- 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 }))
13491
14692
  if (child.isDirectory() && !child.name.startsWith("."))
13492
- pending.push(import_node_path8.default.join(dir, child.name));
14693
+ pending.push(import_node_path13.default.join(dir, child.name));
13493
14694
  }
13494
14695
  return packages;
13495
14696
  }
13496
- const candidate = entry.isa === "XCLocalSwiftPackageReference" ? import_node_path8.default.resolve(project.projectDir, str(entry.relativePath) ?? "") : entry.isa === "PBXFileReference" ? project.resolvePath(id) : null;
13497
- 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] : [];
13498
14699
  })
13499
14700
  )
13500
14701
  ];
@@ -13515,12 +14716,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13515
14716
  const linkedProductKeys = /* @__PURE__ */ new Set();
13516
14717
  const binaryFrameworks = /* @__PURE__ */ new Map();
13517
14718
  for (const { ref, settings: settings2 } of builtTargets) {
13518
- 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));
13519
14720
  for (const raw of settingList(settings2("SWIFT_INCLUDE_PATHS"))) {
13520
14721
  const dir = absolute(raw);
13521
- const modulemap = import_node_path8.default.join(dir, "module.modulemap");
13522
- if (!import_node_fs8.default.existsSync(modulemap)) continue;
13523
- 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"));
13524
14725
  if (name2 && !binaryFrameworks.has(name2)) binaryFrameworks.set(name2, dir);
13525
14726
  }
13526
14727
  for (const phaseId of list(ref.target.buildPhases)) {
@@ -13529,7 +14730,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13529
14730
  const inputs = list(phase.inputPaths).map(absolute);
13530
14731
  for (const raw of list(phase.inputFileListPaths)) {
13531
14732
  const file = absolute(raw);
13532
- if (!import_node_fs8.default.existsSync(file)) continue;
14733
+ if (!import_node_fs12.default.existsSync(file)) continue;
13533
14734
  xcconfigs.add(file);
13534
14735
  inputs.push(...fileListEntries(file, absolute));
13535
14736
  }
@@ -13539,10 +14740,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13539
14740
  }
13540
14741
  }
13541
14742
  }
13542
- for (const { project, target } of order) {
14743
+ const productsByTarget = /* @__PURE__ */ new Map();
14744
+ for (const ref of order) {
14745
+ const { project, target } = ref;
13543
14746
  const productRef = (id) => {
13544
- const ref = str(project.object(id)?.productRef);
13545
- return ref ? [ref] : [];
14747
+ const ref2 = str(project.object(id)?.productRef);
14748
+ return ref2 ? [ref2] : [];
13546
14749
  };
13547
14750
  const productDependencies = [
13548
14751
  ...list(target.packageProductDependencies),
@@ -13552,6 +14755,8 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13552
14755
  return phase?.isa === "PBXFrameworksBuildPhase" ? list(phase.files).flatMap(productRef) : [];
13553
14756
  })
13554
14757
  ];
14758
+ const ownProducts = [];
14759
+ const ownKeys = /* @__PURE__ */ new Set();
13555
14760
  for (const dependencyId of new Set(productDependencies)) {
13556
14761
  const dependency = project.object(dependencyId);
13557
14762
  const product = str(dependency?.productName)?.replace(/^plugin:/, "");
@@ -13564,7 +14769,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13564
14769
  product,
13565
14770
  source: reference?.isa === "XCRemoteSwiftPackageReference" ? { kind: "remote", url: str(reference.repositoryURL) ?? "" } : reference?.isa === "XCLocalSwiftPackageReference" ? {
13566
14771
  kind: "local",
13567
- dir: import_node_path8.default.resolve(
14772
+ dir: import_node_path13.default.resolve(
13568
14773
  project.projectDir,
13569
14774
  str(reference.relativePath) ?? ""
13570
14775
  )
@@ -13573,7 +14778,13 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13573
14778
  productReferences.push({ project: project.projectFile, linked });
13574
14779
  if (linked.source.kind !== "unnamed")
13575
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
+ }
13576
14786
  }
14787
+ productsByTarget.set(ref, ownProducts);
13577
14788
  for (const phaseId of list(target.buildPhases)) {
13578
14789
  const phase = project.object(phaseId);
13579
14790
  if (phase?.isa !== "PBXFrameworksBuildPhase") continue;
@@ -13598,26 +14809,35 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13598
14809
  linkedProductKeys.add(key);
13599
14810
  linkedProducts.push(linked);
13600
14811
  }
13601
- const resolvedFile = import_node_path8.default.join(
13602
- 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"),
13603
14816
  "xcshareddata",
13604
14817
  "swiftpm",
13605
14818
  "Package.resolved"
13606
14819
  );
13607
- 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
+ }
13608
14828
  const used = order.map((ref) => ref.project);
13609
14829
  return {
13610
14830
  ...module2,
13611
14831
  rootDir: commonAncestor(
13612
14832
  [
13613
- workspace ? import_node_path8.default.dirname(workspace) : app.project.projectDir,
14833
+ workspace ? import_node_path13.default.dirname(workspace) : app.project.projectDir,
13614
14834
  ...used.map((project) => project.projectDir),
13615
14835
  ...localPackageDirs,
13616
14836
  ...linkedProducts.flatMap(
13617
- ({ 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] : []
13618
14838
  ),
13619
14839
  ...new Set(podSourceDirs)
13620
- ].map((dir) => import_node_fs8.default.realpathSync(dir))
14840
+ ].map((dir) => import_node_fs12.default.realpathSync(dir))
13621
14841
  ),
13622
14842
  projectFiles: [
13623
14843
  .../* @__PURE__ */ new Set([
@@ -13628,12 +14848,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
13628
14848
  ].sort(),
13629
14849
  projectDirs: [...new Set(used.map((project) => project.projectDir))].sort(),
13630
14850
  appIconName: settings("ASSETCATALOG_COMPILER_APPICON_NAME"),
13631
- infoPlist: import_plist3.default.build(info),
14851
+ infoPlist: infoPlistPending ? null : import_plist3.default.build(info),
13632
14852
  infoPlistFile,
13633
14853
  frameworks,
13634
14854
  linkedProducts,
13635
14855
  localPackageDirs: [
13636
- ...new Set(localPackageDirs.map((dir) => import_node_fs8.default.realpathSync(dir)))
14856
+ ...new Set(localPackageDirs.map((dir) => import_node_fs12.default.realpathSync(dir)))
13637
14857
  ].sort(),
13638
14858
  binaryFrameworks: [...binaryFrameworks].map(([name2, file]) => ({ name: name2, path: file })).sort((left, right) => left.name.localeCompare(right.name)),
13639
14859
  packageResolved,
@@ -13649,6 +14869,10 @@ function nonEmptyString2(value) {
13649
14869
  return typeof value === "string" && value.length > 0 ? value : void 0;
13650
14870
  }
13651
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
+ );
13652
14876
  const dictionary = parseInfoPlist(app.infoPlist);
13653
14877
  if (!isRecord(dictionary)) throw new Error("native app Info.plist is not a dictionary");
13654
14878
  const settings = app.settings;
@@ -13708,7 +14932,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
13708
14932
  const rtcAppGroupIdentifier = nonEmptyString2(dictionary.RTCAppGroupIdentifier);
13709
14933
  const screenShareExtensionBundleId = typeof dictionary.ScreenShareExtensionBundleId === "string" ? dictionary.ScreenShareExtensionBundleId : void 0;
13710
14934
  const rootModuleName = readRootModuleName(
13711
- 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"))
13712
14936
  );
13713
14937
  return {
13714
14938
  applicationName,
@@ -13729,7 +14953,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
13729
14953
  googleSignIn: readGoogleSignInConfiguration(
13730
14954
  dictionary,
13731
14955
  Object.fromEntries(
13732
- 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"))])
13733
14957
  )
13734
14958
  ),
13735
14959
  supportedInterfaceOrientations,
@@ -13738,11 +14962,11 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
13738
14962
  alternateIconNames: [...alternateIconNames],
13739
14963
  appIconArtwork: resolveNativeAppIconArtwork(
13740
14964
  app.resources,
13741
- (file) => import_node_fs9.default.readFileSync(file, "utf8"),
14965
+ (file) => import_node_fs13.default.readFileSync(file, "utf8"),
13742
14966
  (file) => {
13743
- const extension = import_node_path9.default.extname(file).toLowerCase();
14967
+ const extension = import_node_path14.default.extname(file).toLowerCase();
13744
14968
  const contentType = extension === ".jpg" || extension === ".jpeg" ? "image/jpeg" : extension === ".webp" ? "image/webp" : "image/png";
13745
- 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")}`;
13746
14970
  },
13747
14971
  icons,
13748
14972
  app.appIconName,
@@ -13773,22 +14997,22 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
13773
14997
  const read = selectNativeAppIdentityReader(platform, {
13774
14998
  android: () => null,
13775
14999
  ios: () => {
13776
- const iosRoot = import_node_path9.default.join(projectRoot, "ios");
13777
- 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;
13778
15002
  const files = {};
13779
- 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 })) {
13780
15004
  if (entry.name === "Pods") continue;
13781
15005
  if (entry.isDirectory()) {
13782
15006
  const names = entry.name.endsWith(".xcodeproj") ? ["project.pbxproj"] : ["Info.plist", "AppDelegate.swift", "AppDelegate.mm", "AppDelegate.m"];
13783
15007
  for (const name2 of names) {
13784
15008
  const relative3 = `ios/${entry.name}/${name2}`;
13785
- const file = import_node_path9.default.join(projectRoot, relative3);
13786
- 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");
13787
15011
  }
13788
15012
  } else if (/AppDelegate\.(?:swift|mm|m)$/.test(entry.name)) {
13789
15013
  const relative3 = `ios/${entry.name}`;
13790
- const file = import_node_path9.default.join(projectRoot, relative3);
13791
- 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");
13792
15016
  }
13793
15017
  }
13794
15018
  return extractNativeAppIdentityFromFiles(files, "ios", parseInfoPlist, iosTarget);
@@ -13799,41 +15023,41 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
13799
15023
  function readAndroidNativeAppIdentity(projectRoot, androidMergedManifest) {
13800
15024
  const files = {};
13801
15025
  if (androidMergedManifest) {
13802
- const file = import_node_path9.default.resolve(projectRoot, androidMergedManifest);
13803
- if (!import_node_fs9.default.existsSync(file)) return null;
13804
- 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");
13805
15029
  } else {
13806
- const androidRoot = import_node_path9.default.join(projectRoot, "android");
13807
- 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;
13808
15032
  const collect = (directory) => {
13809
- for (const entry of import_node_fs9.default.readdirSync(directory, { withFileTypes: true })) {
13810
- 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);
13811
15035
  if (entry.isDirectory()) collect(file);
13812
15036
  else if (entry.isFile() && entry.name === "AndroidManifest.xml")
13813
- 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");
13814
15038
  }
13815
15039
  };
13816
- 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 })) {
13817
15041
  if (!module2.isDirectory()) continue;
13818
- const outputs = import_node_path9.default.join(
15042
+ const outputs = import_node_path14.default.join(
13819
15043
  androidRoot,
13820
15044
  module2.name,
13821
15045
  "build/intermediates/merged_manifests"
13822
15046
  );
13823
- if (import_node_fs9.default.existsSync(outputs)) collect(outputs);
15047
+ if (import_node_fs13.default.existsSync(outputs)) collect(outputs);
13824
15048
  }
13825
15049
  }
13826
15050
  for (const manifest of Object.keys(files)) {
13827
15051
  const resourceDirectory = androidMergedResourceValuesDirectory(manifest);
13828
15052
  if (!resourceDirectory) continue;
13829
- const absolute = import_node_path9.default.resolve(projectRoot, resourceDirectory);
13830
- if (!import_node_fs9.default.existsSync(absolute)) continue;
13831
- 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 })) {
13832
15056
  if (!entry.isDirectory() || !/^values(?:-|$)/.test(entry.name)) continue;
13833
- 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))) {
13834
15058
  if (!resource.endsWith(".xml")) continue;
13835
15059
  const file = `${resourceDirectory}/${entry.name}/${resource}`;
13836
- 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");
13837
15061
  }
13838
15062
  }
13839
15063
  }
@@ -13850,7 +15074,7 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget) {
13850
15074
  const app = readIosAppTarget(projectRoot, iosTarget);
13851
15075
  if (!app) return null;
13852
15076
  const identity = readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist);
13853
- const projectManifestPath = import_node_path9.default.join(projectRoot, "package.json");
15077
+ const projectManifestPath = import_node_path14.default.join(projectRoot, "package.json");
13854
15078
  const projectRequire = (0, import_node_module3.createRequire)(projectManifestPath);
13855
15079
  let reanimatedManifestPath;
13856
15080
  try {
@@ -13864,22 +15088,22 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget) {
13864
15088
  throw error;
13865
15089
  }
13866
15090
  const installedManifest = JSON.parse(
13867
- import_node_fs9.default.readFileSync(reanimatedManifestPath, "utf8")
15091
+ import_node_fs13.default.readFileSync(reanimatedManifestPath, "utf8")
13868
15092
  );
13869
15093
  const installedVersion = isRecord(installedManifest) ? nonEmptyString2(installedManifest.version) : void 0;
13870
15094
  if (!installedVersion) throw new Error("Reanimated package version is malformed");
13871
15095
  if (Number.parseInt(installedVersion, 10) < 4) return identity;
13872
15096
  const defaults = JSON.parse(
13873
- import_node_fs9.default.readFileSync(
13874
- import_node_path9.default.join(
13875
- 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),
13876
15100
  "src/featureFlags/staticFlags.json"
13877
15101
  ),
13878
15102
  "utf8"
13879
15103
  )
13880
15104
  );
13881
15105
  if (!isRecord(defaults)) throw new Error("Reanimated static flags are malformed");
13882
- const manifest = JSON.parse(import_node_fs9.default.readFileSync(projectManifestPath, "utf8"));
15106
+ const manifest = JSON.parse(import_node_fs13.default.readFileSync(projectManifestPath, "utf8"));
13883
15107
  const reanimated = isRecord(manifest) ? manifest.reanimated : void 0;
13884
15108
  const overrides = isRecord(reanimated) ? reanimated.staticFeatureFlags : void 0;
13885
15109
  if (overrides !== void 0 && !isRecord(overrides)) {
@@ -13902,9 +15126,9 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget) {
13902
15126
  return { ...identity, reanimatedStaticFeatureFlags: flags };
13903
15127
  }
13904
15128
  function readIosAppTarget(projectRoot, iosTarget) {
13905
- const iosRoot = import_node_path9.default.join(projectRoot, "ios");
13906
- if (!import_node_fs9.default.existsSync(iosRoot)) return null;
13907
- 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"));
13908
15132
  if (projects.length === 0) return null;
13909
15133
  if (projects.length > 1 && !iosTarget) {
13910
15134
  throw new NativeAppTargetSelectionError(
@@ -13914,7 +15138,7 @@ function readIosAppTarget(projectRoot, iosTarget) {
13914
15138
  let project = projects[0];
13915
15139
  if (iosTarget && projects.length > 1) {
13916
15140
  const matches = projects.filter(
13917
- (entry) => listXcodeAppTargets(import_node_path9.default.join(iosRoot, entry.name), {
15141
+ (entry) => listXcodeAppTargets(import_node_path14.default.join(iosRoot, entry.name), {
13918
15142
  requireSources: false
13919
15143
  }).includes(iosTarget)
13920
15144
  );
@@ -13928,7 +15152,7 @@ function readIosAppTarget(projectRoot, iosTarget) {
13928
15152
  }
13929
15153
  project = matches[0];
13930
15154
  }
13931
- const xcodeproj = import_node_path9.default.join(iosRoot, project.name);
15155
+ const xcodeproj = import_node_path14.default.join(iosRoot, project.name);
13932
15156
  const appTargets = listXcodeAppTargets(xcodeproj, { requireSources: false });
13933
15157
  if (!iosTarget && appTargets.length > 1) {
13934
15158
  throw new NativeAppTargetSelectionError(
@@ -13943,10 +15167,10 @@ function readIosAppTarget(projectRoot, iosTarget) {
13943
15167
 
13944
15168
  // src/native-firebase-config.ts
13945
15169
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
13946
- var import_node_child_process3 = require("node:child_process");
13947
- var import_node_fs10 = __toESM(require("node:fs"), 1);
13948
- var import_node_os3 = __toESM(require("node:os"), 1);
13949
- 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);
13950
15174
  init_is_record();
13951
15175
  var EXPO_CONFIG_SCRIPT = `const { createRequire } = require('node:module');
13952
15176
  const { writeFileSync } = require('node:fs');
@@ -13957,13 +15181,13 @@ const result = JSON.stringify(getConfig(root, { skipSDKVersionRequirement: true
13957
15181
  if (Buffer.byteLength(result) > 1024 * 1024) throw new Error('Expo native configuration exceeds 1 MiB.');
13958
15182
  writeFileSync(process.argv[2], result, { mode: 0o600 });`;
13959
15183
  function hasExpoConfig(projectRoot) {
13960
- const appJsonPath = import_node_path10.default.join(projectRoot, "app.json");
13961
- 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;
13962
15186
  const staticExpo = isRecord(appJson) && (isRecord(appJson.expo) || [appJson.ios, appJson.android].some(
13963
15187
  (value) => isRecord(value) && typeof value.googleServicesFile === "string"
13964
15188
  ));
13965
15189
  return staticExpo || ["app.config.js", "app.config.ts", "app.config.cjs", "app.config.mjs"].some(
13966
- (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))
13967
15191
  );
13968
15192
  }
13969
15193
  function expoConfigArgs(projectRoot, resultPath) {
@@ -13971,24 +15195,24 @@ function expoConfigArgs(projectRoot, resultPath) {
13971
15195
  "--input-type=commonjs",
13972
15196
  "-e",
13973
15197
  EXPO_CONFIG_SCRIPT,
13974
- import_node_path10.default.resolve(projectRoot),
15198
+ import_node_path15.default.resolve(projectRoot),
13975
15199
  resultPath
13976
15200
  ];
13977
15201
  }
13978
15202
  function readExpoConfigResult(resultPath, status, stderr) {
13979
15203
  if (status !== 0)
13980
15204
  throw new Error(stderr || "Expo native configuration evaluation failed.");
13981
- const resolved = JSON.parse(import_node_fs10.default.readFileSync(resultPath, "utf8"));
15205
+ const resolved = JSON.parse(import_node_fs14.default.readFileSync(resultPath, "utf8"));
13982
15206
  if (!isRecord(resolved)) throw new Error("Expo native configuration is unavailable.");
13983
15207
  return resolved;
13984
15208
  }
13985
- 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-"));
13986
15210
  function readExpoConfig(projectRoot) {
13987
15211
  if (!hasExpoConfig(projectRoot)) return {};
13988
15212
  const directory = resultDirectory();
13989
- const resultPath = import_node_path10.default.join(directory, "config.json");
15213
+ const resultPath = import_node_path15.default.join(directory, "config.json");
13990
15214
  try {
13991
- 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), {
13992
15216
  cwd: projectRoot,
13993
15217
  encoding: "utf8",
13994
15218
  stdio: ["ignore", "ignore", "pipe"],
@@ -13998,7 +15222,7 @@ function readExpoConfig(projectRoot) {
13998
15222
  if (child.error) throw child.error;
13999
15223
  return readExpoConfigResult(resultPath, child.status, child.stderr);
14000
15224
  } finally {
14001
- import_node_fs10.default.rmSync(directory, { recursive: true, force: true });
15225
+ import_node_fs14.default.rmSync(directory, { recursive: true, force: true });
14002
15226
  }
14003
15227
  }
14004
15228
  function evaluateFirebaseGuard(header, resources) {
@@ -14020,7 +15244,7 @@ function evaluateFirebaseGuard(header, resources) {
14020
15244
  }
14021
15245
  clauses.push(condition.slice(start).trim());
14022
15246
  const sources = resources.filter(
14023
- (file) => import_node_path10.default.basename(file) === "GoogleService-Info.plist"
15247
+ (file) => import_node_path15.default.basename(file) === "GoogleService-Info.plist"
14024
15248
  );
14025
15249
  const bound = /* @__PURE__ */ new Map();
14026
15250
  for (const clause of clauses) {
@@ -14036,7 +15260,7 @@ function evaluateFirebaseGuard(header, resources) {
14036
15260
  const dictionary = /^let\s+(\w+)\s*=\s*NSDictionary\s*\(\s*contentsOfFile:\s*(\w+)\s*\)$/.exec(clause);
14037
15261
  if (dictionary && typeof bound.get(dictionary[2]) === "string") {
14038
15262
  const parsed = parsePlistSource(
14039
- import_node_fs10.default.readFileSync(String(bound.get(dictionary[2])), "utf8")
15263
+ import_node_fs14.default.readFileSync(String(bound.get(dictionary[2])), "utf8")
14040
15264
  );
14041
15265
  if (!isRecord(parsed)) return false;
14042
15266
  bound.set(dictionary[1], parsed);
@@ -14118,7 +15342,7 @@ function findDefaultConfigureCall(body, sources) {
14118
15342
  const [, type, name2] = call;
14119
15343
  for (const file of sources) {
14120
15344
  if (!file.endsWith(".swift")) continue;
14121
- const source = blankSwiftObjcLiterals(import_node_fs10.default.readFileSync(file, "utf8"));
15345
+ const source = blankSwiftObjcLiterals(import_node_fs14.default.readFileSync(file, "utf8"));
14122
15346
  const declaration = new RegExp(
14123
15347
  `\\b(?:enum|struct|class)\\s+${type}\\b[^{]*\\{`
14124
15348
  ).exec(source);
@@ -14134,15 +15358,16 @@ function findDefaultConfigureCall(body, sources) {
14134
15358
  }
14135
15359
  return null;
14136
15360
  }
14137
- function readTargetGoogleServicesFile(projectRoot, xcodeproj, target) {
15361
+ function readTargetGoogleServicesFile(projectRoot, xcodeproj, target, prepareGeneratedSources = false) {
14138
15362
  const app = readXcodeAppTarget(xcodeproj, target, void 0, {
14139
- requireSources: false
15363
+ requireSources: false,
15364
+ prepareGeneratedSources
14140
15365
  });
14141
15366
  const delegates = app.allSources.filter(
14142
- (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))
14143
15368
  );
14144
15369
  const defaultConfigured = delegates.some((file) => {
14145
- const raw = import_node_fs10.default.readFileSync(file, "utf8");
15370
+ const raw = import_node_fs14.default.readFileSync(file, "utf8");
14146
15371
  const source = blankSwiftObjcLiterals(raw);
14147
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(
14148
15373
  source
@@ -14207,32 +15432,56 @@ function readTargetGoogleServicesFile(projectRoot, xcodeproj, target) {
14207
15432
  return guarded;
14208
15433
  });
14209
15434
  if (!defaultConfigured) return null;
14210
- const resources = app.resources.filter(
14211
- (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`
14212
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
+ ];
14213
15450
  if (resources.length !== 1)
14214
15451
  throw new Error(
14215
15452
  "native Firebase default initialization requires one GoogleService-Info.plist build resource"
14216
15453
  );
14217
- 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]);
14218
15455
  }
14219
- function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"], iosTarget, config = readExpoConfig(projectRoot)) {
15456
+ function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"], iosTarget, config = readExpoConfig(projectRoot), prepareGeneratedSources = false) {
14220
15457
  const result = {};
14221
15458
  const ios = config.ios;
14222
15459
  if (platforms.includes("ios") && (!isRecord(ios) || typeof ios.googleServicesFile !== "string")) {
14223
- const iosRoot = import_node_path10.default.join(projectRoot, "ios");
14224
- if (import_node_fs10.default.existsSync(iosRoot)) {
14225
- 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"));
14226
15463
  if (projects.length > 1)
14227
15464
  throw new Error(
14228
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(", ")}`
14229
15466
  );
14230
15467
  if (projects.length === 1) {
14231
- const xcodeproj = import_node_path10.default.join(iosRoot, projects[0].name);
15468
+ const xcodeproj = import_node_path15.default.join(iosRoot, projects[0].name);
14232
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
+ ) : [];
14233
15477
  const files = new Set(
14234
- (iosTarget ? [iosTarget] : appTargets).map(
14235
- (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
+ )
14236
15485
  )
14237
15486
  );
14238
15487
  if (files.size > 1)
@@ -14248,8 +15497,8 @@ function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"], i
14248
15497
  const native = config[platform];
14249
15498
  if (!isRecord(native) || typeof native.googleServicesFile !== "string") continue;
14250
15499
  try {
14251
- const source = import_node_fs10.default.readFileSync(
14252
- 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),
14253
15502
  "utf8"
14254
15503
  );
14255
15504
  const parsed = platform === "ios" ? parsePlistSource(source) : JSON.parse(source);
@@ -14570,6 +15819,13 @@ function withPeach(config, options = {}) {
14570
15819
  annotated,
14571
15820
  (code) => insertAndroidAutolinkingFooter(code, androidAutolinkedPackages)
14572
15821
  );
15822
+ const rootModuleName = readAndroidLauncherRootModuleName(cfgProjectRoot);
15823
+ if (rootModuleName !== void 0) {
15824
+ annotated = await mapMetroSerializerCode(
15825
+ annotated,
15826
+ (code) => insertAndroidRootModuleFooter(code, rootModuleName)
15827
+ );
15828
+ }
14573
15829
  }
14574
15830
  const identity = readNativeAppIdentityFromProject(
14575
15831
  cfgProjectRoot,