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;
@@ -98,7 +98,7 @@ var init_bundleGlobalFooter = __esm({
98
98
  var runtime_companion_default;
99
99
  var init_runtime_companion = __esm({
100
100
  "runtime-companion.json"() {
101
- runtime_companion_default = { abi: 1, sha256: "1f3d4b48d9b79b8579197585654c7ea6f1a69bcc5f4cb2dad706f31aa88d791b", file: "node/cli-1f3d4b48d9b79b8579197585654c7ea6f1a69bcc5f4cb2dad706f31aa88d791b.cjs" };
101
+ runtime_companion_default = { abi: 1, sha256: "a0dede25c849ecabd639fbb0a0c4edd8e62a34bf12090932dba19832f2369659", file: "node/cli-a0dede25c849ecabd639fbb0a0c4edd8e62a34bf12090932dba19832f2369659.cjs" };
102
102
  }
103
103
  });
104
104
 
@@ -156,6 +156,16 @@ function runtimeDir(version) {
156
156
  function activeRuntimeFile() {
157
157
  return import_node_path.default.join(runtimesDir(), ACTIVE_RUNTIME_FILE);
158
158
  }
159
+ function cacheDir() {
160
+ return import_node_path.default.join(rnxHomeDir(), "cache");
161
+ }
162
+ function swiftPackageCacheOptions() {
163
+ const root = import_node_path.default.join(cacheDir(), "swiftpm");
164
+ return ["cache", "config", "security"].flatMap((name2) => [
165
+ `--${name2}-path`,
166
+ import_node_path.default.join(root, name2)
167
+ ]);
168
+ }
159
169
  function daemonLockfilePath() {
160
170
  return import_node_path.default.join(rnxHomeDir(), DAEMON_LOCKFILE);
161
171
  }
@@ -377,6 +387,11 @@ function serveRuntimeFile(req, res, fullPath) {
377
387
  import_fs.default.createReadStream(fullPath).pipe(res);
378
388
  return;
379
389
  }
390
+ if (/[?&]sha256=[a-f0-9]{64}(?:&|$)/.test(req?.url ?? "")) {
391
+ res.setHeader("cache-control", "public, max-age=31536000, immutable");
392
+ import_fs.default.createReadStream(fullPath).pipe(res);
393
+ return;
394
+ }
380
395
  res.setHeader("cache-control", "no-cache");
381
396
  res.setHeader("last-modified", lastModified);
382
397
  if (req?.headers?.["if-modified-since"] === lastModified) {
@@ -488,7 +503,8 @@ function verifyCliCompanion(root) {
488
503
  bytes = (0, import_node_fs2.readFileSync)(file);
489
504
  } catch (error) {
490
505
  if (error instanceof Error) {
491
- error.message = `Could not read Peach runtime companion ${file}: ${error.message}`;
506
+ 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" : "";
507
+ error.message = `Could not read Peach runtime companion ${file}: ${error.message}${missing2}`;
492
508
  }
493
509
  throw error;
494
510
  }
@@ -541,7 +557,7 @@ function isTrustedBridgeRequest(headers) {
541
557
  const origin = headers.origin;
542
558
  if (origin === void 0) return true;
543
559
  try {
544
- const { hostname, host } = new URL(String(origin));
560
+ const { hostname, host } = new NativeURL(String(origin));
545
561
  return isLoopbackHost(hostname) || [headers.host, headers[":authority"], headers["x-forwarded-host"]].some(
546
562
  (value) => typeof value === "string" && value.toLowerCase() === host
547
563
  );
@@ -551,16 +567,18 @@ function isTrustedBridgeRequest(headers) {
551
567
  }
552
568
  function loopbackOriginOf(value) {
553
569
  try {
554
- const url = new URL(value);
570
+ const url = new NativeURL(value);
555
571
  return isLoopbackHost(url.hostname) ? url.origin : null;
556
572
  } catch {
557
573
  return null;
558
574
  }
559
575
  }
576
+ var NativeURL;
560
577
  var init_backend_origin = __esm({
561
578
  "src/backend-origin.ts"() {
562
579
  "use strict";
563
580
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
581
+ NativeURL = globalThis.URL;
564
582
  }
565
583
  });
566
584
 
@@ -1763,17 +1781,17 @@ function visit(node, visitor) {
1763
1781
  } else
1764
1782
  visit_(null, node, visitor_, Object.freeze([]));
1765
1783
  }
1766
- function visit_(key, node, visitor, path22) {
1767
- const ctrl = callVisitor(key, node, visitor, path22);
1784
+ function visit_(key, node, visitor, path26) {
1785
+ const ctrl = callVisitor(key, node, visitor, path26);
1768
1786
  if (isNode(ctrl) || isPair(ctrl)) {
1769
- replaceNode(key, path22, ctrl);
1770
- return visit_(key, ctrl, visitor, path22);
1787
+ replaceNode(key, path26, ctrl);
1788
+ return visit_(key, ctrl, visitor, path26);
1771
1789
  }
1772
1790
  if (typeof ctrl !== "symbol") {
1773
1791
  if (isCollection(node)) {
1774
- path22 = Object.freeze(path22.concat(node));
1792
+ path26 = Object.freeze(path26.concat(node));
1775
1793
  for (let i = 0; i < node.items.length; ++i) {
1776
- const ci = visit_(i, node.items[i], visitor, path22);
1794
+ const ci = visit_(i, node.items[i], visitor, path26);
1777
1795
  if (typeof ci === "number")
1778
1796
  i = ci - 1;
1779
1797
  else if (ci === BREAK)
@@ -1784,13 +1802,13 @@ function visit_(key, node, visitor, path22) {
1784
1802
  }
1785
1803
  }
1786
1804
  } else if (isPair(node)) {
1787
- path22 = Object.freeze(path22.concat(node));
1788
- const ck = visit_("key", node.key, visitor, path22);
1805
+ path26 = Object.freeze(path26.concat(node));
1806
+ const ck = visit_("key", node.key, visitor, path26);
1789
1807
  if (ck === BREAK)
1790
1808
  return BREAK;
1791
1809
  else if (ck === REMOVE)
1792
1810
  node.key = null;
1793
- const cv = visit_("value", node.value, visitor, path22);
1811
+ const cv = visit_("value", node.value, visitor, path26);
1794
1812
  if (cv === BREAK)
1795
1813
  return BREAK;
1796
1814
  else if (cv === REMOVE)
@@ -1808,17 +1826,17 @@ async function visitAsync(node, visitor) {
1808
1826
  } else
1809
1827
  await visitAsync_(null, node, visitor_, Object.freeze([]));
1810
1828
  }
1811
- async function visitAsync_(key, node, visitor, path22) {
1812
- const ctrl = await callVisitor(key, node, visitor, path22);
1829
+ async function visitAsync_(key, node, visitor, path26) {
1830
+ const ctrl = await callVisitor(key, node, visitor, path26);
1813
1831
  if (isNode(ctrl) || isPair(ctrl)) {
1814
- replaceNode(key, path22, ctrl);
1815
- return visitAsync_(key, ctrl, visitor, path22);
1832
+ replaceNode(key, path26, ctrl);
1833
+ return visitAsync_(key, ctrl, visitor, path26);
1816
1834
  }
1817
1835
  if (typeof ctrl !== "symbol") {
1818
1836
  if (isCollection(node)) {
1819
- path22 = Object.freeze(path22.concat(node));
1837
+ path26 = Object.freeze(path26.concat(node));
1820
1838
  for (let i = 0; i < node.items.length; ++i) {
1821
- const ci = await visitAsync_(i, node.items[i], visitor, path22);
1839
+ const ci = await visitAsync_(i, node.items[i], visitor, path26);
1822
1840
  if (typeof ci === "number")
1823
1841
  i = ci - 1;
1824
1842
  else if (ci === BREAK)
@@ -1829,13 +1847,13 @@ async function visitAsync_(key, node, visitor, path22) {
1829
1847
  }
1830
1848
  }
1831
1849
  } else if (isPair(node)) {
1832
- path22 = Object.freeze(path22.concat(node));
1833
- const ck = await visitAsync_("key", node.key, visitor, path22);
1850
+ path26 = Object.freeze(path26.concat(node));
1851
+ const ck = await visitAsync_("key", node.key, visitor, path26);
1834
1852
  if (ck === BREAK)
1835
1853
  return BREAK;
1836
1854
  else if (ck === REMOVE)
1837
1855
  node.key = null;
1838
- const cv = await visitAsync_("value", node.value, visitor, path22);
1856
+ const cv = await visitAsync_("value", node.value, visitor, path26);
1839
1857
  if (cv === BREAK)
1840
1858
  return BREAK;
1841
1859
  else if (cv === REMOVE)
@@ -1862,23 +1880,23 @@ function initVisitor(visitor) {
1862
1880
  }
1863
1881
  return visitor;
1864
1882
  }
1865
- function callVisitor(key, node, visitor, path22) {
1883
+ function callVisitor(key, node, visitor, path26) {
1866
1884
  if (typeof visitor === "function")
1867
- return visitor(key, node, path22);
1885
+ return visitor(key, node, path26);
1868
1886
  if (isMap(node))
1869
- return visitor.Map?.(key, node, path22);
1887
+ return visitor.Map?.(key, node, path26);
1870
1888
  if (isSeq(node))
1871
- return visitor.Seq?.(key, node, path22);
1889
+ return visitor.Seq?.(key, node, path26);
1872
1890
  if (isPair(node))
1873
- return visitor.Pair?.(key, node, path22);
1891
+ return visitor.Pair?.(key, node, path26);
1874
1892
  if (isScalar(node))
1875
- return visitor.Scalar?.(key, node, path22);
1893
+ return visitor.Scalar?.(key, node, path26);
1876
1894
  if (isAlias(node))
1877
- return visitor.Alias?.(key, node, path22);
1895
+ return visitor.Alias?.(key, node, path26);
1878
1896
  return void 0;
1879
1897
  }
1880
- function replaceNode(key, path22, node) {
1881
- const parent = path22[path22.length - 1];
1898
+ function replaceNode(key, path26, node) {
1899
+ const parent = path26[path26.length - 1];
1882
1900
  if (isCollection(parent)) {
1883
1901
  parent.items[key] = node;
1884
1902
  } else if (isPair(parent)) {
@@ -2438,10 +2456,10 @@ var init_createNode = __esm({
2438
2456
  });
2439
2457
 
2440
2458
  // ../../node_modules/yaml/browser/dist/nodes/Collection.js
2441
- function collectionFromPath(schema4, path22, value) {
2459
+ function collectionFromPath(schema4, path26, value) {
2442
2460
  let v = value;
2443
- for (let i = path22.length - 1; i >= 0; --i) {
2444
- const k = path22[i];
2461
+ for (let i = path26.length - 1; i >= 0; --i) {
2462
+ const k = path26[i];
2445
2463
  if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
2446
2464
  const a = [];
2447
2465
  a[k] = v;
@@ -2467,7 +2485,7 @@ var init_Collection = __esm({
2467
2485
  init_createNode();
2468
2486
  init_identity();
2469
2487
  init_Node();
2470
- isEmptyPath = (path22) => path22 == null || typeof path22 === "object" && !!path22[Symbol.iterator]().next().done;
2488
+ isEmptyPath = (path26) => path26 == null || typeof path26 === "object" && !!path26[Symbol.iterator]().next().done;
2471
2489
  Collection = class extends NodeBase {
2472
2490
  constructor(type, schema4) {
2473
2491
  super(type);
@@ -2497,11 +2515,11 @@ var init_Collection = __esm({
2497
2515
  * be a Pair instance or a `{ key, value }` object, which may not have a key
2498
2516
  * that already exists in the map.
2499
2517
  */
2500
- addIn(path22, value) {
2501
- if (isEmptyPath(path22))
2518
+ addIn(path26, value) {
2519
+ if (isEmptyPath(path26))
2502
2520
  this.add(value);
2503
2521
  else {
2504
- const [key, ...rest] = path22;
2522
+ const [key, ...rest] = path26;
2505
2523
  const node = this.get(key, true);
2506
2524
  if (isCollection(node))
2507
2525
  node.addIn(rest, value);
@@ -2515,8 +2533,8 @@ var init_Collection = __esm({
2515
2533
  * Removes a value from the collection.
2516
2534
  * @returns `true` if the item was found and removed.
2517
2535
  */
2518
- deleteIn(path22) {
2519
- const [key, ...rest] = path22;
2536
+ deleteIn(path26) {
2537
+ const [key, ...rest] = path26;
2520
2538
  if (rest.length === 0)
2521
2539
  return this.delete(key);
2522
2540
  const node = this.get(key, true);
@@ -2530,8 +2548,8 @@ var init_Collection = __esm({
2530
2548
  * scalar values from their surrounding node; to disable set `keepScalar` to
2531
2549
  * `true` (collections are always returned intact).
2532
2550
  */
2533
- getIn(path22, keepScalar) {
2534
- const [key, ...rest] = path22;
2551
+ getIn(path26, keepScalar) {
2552
+ const [key, ...rest] = path26;
2535
2553
  const node = this.get(key, true);
2536
2554
  if (rest.length === 0)
2537
2555
  return !keepScalar && isScalar(node) ? node.value : node;
@@ -2549,8 +2567,8 @@ var init_Collection = __esm({
2549
2567
  /**
2550
2568
  * Checks if the collection includes a value with the key `key`.
2551
2569
  */
2552
- hasIn(path22) {
2553
- const [key, ...rest] = path22;
2570
+ hasIn(path26) {
2571
+ const [key, ...rest] = path26;
2554
2572
  if (rest.length === 0)
2555
2573
  return this.has(key);
2556
2574
  const node = this.get(key, true);
@@ -2560,8 +2578,8 @@ var init_Collection = __esm({
2560
2578
  * Sets a value in this collection. For `!!set`, `value` needs to be a
2561
2579
  * boolean to add/remove the item from the set.
2562
2580
  */
2563
- setIn(path22, value) {
2564
- const [key, ...rest] = path22;
2581
+ setIn(path26, value) {
2582
+ const [key, ...rest] = path26;
2565
2583
  if (rest.length === 0) {
2566
2584
  this.set(key, value);
2567
2585
  } else {
@@ -4534,15 +4552,15 @@ function visit2(cst, visitor) {
4534
4552
  cst = { start: cst.start, value: cst.value };
4535
4553
  _visit(Object.freeze([]), cst, visitor);
4536
4554
  }
4537
- function _visit(path22, item, visitor) {
4538
- let ctrl = visitor(item, path22);
4555
+ function _visit(path26, item, visitor) {
4556
+ let ctrl = visitor(item, path26);
4539
4557
  if (typeof ctrl === "symbol")
4540
4558
  return ctrl;
4541
4559
  for (const field of ["key", "value"]) {
4542
4560
  const token = item[field];
4543
4561
  if (token && "items" in token) {
4544
4562
  for (let i = 0; i < token.items.length; ++i) {
4545
- const ci = _visit(Object.freeze(path22.concat([[field, i]])), token.items[i], visitor);
4563
+ const ci = _visit(Object.freeze(path26.concat([[field, i]])), token.items[i], visitor);
4546
4564
  if (typeof ci === "number")
4547
4565
  i = ci - 1;
4548
4566
  else if (ci === BREAK2)
@@ -4553,10 +4571,10 @@ function _visit(path22, item, visitor) {
4553
4571
  }
4554
4572
  }
4555
4573
  if (typeof ctrl === "function" && field === "key")
4556
- ctrl = ctrl(item, path22);
4574
+ ctrl = ctrl(item, path26);
4557
4575
  }
4558
4576
  }
4559
- return typeof ctrl === "function" ? ctrl(item, path22) : ctrl;
4577
+ return typeof ctrl === "function" ? ctrl(item, path26) : ctrl;
4560
4578
  }
4561
4579
  var BREAK2, SKIP2, REMOVE2;
4562
4580
  var init_cst_visit = __esm({
@@ -4568,9 +4586,9 @@ var init_cst_visit = __esm({
4568
4586
  visit2.BREAK = BREAK2;
4569
4587
  visit2.SKIP = SKIP2;
4570
4588
  visit2.REMOVE = REMOVE2;
4571
- visit2.itemAtPath = (cst, path22) => {
4589
+ visit2.itemAtPath = (cst, path26) => {
4572
4590
  let item = cst;
4573
- for (const [field, index] of path22) {
4591
+ for (const [field, index] of path26) {
4574
4592
  const tok = item?.[field];
4575
4593
  if (tok && "items" in tok) {
4576
4594
  item = tok.items[index];
@@ -4579,9 +4597,9 @@ var init_cst_visit = __esm({
4579
4597
  }
4580
4598
  return item;
4581
4599
  };
4582
- visit2.parentCollection = (cst, path22) => {
4583
- const parent = visit2.itemAtPath(cst, path22.slice(0, -1));
4584
- const field = path22[path22.length - 1][0];
4600
+ visit2.parentCollection = (cst, path26) => {
4601
+ const parent = visit2.itemAtPath(cst, path26.slice(0, -1));
4602
+ const field = path26[path26.length - 1][0];
4585
4603
  const coll = parent?.[field];
4586
4604
  if (coll && "items" in coll)
4587
4605
  return coll;
@@ -4751,8 +4769,8 @@ function metadataValue(value, key) {
4751
4769
  if (!value || typeof value !== "object") return void 0;
4752
4770
  return Object.getOwnPropertyDescriptor(value, key)?.value;
4753
4771
  }
4754
- function readProjectJson(path22, files = nodeRepoFileReader) {
4755
- const text2 = readProjectMetadata(path22, files);
4772
+ function readProjectJson(path26, files = nodeRepoFileReader) {
4773
+ const text2 = readProjectMetadata(path26, files);
4756
4774
  if (text2 === null) return null;
4757
4775
  try {
4758
4776
  const value = JSON.parse(text2);
@@ -4779,7 +4797,7 @@ function readProjectManifest(dir, files = nodeRepoFileReader) {
4779
4797
  devDependencies: record(metadataValue(parsed, "devDependencies"))
4780
4798
  };
4781
4799
  }
4782
- var import_node_fs4, import_node_path3, import_json5, REPORT_SKIP_DIRS;
4800
+ var import_node_fs4, import_node_path3, import_json5, REPORT_SKIP_DIRS, PODFILE_NEW_ARCH_MARK, PODFILE_NEW_ARCH_RUBY;
4783
4801
  var init_detect = __esm({
4784
4802
  "cli/commands/detect.ts"() {
4785
4803
  "use strict";
@@ -4806,6 +4824,244 @@ var init_detect = __esm({
4806
4824
  "test-results",
4807
4825
  "playwright-report"
4808
4826
  ]);
4827
+ PODFILE_NEW_ARCH_MARK = "PEACH_RCT_NEW_ARCH ";
4828
+ PODFILE_NEW_ARCH_RUBY = `
4829
+ require 'json'
4830
+ payload = JSON.parse($stdin.read)
4831
+ properties = payload['properties']
4832
+ properties = {} unless properties.is_a?(Hash)
4833
+ podfile_properties = properties
4834
+ ENV.delete('RCT_NEW_ARCH_ENABLED')
4835
+ scope = binding
4836
+ Array(payload['statements']).each do |statement|
4837
+ before = ENV['RCT_NEW_ARCH_ENABLED']
4838
+ scope.eval(statement)
4839
+ after = ENV['RCT_NEW_ARCH_ENABLED']
4840
+ if after == before
4841
+ puts '${PODFILE_NEW_ARCH_MARK}skip'
4842
+ elsif after == '0' || after == '1'
4843
+ puts "${PODFILE_NEW_ARCH_MARK}#{after}"
4844
+ else
4845
+ warn "RCT_NEW_ARCH_ENABLED assigned #{after.inspect}"
4846
+ exit 2
4847
+ end
4848
+ end
4849
+ `;
4850
+ }
4851
+ });
4852
+
4853
+ // ../peach-compat/src/version-range.ts
4854
+ function compareVersions(left, right) {
4855
+ if (left.major !== right.major) return left.major < right.major ? -1 : 1;
4856
+ if (left.minor !== right.minor) return left.minor < right.minor ? -1 : 1;
4857
+ if (left.patch !== right.patch) return left.patch < right.patch ? -1 : 1;
4858
+ if (left.prerelease.length === 0) return right.prerelease.length === 0 ? 0 : 1;
4859
+ if (right.prerelease.length === 0) return -1;
4860
+ const length = Math.max(left.prerelease.length, right.prerelease.length);
4861
+ for (let index = 0; index < length; index++) {
4862
+ const leftPart = left.prerelease[index];
4863
+ const rightPart = right.prerelease[index];
4864
+ if (leftPart === void 0) return -1;
4865
+ if (rightPart === void 0) return 1;
4866
+ if (leftPart === rightPart) continue;
4867
+ const leftNumeric = /^\d+$/.test(leftPart);
4868
+ const rightNumeric = /^\d+$/.test(rightPart);
4869
+ if (leftNumeric && rightNumeric) return Number(leftPart) < Number(rightPart) ? -1 : 1;
4870
+ if (leftNumeric !== rightNumeric) return leftNumeric ? -1 : 1;
4871
+ return leftPart < rightPart ? -1 : 1;
4872
+ }
4873
+ return 0;
4874
+ }
4875
+ function parseComparator(input) {
4876
+ const token = input.trim();
4877
+ if (token === "" || token === "*" || token === "x" || token === "X") {
4878
+ return ANY_BOUNDS;
4879
+ }
4880
+ const match = /^(>=|<=|>|<|=|\^|~)?\s*v?(\d+|[xX*])(?:\.(\d+|[xX*]))?(?:\.(\d+|[xX*]))?(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/.exec(
4881
+ token
4882
+ );
4883
+ if (!match) return null;
4884
+ const operator = match[1] ?? "=";
4885
+ const wildcard = (part) => part === void 0 || part === "x" || part === "X" || part === "*";
4886
+ if (wildcard(match[2])) return ANY_BOUNDS;
4887
+ const major = Number(match[2]);
4888
+ const minor = wildcard(match[3]) ? null : Number(match[3]);
4889
+ const patch = wildcard(match[4]) ? null : Number(match[4]);
4890
+ const floor = {
4891
+ major,
4892
+ minor: minor ?? 0,
4893
+ patch: patch ?? 0,
4894
+ prerelease: match[5] ? match[5].split(".") : []
4895
+ };
4896
+ if (operator === ">") {
4897
+ return { ...ANY_BOUNDS, lower: floor, lowerInclusive: false };
4898
+ }
4899
+ if (operator === ">=") {
4900
+ return { ...ANY_BOUNDS, lower: floor, lowerInclusive: true };
4901
+ }
4902
+ if (operator === "<") {
4903
+ return { ...ANY_BOUNDS, upper: floor, upperInclusive: false };
4904
+ }
4905
+ if (operator === "<=") {
4906
+ return { ...ANY_BOUNDS, upper: floor, upperInclusive: true };
4907
+ }
4908
+ let upper;
4909
+ if (operator === "^") {
4910
+ 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: [] };
4911
+ } else if (operator === "~") {
4912
+ upper = minor === null ? { major: major + 1, minor: 0, patch: 0, prerelease: [] } : { major, minor: minor + 1, patch: 0, prerelease: [] };
4913
+ } else if (minor === null) {
4914
+ upper = { major: major + 1, minor: 0, patch: 0, prerelease: [] };
4915
+ } else if (patch === null) {
4916
+ upper = { major, minor: minor + 1, patch: 0, prerelease: [] };
4917
+ } else {
4918
+ return {
4919
+ lower: floor,
4920
+ lowerInclusive: true,
4921
+ upper: floor,
4922
+ upperInclusive: true
4923
+ };
4924
+ }
4925
+ return {
4926
+ lower: floor,
4927
+ lowerInclusive: true,
4928
+ upper,
4929
+ upperInclusive: false
4930
+ };
4931
+ }
4932
+ function stricterLower(left, right) {
4933
+ if (!left.lower) return { lower: right.lower, lowerInclusive: right.lowerInclusive };
4934
+ if (!right.lower) return { lower: left.lower, lowerInclusive: left.lowerInclusive };
4935
+ const order = compareVersions(left.lower, right.lower);
4936
+ if (order > 0) return { lower: left.lower, lowerInclusive: left.lowerInclusive };
4937
+ if (order < 0) return { lower: right.lower, lowerInclusive: right.lowerInclusive };
4938
+ return {
4939
+ lower: left.lower,
4940
+ lowerInclusive: left.lowerInclusive && right.lowerInclusive
4941
+ };
4942
+ }
4943
+ function stricterUpper(left, right) {
4944
+ if (!left.upper) return { upper: right.upper, upperInclusive: right.upperInclusive };
4945
+ if (!right.upper) return { upper: left.upper, upperInclusive: left.upperInclusive };
4946
+ const order = compareVersions(left.upper, right.upper);
4947
+ if (order < 0) return { upper: left.upper, upperInclusive: left.upperInclusive };
4948
+ if (order > 0) return { upper: right.upper, upperInclusive: right.upperInclusive };
4949
+ return {
4950
+ upper: left.upper,
4951
+ upperInclusive: left.upperInclusive && right.upperInclusive
4952
+ };
4953
+ }
4954
+ function hasValues(bounds) {
4955
+ if (!bounds.lower || !bounds.upper) return true;
4956
+ const order = compareVersions(bounds.lower, bounds.upper);
4957
+ return order < 0 || order === 0 && bounds.lowerInclusive && bounds.upperInclusive;
4958
+ }
4959
+ function parseRange(input) {
4960
+ const groups = input.split("||");
4961
+ const parsed = [];
4962
+ for (const group of groups) {
4963
+ const tokens = group.trim().match(COMPARATOR) ?? [];
4964
+ if (tokens.length === 0) return null;
4965
+ let bounds = ANY_BOUNDS;
4966
+ for (const token of tokens) {
4967
+ const comparator = parseComparator(token);
4968
+ if (!comparator) return null;
4969
+ bounds = {
4970
+ ...stricterLower(bounds, comparator),
4971
+ ...stricterUpper(bounds, comparator)
4972
+ };
4973
+ }
4974
+ if (!hasValues(bounds)) return null;
4975
+ parsed.push(bounds);
4976
+ }
4977
+ return parsed;
4978
+ }
4979
+ function containsBounds(container, contained) {
4980
+ if (container.lower) {
4981
+ if (!contained.lower) return false;
4982
+ const order = compareVersions(container.lower, contained.lower);
4983
+ if (order > 0) return false;
4984
+ if (order === 0 && contained.lowerInclusive && !container.lowerInclusive) return false;
4985
+ }
4986
+ if (container.upper) {
4987
+ if (!contained.upper) return false;
4988
+ const order = compareVersions(container.upper, contained.upper);
4989
+ if (order < 0) return false;
4990
+ if (order === 0 && contained.upperInclusive && !container.upperInclusive) return false;
4991
+ }
4992
+ return true;
4993
+ }
4994
+ function overlapsBounds(left, right) {
4995
+ const intersection = {
4996
+ ...stricterLower(left, right),
4997
+ ...stricterUpper(left, right)
4998
+ };
4999
+ return hasValues(intersection);
5000
+ }
5001
+ function resolveCompatVersionRange(availableRegistryRanges, declaredVersion) {
5002
+ const declaredGroups = parseRange(declaredVersion);
5003
+ const registryGroups = availableRegistryRanges.map((range) => ({
5004
+ range,
5005
+ bounds: parseRange(range)
5006
+ }));
5007
+ if (!declaredGroups || registryGroups.some((candidate) => !candidate.bounds)) {
5008
+ return {
5009
+ status: "unresolved",
5010
+ declaredVersion,
5011
+ availableRegistryRanges
5012
+ };
5013
+ }
5014
+ let selectedRange = null;
5015
+ for (const declared of declaredGroups) {
5016
+ const containing = registryGroups.filter(
5017
+ (candidate2) => candidate2.bounds?.length === 1 && containsBounds(candidate2.bounds[0], declared)
5018
+ );
5019
+ if (containing.length !== 1) {
5020
+ const overlaps = registryGroups.some(
5021
+ (candidate2) => candidate2.bounds?.some((bounds) => overlapsBounds(bounds, declared))
5022
+ );
5023
+ return {
5024
+ status: overlaps ? "unresolved" : "unmatched",
5025
+ declaredVersion,
5026
+ availableRegistryRanges
5027
+ };
5028
+ }
5029
+ const candidate = containing[0].range;
5030
+ if (selectedRange && selectedRange !== candidate) {
5031
+ return {
5032
+ status: "unresolved",
5033
+ declaredVersion,
5034
+ availableRegistryRanges
5035
+ };
5036
+ }
5037
+ selectedRange = candidate;
5038
+ }
5039
+ if (!selectedRange) {
5040
+ return {
5041
+ status: "unresolved",
5042
+ declaredVersion,
5043
+ availableRegistryRanges
5044
+ };
5045
+ }
5046
+ return {
5047
+ status: "matched",
5048
+ declaredVersion,
5049
+ registryRange: selectedRange,
5050
+ availableRegistryRanges
5051
+ };
5052
+ }
5053
+ var ANY_BOUNDS, COMPARATOR;
5054
+ var init_version_range = __esm({
5055
+ "../peach-compat/src/version-range.ts"() {
5056
+ "use strict";
5057
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
5058
+ ANY_BOUNDS = {
5059
+ lower: null,
5060
+ lowerInclusive: false,
5061
+ upper: null,
5062
+ upperInclusive: false
5063
+ };
5064
+ COMPARATOR = /\s*(?:[<>]=?|[=^~])?\s*[^\s]+/g;
4809
5065
  }
4810
5066
  });
4811
5067
 
@@ -5137,7 +5393,7 @@ var init_node_http_fetch = __esm({
5137
5393
  });
5138
5394
 
5139
5395
  // ../contrast-bundler/src/posixPath.ts
5140
- function isAbsolute(p) {
5396
+ function isAbsolute2(p) {
5141
5397
  return p.charCodeAt(0) === 47;
5142
5398
  }
5143
5399
  function normalizeSegments(parts, allowAboveRoot) {
@@ -5155,7 +5411,7 @@ function normalizeSegments(parts, allowAboveRoot) {
5155
5411
  }
5156
5412
  function normalize(p) {
5157
5413
  if (p.length === 0) return ".";
5158
- const absolute = isAbsolute(p);
5414
+ const absolute = isAbsolute2(p);
5159
5415
  const trailingSlash = p.charCodeAt(p.length - 1) === 47;
5160
5416
  const segments = normalizeSegments(p.split("/"), !absolute);
5161
5417
  let joined = segments.join("/");
@@ -5178,7 +5434,7 @@ function resolve3(...parts) {
5178
5434
  const part = parts[i];
5179
5435
  if (part.length === 0) continue;
5180
5436
  resolved = resolved.length > 0 ? `${part}/${resolved}` : part;
5181
- absolute = isAbsolute(part);
5437
+ absolute = isAbsolute2(part);
5182
5438
  }
5183
5439
  if (!absolute)
5184
5440
  throw new Error(
@@ -5228,7 +5484,7 @@ var init_posixPath = __esm({
5228
5484
  posix = {
5229
5485
  sep,
5230
5486
  delimiter,
5231
- isAbsolute,
5487
+ isAbsolute: isAbsolute2,
5232
5488
  normalize,
5233
5489
  join: join5,
5234
5490
  resolve: resolve3,
@@ -5473,16 +5729,16 @@ function sendJavaScript(req, res, source) {
5473
5729
  res.end(req.method === "HEAD" ? void 0 : source);
5474
5730
  }
5475
5731
  function resolveReplacementModuleFile(fromFile, specifier) {
5476
- const base = import_node_path9.default.resolve(import_node_path9.default.dirname(fromFile), specifier);
5732
+ const base = import_node_path11.default.resolve(import_node_path11.default.dirname(fromFile), specifier);
5477
5733
  const candidates = [
5478
5734
  ...REPLACEMENT_MODULE_EXTENSIONS.some(
5479
- (ext) => ext === import_node_path9.default.extname(base).toLowerCase()
5735
+ (ext) => ext === import_node_path11.default.extname(base).toLowerCase()
5480
5736
  ) ? [base] : [],
5481
5737
  ...REPLACEMENT_MODULE_EXTENSIONS.map((ext) => base + ext),
5482
- ...REPLACEMENT_MODULE_EXTENSIONS.map((ext) => import_node_path9.default.join(base, `index${ext}`))
5738
+ ...REPLACEMENT_MODULE_EXTENSIONS.map((ext) => import_node_path11.default.join(base, `index${ext}`))
5483
5739
  ];
5484
5740
  const found = candidates.find(
5485
- (candidate) => (0, import_node_fs10.statSync)(candidate, { throwIfNoEntry: false })?.isFile()
5741
+ (candidate) => (0, import_node_fs11.statSync)(candidate, { throwIfNoEntry: false })?.isFile()
5486
5742
  );
5487
5743
  if (!found) {
5488
5744
  throw new Error(
@@ -5493,8 +5749,8 @@ function resolveReplacementModuleFile(fromFile, specifier) {
5493
5749
  }
5494
5750
  function isInsideAny(roots, file) {
5495
5751
  return roots.some((root) => {
5496
- const relative3 = import_node_path9.default.relative(root, file);
5497
- return !relative3.startsWith("..") && !import_node_path9.default.isAbsolute(relative3);
5752
+ const relative3 = import_node_path11.default.relative(root, file);
5753
+ return !relative3.startsWith("..") && !import_node_path11.default.isAbsolute(relative3);
5498
5754
  });
5499
5755
  }
5500
5756
  function isReplacementModuleRequestUrl(rawUrl) {
@@ -5543,19 +5799,19 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
5543
5799
  res.end("missing path param");
5544
5800
  return true;
5545
5801
  }
5546
- const extension = import_node_path9.default.extname(targetPath).toLowerCase();
5802
+ const extension = import_node_path11.default.extname(targetPath).toLowerCase();
5547
5803
  if (!REPLACEMENT_MODULE_EXTENSIONS.some((allowed) => allowed === extension)) {
5548
5804
  res.writeHead(400, { "Content-Type": "text/plain; charset=utf-8" });
5549
5805
  res.end(`replacement files must be ${REPLACEMENT_MODULE_EXTENSIONS.join(", ")}`);
5550
5806
  return true;
5551
5807
  }
5552
- if (!import_node_path9.default.isAbsolute(targetPath)) {
5808
+ if (!import_node_path11.default.isAbsolute(targetPath)) {
5553
5809
  res.writeHead(400, { "Content-Type": "text/plain; charset=utf-8" });
5554
5810
  res.end("replacement file path must be absolute");
5555
5811
  return true;
5556
5812
  }
5557
5813
  const runtimePackages = new Set(url.searchParams.getAll("runtimePackage"));
5558
- const servedRoots = options.servedRoots?.map((root) => import_node_path9.default.resolve(root));
5814
+ const servedRoots = options.servedRoots?.map((root) => import_node_path11.default.resolve(root));
5559
5815
  if (servedRoots && !isInsideAny(servedRoots, targetPath)) {
5560
5816
  res.writeHead(403, { "Content-Type": "text/plain; charset=utf-8" });
5561
5817
  res.end("replacement file must be inside a folder the bundler serves");
@@ -5607,35 +5863,48 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
5607
5863
  }
5608
5864
  return true;
5609
5865
  }
5610
- var import_node_fs10, import_promises4, import_node_path9, REPLACEMENT_MODULE_ROUTE;
5866
+ var import_node_fs11, import_promises4, import_node_path11, REPLACEMENT_MODULE_ROUTE;
5611
5867
  var init_replacement_module_handler = __esm({
5612
5868
  "src/host/replacement-module-handler.ts"() {
5613
5869
  "use strict";
5614
5870
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
5615
- import_node_fs10 = require("node:fs");
5871
+ import_node_fs11 = require("node:fs");
5616
5872
  import_promises4 = __toESM(require("node:fs/promises"), 1);
5617
- import_node_path9 = __toESM(require("node:path"), 1);
5873
+ import_node_path11 = __toESM(require("node:path"), 1);
5618
5874
  init_replacementModule();
5619
5875
  init_backend_origin();
5620
5876
  REPLACEMENT_MODULE_ROUTE = "/__sootsim-replacement-module";
5621
5877
  }
5622
5878
  });
5623
5879
 
5880
+ // cli/internal-child.ts
5881
+ var RNX_FORKED_SCRIPT_ENV;
5882
+ var init_internal_child = __esm({
5883
+ "cli/internal-child.ts"() {
5884
+ "use strict";
5885
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
5886
+ RNX_FORKED_SCRIPT_ENV = "PEACH_RUNS_FORKED_SCRIPTS";
5887
+ }
5888
+ });
5889
+
5624
5890
  // src/swift-source-file.ts
5891
+ function relativeInside(root, file) {
5892
+ const relative3 = import_node_path12.default.relative(root, file);
5893
+ return relative3 === ".." || relative3.startsWith(`..${import_node_path12.default.sep}`) || import_node_path12.default.isAbsolute(relative3) ? null : relative3;
5894
+ }
5625
5895
  function packageInputPath(canonicalRoot, file) {
5626
- const canonicalFile = import_node_fs11.default.realpathSync(file);
5627
- const relative3 = import_node_path10.default.relative(canonicalRoot, canonicalFile);
5628
- if (relative3 === ".." || relative3.startsWith(`..${import_node_path10.default.sep}`) || import_node_path10.default.isAbsolute(relative3)) {
5896
+ const canonicalFile = import_node_fs12.default.realpathSync(file);
5897
+ if (relativeInside(canonicalRoot, canonicalFile) === null) {
5629
5898
  throw new Error(`swift input escapes the selected package: ${file}`);
5630
5899
  }
5631
5900
  return canonicalFile;
5632
5901
  }
5633
5902
  function readPackageFile(root, file, maxBytes) {
5634
- const canonicalFile = packageInputPath(import_node_fs11.default.realpathSync(root), file);
5635
- const expected = import_node_fs11.default.statSync(canonicalFile);
5636
- const fd = import_node_fs11.default.openSync(canonicalFile, import_node_fs11.default.constants.O_RDONLY | import_node_fs11.default.constants.O_NOFOLLOW);
5903
+ const canonicalFile = packageInputPath(import_node_fs12.default.realpathSync(root), file);
5904
+ const expected = import_node_fs12.default.statSync(canonicalFile);
5905
+ const fd = import_node_fs12.default.openSync(canonicalFile, import_node_fs12.default.constants.O_RDONLY | import_node_fs12.default.constants.O_NOFOLLOW);
5637
5906
  try {
5638
- const stat = import_node_fs11.default.fstatSync(fd);
5907
+ const stat = import_node_fs12.default.fstatSync(fd);
5639
5908
  if (stat.dev !== expected.dev || stat.ino !== expected.ino) {
5640
5909
  throw new Error(`swift input changed while opening: ${file}`);
5641
5910
  }
@@ -5645,25 +5914,25 @@ function readPackageFile(root, file, maxBytes) {
5645
5914
  const bytes = Buffer.alloc(stat.size + 1);
5646
5915
  let offset = 0;
5647
5916
  while (offset < bytes.length) {
5648
- const count = import_node_fs11.default.readSync(fd, bytes, offset, bytes.length - offset, null);
5917
+ const count = import_node_fs12.default.readSync(fd, bytes, offset, bytes.length - offset, null);
5649
5918
  if (count === 0) break;
5650
5919
  offset += count;
5651
5920
  }
5652
- if (offset !== stat.size || import_node_fs11.default.fstatSync(fd).size !== stat.size) {
5921
+ if (offset !== stat.size || import_node_fs12.default.fstatSync(fd).size !== stat.size) {
5653
5922
  throw new Error(`swift input changed while reading: ${file}`);
5654
5923
  }
5655
5924
  return bytes.subarray(0, offset);
5656
5925
  } finally {
5657
- import_node_fs11.default.closeSync(fd);
5926
+ import_node_fs12.default.closeSync(fd);
5658
5927
  }
5659
5928
  }
5660
- var import_node_fs11, import_node_path10;
5929
+ var import_node_fs12, import_node_path12;
5661
5930
  var init_swift_source_file = __esm({
5662
5931
  "src/swift-source-file.ts"() {
5663
5932
  "use strict";
5664
5933
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
5665
- import_node_fs11 = __toESM(require("node:fs"), 1);
5666
- import_node_path10 = __toESM(require("node:path"), 1);
5934
+ import_node_fs12 = __toESM(require("node:fs"), 1);
5935
+ import_node_path12 = __toESM(require("node:path"), 1);
5667
5936
  }
5668
5937
  });
5669
5938
 
@@ -5709,9 +5978,9 @@ var init_swift_submit = __esm({
5709
5978
  // cli/app-project.ts
5710
5979
  function firstNamedFile(dir, names) {
5711
5980
  for (const name2 of names) {
5712
- const candidate = import_node_path12.default.join(dir, name2);
5981
+ const candidate = import_node_path14.default.join(dir, name2);
5713
5982
  try {
5714
- if (import_node_fs13.default.statSync(candidate).isFile()) return candidate;
5983
+ if (import_node_fs14.default.statSync(candidate).isFile()) return candidate;
5715
5984
  } catch {
5716
5985
  }
5717
5986
  }
@@ -5724,25 +5993,25 @@ function findRNXAppConfig(dir) {
5724
5993
  return firstNamedFile(dir, PEACH_APP_CONFIG_NAMES);
5725
5994
  }
5726
5995
  function resolveAppProject(projectRoot) {
5727
- const appDir = import_node_path12.default.resolve(projectRoot);
5996
+ const appDir = import_node_path14.default.resolve(projectRoot);
5728
5997
  try {
5729
- if (!import_node_fs13.default.statSync(appDir).isDirectory()) return null;
5998
+ if (!import_node_fs14.default.statSync(appDir).isDirectory()) return null;
5730
5999
  } catch {
5731
6000
  return null;
5732
6001
  }
5733
6002
  const configPath = findRNXAppConfig(appDir);
5734
- if (!configPath && !findExpoAppConfig(appDir) && !import_node_fs13.default.existsSync(import_node_path12.default.join(appDir, "package.json"))) {
6003
+ if (!configPath && !findExpoAppConfig(appDir) && !import_node_fs14.default.existsSync(import_node_path14.default.join(appDir, "package.json"))) {
5735
6004
  return null;
5736
6005
  }
5737
6006
  return { appDir, configPath };
5738
6007
  }
5739
- var import_node_fs13, import_node_path12, EXPO_APP_CONFIG_NAMES, PEACH_APP_CONFIG_NAMES;
6008
+ var import_node_fs14, import_node_path14, EXPO_APP_CONFIG_NAMES, PEACH_APP_CONFIG_NAMES;
5740
6009
  var init_app_project = __esm({
5741
6010
  "cli/app-project.ts"() {
5742
6011
  "use strict";
5743
6012
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
5744
- import_node_fs13 = __toESM(require("node:fs"), 1);
5745
- import_node_path12 = __toESM(require("node:path"), 1);
6013
+ import_node_fs14 = __toESM(require("node:fs"), 1);
6014
+ import_node_path14 = __toESM(require("node:path"), 1);
5746
6015
  EXPO_APP_CONFIG_NAMES = [
5747
6016
  "app.config.js",
5748
6017
  "app.config.ts",
@@ -5759,6 +6028,37 @@ var init_app_project = __esm({
5759
6028
  }
5760
6029
  });
5761
6030
 
6031
+ // src/kotlin-toolchain.ts
6032
+ var import_node_child_process8, import_node_util3, run3;
6033
+ var init_kotlin_toolchain = __esm({
6034
+ "src/kotlin-toolchain.ts"() {
6035
+ "use strict";
6036
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
6037
+ import_node_child_process8 = require("node:child_process");
6038
+ import_node_util3 = require("node:util");
6039
+ init_home_paths();
6040
+ init_is_record();
6041
+ run3 = (0, import_node_util3.promisify)(import_node_child_process8.execFile);
6042
+ }
6043
+ });
6044
+
6045
+ // src/nitro-dependencies.ts
6046
+ var import_node_child_process9, import_node_util4, run4;
6047
+ var init_nitro_dependencies = __esm({
6048
+ "src/nitro-dependencies.ts"() {
6049
+ "use strict";
6050
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
6051
+ import_node_child_process9 = require("node:child_process");
6052
+ import_node_util4 = require("node:util");
6053
+ init_home_paths();
6054
+ init_is_record();
6055
+ init_kotlin_toolchain();
6056
+ init_swift_source_file();
6057
+ init_swift_submit();
6058
+ run4 = (0, import_node_util4.promisify)(import_node_child_process9.execFile);
6059
+ }
6060
+ });
6061
+
5762
6062
  // src/nitro-source.ts
5763
6063
  function object(value) {
5764
6064
  return value !== null && typeof value === "object" && !Array.isArray(value);
@@ -5767,19 +6067,19 @@ function readJson(root, relative3) {
5767
6067
  return JSON.parse(
5768
6068
  readPackageFile(
5769
6069
  root,
5770
- import_node_path18.default.join(root, relative3),
6070
+ import_node_path23.default.join(root, relative3),
5771
6071
  MAX_SWIFT_COMPILE_SOURCE_BYTES
5772
6072
  ).toString("utf8")
5773
6073
  );
5774
6074
  }
5775
6075
  function registrations(root) {
5776
- const directory = import_node_path18.default.join(root, "nitrogen/generated/ios");
5777
- const initializers = import_node_fs18.default.readdirSync(directory).filter((file) => file.endsWith("Autolinking.mm"));
6076
+ const directory = import_node_path23.default.join(root, "nitrogen/generated/ios");
6077
+ const initializers = import_node_fs22.default.readdirSync(directory).filter((file) => file.endsWith("Autolinking.mm"));
5778
6078
  if (initializers.length !== 1)
5779
6079
  throw new Error(`${root}: expected one generated Nitro iOS initializer`);
5780
6080
  const source = readPackageFile(
5781
6081
  root,
5782
- import_node_path18.default.join(directory, initializers[0]),
6082
+ import_node_path23.default.join(directory, initializers[0]),
5783
6083
  MAX_SWIFT_COMPILE_SOURCE_BYTES
5784
6084
  ).toString("utf8");
5785
6085
  const namespaces = [
@@ -5821,12 +6121,12 @@ function registrations(root) {
5821
6121
  return { namespace, swiftModule, classes, views: viewNames(root, classes) };
5822
6122
  }
5823
6123
  function viewNames(root, classes) {
5824
- const directory = import_node_path18.default.join(root, "nitrogen/generated/shared/json");
5825
- if (!import_node_fs18.default.existsSync(directory)) return /* @__PURE__ */ new Set();
6124
+ const directory = import_node_path23.default.join(root, "nitrogen/generated/shared/json");
6125
+ if (!import_node_fs22.default.existsSync(directory)) return /* @__PURE__ */ new Set();
5826
6126
  const views = /* @__PURE__ */ new Set();
5827
- for (const file of import_node_fs18.default.readdirSync(directory)) {
6127
+ for (const file of import_node_fs22.default.readdirSync(directory)) {
5828
6128
  if (!file.endsWith("Config.json")) continue;
5829
- const config = readJson(root, import_node_path18.default.join("nitrogen/generated/shared/json", file));
6129
+ const config = readJson(root, import_node_path23.default.join("nitrogen/generated/shared/json", file));
5830
6130
  const name2 = object(config) ? config.uiViewClassName : void 0;
5831
6131
  if (typeof name2 === "string" && classes.some((entry) => entry.name === name2))
5832
6132
  views.add(name2);
@@ -5834,23 +6134,28 @@ function viewNames(root, classes) {
5834
6134
  return views;
5835
6135
  }
5836
6136
  function hasNitroIosInitializer(root) {
5837
- const generated = import_node_path18.default.join(root, "nitrogen/generated/ios");
5838
- return import_node_fs18.default.existsSync(generated) && import_node_fs18.default.readdirSync(generated).some((file) => file.endsWith("Autolinking.mm"));
6137
+ const generated = import_node_path23.default.join(root, "nitrogen/generated/ios");
6138
+ return import_node_fs22.default.existsSync(generated) && import_node_fs22.default.readdirSync(generated).some((file) => file.endsWith("Autolinking.mm"));
5839
6139
  }
5840
6140
  function nitroRegisteredNames(root) {
5841
6141
  if (!hasNitroIosInitializer(root)) return null;
5842
6142
  const { classes, views } = registrations(root);
5843
6143
  return { names: classes.map(({ name: name2 }) => name2), views: [...views].sort() };
5844
6144
  }
5845
- var import_node_fs18, import_node_path18;
6145
+ var import_node_child_process10, import_node_fs22, import_node_path23, import_node_util5, run5;
5846
6146
  var init_nitro_source = __esm({
5847
6147
  "src/nitro-source.ts"() {
5848
6148
  "use strict";
5849
6149
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
5850
- import_node_fs18 = __toESM(require("node:fs"), 1);
5851
- import_node_path18 = __toESM(require("node:path"), 1);
6150
+ import_node_child_process10 = require("node:child_process");
6151
+ import_node_fs22 = __toESM(require("node:fs"), 1);
6152
+ import_node_path23 = __toESM(require("node:path"), 1);
6153
+ import_node_util5 = require("node:util");
6154
+ init_internal_child();
6155
+ init_nitro_dependencies();
5852
6156
  init_swift_source_file();
5853
6157
  init_swift_submit();
6158
+ run5 = (0, import_node_util5.promisify)(import_node_child_process10.execFile);
5854
6159
  }
5855
6160
  });
5856
6161
 
@@ -5913,7 +6218,7 @@ function resolveAppStubs(appDir, config, configDir) {
5913
6218
  const targetDir = stubTarget ? installedPackageDir(appDir, target) : dir;
5914
6219
  const targetVersion = targetDir ? readPackageJson(targetDir)?.version : void 0;
5915
6220
  if (typeof targetVersion !== "string") continue;
5916
- if (versions !== void 0 && (0, import_version_range.resolveCompatVersionRange)([versions], targetVersion).status !== "matched") {
6221
+ if (versions !== void 0 && resolveCompatVersionRange([versions], targetVersion).status !== "matched") {
5917
6222
  skipped.push({
5918
6223
  target,
5919
6224
  provider: name2,
@@ -5970,7 +6275,7 @@ function resolveAppStubs(appDir, config, configDir) {
5970
6275
  const { modules, views, hybridObjects } = expandStubs(appDir, source);
5971
6276
  assertRegisteredHybridObjects(appDir, source, hybridObjects);
5972
6277
  for (const [name2, answer] of Object.entries(hybridObjects))
5973
- nativeHybridObjects[name2] = answer === "unsupported" ? answer : { file: (0, import_node_path19.resolve)(source.baseDir, answer) };
6278
+ nativeHybridObjects[name2] = answer === "unsupported" ? answer : { file: (0, import_node_path24.resolve)(source.baseDir, answer) };
5974
6279
  for (const [name2, stub] of Object.entries(modules))
5975
6280
  nativeModules[name2] = lowerStub(stub, source.baseDir);
5976
6281
  for (const [name2, stub] of Object.entries(views))
@@ -5982,6 +6287,7 @@ function resolveAppStubs(appDir, config, configDir) {
5982
6287
  providerVersion: source.providerVersion,
5983
6288
  modules: Object.keys(modules),
5984
6289
  views: Object.keys(views),
6290
+ hybridObjects: Object.keys(hybridObjects),
5985
6291
  ...Object.values(views).some((value) => typeof value !== "string") ? {
5986
6292
  viewSources: Object.fromEntries(
5987
6293
  Object.entries(views).filter(
@@ -6034,10 +6340,10 @@ function assertRegisteredHybridObjects(appDir, source, hybridObjects) {
6034
6340
  );
6035
6341
  }
6036
6342
  function lowerStub(stub, baseDir) {
6037
- return stub === "noop" ? stub : { file: (0, import_node_path19.resolve)(baseDir, stub) };
6343
+ return stub === "noop" ? stub : { file: (0, import_node_path24.resolve)(baseDir, stub) };
6038
6344
  }
6039
6345
  function readPackageJson(dir) {
6040
- const text2 = readSmallFile((0, import_node_path19.join)(dir, "package.json"));
6346
+ const text2 = readSmallFile((0, import_node_path24.join)(dir, "package.json"));
6041
6347
  if (!text2) return null;
6042
6348
  try {
6043
6349
  const parsed = JSON.parse(text2);
@@ -6049,9 +6355,9 @@ function readPackageJson(dir) {
6049
6355
  function installedPackageDir(appDir, name2) {
6050
6356
  let current = appDir;
6051
6357
  while (true) {
6052
- const dir = (0, import_node_path19.join)(current, "node_modules", name2);
6053
- if ((0, import_node_fs19.existsSync)((0, import_node_path19.join)(dir, "package.json"))) return (0, import_node_fs19.realpathSync)(dir);
6054
- const parent = (0, import_node_path19.dirname)(current);
6358
+ const dir = (0, import_node_path24.join)(current, "node_modules", name2);
6359
+ if ((0, import_node_fs23.existsSync)((0, import_node_path24.join)(dir, "package.json"))) return (0, import_node_fs23.realpathSync)(dir);
6360
+ const parent = (0, import_node_path24.dirname)(current);
6055
6361
  if (parent === current) return null;
6056
6362
  current = parent;
6057
6363
  }
@@ -6143,7 +6449,7 @@ function mergeRequests(previous, next) {
6143
6449
  function packageNativeRequests(dir) {
6144
6450
  const found = /* @__PURE__ */ new Map();
6145
6451
  const directories = scanRepository(dir).directories.filter((sub) => {
6146
- const segments = (0, import_node_path19.relative)(dir, sub).split("/");
6452
+ const segments = (0, import_node_path24.relative)(dir, sub).split("/");
6147
6453
  return !NATIVE_SOURCE_DIRS.has(segments[0]) && !segments.some((segment) => PACKAGE_SKIP_DIRS.has(segment));
6148
6454
  });
6149
6455
  let files = 0;
@@ -6151,14 +6457,13 @@ function packageNativeRequests(dir) {
6151
6457
  for (const name2 of listDir(sub)) {
6152
6458
  if (!SOURCE_FILE.test(name2) || name2.endsWith(".d.ts") || files >= 2e3) continue;
6153
6459
  files++;
6154
- const file = (0, import_node_path19.join)(sub, name2);
6460
+ const file = (0, import_node_path24.join)(sub, name2);
6155
6461
  const text2 = readSmallFile(file);
6156
6462
  if (!text2) continue;
6157
- for (const { line: _line, ...request } of sourceNativeRequests(file, text2, true))
6158
- found.set(
6159
- `${request.kind}:${request.name}`,
6160
- mergeRequests(found.get(`${request.kind}:${request.name}`), request)
6161
- );
6463
+ for (const { line: _line, ...request } of sourceNativeRequests(file, text2, true)) {
6464
+ const key = `${request.kind}:${request.name}:${request.androidOnly}`;
6465
+ found.set(key, mergeRequests(found.get(key), request));
6466
+ }
6162
6467
  }
6163
6468
  }
6164
6469
  return [...found.values()].sort(
@@ -6270,27 +6575,27 @@ function wireSlotMigration(appDir, configPath, wire, kept = []) {
6270
6575
  }
6271
6576
  function listDir(dir) {
6272
6577
  try {
6273
- return (0, import_node_fs19.readdirSync)(dir);
6578
+ return (0, import_node_fs23.readdirSync)(dir);
6274
6579
  } catch {
6275
6580
  return [];
6276
6581
  }
6277
6582
  }
6278
6583
  function readSmallFile(file) {
6279
6584
  try {
6280
- return (0, import_node_fs19.statSync)(file).size <= 1024 * 1024 ? (0, import_node_fs19.readFileSync)(file, "utf8") : null;
6585
+ return (0, import_node_fs23.statSync)(file).size <= 1024 * 1024 ? (0, import_node_fs23.readFileSync)(file, "utf8") : null;
6281
6586
  } catch {
6282
6587
  return null;
6283
6588
  }
6284
6589
  }
6285
6590
  function hasNativeCode(dir, platform) {
6286
- const expoConfig = (0, import_node_path19.join)(dir, "expo-module.config.json");
6591
+ const expoConfig = (0, import_node_path24.join)(dir, "expo-module.config.json");
6287
6592
  const platforms = metadataValue(readProjectJson(expoConfig), "platforms");
6288
6593
  if (Array.isArray(platforms))
6289
6594
  return platforms.includes(platform) || platform === "ios" && platforms.includes("apple");
6290
- if ([platform, "expo-module.config.json"].some((entry) => (0, import_node_fs19.existsSync)((0, import_node_path19.join)(dir, entry))))
6595
+ if ([platform, "expo-module.config.json"].some((entry) => (0, import_node_fs23.existsSync)((0, import_node_path24.join)(dir, entry))))
6291
6596
  return true;
6292
6597
  if (listDir(dir).some((name2) => name2.endsWith(".podspec"))) return true;
6293
- const manifest = readSmallFile((0, import_node_path19.join)(dir, "package.json"));
6598
+ const manifest = readSmallFile((0, import_node_path24.join)(dir, "package.json"));
6294
6599
  return manifest !== null && manifest.includes('"codegenConfig"');
6295
6600
  }
6296
6601
  function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__PURE__ */ new Set(), includeLegacy = false, providers) {
@@ -6303,7 +6608,7 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
6303
6608
  (excluded) => dir === excluded || dir.startsWith(`${excluded}/`)
6304
6609
  ))
6305
6610
  continue;
6306
- if ((0, import_node_fs19.existsSync)((0, import_node_path19.join)(dir, "expo-module.config.json"))) {
6611
+ if ((0, import_node_fs23.existsSync)((0, import_node_path24.join)(dir, "expo-module.config.json"))) {
6307
6612
  if (platform && !hasNativeCode(dir, platform)) {
6308
6613
  excludedModuleDirs.push(dir);
6309
6614
  continue;
@@ -6312,7 +6617,7 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
6312
6617
  }
6313
6618
  for (const name2 of listDir(dir)) {
6314
6619
  if (SOURCE_FILE.test(name2) && !name2.endsWith(".d.ts"))
6315
- sourceFiles.push((0, import_node_path19.join)(dir, name2));
6620
+ sourceFiles.push((0, import_node_path24.join)(dir, name2));
6316
6621
  }
6317
6622
  }
6318
6623
  }
@@ -6322,7 +6627,7 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
6322
6627
  scanRepository(dir).directories.flatMap(
6323
6628
  (sub) => listDir(sub).filter(
6324
6629
  (name2) => NATIVE_SOURCE_FILE.test(name2) && (!platform || (platform === "ios" ? name2.endsWith(".swift") : name2.endsWith(".kt")))
6325
- ).map((name2) => (0, import_node_path19.join)(sub, name2))
6630
+ ).map((name2) => (0, import_node_path24.join)(sub, name2))
6326
6631
  )
6327
6632
  ])
6328
6633
  );
@@ -6331,32 +6636,32 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
6331
6636
  const known = owners.get(dir);
6332
6637
  if (known) return known;
6333
6638
  const name2 = readPackageJson(dir)?.name;
6334
- const parent = (0, import_node_path19.dirname)(dir);
6639
+ const parent = (0, import_node_path24.dirname)(dir);
6335
6640
  const result = typeof name2 === "string" ? name2 : parent === dir ? pkg.name ?? "app" : owner(parent);
6336
6641
  owners.set(dir, result);
6337
6642
  return result;
6338
6643
  };
6339
6644
  const found = /* @__PURE__ */ new Map();
6340
- const add = (kind, name2, file, line, optional = false) => {
6645
+ const add = (kind, name2, file, line, optional = false, declaration = false) => {
6341
6646
  const key = `${kind}:${name2}`;
6342
6647
  const known = found.get(key);
6343
6648
  if (known) {
6344
- known.optional &&= optional;
6649
+ if (!declaration) known.optional &&= optional;
6345
6650
  return;
6346
6651
  }
6347
6652
  providers ??= dependencyNativeOwners(appDir, pkg);
6348
- const packageName = providers.get(key) ?? owner((0, import_node_path19.dirname)(file));
6653
+ const packageName = providers.get(key) ?? owner((0, import_node_path24.dirname)(file));
6349
6654
  if (knownPackages.has(packageName)) return;
6350
6655
  const moduleDir = expoModuleDirs.find((dir) => file.startsWith(`${dir}/`)) ?? null;
6351
6656
  found.set(key, {
6352
6657
  kind,
6353
6658
  name: name2,
6354
6659
  package: packageName,
6355
- path: `${(0, import_node_path19.relative)(appDir, file)}:${line}`,
6356
- expoModule: moduleDir ? (0, import_node_path19.relative)(appDir, moduleDir) || "." : null,
6660
+ path: `${(0, import_node_path24.relative)(appDir, file)}:${line}`,
6661
+ expoModule: moduleDir ? (0, import_node_path24.relative)(appDir, moduleDir) || "." : null,
6357
6662
  optional,
6358
6663
  swift: moduleDir ? (nativeFilesByModule.get(moduleDir) ?? []).some(
6359
- (path22) => path22.endsWith(".swift") && [...(readSmallFile(path22) ?? "").matchAll(/\bName\(\s*"(\w+)"\s*\)/g)].some(
6664
+ (path26) => path26.endsWith(".swift") && [...(readSmallFile(path26) ?? "").matchAll(/\bName\(\s*"(\w+)"\s*\)/g)].some(
6360
6665
  (match) => match[1] === name2
6361
6666
  )
6362
6667
  ) : false,
@@ -6384,7 +6689,14 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
6384
6689
  if (!text2) continue;
6385
6690
  for (const match of text2.matchAll(/\bName\(\s*"(\w+)"\s*\)/g)) {
6386
6691
  if (match[1])
6387
- add("module", match[1], file, text2.slice(0, match.index).split("\n").length);
6692
+ add(
6693
+ "module",
6694
+ match[1],
6695
+ file,
6696
+ text2.slice(0, match.index).split("\n").length,
6697
+ false,
6698
+ true
6699
+ );
6388
6700
  }
6389
6701
  }
6390
6702
  }
@@ -6397,31 +6709,31 @@ function workspacePackageDirs(appDir, pkg) {
6397
6709
  for (const name2 of Object.keys({ ...pkg.dependencies, ...pkg.devDependencies })) {
6398
6710
  let current = appDir;
6399
6711
  while (true) {
6400
- const link = (0, import_node_path19.join)(current, "node_modules", name2);
6401
- if ((0, import_node_fs19.existsSync)(link)) {
6402
- if ((0, import_node_fs19.lstatSync)(link).isSymbolicLink()) {
6403
- const target = (0, import_node_fs19.realpathSync)(link);
6712
+ const link = (0, import_node_path24.join)(current, "node_modules", name2);
6713
+ if ((0, import_node_fs23.existsSync)(link)) {
6714
+ if ((0, import_node_fs23.lstatSync)(link).isSymbolicLink()) {
6715
+ const target = (0, import_node_fs23.realpathSync)(link);
6404
6716
  if (!target.split("/").includes("node_modules") && !target.startsWith(`${appDir}/`)) {
6405
6717
  dirs.add(target);
6406
6718
  }
6407
6719
  }
6408
6720
  break;
6409
6721
  }
6410
- const parent = (0, import_node_path19.dirname)(current);
6722
+ const parent = (0, import_node_path24.dirname)(current);
6411
6723
  if (parent === current) break;
6412
6724
  current = parent;
6413
6725
  }
6414
6726
  }
6415
6727
  return [...dirs];
6416
6728
  }
6417
- var import_node_fs19, import_node_path19, import_version_range, import_oxc_parser2, import_sucrase, SOURCE_FILE, NATIVE_LOOKUP, NATIVE_SOURCE_DIRS, PACKAGE_SKIP_DIRS, NATIVE_SOURCE_FILE;
6729
+ var import_node_fs23, import_node_path24, import_oxc_parser2, import_sucrase, SOURCE_FILE, NATIVE_LOOKUP, NATIVE_SOURCE_DIRS, PACKAGE_SKIP_DIRS, NATIVE_SOURCE_FILE;
6418
6730
  var init_app_stubs = __esm({
6419
6731
  "cli/app-stubs.ts"() {
6420
6732
  "use strict";
6421
6733
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
6422
- import_node_fs19 = require("node:fs");
6423
- import_node_path19 = require("node:path");
6424
- import_version_range = require("@peach/compat/version-range");
6734
+ import_node_fs23 = require("node:fs");
6735
+ import_node_path24 = require("node:path");
6736
+ init_version_range();
6425
6737
  import_oxc_parser2 = require("oxc-parser");
6426
6738
  import_sucrase = require("sucrase");
6427
6739
  init_config();
@@ -6456,12 +6768,12 @@ function resolveFileEntries(entries, configDir) {
6456
6768
  return Object.fromEntries(
6457
6769
  Object.entries(entries).map(([name2, resolution]) => [
6458
6770
  name2,
6459
- resolution && typeof resolution === "object" && "file" in resolution && typeof resolution.file === "string" ? { ...resolution, file: import_node_path20.default.resolve(configDir, resolution.file) } : resolution
6771
+ resolution && typeof resolution === "object" && "file" in resolution && typeof resolution.file === "string" ? { ...resolution, file: import_node_path25.default.resolve(configDir, resolution.file) } : resolution
6460
6772
  ])
6461
6773
  );
6462
6774
  }
6463
6775
  function resolveConfigReplacementFiles(config, configPath) {
6464
- const configDir = import_node_path20.default.dirname(configPath);
6776
+ const configDir = import_node_path25.default.dirname(configPath);
6465
6777
  return {
6466
6778
  ...config,
6467
6779
  modules: resolveFileEntries(config.modules, configDir)
@@ -6477,7 +6789,7 @@ async function loadRNXAppStubs(project) {
6477
6789
  return resolveAppStubs(
6478
6790
  project.appDir,
6479
6791
  config,
6480
- project.configPath ? import_node_path20.default.dirname(project.configPath) : project.appDir
6792
+ project.configPath ? import_node_path25.default.dirname(project.configPath) : project.appDir
6481
6793
  );
6482
6794
  } catch (error) {
6483
6795
  const message = error instanceof Error ? error.message : String(error);
@@ -6496,7 +6808,7 @@ async function loadConfigFile(project) {
6496
6808
  [`${rnxPublicBrand.packageName}/config`]: config_exports
6497
6809
  }
6498
6810
  });
6499
- const loaded3 = project.configPath.endsWith(".json") ? JSON.parse((0, import_node_fs20.readFileSync)(project.configPath, "utf8")) : await jiti.import(project.configPath, { default: true });
6811
+ const loaded3 = project.configPath.endsWith(".json") ? JSON.parse((0, import_node_fs24.readFileSync)(project.configPath, "utf8")) : await jiti.import(project.configPath, { default: true });
6500
6812
  if (!isPeachConfig(loaded3)) {
6501
6813
  throw new Error("the default export must be a peach config object");
6502
6814
  }
@@ -6532,13 +6844,13 @@ async function resolveRNXAppConfig(startDir = process.cwd()) {
6532
6844
  const project = resolveAppProject(startDir);
6533
6845
  return { project, ...await loadRNXAppStubs(project) };
6534
6846
  }
6535
- var import_node_fs20, import_node_path20, import_jiti, WIRE_SLOTS;
6847
+ var import_node_fs24, import_node_path25, import_jiti, WIRE_SLOTS;
6536
6848
  var init_app_config = __esm({
6537
6849
  "cli/app-config.ts"() {
6538
6850
  "use strict";
6539
6851
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
6540
- import_node_fs20 = require("node:fs");
6541
- import_node_path20 = __toESM(require("node:path"), 1);
6852
+ import_node_fs24 = require("node:fs");
6853
+ import_node_path25 = __toESM(require("node:path"), 1);
6542
6854
  import_jiti = require("jiti");
6543
6855
  init_config();
6544
6856
  init_config();
@@ -6635,14 +6947,14 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
6635
6947
  const neededPackages = /* @__PURE__ */ new Set();
6636
6948
  const factories = [];
6637
6949
  const visit3 = (filePath) => {
6638
- const real = import_node_fs21.default.realpathSync(filePath);
6950
+ const real = import_node_fs25.default.realpathSync(filePath);
6639
6951
  const previous = files.get(real);
6640
6952
  if (previous !== void 0) return previous;
6641
6953
  const id = "peach-config-file:" + files.size;
6642
6954
  files.set(real, id);
6643
6955
  const compiled = compileReplacementModule({
6644
6956
  filePath: real,
6645
- source: import_node_fs21.default.readFileSync(real, "utf8"),
6957
+ source: import_node_fs25.default.readFileSync(real, "utf8"),
6646
6958
  runtimePackages,
6647
6959
  localModuleUrl: (specifier) => visit3(resolveReplacementModuleFile(real, specifier))
6648
6960
  });
@@ -6666,7 +6978,7 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
6666
6978
  if (!entries || typeof entries !== "object") continue;
6667
6979
  for (const resolution of Object.values(entries)) {
6668
6980
  if (resolution && typeof resolution === "object" && "file" in resolution && typeof resolution.file === "string") {
6669
- resolution.file = visit3(import_node_path21.default.resolve(resolution.file));
6981
+ resolution.file = visit3(import_node_path26.default.resolve(resolution.file));
6670
6982
  }
6671
6983
  }
6672
6984
  }
@@ -6690,13 +7002,13 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
6690
7002
  const identityStart = findBundleFooter(source, "globalThis.__sootsimModulePaths=");
6691
7003
  return prefix2 + (identityStart < 0 ? source + footer : source.slice(0, identityStart) + footer + source.slice(identityStart));
6692
7004
  }
6693
- var import_node_fs21, import_node_path21, import_sucrase2, import_terser;
7005
+ var import_node_fs25, import_node_path26, import_sucrase2, import_terser;
6694
7006
  var init_configured_bundle_producer = __esm({
6695
7007
  "src/configured-bundle-producer.ts"() {
6696
7008
  "use strict";
6697
7009
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
6698
- import_node_fs21 = __toESM(require("node:fs"), 1);
6699
- import_node_path21 = __toESM(require("node:path"), 1);
7010
+ import_node_fs25 = __toESM(require("node:fs"), 1);
7011
+ import_node_path26 = __toESM(require("node:path"), 1);
6700
7012
  import_sucrase2 = require("sucrase");
6701
7013
  import_terser = require("terser");
6702
7014
  init_dependencies();
@@ -6757,11 +7069,25 @@ function insertAndroidAutolinkingFooter(source, packages) {
6757
7069
  return insertBundleGlobalFooter(source, FOOTER, readAndroidAutolinkedPackages(packages));
6758
7070
  }
6759
7071
 
7072
+ // src/androidRootModuleContract.ts
7073
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
7074
+ init_bundleGlobalFooter();
7075
+ var FOOTER2 = "__peachAndroidRootModule";
7076
+ function readAndroidRootModuleName(value) {
7077
+ if (typeof value !== "string" || value.length === 0)
7078
+ throw new Error("invalid Android root module name");
7079
+ return value;
7080
+ }
7081
+ function insertAndroidRootModuleFooter(source, name2) {
7082
+ return insertBundleGlobalFooter(source, FOOTER2, readAndroidRootModuleName(name2));
7083
+ }
7084
+
6760
7085
  // src/packageVersionsContract.ts
6761
7086
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
6762
7087
  init_bundleGlobalFooter();
7088
+ var NATIVE_BUILD_OPTIONS_KEY = "@peach/native-build-options";
6763
7089
  var PACKAGE_VERSIONS_HEADER = "X-Peach-Package-Versions";
6764
- var FOOTER2 = "__peachPackageVersions";
7090
+ var FOOTER3 = "__peachPackageVersions";
6765
7091
  function readPackageVersions(value) {
6766
7092
  if (typeof value !== "object" || value === null || Array.isArray(value)) {
6767
7093
  throw new Error("invalid package versions");
@@ -6776,7 +7102,7 @@ function readPackageVersions(value) {
6776
7102
  return versions;
6777
7103
  }
6778
7104
  function insertPackageVersionsFooter(source, versions) {
6779
- return insertBundleGlobalFooter(source, FOOTER2, readPackageVersions(versions));
7105
+ return insertBundleGlobalFooter(source, FOOTER3, readPackageVersions(versions));
6780
7106
  }
6781
7107
  var WORKLETS_STATIC_FLAGS_KEY = "react-native-worklets/staticFlags.json";
6782
7108
  function isFlagRecord(value) {
@@ -7521,7 +7847,6 @@ function writeSecureJsonAtomic(filepath, value) {
7521
7847
  // cli/current-sim.ts
7522
7848
  var CURRENT_SIM_VERSION = 2;
7523
7849
  var CURRENT_SIM_PATH_ENV = "PEACH_CLI_CURRENT_SIM_PATH";
7524
- var LEGACY_CURRENT_SIM_PATH_ENV = "SOOTSIM_CLI_CURRENT_SIM_PATH";
7525
7850
  var IDENTITY_ENV_VARS = [
7526
7851
  "PEACH_CLI_IDENTITY",
7527
7852
  // explicit override — fastest path, skips all pid lookups
@@ -7599,7 +7924,7 @@ function getOwnerProcessGroupId(owner = getStableOwnerPid()) {
7599
7924
  return pgid !== null && pgid > 1 ? pgid : null;
7600
7925
  }
7601
7926
  function getCurrentSimPath() {
7602
- const envPath = process.env[CURRENT_SIM_PATH_ENV] || process.env[LEGACY_CURRENT_SIM_PATH_ENV];
7927
+ const envPath = process.env[CURRENT_SIM_PATH_ENV];
7603
7928
  if (envPath) {
7604
7929
  return (0, import_path2.resolve)(envPath);
7605
7930
  }
@@ -7661,9 +7986,11 @@ function writeCurrentSim(simId, bridgePort) {
7661
7986
  function saveCurrentSimId(simId, bridgePort) {
7662
7987
  writeCurrentSim(simId, bridgePort);
7663
7988
  }
7989
+ var PendingOpenError = class extends Error {
7990
+ };
7664
7991
  function assertNoPendingOpen() {
7665
7992
  if (!isOpenPending()) return;
7666
- throw new Error(
7993
+ throw new PendingOpenError(
7667
7994
  "the last `peach open` did not pin a sim, so this command would land on whichever tab is connected. run `peach open` again, `peach use <sim>`, or pass --sim <id>"
7668
7995
  );
7669
7996
  }
@@ -7968,6 +8295,27 @@ function printBridgeWorldNotice(bridgePort, shellBaseUrl) {
7968
8295
  `
7969
8296
  );
7970
8297
  }
8298
+ var refusedBridges = /* @__PURE__ */ new WeakSet();
8299
+ function trackRefusals(bridge) {
8300
+ const noting = async (run6) => {
8301
+ try {
8302
+ return await run6();
8303
+ } catch (error) {
8304
+ if (error instanceof BridgeSimLockedError || error instanceof PendingOpenError) {
8305
+ refusedBridges.add(tracked);
8306
+ }
8307
+ throw error;
8308
+ }
8309
+ };
8310
+ const tracked = {
8311
+ ...bridge,
8312
+ send: (cmd, callOpts) => noting(() => bridge.send(cmd, callOpts)),
8313
+ closeSim: (id, closeOpts) => noting(() => bridge.closeSim(id, closeOpts)),
8314
+ claim: (id, claimOpts) => noting(() => bridge.claim(id, claimOpts)),
8315
+ focusSim: (id) => noting(() => bridge.focusSim(id))
8316
+ };
8317
+ return tracked;
8318
+ }
7971
8319
  var BridgeSimLockedError = class extends Error {
7972
8320
  lock;
7973
8321
  constructor(message, lock) {
@@ -8119,8 +8467,7 @@ function createBridge(wsPort, opts = {}) {
8119
8467
  }
8120
8468
  function maybeNoticeTarget(cmdType, simId) {
8121
8469
  if (noticedTarget) return;
8122
- if (process.env.PEACH_QUIET_TARGET_NOTICE === "1" || process.env.SOOTSIM_QUIET_TARGET_NOTICE === "1")
8123
- return;
8470
+ if (process.env.PEACH_QUIET_TARGET_NOTICE === "1") return;
8124
8471
  if (cmdType.startsWith("bridge:") || cmdType === "focus" || cmdType === "close")
8125
8472
  return;
8126
8473
  noticedTarget = true;
@@ -8277,8 +8624,8 @@ function createBridge(wsPort, opts = {}) {
8277
8624
  async focusSim(simId) {
8278
8625
  return this.send({ type: "focus", simId });
8279
8626
  },
8280
- async closeSim(simId) {
8281
- return this.send({ type: "close", simId });
8627
+ async closeSim(simId, closeOpts = {}) {
8628
+ return this.send({ type: "close", simId, force: closeOpts.force === true });
8282
8629
  },
8283
8630
  async claim(simId, claimOpts = {}) {
8284
8631
  const result = await this.send({
@@ -8315,7 +8662,7 @@ function createBridgeFromParsed(parsed) {
8315
8662
  simIdSource: parsed.simIdSource
8316
8663
  };
8317
8664
  if (parsed.explicitPort || !parsed.simId || parsed.simIdSource !== "flag") {
8318
- return createBridge(parsed.wsPort, options);
8665
+ return trackRefusals(createBridge(parsed.wsPort, options));
8319
8666
  }
8320
8667
  let selected;
8321
8668
  let closed = false;
@@ -8328,7 +8675,7 @@ function createBridgeFromParsed(parsed) {
8328
8675
  });
8329
8676
  return selected;
8330
8677
  };
8331
- return {
8678
+ return trackRefusals({
8332
8679
  plane: "local",
8333
8680
  async send(cmd, opts) {
8334
8681
  return (await getBridge()).send(cmd, opts);
@@ -8342,8 +8689,8 @@ function createBridgeFromParsed(parsed) {
8342
8689
  async focusSim(id) {
8343
8690
  return (await getBridge()).focusSim(id);
8344
8691
  },
8345
- async closeSim(id) {
8346
- return (await getBridge()).closeSim(id);
8692
+ async closeSim(id, closeOpts) {
8693
+ return (await getBridge()).closeSim(id, closeOpts);
8347
8694
  },
8348
8695
  async claim(id, opts) {
8349
8696
  return (await getBridge()).claim(id, opts);
@@ -8356,7 +8703,7 @@ function createBridgeFromParsed(parsed) {
8356
8703
  }
8357
8704
  );
8358
8705
  }
8359
- };
8706
+ });
8360
8707
  }
8361
8708
  function formatRetainedSimLoss(port, sim) {
8362
8709
  const when = typeof sim.disconnectedAt === "number" ? ` until ${new Date(sim.disconnectedAt).toISOString()}` : "";
@@ -9017,6 +9364,41 @@ async function inspectFind(bridge, q) {
9017
9364
  const resultValue = resolved.mode === "testid" || resolved.mode === "text" ? nodes[0] ?? null : nodes;
9018
9365
  return { mode: resolved.mode, result: resultValue };
9019
9366
  }
9367
+ var WAIT_READY_STALL_MS = 6e4;
9368
+ var WAIT_READY_CAP_MS = 6e5;
9369
+ var WAIT_READY_PROGRESS_INTERVAL_MS = 5e3;
9370
+ function waitReadyPhase(status) {
9371
+ const loading = `${status.loadingText} ${status.externalStatus}`.toLowerCase();
9372
+ const startup = status.startup ?? "";
9373
+ if (status.bundlePercent != null || /response=(pending|not-started)/.test(startup) || /body=(pending|not-started)/.test(startup) || /building bundle|loading native bundle|fetching bundle|fetching app code|preparing peach runtime/.test(
9374
+ loading
9375
+ )) {
9376
+ return "bundle";
9377
+ }
9378
+ if (/phase=(fetched|stubs-start|stub-registry-start|stubs|inject|executed)/.test(
9379
+ startup
9380
+ ) || /loading peach stubs|loading bundle loader|loading native stubs|loading compat bridge|loading react-native shim|loading react bridge|loading reconciler|loading replacement modules|injecting peach modules|warming sqlite|capturing root/.test(
9381
+ loading
9382
+ )) {
9383
+ return "evaluation";
9384
+ }
9385
+ return "first-paint";
9386
+ }
9387
+ function waitReadyProgressKey(status) {
9388
+ return [
9389
+ status.startup ?? "",
9390
+ status.loadingText,
9391
+ status.externalStatus,
9392
+ status.bundlePercent ?? "",
9393
+ status.nodes,
9394
+ status.targets,
9395
+ status.paintedAppContent ? 1 : 0,
9396
+ status.flag === true ? 1 : 0,
9397
+ status.externalReady === true ? 1 : 0,
9398
+ status.liveFramePublishes,
9399
+ status.browserSurfaceCount
9400
+ ].join("|");
9401
+ }
9020
9402
  function waitReadyReason(status) {
9021
9403
  if (status.bridgeError) {
9022
9404
  if (status.bridgeError.includes(HEADLESS_TENANT_FETCH_HUNG_MARKER)) {
@@ -9026,13 +9408,73 @@ function waitReadyReason(status) {
9026
9408
  }
9027
9409
  const waitingOnGuestFetch = status.externalReady === false && /https?:\/\//.test(status.externalStatus);
9028
9410
  const base = status.externalError ? `guest app errored: ${status.externalError}` : waitingOnGuestFetch ? `waiting on a guest fetch: ${status.externalStatus}` : status.loadingText ? `still showing "${status.loadingText}"` : status.externalReady === false ? "guest app is still loading" : status.flag !== true && status.targets > 0 ? "native content is rendered but the ready signal has not settled" : status.flag !== true ? "guest app has not emitted sootsim:externalAppReady" : status.targets <= 0 && !status.paintedAppContent ? "ready flag emitted but no visible app content is inspectable yet" : "node tree is still changing";
9029
- return !status.externalError && status.suppressedEntryError ? `${base} (suppressed entry error: ${status.suppressedEntryError})` : base;
9411
+ const diagnosed = !status.externalError && status.suppressedEntryError ? `${base} (suppressed entry error: ${status.suppressedEntryError})` : base;
9412
+ const phase = status.phase ?? waitReadyPhase(status);
9413
+ if (status.progressCapped) {
9414
+ return `${phase} still in progress after ${status.elapsedMs}ms: ${diagnosed}`;
9415
+ }
9416
+ if (status.progressStalledMs != null) {
9417
+ return `${phase} stalled for ${status.progressStalledMs}ms: ${diagnosed}`;
9418
+ }
9419
+ return `${phase}: ${diagnosed}`;
9420
+ }
9421
+ async function inspectWaitReady(bridge, timeoutMs, options = {}) {
9422
+ if (timeoutMs != null) {
9423
+ const result = await sendReadyWait(bridge, timeoutMs, options.simId);
9424
+ const status = waitReadyFromResult(result);
9425
+ if (!status.ready && options.onProgress) options.onProgress(status);
9426
+ return status;
9427
+ }
9428
+ const now = options.now ?? Date.now;
9429
+ const stallMs = options.stallMs ?? WAIT_READY_STALL_MS;
9430
+ const capMs = options.capMs ?? WAIT_READY_CAP_MS;
9431
+ const intervalMs = options.progressIntervalMs ?? WAIT_READY_PROGRESS_INTERVAL_MS;
9432
+ const start = now();
9433
+ let lastKey = "";
9434
+ let lastProgressAt = start;
9435
+ let lastStatus;
9436
+ for (; ; ) {
9437
+ const elapsed = now() - start;
9438
+ if (lastStatus) {
9439
+ const stalledFor = now() - lastProgressAt;
9440
+ if (stalledFor >= stallMs) {
9441
+ return { ...lastStatus, elapsedMs: elapsed, progressStalledMs: stalledFor };
9442
+ }
9443
+ if (elapsed >= capMs) {
9444
+ return { ...lastStatus, elapsedMs: elapsed, progressCapped: true };
9445
+ }
9446
+ }
9447
+ const remainingCap = Math.max(0, capMs - elapsed);
9448
+ const remainingStall = Math.max(0, stallMs - (now() - lastProgressAt));
9449
+ const slice = Math.min(
9450
+ SEMANTIC_WAIT_MAX_TIMEOUT_MS,
9451
+ intervalMs,
9452
+ remainingCap,
9453
+ lastStatus ? remainingStall : remainingCap
9454
+ );
9455
+ if (lastStatus && slice <= 0) {
9456
+ const stalledFor = now() - lastProgressAt;
9457
+ return {
9458
+ ...lastStatus,
9459
+ elapsedMs: elapsed,
9460
+ ...stalledFor >= stallMs ? { progressStalledMs: stalledFor } : { progressCapped: true }
9461
+ };
9462
+ }
9463
+ const result = await sendReadyWait(bridge, slice, options.simId);
9464
+ const status = waitReadyFromResult(result);
9465
+ status.elapsedMs = now() - start;
9466
+ lastStatus = status;
9467
+ if (status.ready || status.externalError || status.bridgeError) return status;
9468
+ const key = waitReadyProgressKey(status);
9469
+ if (key !== lastKey) {
9470
+ lastKey = key;
9471
+ lastProgressAt = now();
9472
+ }
9473
+ options.onProgress?.(status);
9474
+ }
9030
9475
  }
9031
- async function inspectWaitReady(bridge, timeoutMs = 2e4, options = {}) {
9032
- const result = await sendReadyWait(bridge, timeoutMs, options.simId);
9033
- const status = waitReadyStatus(result, result.matched && !result.probe?.externalError);
9034
- if (!status.ready && options.onProgress) options.onProgress(status);
9035
- return status;
9476
+ function waitReadyFromResult(result) {
9477
+ return waitReadyStatus(result, result.matched && !result.probe?.externalError);
9036
9478
  }
9037
9479
  async function sendSemanticWait(bridge, condition, timeoutMs, simId, transportMs = 1e3) {
9038
9480
  const start = Date.now();
@@ -9116,7 +9558,14 @@ function waitReadyStatus(result, ready) {
9116
9558
  bridgeError: result.error ?? "",
9117
9559
  paintedAppContent: probe?.paintedAppContent ?? false,
9118
9560
  treeQuietMs: probe?.treeQuietMs ?? 0,
9119
- readyBasis: probe ? readyProbeContentBasis(probe) : ""
9561
+ readyBasis: probe ? readyProbeContentBasis(probe) : "",
9562
+ bundlePercent: probe?.bundlePercent ?? null,
9563
+ phase: waitReadyPhase({
9564
+ startup: probe?.startup,
9565
+ loadingText: probe?.loadingText ?? "",
9566
+ externalStatus: probe?.externalStatus ?? "",
9567
+ bundlePercent: probe?.bundlePercent ?? null
9568
+ })
9120
9569
  };
9121
9570
  }
9122
9571
  function consoleEntriesEval(level, limit) {
@@ -10574,7 +11023,7 @@ var SimClient = class {
10574
11023
  * throws SimReadyTimeoutError (with the last probe status) on timeout.
10575
11024
  */
10576
11025
  async waitReady(opts = {}) {
10577
- const status = await inspectWaitReady(this, opts.timeoutMs ?? 2e4, {
11026
+ const status = await inspectWaitReady(this, opts.timeoutMs, {
10578
11027
  onProgress: opts.onProgress
10579
11028
  });
10580
11029
  if (!status.ready) throw new SimReadyTimeoutError(status);
@@ -10951,10 +11400,10 @@ function selectRnxRasterNodeIds(tree) {
10951
11400
  const visibleFrame = liveVideo ? rasterLayerFrame(node) : node.visibleFrame ?? node.frame;
10952
11401
  if (!visibleFrame || visibleFrame.width <= 0 || visibleFrame.height <= 0) continue;
10953
11402
  const glass = node.style._liquidGlass !== void 0 || node.style._liquidGlassEdge !== void 0 || node.style._liquidGlassMaterialTint !== void 0;
10954
- const unsupported = node.type === "masked-view" || liveVideo || node.type === "text" && typeof node.text === "string" && (new RegExp("\\p{Emoji_Presentation}", "u").test(node.text) || new RegExp("\\uFE0F|\\u200D|\\u20E3|\\p{Emoji_Modifier}|\\p{Regional_Indicator}", "u").test(
11403
+ const unsupported2 = node.type === "masked-view" || liveVideo || node.type === "text" && typeof node.text === "string" && (new RegExp("\\p{Emoji_Presentation}", "u").test(node.text) || new RegExp("\\uFE0F|\\u200D|\\u20E3|\\p{Emoji_Modifier}|\\p{Regional_Indicator}", "u").test(
10955
11404
  node.text
10956
11405
  )) || glass;
10957
- if (!unsupported) continue;
11406
+ if (!unsupported2) continue;
10958
11407
  const captured = rasterLayerFrame(node);
10959
11408
  const area = captured.width * captured.height;
10960
11409
  if (liveVideo || area <= maxLayerArea) {
@@ -11264,7 +11713,7 @@ var import_fs6 = __toESM(require("fs"), 1);
11264
11713
  var import_node_crypto6 = require("node:crypto");
11265
11714
  var import_node_http3 = __toESM(require("node:http"), 1);
11266
11715
  var import_node_https2 = __toESM(require("node:https"), 1);
11267
- var import_node_url = require("node:url");
11716
+ var import_node_url2 = require("node:url");
11268
11717
  var import_path5 = __toESM(require("path"), 1);
11269
11718
  var import_promises5 = require("stream/promises");
11270
11719
  var import_ws2 = require("ws");
@@ -11449,7 +11898,6 @@ var LAZY_STUB_PATTERNS = [
11449
11898
  "react-native-advanced-input-mask",
11450
11899
  "react-native-agora",
11451
11900
  "react-native-android-location-enabler",
11452
- "react-native-android-widget",
11453
11901
  "react-native-animateable-text",
11454
11902
  "react-native-app-clip",
11455
11903
  "react-native-appsflyer",
@@ -11589,7 +12037,6 @@ var LIGHT_NATIVE_PACKAGE_NAMES = [
11589
12037
  "@allboatsrise/expo-marketingcloudsdk",
11590
12038
  "@ammarahmed/react-native-eventsource",
11591
12039
  "@ammarahmed/react-native-share-extension",
11592
- "@ammarahmed/react-native-sodium",
11593
12040
  "@ammarahmed/react-native-upload",
11594
12041
  "@amplitude/analytics-react-native",
11595
12042
  "@amplitude/experiment-react-native-client",
@@ -11945,7 +12392,6 @@ var LIGHT_NATIVE_PACKAGE_NAMES = [
11945
12392
  "expo-ai-kit",
11946
12393
  "expo-app-blocker",
11947
12394
  "expo-audio-stream-pcm",
11948
- "expo-barcode-scanner",
11949
12395
  "expo-brownfield",
11950
12396
  "expo-check-installed-apps",
11951
12397
  "expo-esim",
@@ -12160,6 +12606,7 @@ var LIGHT_NATIVE_PACKAGE_NAMES = [
12160
12606
  "react-native-kochava-tracker",
12161
12607
  "react-native-launch-navigator",
12162
12608
  "react-native-layout-guides",
12609
+ "react-native-live-audio-stream",
12163
12610
  "react-native-local-resource",
12164
12611
  "react-native-marigold",
12165
12612
  "react-native-marketingcloudsdk",
@@ -13332,6 +13779,7 @@ var NATIVE_RUNTIME_PACKAGE_NAMES = [
13332
13779
  ...NATIVE_STUB_PACKAGE_NAMES,
13333
13780
  ...LIGHT_NATIVE_PACKAGE_NAMES,
13334
13781
  "@ammarahmed/react-native-background-fetch",
13782
+ "@ammarahmed/react-native-sodium",
13335
13783
  "@bsky.app/react-native-uitextview",
13336
13784
  "@bsky.app/video",
13337
13785
  "@datadog/mobile-react-native-webview",
@@ -14205,6 +14653,120 @@ var COMPAT_STUBS = {
14205
14653
  }
14206
14654
  };
14207
14655
 
14656
+ // src/installed-native-build-options.ts
14657
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
14658
+ var import_node_fs9 = __toESM(require("node:fs"), 1);
14659
+ var import_node_path8 = __toESM(require("node:path"), 1);
14660
+ init_version_range();
14661
+ var RIVE_PACKAGE = "@rive-app/react-native";
14662
+ var RIVE_05 = [">=0.5.0 <0.6.0"];
14663
+ function missing(error) {
14664
+ return error instanceof Error && "code" in error && error.code === "ENOENT";
14665
+ }
14666
+ function answerSync(step) {
14667
+ try {
14668
+ if (step.type === "realpath") return import_node_fs9.default.realpathSync(step.path);
14669
+ if (step.type === "read") return import_node_fs9.default.readFileSync(step.path, "utf8");
14670
+ if (step.type === "isDirectory") return import_node_fs9.default.statSync(step.path).isDirectory();
14671
+ return import_node_fs9.default.readdirSync(step.path, { withFileTypes: true }).map((entry) => ({
14672
+ name: entry.name,
14673
+ directory: entry.isDirectory(),
14674
+ symbolicLink: entry.isSymbolicLink()
14675
+ }));
14676
+ } catch (error) {
14677
+ if (missing(error)) return null;
14678
+ throw error;
14679
+ }
14680
+ }
14681
+ async function answerAsync(step) {
14682
+ try {
14683
+ if (step.type === "realpath") return await import_node_fs9.default.promises.realpath(step.path);
14684
+ if (step.type === "read") return await import_node_fs9.default.promises.readFile(step.path, "utf8");
14685
+ if (step.type === "isDirectory")
14686
+ return (await import_node_fs9.default.promises.stat(step.path)).isDirectory();
14687
+ return (await import_node_fs9.default.promises.readdir(step.path, { withFileTypes: true })).map(
14688
+ (entry) => ({
14689
+ name: entry.name,
14690
+ directory: entry.isDirectory(),
14691
+ symbolicLink: entry.isSymbolicLink()
14692
+ })
14693
+ );
14694
+ } catch (error) {
14695
+ if (missing(error)) return null;
14696
+ throw error;
14697
+ }
14698
+ }
14699
+ function needsRiveOptions(versions) {
14700
+ const version = versions[RIVE_PACKAGE];
14701
+ return version !== void 0 && resolveCompatVersionRange(RIVE_05, version).status === "matched";
14702
+ }
14703
+ function unsupported(file, line) {
14704
+ throw new Error(
14705
+ `${file}:${line}: unsupported $UseRiveLegacy; use one column-0 literal assignment in ios/Podfile`
14706
+ );
14707
+ }
14708
+ function* rubyFiles(directory, seen, iosRoot = false) {
14709
+ const real = yield { type: "realpath", path: directory };
14710
+ if (real === null) return [];
14711
+ if (typeof real !== "string") throw new Error(`cannot inspect ${directory}`);
14712
+ if (seen.has(real)) return [];
14713
+ seen.add(real);
14714
+ const entries = yield { type: "directory", path: directory };
14715
+ if (entries === null) return [];
14716
+ if (!Array.isArray(entries)) throw new Error(`cannot inspect ${directory}`);
14717
+ const files = [];
14718
+ for (const entry of entries.sort((a, b) => a.name.localeCompare(b.name))) {
14719
+ if (iosRoot && (entry.name === "Pods" || entry.name === "build")) continue;
14720
+ const target = import_node_path8.default.join(directory, entry.name);
14721
+ let isDirectory2 = entry.directory;
14722
+ if (entry.symbolicLink)
14723
+ isDirectory2 = (yield { type: "isDirectory", path: target }) === true;
14724
+ if (isDirectory2) files.push(...yield* rubyFiles(target, seen));
14725
+ else if (entry.name.endsWith(".rb")) files.push(target);
14726
+ }
14727
+ return files;
14728
+ }
14729
+ function* nativeBuildOptionsWalk(projectRoot, versions, environment) {
14730
+ if (!needsRiveOptions(versions)) return {};
14731
+ if (environment.USE_RIVE_LEGACY === "1" || environment.USE_RIVE_LEGACY === "true")
14732
+ return { [RIVE_PACKAGE]: { USE_RIVE_LEGACY: true } };
14733
+ const ios = import_node_path8.default.join(projectRoot, "ios");
14734
+ const podfile = import_node_path8.default.join(ios, "Podfile");
14735
+ const files = [podfile, ...yield* rubyFiles(ios, /* @__PURE__ */ new Set(), true)];
14736
+ let value = false;
14737
+ let assigned = false;
14738
+ for (const file of files) {
14739
+ const source = yield { type: "read", path: file };
14740
+ if (source === null) continue;
14741
+ if (typeof source !== "string") throw new Error(`cannot inspect ${file}`);
14742
+ const lines = source.split(/\r?\n/);
14743
+ for (const [index, line] of lines.entries()) {
14744
+ const occurrences = [...line.matchAll(/\$UseRiveLegacy\b/g)];
14745
+ if (!occurrences.length) continue;
14746
+ const literal = /^\$UseRiveLegacy = (true|false)\s*(?:#.*)?$/.exec(line);
14747
+ if (file !== podfile || occurrences.length !== 1 || !literal || assigned)
14748
+ unsupported(file, index + 1);
14749
+ assigned = true;
14750
+ value = literal[1] === "true";
14751
+ }
14752
+ }
14753
+ return { [RIVE_PACKAGE]: { USE_RIVE_LEGACY: value } };
14754
+ }
14755
+ function readInstalledNativeBuildOptions(projectRoot, versions, environment = process.env) {
14756
+ const walk = nativeBuildOptionsWalk(projectRoot, versions, environment);
14757
+ for (let step = walk.next(); ; ) {
14758
+ if (step.done) return step.value;
14759
+ step = walk.next(answerSync(step.value));
14760
+ }
14761
+ }
14762
+ async function readInstalledNativeBuildOptionsAsync(projectRoot, versions, environment = process.env) {
14763
+ const walk = nativeBuildOptionsWalk(projectRoot, versions, environment);
14764
+ for (let step = walk.next(); ; ) {
14765
+ if (step.done) return step.value;
14766
+ step = walk.next(await answerAsync(step.value));
14767
+ }
14768
+ }
14769
+
14208
14770
  // src/stub-pattern-matcher.ts
14209
14771
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
14210
14772
  function extractPackageFromPath(modulePath) {
@@ -14247,7 +14809,7 @@ function parseManifest(source) {
14247
14809
  function isMissing(error) {
14248
14810
  return error instanceof Error && "code" in error && error.code === "ENOENT";
14249
14811
  }
14250
- function answerSync(step) {
14812
+ function answerSync2(step) {
14251
14813
  if (step.op === "exists") return import_fs4.default.existsSync(step.path);
14252
14814
  if (step.op === "realpath") return import_fs4.default.realpathSync(step.path);
14253
14815
  try {
@@ -14257,7 +14819,7 @@ function answerSync(step) {
14257
14819
  throw error;
14258
14820
  }
14259
14821
  }
14260
- async function answerAsync(step) {
14822
+ async function answerAsync2(step) {
14261
14823
  if (step.op === "exists")
14262
14824
  return import_fs4.default.promises.access(step.path).then(
14263
14825
  () => true,
@@ -14274,13 +14836,15 @@ async function answerAsync(step) {
14274
14836
  function runSync(walk) {
14275
14837
  for (let step = walk.next(); ; ) {
14276
14838
  if (step.done) return step.value;
14277
- step = walk.next(answerSync(step.value));
14839
+ step = walk.next(answerSync2(step.value));
14278
14840
  }
14279
14841
  }
14280
- async function runAsync(walk) {
14842
+ async function runAsync(walk, inputs) {
14281
14843
  for (let step = walk.next(); ; ) {
14282
14844
  if (step.done) return step.value;
14283
- step = walk.next(await answerAsync(step.value));
14845
+ const target = step.value.path;
14846
+ if (!inputs.has(target)) inputs.set(target, await installFingerprint(target));
14847
+ step = walk.next(await answerAsync2(step.value));
14284
14848
  }
14285
14849
  }
14286
14850
  function createInstalledPackageReader() {
@@ -14337,12 +14901,17 @@ function readInstalledPackageVersions(projectRoot, modulePaths) {
14337
14901
  const name2 = extractPackageFromPath(modulePath.replaceAll(import_path3.default.sep, "/"));
14338
14902
  if (name2) names.add(name2);
14339
14903
  }
14340
- return runSync(installedVersionsWalk(projectRoot, names));
14904
+ const versions = runSync(installedVersionsWalk(projectRoot, names));
14905
+ const options = readInstalledNativeBuildOptions(projectRoot, versions);
14906
+ if (Object.keys(options).length)
14907
+ versions[NATIVE_BUILD_OPTIONS_KEY] = JSON.stringify(options);
14908
+ return versions;
14341
14909
  }
14342
14910
  function* nativePackageVersionsWalk(projectRoot) {
14343
14911
  const appRoot = yield* realpath(projectRoot);
14344
14912
  const nativeNames = /* @__PURE__ */ new Set();
14345
14913
  for (const specifier of [
14914
+ "react",
14346
14915
  "react-native",
14347
14916
  ...NATIVE_RUNTIME_PACKAGE_NAMES,
14348
14917
  ...LAZY_STUB_PATTERNS,
@@ -14383,51 +14952,47 @@ function* nativePackageVersionsWalk(projectRoot) {
14383
14952
  return yield* installedVersionsWalk(projectRoot, needed);
14384
14953
  }
14385
14954
  function readInstalledNativePackageVersions(projectRoot) {
14386
- return runSync(nativePackageVersionsWalk(projectRoot));
14387
- }
14388
- var INSTALL_RECORD_FILES = [
14389
- "package.json",
14390
- "bun.lock",
14391
- "bun.lockb",
14392
- "package-lock.json",
14393
- "yarn.lock",
14394
- "pnpm-lock.yaml",
14395
- "node_modules",
14396
- "node_modules/.package-lock.json",
14397
- "node_modules/.yarn-integrity",
14398
- "node_modules/.modules.yaml"
14399
- ];
14400
- async function installFingerprint(projectRoot) {
14401
- const appRoot = await import_fs4.default.promises.realpath(projectRoot);
14402
- const targets = [];
14403
- for (let dir = appRoot; ; ) {
14404
- if (import_path3.default.basename(dir) !== "node_modules")
14405
- for (const file of INSTALL_RECORD_FILES) targets.push(import_path3.default.join(dir, file));
14406
- const parent = import_path3.default.dirname(dir);
14407
- if (parent === dir) break;
14408
- dir = parent;
14409
- }
14410
- const stats = await Promise.all(
14411
- targets.map(
14412
- (target) => import_fs4.default.promises.stat(target).then(
14413
- (stat) => `${stat.ino}:${stat.size}:${stat.mtimeMs}`,
14414
- () => ""
14415
- )
14416
- )
14955
+ const versions = runSync(nativePackageVersionsWalk(projectRoot));
14956
+ const options = readInstalledNativeBuildOptions(projectRoot, versions);
14957
+ if (Object.keys(options).length)
14958
+ versions[NATIVE_BUILD_OPTIONS_KEY] = JSON.stringify(options);
14959
+ return versions;
14960
+ }
14961
+ async function installFingerprint(target) {
14962
+ return import_fs4.default.promises.stat(target).then(
14963
+ (stat) => `${stat.dev}:${stat.ino}:${stat.size}:${stat.mtimeMs}:${stat.ctimeMs}`,
14964
+ () => ""
14417
14965
  );
14418
- return `${appRoot}
14419
- ${stats.join("\n")}`;
14420
14966
  }
14421
14967
  var scans = /* @__PURE__ */ new Map();
14422
14968
  async function readInstalledNativePackageVersionsAsync(projectRoot) {
14423
- const fingerprint = await installFingerprint(projectRoot);
14424
14969
  const cached2 = scans.get(projectRoot);
14425
- if (cached2?.fingerprint === fingerprint) return cached2.versions;
14426
- const versions = runAsync(nativePackageVersionsWalk(projectRoot));
14427
- scans.set(projectRoot, { fingerprint, versions });
14428
- versions.catch(() => {
14429
- if (scans.get(projectRoot)?.versions === versions) scans.delete(projectRoot);
14430
- });
14970
+ let scan;
14971
+ if (cached2) {
14972
+ await cached2.versions;
14973
+ const unchanged = await Promise.all(
14974
+ [...cached2.inputs].map(
14975
+ async ([target, fingerprint]) => await installFingerprint(target) === fingerprint
14976
+ )
14977
+ );
14978
+ if (unchanged.every(Boolean)) scan = cached2.versions;
14979
+ }
14980
+ if (!scan) {
14981
+ const current = scans.get(projectRoot);
14982
+ if (current && current !== cached2) scan = current.versions;
14983
+ else {
14984
+ const inputs = /* @__PURE__ */ new Map();
14985
+ scan = runAsync(nativePackageVersionsWalk(projectRoot), inputs);
14986
+ scans.set(projectRoot, { inputs, versions: scan });
14987
+ scan.catch(() => {
14988
+ if (scans.get(projectRoot)?.versions === scan) scans.delete(projectRoot);
14989
+ });
14990
+ }
14991
+ }
14992
+ const versions = { ...await scan };
14993
+ const options = await readInstalledNativeBuildOptionsAsync(projectRoot, versions);
14994
+ if (Object.keys(options).length)
14995
+ versions[NATIVE_BUILD_OPTIONS_KEY] = JSON.stringify(options);
14431
14996
  return versions;
14432
14997
  }
14433
14998
 
@@ -14438,9 +15003,9 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
14438
15003
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
14439
15004
  var import_child_process2 = require("child_process");
14440
15005
  var import_promises = require("fs/promises");
14441
- var import_node_fs9 = require("node:fs");
15006
+ var import_node_fs10 = require("node:fs");
14442
15007
  var import_node_os3 = require("node:os");
14443
- var import_node_path8 = require("node:path");
15008
+ var import_node_path9 = require("node:path");
14444
15009
  init_backend_origin();
14445
15010
  init_config();
14446
15011
 
@@ -14587,8 +15152,8 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
14587
15152
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
14588
15153
 
14589
15154
  // scripts/dev-server-scanner.ts
14590
- var LISTENER_LOCK_PATH = (0, import_node_path8.join)((0, import_node_os3.tmpdir)(), "peach-listener-scan.lock");
14591
- var LISTENER_RESULT_PATH = (0, import_node_path8.join)((0, import_node_os3.tmpdir)(), "peach-listener-scan.result");
15155
+ var LISTENER_LOCK_PATH = (0, import_node_path9.join)((0, import_node_os3.tmpdir)(), "peach-listener-scan.lock");
15156
+ var LISTENER_RESULT_PATH = (0, import_node_path9.join)((0, import_node_os3.tmpdir)(), "peach-listener-scan.result");
14592
15157
  var LISTENER_LOCK_STALE_MS = 25e3;
14593
15158
  var LISTENER_LOCK_WAIT_MS = 8e3;
14594
15159
  function sleep2(ms) {
@@ -14606,8 +15171,8 @@ function pidIsAlive(pid) {
14606
15171
  }
14607
15172
  function readLockOwner() {
14608
15173
  try {
14609
- const raw = (0, import_node_fs9.readFileSync)(LISTENER_LOCK_PATH, "utf8");
14610
- const mtimeMs = (0, import_node_fs9.statSync)(LISTENER_LOCK_PATH).mtimeMs;
15174
+ const raw = (0, import_node_fs10.readFileSync)(LISTENER_LOCK_PATH, "utf8");
15175
+ const mtimeMs = (0, import_node_fs10.statSync)(LISTENER_LOCK_PATH).mtimeMs;
14611
15176
  const pid = Number(raw.split("-")[0]);
14612
15177
  return { raw, pid: Number.isInteger(pid) ? pid : -1, mtimeMs };
14613
15178
  } catch {
@@ -14620,15 +15185,15 @@ function lockIsAbandoned(owner) {
14620
15185
  }
14621
15186
  function clearLock(raw) {
14622
15187
  try {
14623
- if ((0, import_node_fs9.readFileSync)(LISTENER_LOCK_PATH, "utf8") !== raw) return;
14624
- (0, import_node_fs9.unlinkSync)(LISTENER_LOCK_PATH);
15188
+ if ((0, import_node_fs10.readFileSync)(LISTENER_LOCK_PATH, "utf8") !== raw) return;
15189
+ (0, import_node_fs10.unlinkSync)(LISTENER_LOCK_PATH);
14625
15190
  } catch {
14626
15191
  }
14627
15192
  }
14628
15193
  function readResult() {
14629
15194
  try {
14630
15195
  const parsed = JSON.parse(
14631
- (0, import_node_fs9.readFileSync)(LISTENER_RESULT_PATH, "utf8")
15196
+ (0, import_node_fs10.readFileSync)(LISTENER_RESULT_PATH, "utf8")
14632
15197
  );
14633
15198
  if (!parsed || typeof parsed.token !== "string" || typeof parsed.key !== "string")
14634
15199
  return null;
@@ -14639,8 +15204,8 @@ function readResult() {
14639
15204
  }
14640
15205
  function publishResult(payload) {
14641
15206
  const tmp = `${LISTENER_RESULT_PATH}.${process.pid}.tmp`;
14642
- (0, import_node_fs9.writeFileSync)(tmp, JSON.stringify(payload));
14643
- (0, import_node_fs9.renameSync)(tmp, LISTENER_RESULT_PATH);
15207
+ (0, import_node_fs10.writeFileSync)(tmp, JSON.stringify(payload));
15208
+ (0, import_node_fs10.renameSync)(tmp, LISTENER_RESULT_PATH);
14644
15209
  }
14645
15210
  function throwPublished(payload) {
14646
15211
  throw Object.assign(new Error(payload.message || "listener scan failed"), {
@@ -14683,7 +15248,7 @@ async function withListenerLock(key, body) {
14683
15248
  for (; ; ) {
14684
15249
  let fd = null;
14685
15250
  try {
14686
- fd = (0, import_node_fs9.openSync)(LISTENER_LOCK_PATH, "wx");
15251
+ fd = (0, import_node_fs10.openSync)(LISTENER_LOCK_PATH, "wx");
14687
15252
  } catch (error) {
14688
15253
  const code = error instanceof Error && "code" in error ? error.code : "";
14689
15254
  if (code !== "EEXIST") throw error;
@@ -14692,7 +15257,7 @@ async function withListenerLock(key, body) {
14692
15257
  if (owner) clearLock(owner.raw);
14693
15258
  else {
14694
15259
  try {
14695
- (0, import_node_fs9.unlinkSync)(LISTENER_LOCK_PATH);
15260
+ (0, import_node_fs10.unlinkSync)(LISTENER_LOCK_PATH);
14696
15261
  } catch {
14697
15262
  }
14698
15263
  }
@@ -14708,7 +15273,7 @@ async function withListenerLock(key, body) {
14708
15273
  }
14709
15274
  if (fd === null) continue;
14710
15275
  try {
14711
- (0, import_node_fs9.writeSync)(fd, token);
15276
+ (0, import_node_fs10.writeSync)(fd, token);
14712
15277
  try {
14713
15278
  const value = await body();
14714
15279
  publishResult({ token, key, ok: true, value });
@@ -14725,7 +15290,7 @@ async function withListenerLock(key, body) {
14725
15290
  }
14726
15291
  } finally {
14727
15292
  try {
14728
- (0, import_node_fs9.closeSync)(fd);
15293
+ (0, import_node_fs10.closeSync)(fd);
14729
15294
  } catch {
14730
15295
  }
14731
15296
  clearLock(token);
@@ -15216,6 +15781,85 @@ for (const pair of process.env.PEACH_LOOPBACK_PORTS?.split(",").filter(Boolean)
15216
15781
  function projectLoopbackPort(hostname, port) {
15217
15782
  return isLoopbackHost(hostname) ? LOOPBACK_PORTS.get(port) ?? port : port;
15218
15783
  }
15784
+ function projectLoopbackUrl(value) {
15785
+ if (LOOPBACK_PORTS.size === 0) return value;
15786
+ const url = new URL(value);
15787
+ const port = Number(
15788
+ url.port || (url.protocol === "https:" || url.protocol === "wss:" ? 443 : 80)
15789
+ );
15790
+ const projected = projectLoopbackPort(url.hostname, port);
15791
+ if (projected === port) return value;
15792
+ url.port = String(projected);
15793
+ return url.href;
15794
+ }
15795
+
15796
+ // src/host/network-policy.ts
15797
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
15798
+ var import_node_path10 = require("node:path");
15799
+ var import_node_url = require("node:url");
15800
+ var NETWORK_POLICY_TIMEOUT_MS = 1e4;
15801
+ var NetworkPolicyDeniedError = class extends Error {
15802
+ code = "EPOLICY";
15803
+ constructor(what) {
15804
+ super(`network policy denied ${what}`);
15805
+ }
15806
+ };
15807
+ function describeEvent(event) {
15808
+ switch (event.kind) {
15809
+ case "http":
15810
+ return `${event.method} ${new URL(event.url).origin}`;
15811
+ case "websocket":
15812
+ return `websocket ${new URL(event.url).origin}`;
15813
+ case "websocket-frame":
15814
+ return `websocket frame opcode ${event.opcode} (${event.data.byteLength} bytes) to ${new URL(event.url).origin}`;
15815
+ case "tcp":
15816
+ return `tcp ${event.host}:${event.port}`;
15817
+ case "tunnel":
15818
+ return `tunnel ${event.host}:${event.port}`;
15819
+ }
15820
+ }
15821
+ function createNetworkAuthorizer(policy) {
15822
+ if (policy === null) return async () => true;
15823
+ if (policy instanceof Promise) policy.catch(() => {
15824
+ });
15825
+ return async (event) => {
15826
+ let allowed = false;
15827
+ let timer;
15828
+ try {
15829
+ const decide = await policy;
15830
+ allowed = await Promise.race([
15831
+ decide(event),
15832
+ new Promise((_, reject) => {
15833
+ timer = setTimeout(
15834
+ () => reject(new Error("network policy timed out")),
15835
+ NETWORK_POLICY_TIMEOUT_MS
15836
+ );
15837
+ })
15838
+ ]) === true;
15839
+ } catch {
15840
+ allowed = false;
15841
+ } finally {
15842
+ clearTimeout(timer);
15843
+ }
15844
+ if (!allowed) console.error(`peach: network policy denied ${describeEvent(event)}`);
15845
+ return allowed;
15846
+ };
15847
+ }
15848
+ async function loadNetworkPolicy(file) {
15849
+ if (!(0, import_node_path10.isAbsolute)(file)) {
15850
+ throw new Error(`PEACH_NETWORK_POLICY must be an absolute path: ${file}`);
15851
+ }
15852
+ const loaded3 = await import((0, import_node_url.pathToFileURL)(file).href);
15853
+ const decide = Reflect.get(Object(loaded3), "default");
15854
+ if (typeof decide !== "function") {
15855
+ throw new Error(`${file} must default-export a network policy function`);
15856
+ }
15857
+ return (event) => decide(event);
15858
+ }
15859
+ var policyFile = process.env.PEACH_NETWORK_POLICY || null;
15860
+ var authorizeNetwork = createNetworkAuthorizer(
15861
+ policyFile === null ? null : loadNetworkPolicy(policyFile)
15862
+ );
15219
15863
 
15220
15864
  // src/host/rolldown-bundle-forward.ts
15221
15865
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
@@ -15496,6 +16140,14 @@ async function proxyUpstream(req, res, upstreamUrl, reportFailure, route) {
15496
16140
  delete targetHeaders["transfer-encoding"];
15497
16141
  targetHeaders["content-length"] = String(nextBody.byteLength);
15498
16142
  }
16143
+ const allowed = await authorizeNetwork({
16144
+ kind: "http",
16145
+ method,
16146
+ url: projectLoopbackUrl(targetUrl.href),
16147
+ headers: targetHeaders,
16148
+ body: nextBody
16149
+ });
16150
+ if (!allowed) throw new NetworkPolicyDeniedError(`${method} ${targetUrl.origin}`);
15499
16151
  const port = projectLoopbackPort(
15500
16152
  targetUrl.hostname,
15501
16153
  Number(targetUrl.port || (targetUrl.protocol === "https:" ? 443 : 80))
@@ -15611,6 +16263,10 @@ async function proxyUpstream(req, res, upstreamUrl, reportFailure, route) {
15611
16263
  if (!res.headersSent && reportFailure) {
15612
16264
  const code = err?.code;
15613
16265
  res.statusCode = 502;
16266
+ res.removeHeader("content-type");
16267
+ res.removeHeader("content-encoding");
16268
+ res.removeHeader("transfer-encoding");
16269
+ res.setHeader("content-length", "0");
15614
16270
  res.setHeader(
15615
16271
  FETCH_PROXY_FAILURE_HEADER,
15616
16272
  typeof code === "string" ? code : "unknown"
@@ -15632,16 +16288,11 @@ init_replacement_module_handler();
15632
16288
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
15633
16289
  var import_node_child_process3 = require("node:child_process");
15634
16290
  var import_node_crypto5 = require("node:crypto");
15635
- var import_node_fs12 = __toESM(require("node:fs"), 1);
16291
+ var import_node_fs13 = __toESM(require("node:fs"), 1);
15636
16292
  var import_node_module2 = require("node:module");
15637
- var import_node_path11 = __toESM(require("node:path"), 1);
16293
+ var import_node_path13 = __toESM(require("node:path"), 1);
15638
16294
  var import_node_util = require("node:util");
15639
-
15640
- // cli/internal-child.ts
15641
- init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
15642
- var RNX_FORKED_SCRIPT_ENV = "PEACH_RUNS_FORKED_SCRIPTS";
15643
-
15644
- // src/one-widget-metadata.ts
16295
+ init_internal_child();
15645
16296
  init_is_record();
15646
16297
  init_swift_source_file();
15647
16298
  init_swift_submit();
@@ -15665,8 +16316,8 @@ fs.writeFileSync(process.argv[2], JSON.stringify({
15665
16316
  function configStamp(files) {
15666
16317
  return JSON.stringify(
15667
16318
  files.map((file) => {
15668
- if (!import_node_fs12.default.existsSync(file)) return [file, null];
15669
- const stat = import_node_fs12.default.statSync(file);
16319
+ if (!import_node_fs13.default.existsSync(file)) return [file, null];
16320
+ const stat = import_node_fs13.default.statSync(file);
15670
16321
  return [file, stat.mtimeMs, stat.ctimeMs, stat.size];
15671
16322
  })
15672
16323
  );
@@ -15677,13 +16328,13 @@ async function readConfig(root) {
15677
16328
  const reading = reads.get(root);
15678
16329
  if (reading) return reading;
15679
16330
  const promise = (async () => {
15680
- (0, import_node_module2.createRequire)(import_node_path11.default.join(root, "package.json")).resolve("one/vite");
15681
- const cache = import_node_path11.default.join(root, "node_modules/.cache/peach-widget-config");
15682
- import_node_fs12.default.mkdirSync(cache, { recursive: true });
15683
- const directory = import_node_fs12.default.mkdtempSync(import_node_path11.default.join(cache, "read-"));
15684
- const script = import_node_path11.default.join(directory, "read.mjs");
15685
- const result = import_node_path11.default.join(directory, "result.json");
15686
- import_node_fs12.default.writeFileSync(script, CONFIG_CHILD);
16331
+ (0, import_node_module2.createRequire)(import_node_path13.default.join(root, "package.json")).resolve("one/vite");
16332
+ const cache = import_node_path13.default.join(root, "node_modules/.cache/peach-widget-config");
16333
+ import_node_fs13.default.mkdirSync(cache, { recursive: true });
16334
+ const directory = import_node_fs13.default.mkdtempSync(import_node_path13.default.join(cache, "read-"));
16335
+ const script = import_node_path13.default.join(directory, "read.mjs");
16336
+ const result = import_node_path13.default.join(directory, "result.json");
16337
+ import_node_fs13.default.writeFileSync(script, CONFIG_CHILD);
15687
16338
  try {
15688
16339
  await run(process.execPath, [script, result], {
15689
16340
  cwd: root,
@@ -15691,7 +16342,7 @@ async function readConfig(root) {
15691
16342
  timeout: 3e4,
15692
16343
  maxBuffer: 1024 * 1024
15693
16344
  });
15694
- const value = JSON.parse(import_node_fs12.default.readFileSync(result, "utf8"));
16345
+ const value = JSON.parse(import_node_fs13.default.readFileSync(result, "utf8"));
15695
16346
  if (!isRecord(value) || !Array.isArray(value.watched) || !value.watched.every((file) => typeof file === "string"))
15696
16347
  throw new Error("One config loader returned invalid dependencies");
15697
16348
  if (!Array.isArray(value.urlSchemes) || !value.urlSchemes.every(
@@ -15714,8 +16365,8 @@ async function readConfig(root) {
15714
16365
  }
15715
16366
  const watched = [
15716
16367
  .../* @__PURE__ */ new Set([
15717
- import_node_path11.default.join(root, "package.json"),
15718
- ...value.watched.map((file) => import_node_path11.default.resolve(root, file))
16368
+ import_node_path13.default.join(root, "package.json"),
16369
+ ...value.watched.map((file) => import_node_path13.default.resolve(root, file))
15719
16370
  ])
15720
16371
  ];
15721
16372
  const loaded3 = {
@@ -15727,7 +16378,7 @@ async function readConfig(root) {
15727
16378
  configs.set(root, loaded3);
15728
16379
  return loaded3;
15729
16380
  } finally {
15730
- import_node_fs12.default.rmSync(directory, { recursive: true, force: true });
16381
+ import_node_fs13.default.rmSync(directory, { recursive: true, force: true });
15731
16382
  }
15732
16383
  })();
15733
16384
  reads.set(root, promise);
@@ -15748,13 +16399,13 @@ function declaredFamilies(source) {
15748
16399
  return home;
15749
16400
  }
15750
16401
  async function readOneWidgetSources(appRoot) {
15751
- const root = import_node_fs12.default.realpathSync(appRoot);
16402
+ const root = import_node_fs13.default.realpathSync(appRoot);
15752
16403
  const config = await readConfig(root);
15753
16404
  if (!config.widget) return null;
15754
16405
  const widget = config.widget;
15755
16406
  const sourceFiles = {
15756
- "OneWidget.swift": import_node_path11.default.join(root, "ios/OneWidgets/OneWidget.swift"),
15757
- "OneWidgetContract.swift": import_node_path11.default.join(
16407
+ "OneWidget.swift": import_node_path13.default.join(root, "ios/OneWidgets/OneWidget.swift"),
16408
+ "OneWidgetContract.swift": import_node_path13.default.join(
15758
16409
  root,
15759
16410
  "ios",
15760
16411
  widget.appName,
@@ -15764,14 +16415,14 @@ async function readOneWidgetSources(appRoot) {
15764
16415
  const files = /* @__PURE__ */ new Map();
15765
16416
  const sources = {};
15766
16417
  for (const [name2, file] of Object.entries(sourceFiles)) {
15767
- if (!import_node_fs12.default.existsSync(file))
16418
+ if (!import_node_fs13.default.existsSync(file))
15768
16419
  throw new Error(`missing One widget prebuild source ${file}; run one prebuild`);
15769
16420
  const bytes = readPackageFile(root, file, MAX_SWIFT_COMPILE_SOURCE_BYTES);
15770
16421
  const text2 = bytes.toString("utf8");
15771
16422
  if (!Buffer.from(text2).equals(bytes))
15772
16423
  throw new Error(`One widget prebuild source is not UTF-8: ${file}`);
15773
16424
  files.set(name2, text2);
15774
- sources[import_node_path11.default.relative(root, file).split(import_node_path11.default.sep).join("/")] = (0, import_node_crypto5.createHash)("sha256").update(bytes).digest("hex");
16425
+ sources[import_node_path13.default.relative(root, file).split(import_node_path13.default.sep).join("/")] = (0, import_node_crypto5.createHash)("sha256").update(bytes).digest("hex");
15775
16426
  }
15776
16427
  const contract = files.get("OneWidgetContract.swift") ?? "";
15777
16428
  const source = files.get("OneWidget.swift") ?? "";
@@ -15959,7 +16610,7 @@ function peachPlugin(options = {}) {
15959
16610
  const moduleRootFor = () => {
15960
16611
  if (swiftModuleRoot === void 0) {
15961
16612
  const moduleRoot = import_path5.default.resolve(
15962
- import_path5.default.dirname((0, import_node_url.fileURLToPath)(__sootsim_import_meta_url)),
16613
+ import_path5.default.dirname((0, import_node_url2.fileURLToPath)(__sootsim_import_meta_url)),
15963
16614
  "../../sootsim-swift"
15964
16615
  );
15965
16616
  swiftModuleRoot = import_fs6.default.existsSync(import_path5.default.join(moduleRoot, "toolchain.json")) ? moduleRoot : null;
@@ -16300,15 +16951,16 @@ init_app_project();
16300
16951
  // src/android-autolinking.ts
16301
16952
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
16302
16953
  var import_node_child_process4 = require("node:child_process");
16303
- var import_node_fs14 = __toESM(require("node:fs"), 1);
16954
+ var import_node_fs15 = __toESM(require("node:fs"), 1);
16304
16955
  var import_node_module3 = require("node:module");
16305
- var import_node_path13 = __toESM(require("node:path"), 1);
16956
+ var import_node_path15 = __toESM(require("node:path"), 1);
16306
16957
  var import_node_util2 = require("node:util");
16958
+ init_internal_child();
16307
16959
  init_is_record();
16308
16960
  var run2 = (0, import_node_util2.promisify)(import_node_child_process4.execFile);
16309
16961
  var resolving = /* @__PURE__ */ new Map();
16310
16962
  async function resolveExpoAndroidAutolinking(appRoot) {
16311
- const root = import_node_fs14.default.realpathSync(appRoot);
16963
+ const root = import_node_fs15.default.realpathSync(appRoot);
16312
16964
  const existing = resolving.get(root);
16313
16965
  if (existing) return existing;
16314
16966
  const pending = resolveAndroidModules(root);
@@ -16322,7 +16974,7 @@ async function resolveExpoAndroidAutolinking(appRoot) {
16322
16974
  async function resolveAndroidModules(appRoot) {
16323
16975
  let autolinker;
16324
16976
  try {
16325
- autolinker = (0, import_node_module3.createRequire)(import_node_path13.default.join(appRoot, "package.json")).resolve(
16977
+ autolinker = (0, import_node_module3.createRequire)(import_node_path15.default.join(appRoot, "package.json")).resolve(
16326
16978
  "expo-modules-autolinking/package.json"
16327
16979
  );
16328
16980
  } catch (error) {
@@ -16332,7 +16984,7 @@ async function resolveAndroidModules(appRoot) {
16332
16984
  const { stdout } = await run2(
16333
16985
  process.execPath,
16334
16986
  [
16335
- import_node_path13.default.join(import_node_path13.default.dirname(autolinker), "bin/expo-modules-autolinking.js"),
16987
+ import_node_path15.default.join(import_node_path15.default.dirname(autolinker), "bin/expo-modules-autolinking.js"),
16336
16988
  "resolve",
16337
16989
  "--platform",
16338
16990
  "android",
@@ -16358,48 +17010,10 @@ async function collectAndroidAutolinkedPackages(appRoot) {
16358
17010
  return readAndroidAutolinkedPackages(modules.map((entry) => entry.packageName));
16359
17011
  }
16360
17012
 
16361
- // src/metro-plugin.ts
16362
- init_replacement_module_handler();
16363
-
16364
- // src/native-app-identity.ts
16365
- init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
16366
-
16367
- // src/android-app-identity.ts
16368
- init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
16369
-
16370
- // src/android-string-value.ts
17013
+ // src/android-root-module.ts
16371
17014
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
16372
- function compileAndroidStringValue(text2, where) {
16373
- if (/^\s*[@?]/.test(text2))
16374
- throw new Error(`${where} is a resource reference, not resolved by peach kotlin yet`);
16375
- const out = [];
16376
- let quoted = false;
16377
- for (let index = 0; index < text2.length; index++) {
16378
- const char = text2[index] ?? "";
16379
- if (char === "\\") {
16380
- const next = text2[index + 1];
16381
- if (next === void 0) break;
16382
- index++;
16383
- if (next === "n") out.push({ char: "\n", soft: false });
16384
- else if (next === "t") out.push({ char: " ", soft: false });
16385
- else if (next === "u") {
16386
- const hex = text2.slice(index + 1, index + 5);
16387
- if (!/^[0-9a-fA-F]{4}$/.test(hex))
16388
- throw new Error(`${where} has an invalid unicode escape \\u${hex}`);
16389
- out.push({ char: String.fromCharCode(Number.parseInt(hex, 16)), soft: false });
16390
- index += 4;
16391
- } else out.push({ char: next, soft: false });
16392
- } else if (char === '"') quoted = !quoted;
16393
- else if (char === "'" && !quoted)
16394
- throw new Error(`${where} has an unescaped apostrophe`);
16395
- else if (!quoted && /\s/.test(char)) {
16396
- if (out.at(-1)?.soft !== true) out.push({ char: " ", soft: true });
16397
- } else out.push({ char, soft: false });
16398
- }
16399
- while (out[0]?.soft) out.shift();
16400
- while (out.at(-1)?.soft) out.pop();
16401
- return out.map((part) => part.char).join("");
16402
- }
17015
+ var import_node_fs16 = __toESM(require("node:fs"), 1);
17016
+ var import_node_path16 = __toESM(require("node:path"), 1);
16403
17017
 
16404
17018
  // src/android-xml.ts
16405
17019
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
@@ -16459,6 +17073,143 @@ function parseXml(text2, file) {
16459
17073
  return root;
16460
17074
  }
16461
17075
 
17076
+ // src/android-root-module.ts
17077
+ var STRINGS_AND_COMMENTS = /"(?:\\.|[^"\\])*"|\/\/[^\n]*|\/\*[\s\S]*?\*\//g;
17078
+ var DECLARATION = /\b(?:fun|String)\s+getMainComponentName\s*\(/g;
17079
+ 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|@|$))/;
17080
+ var JAVA_LITERAL = /^String\s+getMainComponentName\s*\(\s*\)\s*\{\s*return\s+"([^"\\]+)"\s*;\s*\}/;
17081
+ function readAndroidRootModuleFromActivitySource(source, simpleName) {
17082
+ const code = source.replace(
17083
+ STRINGS_AND_COMMENTS,
17084
+ (match) => match.startsWith('"') ? match : " "
17085
+ );
17086
+ const classes = [...code.matchAll(/\bclass\s+(\w+)/g)];
17087
+ if (classes.length !== 1 || classes[0][1] !== simpleName) return void 0;
17088
+ const declarations = [...code.matchAll(DECLARATION)];
17089
+ if (declarations.length !== 1) return void 0;
17090
+ const rest = code.slice(declarations[0].index);
17091
+ const kotlin = code.slice(code.lastIndexOf("override", declarations[0].index));
17092
+ const literal = (KOTLIN_LITERAL.exec(kotlin) ?? JAVA_LITERAL.exec(rest))?.[1];
17093
+ if (literal === void 0) return void 0;
17094
+ const delegate = /createReactActivityDelegate[\s\S]*/.exec(code)?.[0];
17095
+ if (delegate && !/\b(?:mainComponentName|getMainComponentName\s*\(\s*\))/.test(delegate))
17096
+ return void 0;
17097
+ return literal;
17098
+ }
17099
+ function launcherActivities(application) {
17100
+ return application.children.filter(
17101
+ (element) => (element.name === "activity" || element.name === "activity-alias") && element.children.some(
17102
+ (filter) => filter.name === "intent-filter" && filter.children.some(
17103
+ (child) => child.name === "action" && child.attributes["android:name"] === "android.intent.action.MAIN"
17104
+ ) && filter.children.some(
17105
+ (child) => child.name === "category" && child.attributes["android:name"] === "android.intent.category.LAUNCHER"
17106
+ )
17107
+ )
17108
+ );
17109
+ }
17110
+ function readModuleNamespace(moduleRoot, manifest) {
17111
+ if (manifest.attributes.package) return manifest.attributes.package;
17112
+ for (const name2 of ["build.gradle", "build.gradle.kts"]) {
17113
+ const file = import_node_path16.default.join(moduleRoot, name2);
17114
+ if (!import_node_fs16.default.existsSync(file)) continue;
17115
+ const match = /\bnamespace\s*=?\s*["']([\w.]+)["']/.exec(
17116
+ import_node_fs16.default.readFileSync(file, "utf8")
17117
+ );
17118
+ if (match) return match[1];
17119
+ }
17120
+ return void 0;
17121
+ }
17122
+ function readModuleRootModuleName(moduleRoot) {
17123
+ const sourceSets = import_node_path16.default.join(moduleRoot, "src");
17124
+ const manifestFile = import_node_path16.default.join(sourceSets, "main/AndroidManifest.xml");
17125
+ if (!import_node_fs16.default.existsSync(manifestFile)) return void 0;
17126
+ const document = parseXml(import_node_fs16.default.readFileSync(manifestFile, "utf8"), manifestFile);
17127
+ const manifest = document.children[0];
17128
+ const application = manifest?.children.find((child) => child.name === "application");
17129
+ if (manifest?.name !== "manifest" || !application) return void 0;
17130
+ const launchers = launcherActivities(application);
17131
+ if (launchers.length === 0) return void 0;
17132
+ for (const set2 of import_node_fs16.default.readdirSync(sourceSets, { withFileTypes: true })) {
17133
+ const file = import_node_path16.default.join(sourceSets, set2.name, "AndroidManifest.xml");
17134
+ if (!set2.isDirectory() || set2.name === "main" || !import_node_fs16.default.existsSync(file)) continue;
17135
+ if (import_node_fs16.default.readFileSync(file, "utf8").includes("<activity")) return void 0;
17136
+ }
17137
+ const launcher = launchers[0];
17138
+ const enabled = launcher.attributes["android:enabled"];
17139
+ if (launchers.length !== 1 || launcher.name !== "activity" || enabled !== void 0 && enabled !== "true")
17140
+ return void 0;
17141
+ const namespace = readModuleNamespace(moduleRoot, manifest);
17142
+ const declared = launcher.attributes["android:name"];
17143
+ if (!declared) return void 0;
17144
+ const qualified = declared.startsWith(".") ? namespace && `${namespace}${declared}` : declared.includes(".") ? declared : namespace && `${namespace}.${declared}`;
17145
+ if (!qualified || qualified.includes("$")) return void 0;
17146
+ const relative3 = qualified.split(".").join("/");
17147
+ const files = import_node_fs16.default.readdirSync(sourceSets, { withFileTypes: true }).filter((set2) => set2.isDirectory()).flatMap(
17148
+ (set2) => ["java", "kotlin"].flatMap(
17149
+ (language) => ["kt", "java"].map(
17150
+ (extension) => import_node_path16.default.join(sourceSets, set2.name, language, `${relative3}.${extension}`)
17151
+ )
17152
+ )
17153
+ ).filter((file) => import_node_fs16.default.existsSync(file));
17154
+ if (files.length !== 1) return void 0;
17155
+ return readAndroidRootModuleFromActivitySource(
17156
+ import_node_fs16.default.readFileSync(files[0], "utf8"),
17157
+ qualified.slice(qualified.lastIndexOf(".") + 1)
17158
+ );
17159
+ }
17160
+ function readAndroidLauncherRootModuleName(projectRoot) {
17161
+ const androidRoot = import_node_path16.default.join(projectRoot, "android");
17162
+ if (!import_node_fs16.default.existsSync(androidRoot)) return void 0;
17163
+ const names = import_node_fs16.default.readdirSync(androidRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory()).flatMap((entry) => {
17164
+ const name2 = readModuleRootModuleName(import_node_path16.default.join(androidRoot, entry.name));
17165
+ return name2 === void 0 ? [] : [name2];
17166
+ });
17167
+ return names.length === 1 ? names[0] : void 0;
17168
+ }
17169
+
17170
+ // src/metro-plugin.ts
17171
+ init_replacement_module_handler();
17172
+
17173
+ // src/native-app-identity.ts
17174
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
17175
+
17176
+ // src/android-app-identity.ts
17177
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
17178
+
17179
+ // src/android-string-value.ts
17180
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
17181
+ function compileAndroidStringValue(text2, where) {
17182
+ if (/^\s*[@?]/.test(text2))
17183
+ throw new Error(`${where} is a resource reference, not resolved by peach kotlin yet`);
17184
+ const out = [];
17185
+ let quoted = false;
17186
+ for (let index = 0; index < text2.length; index++) {
17187
+ const char = text2[index] ?? "";
17188
+ if (char === "\\") {
17189
+ const next = text2[index + 1];
17190
+ if (next === void 0) break;
17191
+ index++;
17192
+ if (next === "n") out.push({ char: "\n", soft: false });
17193
+ else if (next === "t") out.push({ char: " ", soft: false });
17194
+ else if (next === "u") {
17195
+ const hex = text2.slice(index + 1, index + 5);
17196
+ if (!/^[0-9a-fA-F]{4}$/.test(hex))
17197
+ throw new Error(`${where} has an invalid unicode escape \\u${hex}`);
17198
+ out.push({ char: String.fromCharCode(Number.parseInt(hex, 16)), soft: false });
17199
+ index += 4;
17200
+ } else out.push({ char: next, soft: false });
17201
+ } else if (char === '"') quoted = !quoted;
17202
+ else if (char === "'" && !quoted)
17203
+ throw new Error(`${where} has an unescaped apostrophe`);
17204
+ else if (!quoted && /\s/.test(char)) {
17205
+ if (out.at(-1)?.soft !== true) out.push({ char: " ", soft: true });
17206
+ } else out.push({ char, soft: false });
17207
+ }
17208
+ while (out[0]?.soft) out.shift();
17209
+ while (out.at(-1)?.soft) out.pop();
17210
+ return out.map((part) => part.char).join("");
17211
+ }
17212
+
16462
17213
  // src/android-app-identity.ts
16463
17214
  function nativeAppIdentityFromAndroidManifest(source, file, files = {}) {
16464
17215
  const document = parseXml(source, file);
@@ -16950,10 +17701,10 @@ function appTargetReleaseSettings(pbxproj, targetName, infoPlistRelativePath) {
16950
17701
  var APP_DELEGATE_PATH_RE = /(?:^|\/)ios\/([^/]+)\/AppDelegate\.(?:swift|mm|m)$/;
16951
17702
  function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri) {
16952
17703
  const pbxprojPath = Object.keys(files).find(
16953
- (path22) => /(?:^|\/)ios\/[^/]+\.xcodeproj\/project\.pbxproj$/.test(path22)
17704
+ (path26) => /(?:^|\/)ios\/[^/]+\.xcodeproj\/project\.pbxproj$/.test(path26)
16954
17705
  ) ?? Object.keys(files).find(
16955
- (path22) => /(?:^|\/)[^/]+\.xcodeproj\/project\.pbxproj$/.test(path22)
16956
- ) ?? Object.keys(files).find((path22) => /(?:^|\/)project\.pbxproj$/.test(path22));
17706
+ (path26) => /(?:^|\/)[^/]+\.xcodeproj\/project\.pbxproj$/.test(path26)
17707
+ ) ?? Object.keys(files).find((path26) => /(?:^|\/)project\.pbxproj$/.test(path26));
16957
17708
  if (!pbxprojPath) return null;
16958
17709
  const pbxproj = files[pbxprojPath];
16959
17710
  let objects = {};
@@ -16995,7 +17746,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
16995
17746
  } else if (applicationTargetNames.size === 1) {
16996
17747
  targetName = [...applicationTargetNames][0];
16997
17748
  } else if (applicationTargetNames.size > 1) {
16998
- const delegateTargets = Object.keys(files).filter((path22) => !path22.includes("/Pods/")).map((path22) => path22.match(APP_DELEGATE_PATH_RE)?.[1]).filter(
17749
+ const delegateTargets = Object.keys(files).filter((path26) => !path26.includes("/Pods/")).map((path26) => path26.match(APP_DELEGATE_PATH_RE)?.[1]).filter(
16999
17750
  (name2) => typeof name2 === "string" && applicationTargetNames.has(name2)
17000
17751
  );
17001
17752
  if (delegateTargets.length === 1) {
@@ -17219,7 +17970,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
17219
17970
  if (Object.hasOwn(files, file)) return [file];
17220
17971
  const prefix2 = file === "" ? "" : `${file.replace(/\/$/, "")}/`;
17221
17972
  return paths.filter(
17222
- (path22) => path22.startsWith(prefix2) && !/(?:^|\/)\./.test(path22.slice(prefix2.length))
17973
+ (path26) => path26.startsWith(prefix2) && !/(?:^|\/)\./.test(path26.slice(prefix2.length))
17223
17974
  );
17224
17975
  },
17225
17976
  join7,
@@ -17230,7 +17981,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
17230
17981
  }
17231
17982
  const rootModuleName = readRootModuleName(
17232
17983
  Object.entries(files).filter(
17233
- ([path22]) => !path22.includes("/Pods/") && (/(?:^|\/)ios\/AppDelegate\.(?:swift|mm|m)$/.test(path22) || path22.match(APP_DELEGATE_PATH_RE)?.[1] === targetName)
17984
+ ([path26]) => !path26.includes("/Pods/") && (/(?:^|\/)ios\/AppDelegate\.(?:swift|mm|m)$/.test(path26) || path26.match(APP_DELEGATE_PATH_RE)?.[1] === targetName)
17234
17985
  ).map(([, source]) => source)
17235
17986
  );
17236
17987
  return {
@@ -17316,17 +18067,17 @@ function extractNativeAppIdentityFromFiles(files, platform, parseInfoPlist, iosT
17316
18067
 
17317
18068
  // src/native-app-identity-project.ts
17318
18069
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
17319
- var import_node_fs16 = __toESM(require("node:fs"), 1);
18070
+ var import_node_fs20 = __toESM(require("node:fs"), 1);
17320
18071
  var import_node_module4 = require("node:module");
17321
- var import_node_path16 = __toESM(require("node:path"), 1);
18072
+ var import_node_path21 = __toESM(require("node:path"), 1);
17322
18073
  init_is_record();
17323
18074
 
17324
18075
  // src/xcode-project.ts
17325
18076
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
17326
- var import_node_child_process5 = require("node:child_process");
18077
+ var import_node_child_process6 = require("node:child_process");
17327
18078
  var import_node_crypto7 = require("node:crypto");
17328
- var import_node_fs15 = __toESM(require("node:fs"), 1);
17329
- var import_node_path15 = __toESM(require("node:path"), 1);
18079
+ var import_node_fs19 = __toESM(require("node:fs"), 1);
18080
+ var import_node_path20 = __toESM(require("node:path"), 1);
17330
18081
  var import_plist3 = __toESM(require("plist"), 1);
17331
18082
 
17332
18083
  // src/swift-coverage/xcode-assets.ts
@@ -17347,7 +18098,7 @@ var assetSymbolSettingKeys = [
17347
18098
  "ASSETCATALOG_COMPILER_LIGHTWEIGHT_ASSET_RUNTIME_MODE",
17348
18099
  "ASSETCATALOG_OTHER_FLAGS"
17349
18100
  ];
17350
- var unprovenAssetSettings = assetSymbolSettingKeys.slice(4);
18101
+ var unprovenAssetSettings = assetSymbolSettingKeys.slice(4).filter((key) => key !== "ASSETCATALOG_OTHER_FLAGS");
17351
18102
 
17352
18103
  // src/swift-package.ts
17353
18104
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
@@ -17366,6 +18117,8 @@ function isSwiftNativeTranslationUnit(file) {
17366
18117
  }
17367
18118
  var SWIFT_NATIVE_SOURCE_EXTENSIONS = [
17368
18119
  ...SWIFT_NATIVE_TRANSLATION_UNIT_EXTENSIONS,
18120
+ ".s",
18121
+ ".S",
17369
18122
  ".h",
17370
18123
  ".hh",
17371
18124
  ".hpp",
@@ -17375,17 +18128,417 @@ var SWIFT_NATIVE_SOURCE_EXTENSIONS = [
17375
18128
  ".inl",
17376
18129
  ".modulemap"
17377
18130
  ];
18131
+ function moduleMapTokens(text2) {
18132
+ return (text2.match(/\/\*[\s\S]*?\*\/|\/\/[^\n]*|"[^"]*"|[\w.*]+|[{}\[\]]/g) ?? []).filter((token) => !token.startsWith("/"));
18133
+ }
17378
18134
  function moduleMapName(text2) {
17379
- return /(?:^|\s)module\s+(\w+)/.exec(text2)?.[1];
18135
+ const tokens = moduleMapTokens(text2);
18136
+ const index = tokens.findIndex(
18137
+ (token, i) => token === "module" && tokens[i - 1] !== "extern"
18138
+ );
18139
+ return index < 0 ? void 0 : tokens[index + 1];
18140
+ }
18141
+ function swiftPackageIdentity(url) {
18142
+ const path26 = url.endsWith("/") ? url.slice(0, -1) : url;
18143
+ return (path26.split("/").pop() ?? path26).replace(/\.git$/, "").toLowerCase();
18144
+ }
18145
+
18146
+ // src/swift-package-manifest.ts
18147
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
18148
+ var import_node_child_process5 = require("node:child_process");
18149
+ var import_node_fs18 = __toESM(require("node:fs"), 1);
18150
+ var import_node_os5 = __toESM(require("node:os"), 1);
18151
+ var import_node_path18 = __toESM(require("node:path"), 1);
18152
+ init_home_paths();
18153
+
18154
+ // src/swift-distribution.lock.json
18155
+ var swift_distribution_lock_default = {
18156
+ id: "d2c6d715951f5e98",
18157
+ release: "swift-6.4.0-RELEASE-custom-ecd2ad9d3fe59329",
18158
+ wasmSdkId: "swift-6.4.0-RELEASE_wasm-peach-cbf01f4b",
18159
+ wasmSdkUrl: "https://r2.sootsim.com/swift-wasm-sdk/swift-6.4.0-RELEASE_wasm-peach-cbf01f4b.artifactbundle.tar.gz",
18160
+ wasmSdkChecksum: "2243db65b12743d577fecc6aa27761363ccef470202f1fef2582e58750c0da4f",
18161
+ source: "723697c8df030077d06e7e760259e494f6a1c5a8",
18162
+ targets: [
18163
+ "ImagePlayground",
18164
+ "QuickLookThumbnailing",
18165
+ "libxml2",
18166
+ "CarPlay",
18167
+ "System",
18168
+ "_LocationEssentials",
18169
+ "GeoToolbox",
18170
+ "DataDetection",
18171
+ "Accessibility",
18172
+ "Contacts",
18173
+ "CoreML",
18174
+ "EventKit",
18175
+ "CloudKit",
18176
+ "IOSurface",
18177
+ "OpenGLES",
18178
+ "ContactsUI",
18179
+ "CoreLocationUI",
18180
+ "MediaPlayer",
18181
+ "MediaAccessibility",
18182
+ "MusicKit",
18183
+ "RealityKit",
18184
+ "SecureElementCredential",
18185
+ "Social",
18186
+ "SceneKit",
18187
+ "CoreBluetooth",
18188
+ "HealthKit",
18189
+ "CoreNFC",
18190
+ "Speech",
18191
+ "Vision",
18192
+ "VisionKit",
18193
+ "WorkoutKit",
18194
+ "_PassKit_SwiftUI",
18195
+ "ExpoModulesCore",
18196
+ "_MapKit_SwiftUI",
18197
+ "PeachJSON",
18198
+ "PeachFoundation",
18199
+ "FoundationNetworking",
18200
+ "DeveloperToolsSupport",
18201
+ "SwiftUI",
18202
+ "DarwinRecords",
18203
+ "Darwin",
18204
+ "MachO",
18205
+ "PeachObjCRuntime",
18206
+ "PeachObjC",
18207
+ "UIUtilities",
18208
+ "UIKitEnums",
18209
+ "UIKitCore",
18210
+ "PeachICU",
18211
+ "PeachCMark",
18212
+ "CoreImage",
18213
+ "QuartzCore",
18214
+ "CoreGraphics",
18215
+ "AppTrackingTransparency",
18216
+ "StoreKit",
18217
+ "_StoreKit_SwiftUI",
18218
+ "WeatherKit",
18219
+ "DeviceCheck",
18220
+ "PassKit",
18221
+ "Translation",
18222
+ "TipKit",
18223
+ "CoreSpotlight",
18224
+ "CoreVideo",
18225
+ "CoreMedia",
18226
+ "VideoToolbox",
18227
+ "AdSupport",
18228
+ "BackgroundTasks",
18229
+ "LocalAuthentication",
18230
+ "CoreMotion",
18231
+ "MessageUI",
18232
+ "GameController",
18233
+ "GameKit",
18234
+ "MetricKit",
18235
+ "Metal",
18236
+ "AuthenticationServices",
18237
+ "os",
18238
+ "Charts",
18239
+ "Symbols",
18240
+ "UniformTypeIdentifiers",
18241
+ "WidgetKit",
18242
+ "ActivityKit",
18243
+ "SwiftData",
18244
+ "UIKit",
18245
+ "React",
18246
+ "Combine",
18247
+ "PeachFoundationCombine",
18248
+ "AppIntents",
18249
+ "PhotosUI",
18250
+ "AVFoundation",
18251
+ "AVFAudio",
18252
+ "UserNotifications",
18253
+ "Network",
18254
+ "NetworkExtension",
18255
+ "OSLog",
18256
+ "PeachSecurityRuntime",
18257
+ "Accelerate",
18258
+ "CoreText",
18259
+ "CFNetwork",
18260
+ "CommonCrypto",
18261
+ "PeachCodec",
18262
+ "Compression",
18263
+ "zlib",
18264
+ "CryptoKit",
18265
+ "TikTokBusinessSDK",
18266
+ "nSure",
18267
+ "Statsig",
18268
+ "TOCropViewController",
18269
+ "RiveRuntime",
18270
+ "AVRouting",
18271
+ "CoreData",
18272
+ "PDFKit",
18273
+ "ModelIOEnums",
18274
+ "ModelIO",
18275
+ "MetalKit",
18276
+ "DatadogCore",
18277
+ "DatadogLogs",
18278
+ "DatadogRUM",
18279
+ "DatadogTrace",
18280
+ "AppLovinSDK",
18281
+ "GoogleMobileAds",
18282
+ "AppsFlyerLib",
18283
+ "FBSDKCoreKit",
18284
+ "FBAEMKit",
18285
+ "FBSDKCoreKit_Basics",
18286
+ "FirebaseCore",
18287
+ "FirebaseSharedSwift",
18288
+ "FirebaseRemoteConfig",
18289
+ "FirebaseFirestoreInternal",
18290
+ "FirebaseAnalytics",
18291
+ "FirebaseAppCheck",
18292
+ "FirebaseAuth",
18293
+ "FirebaseCrashlytics",
18294
+ "FirebaseFirestore",
18295
+ "FirebaseStorage",
18296
+ "Firebase",
18297
+ "Intercom",
18298
+ "FBAudienceNetwork",
18299
+ "NaturalLanguage",
18300
+ "AVKit",
18301
+ "SafariServices",
18302
+ "QuickLook",
18303
+ "CoreHaptics",
18304
+ "WebKit",
18305
+ "Photos",
18306
+ "LinkPresentation",
18307
+ "FoundationModels",
18308
+ "CoreTransferable",
18309
+ "AudioToolbox",
18310
+ "CoreAudioTypes",
18311
+ "AudioUnit",
18312
+ "Intents",
18313
+ "IntentsUI",
18314
+ "WatchConnectivity",
18315
+ "CoreServices",
18316
+ "MobileCoreServices",
18317
+ "CoreTelephony",
18318
+ "SystemConfiguration",
18319
+ "ImageIO",
18320
+ "CoreLocationEnums",
18321
+ "CoreLocation",
18322
+ "MapKit",
18323
+ "One",
18324
+ "simd",
18325
+ "GLKit",
18326
+ "GameplayKit",
18327
+ "SpriteKit",
18328
+ "PeachBox2D"
18329
+ ],
18330
+ systemEnvironment: {
18331
+ scenePhase: ["string:active", "string:inactive", "string:background"],
18332
+ colorScheme: ["string:light", "string:dark"],
18333
+ semanticColors: ["object"],
18334
+ deviceModel: ["string"],
18335
+ systemName: ["string"],
18336
+ systemVersion: ["string"],
18337
+ locale: ["string"],
18338
+ dynamicTypeSize: [
18339
+ "string:xSmall",
18340
+ "string:small",
18341
+ "string:medium",
18342
+ "string:large",
18343
+ "string:xLarge",
18344
+ "string:xxLarge",
18345
+ "string:xxxLarge",
18346
+ "string:accessibility1",
18347
+ "string:accessibility2",
18348
+ "string:accessibility3",
18349
+ "string:accessibility4",
18350
+ "string:accessibility5"
18351
+ ],
18352
+ accessibilityReduceMotion: ["bool"],
18353
+ horizontalSizeClass: ["string:compact", "string:regular"],
18354
+ verticalSizeClass: ["string:compact", "string:regular"],
18355
+ imageAssets: ["object"]
18356
+ },
18357
+ hosts: {
18358
+ "darwin-arm64": {
18359
+ sha256: "3b47173dfa25473dfc3c76e46b1203efdc7c2101eca02eb6c89692d66561e78e",
18360
+ size: 81210958
18361
+ },
18362
+ "linux-x64": {
18363
+ sha256: "d11f5fe29845064c390ec980c641c6a70b0199a7f5b6cd445ddc362ff5a2394f",
18364
+ size: 81209921
18365
+ },
18366
+ "linux-arm64": {
18367
+ sha256: "df9ab4453985dbbaf335610f6ab62a15f6f63175869dd484f359b702f316dfac",
18368
+ size: 81209987
18369
+ }
18370
+ }
18371
+ };
18372
+
18373
+ // src/swift-toolchain.ts
18374
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
18375
+ var import_node_fs17 = __toESM(require("node:fs"), 1);
18376
+ var import_node_os4 = __toESM(require("node:os"), 1);
18377
+ var import_node_path17 = __toESM(require("node:path"), 1);
18378
+ function swiftToolchainBin(release) {
18379
+ if (process.platform === "darwin") {
18380
+ const dirs = [import_node_os4.default.homedir(), "/"].map(
18381
+ (base) => import_node_path17.default.join(base, `Library/Developer/Toolchains/${release}.xctoolchain/usr/bin`)
18382
+ );
18383
+ return dirs.find((dir) => import_node_fs17.default.existsSync(import_node_path17.default.join(dir, "swift"))) ?? dirs[0];
18384
+ }
18385
+ if (process.env.CONTRAST_SWIFT_TOOLCHAINS) {
18386
+ return import_node_path17.default.join(process.env.CONTRAST_SWIFT_TOOLCHAINS, release, "usr/bin");
18387
+ }
18388
+ const image = import_node_path17.default.join("/opt/swift", release, "usr/bin");
18389
+ if (import_node_fs17.default.existsSync(import_node_path17.default.join(image, "swift"))) return image;
18390
+ if (release.includes("-custom-"))
18391
+ return import_node_path17.default.join(peachHome(), "swift", "toolchains", release, "usr/bin");
18392
+ return (process.env.PATH ?? "").split(import_node_path17.default.delimiter).find((dir) => dir && import_node_fs17.default.existsSync(import_node_path17.default.join(dir, "swift"))) ?? image;
18393
+ }
18394
+ function peachHome() {
18395
+ const override = process.env.PEACH_HOME;
18396
+ return override ? import_node_path17.default.resolve(override) : import_node_path17.default.join(import_node_os4.default.homedir(), ".peach");
18397
+ }
18398
+ var scratch;
18399
+ function swiftEnvironment(base = process.env) {
18400
+ if (!scratch) return base;
18401
+ return {
18402
+ ...base,
18403
+ TMPDIR: scratch.directory,
18404
+ XDG_CONFIG_HOME: import_node_path17.default.join(scratch.home, ".config"),
18405
+ XDG_CACHE_HOME: import_node_path17.default.join(scratch.home, ".cache"),
18406
+ XDG_DATA_HOME: import_node_path17.default.join(scratch.home, ".local", "share"),
18407
+ ...process.platform === "linux" ? { HOME: scratch.home } : {}
18408
+ };
18409
+ }
18410
+
18411
+ // src/swift-package-manifest.ts
18412
+ function swiftCommand() {
18413
+ return import_node_path18.default.join(swiftToolchainBin(swift_distribution_lock_default.release), "swift");
18414
+ }
18415
+ var cacheDir2 = import_node_path18.default.join(cacheDir(), "swift-manifests");
18416
+ var requirementClause = (item) => {
18417
+ const url = JSON.stringify(item.url);
18418
+ const requirement = item.requirement;
18419
+ if (requirement.kind === "upToNextMajorVersion")
18420
+ return `.package(url: ${url}, from: ${JSON.stringify(requirement.minimumVersion)})`;
18421
+ if (requirement.kind === "upToNextMinorVersion")
18422
+ return `.package(url: ${url}, .upToNextMinor(from: ${JSON.stringify(requirement.minimumVersion)}))`;
18423
+ if (requirement.kind === "versionRange")
18424
+ return `.package(url: ${url}, ${JSON.stringify(requirement.minimumVersion)}..<${JSON.stringify(requirement.maximumVersion)})`;
18425
+ if (requirement.kind === "exactVersion")
18426
+ return `.package(url: ${url}, exact: ${JSON.stringify(requirement.version)})`;
18427
+ if (requirement.kind === "branch")
18428
+ return `.package(url: ${url}, branch: ${JSON.stringify(requirement.branch)})`;
18429
+ return `.package(url: ${url}, revision: ${JSON.stringify(requirement.revision)})`;
18430
+ };
18431
+ function resolveSwiftPackageRequirements(requirements, destination) {
18432
+ const repository = (url) => url.replace(/(?:\.git)?\/?$/, "");
18433
+ const chosen = /* @__PURE__ */ new Map();
18434
+ for (const item of requirements) {
18435
+ const identity = swiftPackageIdentity(item.url);
18436
+ const previous = chosen.get(identity);
18437
+ if (previous && (repository(previous.url) !== repository(item.url) || JSON.stringify(previous.requirement) !== JSON.stringify(item.requirement)))
18438
+ throw new Error(
18439
+ `conflicting requirements for ${identity}: ${previous.url} ${JSON.stringify(previous.requirement)}; ${item.url} ${JSON.stringify(item.requirement)}`
18440
+ );
18441
+ if (!previous) chosen.set(identity, item);
18442
+ }
18443
+ const clauses = [...chosen.values()].sort(
18444
+ (a, b) => swiftPackageIdentity(a.url).localeCompare(swiftPackageIdentity(b.url))
18445
+ ).map(requirementClause);
18446
+ const manifest = `// swift-tools-version:5.9
18447
+ import PackageDescription
18448
+ let package = Package(
18449
+ name: "Resolve",
18450
+ dependencies: [
18451
+ ${clauses.join(",\n ")},
18452
+ ]
18453
+ )
18454
+ `;
18455
+ const dir = import_node_fs18.default.mkdtempSync(import_node_path18.default.join(import_node_os5.default.tmpdir(), "peach-resolve-"));
18456
+ try {
18457
+ import_node_fs18.default.writeFileSync(import_node_path18.default.join(dir, "Package.swift"), manifest);
18458
+ try {
18459
+ (0, import_node_child_process5.execFileSync)(
18460
+ swiftCommand(),
18461
+ [
18462
+ "package",
18463
+ ...swiftPackageCacheOptions(),
18464
+ "--package-path",
18465
+ dir,
18466
+ "--scratch-path",
18467
+ import_node_path18.default.join(dir, ".build"),
18468
+ "resolve"
18469
+ ],
18470
+ {
18471
+ encoding: "utf8",
18472
+ env: { ...swiftEnvironment(), GIT_TERMINAL_PROMPT: "0" },
18473
+ stdio: ["ignore", "pipe", "pipe"],
18474
+ maxBuffer: 32 * 1024 * 1024
18475
+ }
18476
+ );
18477
+ } catch (error) {
18478
+ const stderr = error instanceof Error && "stderr" in error ? String(error.stderr).trim() : "";
18479
+ throw new Error(
18480
+ `swiftpm could not resolve ${clauses.length} package requirements${stderr ? `: ${stderr}` : ""}`
18481
+ );
18482
+ }
18483
+ const resolved = import_node_path18.default.join(dir, "Package.resolved");
18484
+ if (!import_node_fs18.default.existsSync(resolved))
18485
+ throw new Error("swift package resolve wrote no Package.resolved");
18486
+ import_node_fs18.default.mkdirSync(import_node_path18.default.dirname(destination), { recursive: true });
18487
+ import_node_fs18.default.copyFileSync(resolved, destination);
18488
+ } finally {
18489
+ import_node_fs18.default.rmSync(dir, { recursive: true, force: true });
18490
+ }
17380
18491
  }
17381
18492
 
17382
18493
  // src/xcode-json-project.ts
17383
18494
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
17384
- var import_node_path14 = __toESM(require("node:path"), 1);
18495
+ var import_node_path19 = __toESM(require("node:path"), 1);
17385
18496
  var import_json52 = __toESM(require_lib(), 1);
17386
18497
  var isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
17387
18498
  var text = (value) => typeof value === "string" ? value : void 0;
17388
18499
  var items = (value) => Array.isArray(value) ? value : [];
18500
+ function remoteVersionRequirement(entry) {
18501
+ const revision = text(entry.revision);
18502
+ if (revision !== void 0) return { requirement: { kind: "revision", revision } };
18503
+ const branch = text(entry.branch);
18504
+ if (branch !== void 0) return { requirement: { kind: "branch", branch } };
18505
+ const version = text(entry.version);
18506
+ if (version !== void 0) return { requirement: { kind: "exactVersion", version } };
18507
+ const minor = text(entry["up-to-next-minor-version"]);
18508
+ if (minor !== void 0)
18509
+ return { requirement: { kind: "upToNextMinorVersion", minimumVersion: minor } };
18510
+ const major = text(entry["up-to-next-major-version"]);
18511
+ if (major !== void 0)
18512
+ return { requirement: { kind: "upToNextMajorVersion", minimumVersion: major } };
18513
+ const range = text(entry["version-range"]);
18514
+ if (range !== void 0) {
18515
+ const bounds = range.split("..<");
18516
+ const minimum2 = bounds[0];
18517
+ const maximum2 = bounds[1];
18518
+ if (bounds.length !== 2 || !minimum2 || !maximum2 || bounds[2] !== void 0)
18519
+ throw new Error(
18520
+ `${text(entry.repository) ?? "package"} has a version-range that is not min..<max`
18521
+ );
18522
+ return {
18523
+ requirement: {
18524
+ kind: "versionRange",
18525
+ minimumVersion: minimum2,
18526
+ maximumVersion: maximum2
18527
+ }
18528
+ };
18529
+ }
18530
+ const minimum = text(entry["version-range-min"]);
18531
+ const maximum = text(entry["version-range-max"]);
18532
+ if (minimum !== void 0 && maximum !== void 0)
18533
+ return {
18534
+ requirement: {
18535
+ kind: "versionRange",
18536
+ minimumVersion: minimum,
18537
+ maximumVersion: maximum
18538
+ }
18539
+ };
18540
+ return void 0;
18541
+ }
17389
18542
  var PHASE_ISA = {
17390
18543
  "compile-sources": "PBXSourcesBuildPhase",
17391
18544
  resources: "PBXResourcesBuildPhase",
@@ -17397,7 +18550,7 @@ var PHASE_ISA = {
17397
18550
  function readXcodeJsonProject(xcodeproj, source) {
17398
18551
  const json = import_json52.default.parse(source);
17399
18552
  if (!isJsonObject(json)) throw new Error(`${xcodeproj}/project.xcproj is not an object`);
17400
- const projectDir = import_node_path14.default.dirname(xcodeproj);
18553
+ const projectDir = import_node_path19.default.dirname(xcodeproj);
17401
18554
  const objects = {};
17402
18555
  let next = 0;
17403
18556
  const add = (entry, id) => {
@@ -17410,7 +18563,7 @@ function readXcodeJsonProject(xcodeproj, source) {
17410
18563
  const base = /^<([A-Z]+)>\/(.*)$/.exec(raw);
17411
18564
  if (base) {
17412
18565
  if (base[1] === "PROJECT")
17413
- return { sourceTree: "<absolute>", path: import_node_path14.default.join(projectDir, base[2]) };
18566
+ return { sourceTree: "<absolute>", path: import_node_path19.default.join(projectDir, base[2]) };
17414
18567
  if (base[1] === "PRODUCTS")
17415
18568
  return { sourceTree: "BUILT_PRODUCTS_DIR", path: base[2] };
17416
18569
  return null;
@@ -17418,7 +18571,7 @@ function readXcodeJsonProject(xcodeproj, source) {
17418
18571
  const unescaped = raw.replaceAll("\\<", "<");
17419
18572
  if (unescaped.startsWith("/")) return { sourceTree: "<absolute>", path: unescaped };
17420
18573
  if (unescaped.startsWith("~")) return null;
17421
- return groupDir === null ? null : { sourceTree: "<absolute>", path: import_node_path14.default.join(groupDir, unescaped) };
18574
+ return groupDir === null ? null : { sourceTree: "<absolute>", path: import_node_path19.default.join(groupDir, unescaped) };
17422
18575
  };
17423
18576
  const memberships = [];
17424
18577
  const folders = [];
@@ -17429,7 +18582,7 @@ function readXcodeJsonProject(xcodeproj, source) {
17429
18582
  const kind = text(entry.kind) ?? "file-reference";
17430
18583
  const raw = text(entry.path) ?? "";
17431
18584
  const located = raw === "" ? null : locate(raw, parent.dir);
17432
- const name2 = text(entry.name) ?? import_node_path14.default.basename(raw);
18585
+ const name2 = text(entry.name) ?? import_node_path19.default.basename(raw);
17433
18586
  const node = { id: "", name: name2, dir: null, parent, children: [] };
17434
18587
  if (kind === "group" || kind === "variant-group" || kind === "version-group") {
17435
18588
  node.dir = raw === "" ? parent.dir : located?.sourceTree === "<absolute>" ? located.path : null;
@@ -17550,8 +18703,12 @@ function readXcodeJsonProject(xcodeproj, source) {
17550
18703
  if (!isObject(entry)) continue;
17551
18704
  const repository = text(entry.repository);
17552
18705
  const local = text(entry.path);
17553
- const name2 = local !== void 0 ? import_node_path14.default.basename(import_node_path14.default.resolve(import_node_path14.default.dirname(xcodeproj), local)) : import_node_path14.default.basename(repository ?? "").replace(/\.git$/, "");
17554
- const id = text(entry.kind) === "local" && local !== void 0 ? add({ isa: "XCLocalSwiftPackageReference", relativePath: local }) : add({ isa: "XCRemoteSwiftPackageReference", repositoryURL: repository ?? "" });
18706
+ const name2 = local !== void 0 ? import_node_path19.default.basename(import_node_path19.default.resolve(import_node_path19.default.dirname(xcodeproj), local)) : import_node_path19.default.basename(repository ?? "").replace(/\.git$/, "");
18707
+ const id = text(entry.kind) === "local" && local !== void 0 ? add({ isa: "XCLocalSwiftPackageReference", relativePath: local }) : add({
18708
+ isa: "XCRemoteSwiftPackageReference",
18709
+ repositoryURL: repository ?? "",
18710
+ ...remoteVersionRequirement(entry)
18711
+ });
17555
18712
  packageIds.set(name2.toLowerCase(), id);
17556
18713
  }
17557
18714
  const productDependency = (entry) => add({
@@ -17739,28 +18896,28 @@ var CONDITIONS = {
17739
18896
  variant: "normal"
17740
18897
  };
17741
18898
  function walkFiles(dir) {
17742
- if (!import_node_fs15.default.existsSync(dir)) return [];
18899
+ if (!import_node_fs19.default.existsSync(dir)) return [];
17743
18900
  const out = [];
17744
- for (const entry of import_node_fs15.default.readdirSync(dir, { withFileTypes: true }).sort((left, right) => left.name.localeCompare(right.name))) {
18901
+ for (const entry of import_node_fs19.default.readdirSync(dir, { withFileTypes: true }).sort((left, right) => left.name.localeCompare(right.name))) {
17745
18902
  if (entry.name.startsWith(".")) continue;
17746
- const full = import_node_path15.default.join(dir, entry.name);
18903
+ const full = import_node_path20.default.join(dir, entry.name);
17747
18904
  if (entry.isDirectory()) out.push(...walkFiles(full));
17748
18905
  else if (entry.isFile()) out.push(full);
17749
18906
  }
17750
18907
  return out;
17751
18908
  }
17752
- var isDirectory = (dir) => import_node_fs15.default.existsSync(dir) && import_node_fs15.default.statSync(dir).isDirectory();
18909
+ var isDirectory = (dir) => import_node_fs19.default.existsSync(dir) && import_node_fs19.default.statSync(dir).isDirectory();
17753
18910
  function readXcconfig(file, read) {
17754
- if (read.includes(file) || !import_node_fs15.default.existsSync(file)) return {};
18911
+ if (read.includes(file) || !import_node_fs19.default.existsSync(file)) return {};
17755
18912
  read.push(file);
17756
18913
  const settings = {};
17757
- for (const raw of import_node_fs15.default.readFileSync(file, "utf8").split("\n")) {
18914
+ for (const raw of import_node_fs19.default.readFileSync(file, "utf8").split("\n")) {
17758
18915
  const line = raw.replace(/\/\/.*$/, "").trim();
17759
18916
  const include = /^#include\??\s+"([^"]+)"/.exec(line);
17760
18917
  if (include) {
17761
18918
  Object.assign(
17762
18919
  settings,
17763
- readXcconfig(import_node_path15.default.resolve(import_node_path15.default.dirname(file), include[1]), read)
18920
+ readXcconfig(import_node_path20.default.resolve(import_node_path20.default.dirname(file), include[1]), read)
17764
18921
  );
17765
18922
  continue;
17766
18923
  }
@@ -17810,22 +18967,22 @@ function decodeXml(text2) {
17810
18967
  return text2.replaceAll("&quot;", '"').replaceAll("&apos;", "'").replaceAll("&lt;", "<").replaceAll("&gt;", ">").replaceAll("&amp;", "&");
17811
18968
  }
17812
18969
  function workspaceReferences(workspace) {
17813
- const data = import_node_path15.default.join(workspace, "contents.xcworkspacedata");
17814
- if (!import_node_fs15.default.existsSync(data))
18970
+ const data = import_node_path20.default.join(workspace, "contents.xcworkspacedata");
18971
+ if (!import_node_fs19.default.existsSync(data))
17815
18972
  throw new Error(`${workspace} has no contents.xcworkspacedata`);
17816
- const container = import_node_path15.default.dirname(workspace);
18973
+ const container = import_node_path20.default.dirname(workspace);
17817
18974
  const locate = (location, base) => {
17818
18975
  const colon = location.indexOf(":");
17819
18976
  const kind = location.slice(0, colon);
17820
18977
  const rest = location.slice(colon + 1);
17821
- if (kind === "group") return import_node_path15.default.resolve(base, rest);
17822
- if (kind === "container" || kind === "self") return import_node_path15.default.resolve(container, rest);
17823
- if (kind === "absolute") return import_node_path15.default.resolve(rest);
17824
- throw new Error(`${import_node_path15.default.basename(workspace)} has an unsupported location ${location}`);
18978
+ if (kind === "group") return import_node_path20.default.resolve(base, rest);
18979
+ if (kind === "container" || kind === "self") return import_node_path20.default.resolve(container, rest);
18980
+ if (kind === "absolute") return import_node_path20.default.resolve(rest);
18981
+ throw new Error(`${import_node_path20.default.basename(workspace)} has an unsupported location ${location}`);
17825
18982
  };
17826
18983
  const groups = [container];
17827
18984
  const references = [];
17828
- for (const [, closing, tag, attributes, selfClosing] of import_node_fs15.default.readFileSync(data, "utf8").matchAll(/<(\/?)(Group|FileRef)\b([^>]*?)(\/?)>/g)) {
18985
+ for (const [, closing, tag, attributes, selfClosing] of import_node_fs19.default.readFileSync(data, "utf8").matchAll(/<(\/?)(Group|FileRef)\b([^>]*?)(\/?)>/g)) {
17829
18986
  if (closing) {
17830
18987
  if (tag === "Group") groups.pop();
17831
18988
  continue;
@@ -17838,11 +18995,46 @@ function workspaceReferences(workspace) {
17838
18995
  }
17839
18996
  return references;
17840
18997
  }
18998
+ function versionRequirement(url, requirement) {
18999
+ const kind = str(requirement.kind);
19000
+ const minimum = str(requirement.minimumVersion);
19001
+ const maximum = str(requirement.maximumVersion);
19002
+ const version = str(requirement.version);
19003
+ const branch = str(requirement.branch);
19004
+ const revision = str(requirement.revision);
19005
+ if (kind === "upToNextMajorVersion" && minimum)
19006
+ return { kind: "upToNextMajorVersion", minimumVersion: minimum };
19007
+ if (kind === "upToNextMinorVersion" && minimum)
19008
+ return { kind: "upToNextMinorVersion", minimumVersion: minimum };
19009
+ if (kind === "versionRange" && minimum && maximum)
19010
+ return { kind: "versionRange", minimumVersion: minimum, maximumVersion: maximum };
19011
+ if (kind === "exactVersion" && version) return { kind: "exactVersion", version };
19012
+ if (kind === "branch" && branch) return { kind: "branch", branch };
19013
+ if (kind === "revision" && revision) return { kind: "revision", revision };
19014
+ throw new Error(
19015
+ `${url} has an unsupported package requirement${kind ? ` (${kind})` : ""}`
19016
+ );
19017
+ }
19018
+ function remotePackageRequirements(projects) {
19019
+ const out = [];
19020
+ for (const project of projects) {
19021
+ for (const id of list(project.project.packageReferences)) {
19022
+ const reference = project.object(id);
19023
+ if (reference?.isa !== "XCRemoteSwiftPackageReference") continue;
19024
+ const url = str(reference.repositoryURL);
19025
+ if (!url) continue;
19026
+ const requirement = reference.requirement;
19027
+ if (!isDict(requirement)) throw new Error(`${url} has no version requirement`);
19028
+ out.push({ url, requirement: versionRequirement(url, requirement) });
19029
+ }
19030
+ }
19031
+ return out;
19032
+ }
17841
19033
  var loaded2 = /* @__PURE__ */ new Map();
17842
19034
  function xcodeProjectFile(xcodeproj) {
17843
19035
  for (const name2 of ["project.pbxproj", "project.xcproj"]) {
17844
- const file = import_node_path15.default.join(xcodeproj, name2);
17845
- if (import_node_fs15.default.existsSync(file)) return file;
19036
+ const file = import_node_path20.default.join(xcodeproj, name2);
19037
+ if (import_node_fs19.default.existsSync(file)) return file;
17846
19038
  }
17847
19039
  return null;
17848
19040
  }
@@ -17850,7 +19042,7 @@ function loadProject(xcodeproj) {
17850
19042
  const projectFile = xcodeProjectFile(xcodeproj);
17851
19043
  if (!projectFile)
17852
19044
  throw new Error(`${xcodeproj} has no project.pbxproj or project.xcproj`);
17853
- const source = import_node_fs15.default.readFileSync(projectFile, "utf8");
19045
+ const source = import_node_fs19.default.readFileSync(projectFile, "utf8");
17854
19046
  const digest = (0, import_node_crypto7.createHash)("sha256").update(source).digest("hex");
17855
19047
  const cached2 = loaded2.get(projectFile);
17856
19048
  if (cached2?.digest === digest) return cached2.project;
@@ -17867,10 +19059,10 @@ function loadProject(xcodeproj) {
17867
19059
  if (!project || project.isa !== "PBXProject") {
17868
19060
  throw new Error(`${projectFile} has no PBXProject root`);
17869
19061
  }
17870
- const projectDir = import_node_fs15.default.realpathSync(
17871
- import_node_path15.default.resolve(import_node_path15.default.dirname(xcodeproj), str(project.projectDirPath) ?? "")
19062
+ const projectDir = import_node_fs19.default.realpathSync(
19063
+ import_node_path20.default.resolve(import_node_path20.default.dirname(xcodeproj), str(project.projectDirPath) ?? "")
17872
19064
  );
17873
- const resolvePath = xcodePathResolver(objects, projectDir, import_node_path15.default.join);
19065
+ const resolvePath = xcodePathResolver(objects, projectDir, import_node_path20.default.join);
17874
19066
  const result = {
17875
19067
  xcodeproj,
17876
19068
  projectFile,
@@ -17904,8 +19096,8 @@ function targetSettings(ref, configuration, builtins, options = {}, overrides =
17904
19096
  const relative3 = str(config.baseConfigurationReferenceRelativePath);
17905
19097
  const own = isDict(config.buildSettings) ? config.buildSettings : {};
17906
19098
  const directory = anchor ? project.resolvePath(anchor) : null;
17907
- const baseFile = base ? project.resolvePath(base) : directory && relative3 ? import_node_path15.default.resolve(directory, relative3) : null;
17908
- if (options.requireSources !== false && (base || anchor || relative3) && (!baseFile || !import_node_fs15.default.existsSync(baseFile)))
19099
+ const baseFile = base ? project.resolvePath(base) : directory && relative3 ? import_node_path20.default.resolve(directory, relative3) : null;
19100
+ if (options.requireSources !== false && (base || anchor || relative3) && (!baseFile || !import_node_fs19.default.existsSync(baseFile)))
17909
19101
  throw new Error(
17910
19102
  `Unable to open base configuration reference file '${baseFile ?? base ?? relative3 ?? anchor}'`
17911
19103
  );
@@ -17984,26 +19176,26 @@ function settingList(value) {
17984
19176
  return items2;
17985
19177
  }
17986
19178
  function expandSearchPath(directory, rules) {
17987
- if (import_node_path15.default.basename(directory) !== "**") return [directory];
19179
+ if (import_node_path20.default.basename(directory) !== "**") return [directory];
17988
19180
  const expanded = [];
17989
19181
  const seen = /* @__PURE__ */ new Set();
17990
- const queue = [import_node_path15.default.dirname(directory)];
19182
+ const queue = [import_node_path20.default.dirname(directory)];
17991
19183
  for (let at = 0; at < queue.length; at++) {
17992
19184
  const current = queue[at];
17993
19185
  let real;
17994
19186
  try {
17995
- real = import_node_fs15.default.realpathSync(current);
19187
+ real = import_node_fs19.default.realpathSync(current);
17996
19188
  } catch {
17997
19189
  continue;
17998
19190
  }
17999
- if (!import_node_fs15.default.statSync(real).isDirectory() || seen.has(real)) continue;
19191
+ if (!import_node_fs19.default.statSync(real).isDirectory() || seen.has(real)) continue;
18000
19192
  seen.add(real);
18001
19193
  expanded.push(current);
18002
- for (const entry of import_node_fs15.default.readdirSync(real, { withFileTypes: true }).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
19194
+ for (const entry of import_node_fs19.default.readdirSync(real, { withFileTypes: true }).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
18003
19195
  if (entry.isSymbolicLink() ? !rules.followLinks : !entry.isDirectory()) continue;
18004
19196
  if (rules.excluded.some((pattern) => pattern.test(entry.name)) && !rules.included.some((pattern) => pattern.test(entry.name)))
18005
19197
  continue;
18006
- queue.push(import_node_path15.default.join(current, entry.name));
19198
+ queue.push(import_node_path20.default.join(current, entry.name));
18007
19199
  }
18008
19200
  }
18009
19201
  return expanded;
@@ -18045,8 +19237,54 @@ function expand(value, lookup) {
18045
19237
  );
18046
19238
  }
18047
19239
  var preparedSourcePhases = /* @__PURE__ */ new Map();
19240
+ function shellCopies(script, settings, projectDir) {
19241
+ const assigned = /* @__PURE__ */ new Map();
19242
+ const copies = [];
19243
+ let resolved = true;
19244
+ const lookup = (name2) => {
19245
+ const value = assigned.get(name2) ?? settings(name2);
19246
+ if (value === "") resolved = false;
19247
+ return value;
19248
+ };
19249
+ const word = (token2) => {
19250
+ if (/\$\{[A-Za-z_][A-Za-z0-9_]*(?::?[-+=?]|[#%/^,])/.test(token2)) return null;
19251
+ resolved = true;
19252
+ const quote = token2[0];
19253
+ const value = quote === "'" ? token2.slice(1, -1) : expand(quote === '"' ? token2.slice(1, -1) : token2, lookup);
19254
+ return resolved && !value.includes("$") ? value : null;
19255
+ };
19256
+ const token = /^(?:"[^"\\`]*"|'[^']*'|[^\s"'`;&|<>()\\]+)$/;
19257
+ for (const raw of script.split(/\r?\n/)) {
19258
+ const line = raw.trim().replace(/^export\s+/, "");
19259
+ if (line === "" || line.startsWith("#") || /^set\s+-[A-Za-z]+(\s+\w+)?$/.test(line))
19260
+ continue;
19261
+ const tokens = line.match(/"[^"]*"|'[^']*'|\S+/g) ?? [];
19262
+ if (!tokens.every(
19263
+ (value, index) => token.test(index === 0 ? value.replace(/^[A-Za-z_][A-Za-z0-9_]*=/, "") : value)
19264
+ ))
19265
+ return [];
19266
+ const assignment = /^([A-Za-z_][A-Za-z0-9_]*)=(.*)$/.exec(line);
19267
+ if (assignment) {
19268
+ const value = tokens.length === 1 ? word(assignment[2]) : null;
19269
+ if (value === null) return [];
19270
+ assigned.set(assignment[1], value);
19271
+ continue;
19272
+ }
19273
+ if (tokens[0] !== "cp" && tokens[0] !== "echo") return [];
19274
+ const operands = tokens.slice(1).map(word);
19275
+ if (operands.includes(null)) return [];
19276
+ if (tokens[0] === "echo") continue;
19277
+ if (operands.length !== 2 || operands.some((operand) => operand.startsWith("-")))
19278
+ return [];
19279
+ copies.push({
19280
+ from: import_node_path20.default.resolve(projectDir, operands[0]),
19281
+ to: import_node_path20.default.resolve(projectDir, operands[1])
19282
+ });
19283
+ }
19284
+ return copies;
19285
+ }
18048
19286
  function fileListEntries(file, absolute) {
18049
- return import_node_fs15.default.readFileSync(file, "utf8").split(/\r?\n/).map((line) => line.trim()).filter((line) => line !== "" && !line.startsWith("#")).map(absolute);
19287
+ return import_node_fs19.default.readFileSync(file, "utf8").split(/\r?\n/).map((line) => line.trim()).filter((line) => line !== "" && !line.startsWith("#")).map(absolute);
18050
19288
  }
18051
19289
  function targetMembers(ref, settings, options, settingKeys, projectInputs) {
18052
19290
  const { project, target, id: targetId } = ref;
@@ -18056,14 +19294,19 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
18056
19294
  const headers = /* @__PURE__ */ new Set();
18057
19295
  const resources = /* @__PURE__ */ new Set();
18058
19296
  const scriptForOutput = /* @__PURE__ */ new Map();
19297
+ const copiedFiles = [];
19298
+ let generatedInfoPlist = false;
18059
19299
  const declaredInfoPlist = settings("INFOPLIST_FILE");
18060
- const infoPlistOutput = declaredInfoPlist ? import_node_path15.default.resolve(project.projectDir, declaredInfoPlist) : null;
19300
+ const infoPlistOutput = declaredInfoPlist ? import_node_path20.default.resolve(project.projectDir, declaredInfoPlist) : null;
18061
19301
  const isPreparedOutput = (file) => file === infoPlistOutput || options.requireSources !== false && file.endsWith(".swift");
18062
19302
  for (const phaseId of list(target.buildPhases)) {
18063
19303
  const phase = project.object(phaseId);
18064
19304
  if (phase?.isa !== "PBXShellScriptBuildPhase") continue;
18065
19305
  const script = str(phase.name) ?? phaseId;
18066
- const absolute = (raw) => import_node_path15.default.resolve(project.projectDir, expand(raw, settings));
19306
+ copiedFiles.push(
19307
+ ...shellCopies(str(phase.shellScript) ?? "", settings, project.projectDir)
19308
+ );
19309
+ const absolute = (raw) => import_node_path20.default.resolve(project.projectDir, expand(raw, settings));
18067
19310
  const inputs = list(phase.inputPaths).map(absolute);
18068
19311
  const outputs = list(phase.outputPaths).map(absolute);
18069
19312
  const fileLists = /* @__PURE__ */ new Map();
@@ -18072,7 +19315,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
18072
19315
  kind === "INPUT" ? phase.inputFileListPaths : phase.outputFileListPaths
18073
19316
  ).map((raw) => {
18074
19317
  const file = absolute(raw);
18075
- if (!import_node_fs15.default.existsSync(file)) {
19318
+ if (!import_node_fs19.default.existsSync(file)) {
18076
19319
  return { file, entries: [] };
18077
19320
  }
18078
19321
  return { file, entries: fileListEntries(file, absolute) };
@@ -18083,6 +19326,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
18083
19326
  ...outputs,
18084
19327
  ...fileLists.get("OUTPUT").flatMap((item) => item.entries)
18085
19328
  ];
19329
+ if (allOutputs.includes(infoPlistOutput)) generatedInfoPlist = true;
18086
19330
  for (const output of allOutputs)
18087
19331
  if (output.endsWith(".swift") && !scriptForOutput.has(output))
18088
19332
  scriptForOutput.set(output, script);
@@ -18092,13 +19336,13 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
18092
19336
  ...fileLists.get("OUTPUT").map((item) => item.file)
18093
19337
  ];
18094
19338
  if (allOutputs.some((file) => file.endsWith(".swift") || file === infoPlistOutput)) {
18095
- for (const file of inputFiles) if (import_node_fs15.default.existsSync(file)) projectInputs.add(file);
19339
+ for (const file of inputFiles) if (import_node_fs19.default.existsSync(file)) projectInputs.add(file);
18096
19340
  }
18097
- if (options.prepareGeneratedSources && allOutputs.some(isPreparedOutput)) {
18098
- const phaseDir = import_node_path15.default.join(settings("TARGET_TEMP_DIR"), `Script-${phaseId}`);
19341
+ if (options.prepareGeneratedSources === true && allOutputs.some(isPreparedOutput)) {
19342
+ const phaseDir = import_node_path20.default.join(settings("TARGET_TEMP_DIR"), `Script-${phaseId}`);
18099
19343
  for (const lists of fileLists.values())
18100
19344
  for (const { file } of lists)
18101
- if (!import_node_fs15.default.existsSync(file))
19345
+ if (!import_node_fs19.default.existsSync(file))
18102
19346
  throw new Error(
18103
19347
  `${targetName}: Run Script "${script}" missing file list ${file}`
18104
19348
  );
@@ -18117,7 +19361,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
18117
19361
  const lists = fileLists.get(kind);
18118
19362
  env[`SCRIPT_${kind}_FILE_LIST_COUNT`] = String(lists.length);
18119
19363
  lists.forEach((_item, index) => {
18120
- env[`SCRIPT_${kind}_FILE_LIST_${index}`] = import_node_path15.default.join(
19364
+ env[`SCRIPT_${kind}_FILE_LIST_${index}`] = import_node_path20.default.join(
18121
19365
  phaseDir,
18122
19366
  `${kind}-${index}.xcfilelist`
18123
19367
  );
@@ -18128,37 +19372,37 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
18128
19372
  );
18129
19373
  for (const file of inputFiles) {
18130
19374
  signature.update(file);
18131
- if (import_node_fs15.default.existsSync(file)) {
18132
- const stat = import_node_fs15.default.statSync(file);
19375
+ if (import_node_fs19.default.existsSync(file)) {
19376
+ const stat = import_node_fs19.default.statSync(file);
18133
19377
  signature.update(`${stat.mtimeMs}:${stat.ctimeMs}:${stat.size}`);
18134
19378
  } else signature.update("missing");
18135
19379
  }
18136
19380
  const stamp = signature.digest("hex");
18137
19381
  const key = `${project.projectFile}:${targetId}:${phaseId}:${settings("CONFIGURATION")}`;
18138
- if (preparedSourcePhases.get(key) === stamp && allOutputs.every((file) => import_node_fs15.default.existsSync(file)))
19382
+ if (preparedSourcePhases.get(key) === stamp && allOutputs.every((file) => import_node_fs19.default.existsSync(file)))
18139
19383
  continue;
18140
- import_node_fs15.default.mkdirSync(phaseDir, { recursive: true });
18141
- import_node_fs15.default.mkdirSync(settings("BUILT_PRODUCTS_DIR"), { recursive: true });
18142
- import_node_fs15.default.mkdirSync(settings("DERIVED_FILE_DIR"), { recursive: true });
19384
+ import_node_fs19.default.mkdirSync(phaseDir, { recursive: true });
19385
+ import_node_fs19.default.mkdirSync(settings("BUILT_PRODUCTS_DIR"), { recursive: true });
19386
+ import_node_fs19.default.mkdirSync(settings("DERIVED_FILE_DIR"), { recursive: true });
18143
19387
  for (const output of allOutputs)
18144
- import_node_fs15.default.mkdirSync(import_node_path15.default.dirname(output), { recursive: true });
19388
+ import_node_fs19.default.mkdirSync(import_node_path20.default.dirname(output), { recursive: true });
18145
19389
  for (const [kind, lists] of fileLists)
18146
19390
  lists.forEach((item, index) => {
18147
- import_node_fs15.default.writeFileSync(
19391
+ import_node_fs19.default.writeFileSync(
18148
19392
  env[`SCRIPT_${kind}_FILE_LIST_${index}`],
18149
19393
  `${item.entries.join("\n")}
18150
19394
  `
18151
19395
  );
18152
19396
  });
18153
19397
  try {
18154
- (0, import_node_child_process5.execFileSync)(
19398
+ (0, import_node_child_process6.execFileSync)(
18155
19399
  str(phase.shellPath) ?? "/bin/sh",
18156
19400
  ["-c", str(phase.shellScript) ?? ""],
18157
19401
  {
18158
19402
  cwd: project.projectDir,
18159
19403
  env,
18160
19404
  stdio: ["ignore", "pipe", "pipe"],
18161
- timeout: 12e4
19405
+ maxBuffer: Infinity
18162
19406
  }
18163
19407
  );
18164
19408
  } catch (error) {
@@ -18169,12 +19413,12 @@ ${"stdout" in error ? String(error.stdout) : ""}${"stderr" in error ? String(err
18169
19413
  ${output}`
18170
19414
  );
18171
19415
  }
18172
- const missing = allOutputs.filter(
18173
- (file) => isPreparedOutput(file) && !import_node_fs15.default.existsSync(file)
19416
+ const missing2 = allOutputs.filter(
19417
+ (file) => file === infoPlistOutput && !import_node_fs19.default.existsSync(file)
18174
19418
  );
18175
- if (missing.length > 0)
19419
+ if (missing2.length > 0)
18176
19420
  throw new Error(
18177
- `${targetName}: Run Script "${script}" did not produce ${missing.join(", ")}`
19421
+ `${targetName}: Run Script "${script}" did not produce ${missing2.join(", ")}`
18178
19422
  );
18179
19423
  preparedSourcePhases.set(key, stamp);
18180
19424
  }
@@ -18183,8 +19427,8 @@ ${output}`
18183
19427
  project.objects,
18184
19428
  targetId,
18185
19429
  project.resolvePath,
18186
- (file) => isDirectory(file) ? walkFiles(file) : import_node_fs15.default.existsSync(file) ? [file] : [],
18187
- import_node_path15.default.join,
19430
+ (file) => isDirectory(file) ? walkFiles(file) : import_node_fs19.default.existsSync(file) ? [file] : [],
19431
+ import_node_path20.default.join,
18188
19432
  (file, kind) => {
18189
19433
  if (kind === "header") {
18190
19434
  headers.add(file);
@@ -18194,9 +19438,9 @@ ${output}`
18194
19438
  resources.add(file);
18195
19439
  return;
18196
19440
  }
18197
- if (!import_node_fs15.default.existsSync(file)) {
19441
+ if (!import_node_fs19.default.existsSync(file)) {
18198
19442
  if (options.requireSources === false) return;
18199
- const script = scriptForOutput.get(import_node_path15.default.normalize(file));
19443
+ const script = scriptForOutput.get(import_node_path20.default.normalize(file));
18200
19444
  throw new Error(
18201
19445
  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}`
18202
19446
  );
@@ -18205,20 +19449,19 @@ ${output}`
18205
19449
  if (file.endsWith(".swift")) sources.add(file);
18206
19450
  }
18207
19451
  );
18208
- for (const [file, script] of scriptForOutput) {
19452
+ for (const [file] of scriptForOutput) {
18209
19453
  if (sources.has(file) || allSources.has(file)) continue;
18210
- if (!import_node_fs15.default.existsSync(file)) {
18211
- if (options.requireSources === false) continue;
18212
- throw new Error(
18213
- `${targetName}: missing generated source ${file} (Run Script "${script}" declares it in outputPaths; run the script or check in its output)`
18214
- );
18215
- }
18216
- allSources.add(file);
18217
- sources.add(file);
19454
+ if (!import_node_fs19.default.existsSync(file)) continue;
19455
+ const canonical = import_node_fs19.default.realpathSync(file);
19456
+ if (sources.has(canonical) || allSources.has(canonical)) continue;
19457
+ allSources.add(canonical);
19458
+ sources.add(canonical);
18218
19459
  }
18219
19460
  return {
18220
19461
  sources: [...sources].sort(),
18221
19462
  resources: [...resources].sort(),
19463
+ copiedFiles,
19464
+ generatedInfoPlist,
18222
19465
  allSources: [...allSources].sort(),
18223
19466
  headers: [...headers].sort()
18224
19467
  };
@@ -18226,37 +19469,37 @@ ${output}`
18226
19469
  function commonAncestor(dirs) {
18227
19470
  let common = dirs[0];
18228
19471
  for (const dir of dirs) {
18229
- while (common !== import_node_path15.default.dirname(common) && import_node_path15.default.relative(common, dir).startsWith(".."))
18230
- common = import_node_path15.default.dirname(common);
19472
+ while (common !== import_node_path20.default.dirname(common) && import_node_path20.default.relative(common, dir).startsWith(".."))
19473
+ common = import_node_path20.default.dirname(common);
18231
19474
  }
18232
19475
  return common;
18233
19476
  }
18234
- var isPodsProject = (xcodeproj) => import_node_path15.default.basename(xcodeproj) === "Pods.xcodeproj" && import_node_path15.default.basename(import_node_path15.default.dirname(xcodeproj)) === "Pods";
19477
+ var isPodsProject = (xcodeproj) => import_node_path20.default.basename(xcodeproj) === "Pods.xcodeproj" && import_node_path20.default.basename(import_node_path20.default.dirname(xcodeproj)) === "Pods";
18235
19478
  function installedPodsSandbox(pods) {
18236
- const podfileLock = import_node_path15.default.join(import_node_path15.default.dirname(pods), "Podfile.lock");
18237
- const manifestLock = import_node_path15.default.join(pods, "Manifest.lock");
18238
- if (!import_node_fs15.default.existsSync(podfileLock))
19479
+ const podfileLock = import_node_path20.default.join(import_node_path20.default.dirname(pods), "Podfile.lock");
19480
+ const manifestLock = import_node_path20.default.join(pods, "Manifest.lock");
19481
+ if (!import_node_fs19.default.existsSync(podfileLock))
18239
19482
  throw new Error(
18240
- `${pods} has no ${podfileLock}: run \`pod install\` in ${import_node_path15.default.dirname(pods)}`
19483
+ `${pods} has no ${podfileLock}: run \`pod install\` in ${import_node_path20.default.dirname(pods)}`
18241
19484
  );
18242
- if (!import_node_fs15.default.existsSync(manifestLock) || !import_node_fs15.default.readFileSync(manifestLock).equals(import_node_fs15.default.readFileSync(podfileLock)))
19485
+ if (!import_node_fs19.default.existsSync(manifestLock) || !import_node_fs19.default.readFileSync(manifestLock).equals(import_node_fs19.default.readFileSync(podfileLock)))
18243
19486
  throw new Error(
18244
- `The sandbox is not in sync with the Podfile.lock: ${manifestLock} differs from ${podfileLock}. Run \`pod install\` in ${import_node_path15.default.dirname(pods)}`
19487
+ `The sandbox is not in sync with the Podfile.lock: ${manifestLock} differs from ${podfileLock}. Run \`pod install\` in ${import_node_path20.default.dirname(pods)}`
18245
19488
  );
18246
19489
  const specChecksums = {};
18247
- const lines = import_node_fs15.default.readFileSync(manifestLock, "utf8").split("\n");
19490
+ const lines = import_node_fs19.default.readFileSync(manifestLock, "utf8").split("\n");
18248
19491
  const start = lines.indexOf("SPEC CHECKSUMS:");
18249
19492
  for (const line of start === -1 ? [] : lines.slice(start + 1)) {
18250
19493
  const entry = /^ {2}"?([^":]+)"?: ([0-9a-f]+)$/.exec(line);
18251
19494
  if (!entry) break;
18252
19495
  specChecksums[entry[1]] = entry[2];
18253
19496
  }
18254
- const specs = import_node_path15.default.join(pods, "Local Podspecs");
19497
+ const specs = import_node_path20.default.join(pods, "Local Podspecs");
18255
19498
  return {
18256
19499
  podfileLock,
18257
19500
  manifestLock,
18258
19501
  specChecksums,
18259
- localPodspecs: isDirectory(specs) ? import_node_fs15.default.readdirSync(specs).filter((name2) => name2.endsWith(".podspec.json")).sort().map((name2) => import_node_path15.default.join(specs, name2)) : []
19502
+ localPodspecs: isDirectory(specs) ? import_node_fs19.default.readdirSync(specs).filter((name2) => name2.endsWith(".podspec.json")).sort().map((name2) => import_node_path20.default.join(specs, name2)) : []
18260
19503
  };
18261
19504
  }
18262
19505
  function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
@@ -18268,14 +19511,14 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
18268
19511
  if (!xcodeProjectFile(xcodeproj)) {
18269
19512
  if (installedPods && isPodsProject(xcodeproj))
18270
19513
  throw new Error(
18271
- `${import_node_path15.default.basename(xcodeprojOrWorkspace)} builds ${xcodeproj}, which is not installed: run \`pod install\` in ${import_node_path15.default.dirname(import_node_path15.default.dirname(xcodeproj))}`
19514
+ `${import_node_path20.default.basename(xcodeprojOrWorkspace)} builds ${xcodeproj}, which is not installed: run \`pod install\` in ${import_node_path20.default.dirname(import_node_path20.default.dirname(xcodeproj))}`
18272
19515
  );
18273
19516
  return;
18274
19517
  }
18275
- const key = import_node_fs15.default.realpathSync(xcodeproj);
18276
- if (projectAt.has(key) || !installedPods && key.split(import_node_path15.default.sep).includes("Pods"))
19518
+ const key = import_node_fs19.default.realpathSync(xcodeproj);
19519
+ if (projectAt.has(key) || !installedPods && key.split(import_node_path20.default.sep).includes("Pods"))
18277
19520
  return;
18278
- if (isPodsProject(key)) cocoapods = installedPodsSandbox(import_node_path15.default.dirname(key));
19521
+ if (isPodsProject(key)) cocoapods = installedPodsSandbox(import_node_path20.default.dirname(key));
18279
19522
  const project = loadProject(key);
18280
19523
  projectAt.set(key, project);
18281
19524
  projects.push(project);
@@ -18291,12 +19534,12 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
18291
19534
  for (const reference of listed)
18292
19535
  if (reference.endsWith(".xcodeproj")) addProject(reference);
18293
19536
  if (projects.length === 0) {
18294
- throw new Error(`${import_node_path15.default.basename(xcodeprojOrWorkspace)} lists no Xcode project`);
19537
+ throw new Error(`${import_node_path20.default.basename(xcodeprojOrWorkspace)} lists no Xcode project`);
18295
19538
  }
18296
- const podfile = import_node_path15.default.join(import_node_path15.default.dirname(xcodeprojOrWorkspace), "Podfile");
18297
- if (installedPods && !cocoapods && import_node_fs15.default.existsSync(podfile))
19539
+ const podfile = import_node_path20.default.join(import_node_path20.default.dirname(xcodeprojOrWorkspace), "Podfile");
19540
+ if (installedPods && !cocoapods && import_node_fs19.default.existsSync(podfile))
18298
19541
  throw new Error(
18299
- `${podfile} is not installed into ${import_node_path15.default.basename(xcodeprojOrWorkspace)}: run \`pod install\` in ${import_node_path15.default.dirname(podfile)} and open the workspace it writes`
19542
+ `${podfile} is not installed into ${import_node_path20.default.basename(xcodeprojOrWorkspace)}: run \`pod install\` in ${import_node_path20.default.dirname(podfile)} and open the workspace it writes`
18300
19543
  );
18301
19544
  return { listed, projects, projectAt, cocoapods };
18302
19545
  }
@@ -18332,7 +19575,7 @@ function listXcodeAppTargets(xcodeprojOrWorkspace, options = {}) {
18332
19575
  return workspaceProjects(xcodeprojOrWorkspace).projects.flatMap(projectTargets).filter((ref) => isIosAppTarget(ref, options)).map((ref) => str(ref.target.name) ?? ref.id);
18333
19576
  }
18334
19577
  function readXcodeAppTarget(input, targetName, configurationName, options = {}) {
18335
- const xcodeprojOrWorkspace = import_node_fs15.default.realpathSync(input);
19578
+ const xcodeprojOrWorkspace = import_node_fs19.default.realpathSync(input);
18336
19579
  const workspace = xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : null;
18337
19580
  const { listed, projects, projectAt, cocoapods } = workspaceProjects(
18338
19581
  xcodeprojOrWorkspace,
@@ -18341,7 +19584,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
18341
19584
  const allTargets = projects.flatMap(projectTargets);
18342
19585
  const appTargets = allTargets.filter((ref) => isIosAppTarget(ref, options));
18343
19586
  const appTargetNames = appTargets.map((ref) => str(ref.target.name) ?? ref.id);
18344
- const container = import_node_path15.default.basename(xcodeprojOrWorkspace);
19587
+ const container = import_node_path20.default.basename(xcodeprojOrWorkspace);
18345
19588
  const named = targetName ? appTargets.filter((ref) => ref.target.name === targetName) : appTargets;
18346
19589
  if (named.length !== 1) {
18347
19590
  throw new Error(
@@ -18354,15 +19597,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
18354
19597
  for (const ref of allTargets) {
18355
19598
  const product = ref.project.object(str(ref.target.productReference));
18356
19599
  const file = str(product?.path);
18357
- if (file && !byProduct.has(import_node_path15.default.basename(file)))
18358
- byProduct.set(import_node_path15.default.basename(file), ref);
19600
+ if (file && !byProduct.has(import_node_path20.default.basename(file)))
19601
+ byProduct.set(import_node_path20.default.basename(file), ref);
18359
19602
  }
18360
19603
  const proxied = (project, proxyId) => {
18361
19604
  const proxy = project.object(proxyId);
18362
19605
  if (proxy?.isa !== "PBXContainerItemProxy") return void 0;
18363
19606
  const portal = str(proxy.containerPortal);
18364
19607
  const portalPath = project.resolvePath(portal ?? "");
18365
- const owner = project.object(portal)?.isa === "PBXProject" ? project : portalPath && import_node_fs15.default.existsSync(portalPath) ? projectAt.get(import_node_fs15.default.realpathSync(portalPath)) : void 0;
19608
+ const owner = project.object(portal)?.isa === "PBXProject" ? project : portalPath && import_node_fs19.default.existsSync(portalPath) ? projectAt.get(import_node_fs19.default.realpathSync(portalPath)) : void 0;
18366
19609
  const remote = str(proxy.remoteGlobalIDString);
18367
19610
  if (!owner || !remote) return void 0;
18368
19611
  return projectTargets(owner).find(
@@ -18383,7 +19626,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
18383
19626
  if (phase?.isa !== "PBXFrameworksBuildPhase") continue;
18384
19627
  for (const buildFileId of list(phase.files)) {
18385
19628
  const file = project.object(str(project.object(buildFileId)?.fileRef));
18386
- const resolved = file?.isa === "PBXReferenceProxy" ? proxied(project, str(file.remoteRef)) : file && str(file.sourceTree) === "BUILT_PRODUCTS_DIR" ? byProduct.get(import_node_path15.default.basename(str(file.path) ?? "")) : void 0;
19629
+ const resolved = file?.isa === "PBXReferenceProxy" ? proxied(project, str(file.remoteRef)) : file && str(file.sourceTree) === "BUILT_PRODUCTS_DIR" ? byProduct.get(import_node_path20.default.basename(str(file.path) ?? "")) : void 0;
18387
19630
  if (resolved) found.push(resolved);
18388
19631
  }
18389
19632
  }
@@ -18422,6 +19665,25 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
18422
19665
  { TARGET_NAME: str(ref.target.name) ?? ref.id },
18423
19666
  options
18424
19667
  ).get("PRODUCT_NAME");
19668
+ const syncHeaderCache = /* @__PURE__ */ new Map();
19669
+ const synchronizedHeaders = (ref) => {
19670
+ const key = `${ref.project.xcodeproj}\0${ref.id}`;
19671
+ const cached2 = syncHeaderCache.get(key);
19672
+ if (cached2) return cached2;
19673
+ const found = [];
19674
+ visitXcodeTargetMembers(
19675
+ ref.project.objects,
19676
+ ref.id,
19677
+ ref.project.resolvePath,
19678
+ (file) => isDirectory(file) ? walkFiles(file) : import_node_fs19.default.existsSync(file) ? [file] : [],
19679
+ import_node_path20.default.join,
19680
+ (file, kind) => {
19681
+ if (kind === "header") found.push(file);
19682
+ }
19683
+ );
19684
+ syncHeaderCache.set(key, found);
19685
+ return found;
19686
+ };
18425
19687
  const projectHeaderMaps = /* @__PURE__ */ new Map();
18426
19688
  const projectHeaderMap = (project) => {
18427
19689
  const cached2 = projectHeaderMaps.get(project);
@@ -18430,26 +19692,41 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
18430
19692
  for (const ref of projectTargets(project)) {
18431
19693
  const product = productName(ref);
18432
19694
  for (const { file, visibility } of headerPhase(ref)) {
18433
- const name2 = import_node_path15.default.basename(file);
19695
+ const name2 = import_node_path20.default.basename(file);
18434
19696
  if (!entries.has(name2))
18435
19697
  entries.set(name2, visibility !== "Project" ? `${product}/${name2}` : file);
18436
19698
  }
19699
+ for (const file of synchronizedHeaders(ref)) {
19700
+ const name2 = import_node_path20.default.basename(file);
19701
+ if (!entries.has(name2)) entries.set(name2, file);
19702
+ }
19703
+ }
19704
+ for (const ref of projectTargets(project)) {
19705
+ for (const groupId of list(ref.target.fileSystemSynchronizedGroups)) {
19706
+ const folder = project.resolvePath(groupId);
19707
+ if (folder === null) continue;
19708
+ for (const file of walkFiles(folder)) {
19709
+ if (!HEADER_FILE.test(file)) continue;
19710
+ const name2 = import_node_path20.default.basename(file);
19711
+ if (!entries.has(name2)) entries.set(name2, file);
19712
+ }
19713
+ }
18437
19714
  }
18438
19715
  for (const id of Object.keys(project.objects)) {
18439
19716
  if (project.object(id)?.isa !== "PBXFileReference") continue;
18440
19717
  const file = project.resolvePath(id);
18441
- if (file && HEADER_FILE.test(file) && !entries.has(import_node_path15.default.basename(file)))
18442
- entries.set(import_node_path15.default.basename(file), file);
19718
+ if (file && HEADER_FILE.test(file) && !entries.has(import_node_path20.default.basename(file)))
19719
+ entries.set(import_node_path20.default.basename(file), file);
18443
19720
  }
18444
19721
  const map2 = [...entries];
18445
19722
  projectHeaderMaps.set(project, map2);
18446
19723
  return map2;
18447
19724
  };
18448
19725
  const xcconfigs = /* @__PURE__ */ new Set();
18449
- const buildDir = (project) => import_node_path15.default.join(project.projectDir, ".build/peach-xcode/Build");
19726
+ const buildDir = (project) => import_node_path20.default.join(project.projectDir, ".build/peach-xcode/Build");
18450
19727
  const podsBuild = {
18451
- SYMROOT: import_node_path15.default.join(buildDir(app.project), "Products"),
18452
- OBJROOT: import_node_path15.default.join(buildDir(app.project), "Intermediates.noindex")
19728
+ SYMROOT: import_node_path20.default.join(buildDir(app.project), "Products"),
19729
+ OBJROOT: import_node_path20.default.join(buildDir(app.project), "Intermediates.noindex")
18453
19730
  };
18454
19731
  const moduleTarget = (ref) => {
18455
19732
  const name2 = str(ref.target.name) ?? ref.id;
@@ -18464,15 +19741,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
18464
19741
  TARGET_NAME: name2,
18465
19742
  TARGETNAME: "$(TARGET_NAME)",
18466
19743
  PROJECT: "$(PROJECT_NAME)",
18467
- PROJECT_NAME: import_node_path15.default.basename(ref.project.xcodeproj, ".xcodeproj"),
19744
+ PROJECT_NAME: import_node_path20.default.basename(ref.project.xcodeproj, ".xcodeproj"),
18468
19745
  PROJECT_FILE_PATH: ref.project.xcodeproj,
18469
19746
  SRCROOT: ref.project.projectDir,
18470
19747
  SOURCE_ROOT: ref.project.projectDir,
18471
19748
  PROJECT_DIR: ref.project.projectDir,
18472
- SYMROOT: import_node_path15.default.join(buildDir(ref.project), "Products"),
19749
+ SYMROOT: import_node_path20.default.join(buildDir(ref.project), "Products"),
18473
19750
  BUILD_DIR: "$(SYMROOT)",
18474
19751
  BUILD_ROOT: "$(SYMROOT)",
18475
- OBJROOT: import_node_path15.default.join(buildDir(ref.project), "Intermediates.noindex"),
19752
+ OBJROOT: import_node_path20.default.join(buildDir(ref.project), "Intermediates.noindex"),
18476
19753
  CONFIGURATION_BUILD_DIR: "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)",
18477
19754
  BUILT_PRODUCTS_DIR: "$(CONFIGURATION_BUILD_DIR)",
18478
19755
  TARGET_BUILD_DIR: "$(CONFIGURATION_BUILD_DIR)",
@@ -18485,6 +19762,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
18485
19762
  TEMP_ROOT: "$(OBJROOT)",
18486
19763
  DERIVED_FILE_DIR: "$(TARGET_TEMP_DIR)/DerivedSources",
18487
19764
  DERIVED_FILES_DIR: "$(DERIVED_FILE_DIR)",
19765
+ DERIVED_SOURCES_DIR: "$(DERIVED_FILE_DIR)",
18488
19766
  PLATFORM_NAME: "iphonesimulator",
18489
19767
  EFFECTIVE_PLATFORM_NAME: "-iphonesimulator",
18490
19768
  CURRENT_ARCH: "arm64",
@@ -18505,11 +19783,38 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
18505
19783
  xcconfigs
18506
19784
  );
18507
19785
  const searchRules = recursiveSearchRules(settings2);
18508
- const absolute = (file) => import_node_path15.default.resolve(ref.project.projectDir, file);
19786
+ const absolute = (file) => import_node_path20.default.resolve(ref.project.projectDir, file);
18509
19787
  const framework = FRAMEWORK_PRODUCTS.has(str(ref.target.productType) ?? "");
18510
19788
  const product = settings2("PRODUCT_NAME");
19789
+ const moduleName = applyOperator(settings2("PRODUCT_MODULE_NAME"), "c99extidentifier");
19790
+ const compatibilityPhases = list(ref.target.buildPhases).flatMap((id) => {
19791
+ const phase = ref.project.object(id);
19792
+ if (phase?.isa !== "PBXShellScriptBuildPhase" || str(phase.name) !== "Copy generated compatibility header")
19793
+ return [];
19794
+ const inputs = list(phase.inputPaths).map(
19795
+ (file) => absolute(expand(file, settings2))
19796
+ );
19797
+ const outputs = list(phase.outputPaths).map(
19798
+ (file) => absolute(expand(file, settings2))
19799
+ );
19800
+ const moduleMap2 = inputs.find((file) => file.endsWith(".modulemap"));
19801
+ const umbrella = inputs.find((file) => file.endsWith("-umbrella.h"));
19802
+ const outputModuleMap = outputs.find((file) => file.endsWith(".modulemap"));
19803
+ const outputUmbrella = outputs.find((file) => file.endsWith("-umbrella.h"));
19804
+ const outputHeader = outputs.find((file) => file.endsWith(`/${moduleName}-Swift.h`));
19805
+ if (!moduleMap2 || !umbrella || !outputModuleMap || !outputUmbrella || !outputHeader)
19806
+ throw new Error(`${name2}: incomplete CocoaPods Swift compatibility header phase`);
19807
+ return [{ id, moduleMap: moduleMap2, umbrella, outputModuleMap, outputUmbrella, outputHeader }];
19808
+ });
19809
+ if (compatibilityPhases.length > 1)
19810
+ throw new Error(`${name2}: multiple CocoaPods Swift compatibility header phases`);
19811
+ const compatibility = compatibilityPhases[0];
19812
+ if (compatibility && members.sources.length === 0)
19813
+ throw new Error(
19814
+ `${name2}: Swift compatibility header phase has no Swift producer sources`
19815
+ );
18511
19816
  const building = options.prepareGeneratedSources && options.requireSources !== false;
18512
- const versioning = building && allSources.length > 0 && settings2("VERSIONING_SYSTEM") === "apple-generic" ? import_node_path15.default.join(settings2("DERIVED_FILE_DIR"), `${product}_vers.c`) : null;
19817
+ const versioning = building && allSources.length > 0 && settings2("VERSIONING_SYSTEM") === "apple-generic" ? import_node_path20.default.join(settings2("DERIVED_FILE_DIR"), `${product}_vers.c`) : null;
18513
19818
  if (versioning) {
18514
19819
  const version = settings2("CURRENT_PROJECT_VERSION");
18515
19820
  const custom = [
@@ -18522,7 +19827,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
18522
19827
  ].filter((key) => settings2(key));
18523
19828
  if (custom.length)
18524
19829
  throw new Error(
18525
- `${name2}: Xcode generates ${import_node_path15.default.basename(versioning)} with ${custom.join(", ")}; peach does not model VERSION_INFO_* overrides`
19830
+ `${name2}: Xcode generates ${import_node_path20.default.basename(versioning)} with ${custom.join(", ")}; peach does not model VERSION_INFO_* overrides`
18526
19831
  );
18527
19832
  const symbol = product.replace(/^[^A-Za-z_]/, "_").replace(/[^A-Za-z0-9_]/g, "_");
18528
19833
  const [major, minor] = version.split(".");
@@ -18535,9 +19840,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
18535
19840
  ` const double ${symbol}VersionNumber __attribute__ ((used)) = (double)${number};`,
18536
19841
  ""
18537
19842
  ].join("\n");
18538
- if (!import_node_fs15.default.existsSync(versioning) || import_node_fs15.default.readFileSync(versioning, "utf8") !== unit) {
18539
- import_node_fs15.default.mkdirSync(import_node_path15.default.dirname(versioning), { recursive: true });
18540
- import_node_fs15.default.writeFileSync(versioning, unit);
19843
+ if (!import_node_fs19.default.existsSync(versioning) || import_node_fs19.default.readFileSync(versioning, "utf8") !== unit) {
19844
+ import_node_fs19.default.mkdirSync(import_node_path20.default.dirname(versioning), { recursive: true });
19845
+ import_node_fs19.default.writeFileSync(versioning, unit);
18541
19846
  }
18542
19847
  allSources.push(versioning);
18543
19848
  }
@@ -18556,29 +19861,36 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
18556
19861
  const headerFiles = headerPhase(ref);
18557
19862
  const ownHeaders = /* @__PURE__ */ new Map();
18558
19863
  for (const { file, visibility } of headerFiles) {
18559
- const name3 = import_node_path15.default.basename(file);
19864
+ const name3 = import_node_path20.default.basename(file);
18560
19865
  const published = visibility !== "Project";
18561
19866
  if (!ownHeaders.has(name3))
18562
19867
  ownHeaders.set(name3, published ? `${product}/${name3}` : file);
18563
19868
  if (!published && !ownHeaders.has(`${product}/${name3}`))
18564
19869
  ownHeaders.set(`${product}/${name3}`, file);
18565
19870
  }
19871
+ for (const file of synchronizedHeaders(ref)) {
19872
+ const name3 = import_node_path20.default.basename(file);
19873
+ if (ownHeaders.has(name3)) continue;
19874
+ ownHeaders.set(name3, file);
19875
+ const qualified = `${product}/${name3}`;
19876
+ if (!ownHeaders.has(qualified)) ownHeaders.set(qualified, file);
19877
+ }
18566
19878
  const nonFrameworkHeaders = /* @__PURE__ */ new Map();
18567
19879
  for (const other of projectTargets(ref.project)) {
18568
19880
  if (FRAMEWORK_PRODUCTS.has(str(other.target.productType) ?? "")) continue;
18569
19881
  const otherProduct = productName(other);
18570
19882
  for (const { file, visibility } of headerPhase(other)) {
18571
19883
  if (visibility === "Project") continue;
18572
- const key = `${otherProduct}/${import_node_path15.default.basename(file)}`;
19884
+ const key = `${otherProduct}/${import_node_path20.default.basename(file)}`;
18573
19885
  if (!nonFrameworkHeaders.has(key)) nonFrameworkHeaders.set(key, file);
18574
19886
  }
18575
19887
  }
18576
- const wrapper = import_node_path15.default.join(settings2("BUILT_PRODUCTS_DIR"), `${product}.framework`);
19888
+ const wrapper = import_node_path20.default.join(settings2("BUILT_PRODUCTS_DIR"), `${product}.framework`);
18577
19889
  const moduleMap = (settings2("DEFINES_MODULE") === "YES" || !framework) && settings2("MODULEMAP_FILE") ? absolute(settings2("MODULEMAP_FILE")) : null;
18578
- const podHeaders = !framework && isPodsProject(ref.project.xcodeproj) && moduleMap && import_node_path15.default.relative(import_node_path15.default.join(ref.project.projectDir, "Headers", "Public"), moduleMap).split(import_node_path15.default.sep)[0] !== ".." && import_node_fs15.default.existsSync(moduleMap) ? import_node_fs15.default.readdirSync(import_node_path15.default.dirname(moduleMap)).flatMap((entry) => {
19890
+ const podHeaders = !framework && isPodsProject(ref.project.xcodeproj) && moduleMap && import_node_path20.default.relative(import_node_path20.default.join(ref.project.projectDir, "Headers", "Public"), moduleMap).split(import_node_path20.default.sep)[0] !== ".." && import_node_fs19.default.existsSync(moduleMap) ? import_node_fs19.default.readdirSync(import_node_path20.default.dirname(moduleMap)).flatMap((entry) => {
18579
19891
  if (!/\.(h|hh|hpp|hxx|modulemap)$/.test(entry)) return [];
18580
- const file = import_node_path15.default.join(import_node_path15.default.dirname(moduleMap), entry);
18581
- return import_node_fs15.default.existsSync(file) ? [file] : [];
19892
+ const file = import_node_path20.default.join(import_node_path20.default.dirname(moduleMap), entry);
19893
+ return import_node_fs19.default.existsSync(file) ? [file] : [];
18582
19894
  }) : [];
18583
19895
  const fileFlags = {};
18584
19896
  for (const phaseId of list(ref.target.buildPhases)) {
@@ -18601,7 +19913,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
18601
19913
  keys,
18602
19914
  module: {
18603
19915
  name: name2,
18604
- moduleName: applyOperator(settings2("PRODUCT_MODULE_NAME"), "c99extidentifier"),
19916
+ moduleName,
18605
19917
  ...members,
18606
19918
  allSources,
18607
19919
  languageMode: swiftVersion >= 6 ? 6 : 5,
@@ -18616,6 +19928,20 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
18616
19928
  )
18617
19929
  )
18618
19930
  },
19931
+ packageProducts: Array(),
19932
+ ...members.sources.length > 0 ? {
19933
+ swift: {
19934
+ flags: settingList(settings2("OTHER_SWIFT_FLAGS")),
19935
+ includePaths: settingList(settings2("SWIFT_INCLUDE_PATHS")).map(absolute),
19936
+ compatibility: compatibility ? {
19937
+ moduleMap: compatibility.moduleMap,
19938
+ umbrella: compatibility.umbrella,
19939
+ outputModuleMap: compatibility.outputModuleMap,
19940
+ outputUmbrella: compatibility.outputUmbrella,
19941
+ outputHeader: compatibility.outputHeader
19942
+ } : null
19943
+ }
19944
+ } : {},
18619
19945
  ...native ? {
18620
19946
  objc: {
18621
19947
  publicHeaders: [
@@ -18629,7 +19955,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
18629
19955
  ...headers,
18630
19956
  ...Object.keys(ref.project.objects).flatMap((id) => {
18631
19957
  const file = ref.project.resolvePath(id);
18632
- return file && HEADER_FILE.test(file) && import_node_fs15.default.existsSync(file) ? [file] : [];
19958
+ return file && HEADER_FILE.test(file) && import_node_fs19.default.existsSync(file) ? [file] : [];
18633
19959
  })
18634
19960
  ])
18635
19961
  ],
@@ -18638,15 +19964,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
18638
19964
  // xcode searches its products' include directory before
18639
19965
  // HEADER_SEARCH_PATHS and the target's derived sources after.
18640
19966
  headerSearchPaths: [
18641
- import_node_path15.default.join(settings2("BUILT_PRODUCTS_DIR"), "include"),
19967
+ import_node_path20.default.join(settings2("BUILT_PRODUCTS_DIR"), "include"),
18642
19968
  ...settingList(settings2("HEADER_SEARCH_PATHS")).flatMap(
18643
19969
  (raw) => expandSearchPath(absolute(raw), searchRules)
18644
19970
  ),
18645
- import_node_path15.default.join(
19971
+ import_node_path20.default.join(
18646
19972
  `${settings2("DERIVED_FILE_DIR")}-normal`,
18647
19973
  settings2("CURRENT_ARCH")
18648
19974
  ),
18649
- import_node_path15.default.join(settings2("DERIVED_FILE_DIR"), settings2("CURRENT_ARCH")),
19975
+ import_node_path20.default.join(settings2("DERIVED_FILE_DIR"), settings2("CURRENT_ARCH")),
18650
19976
  settings2("DERIVED_FILE_DIR")
18651
19977
  ],
18652
19978
  userHeaderSearchPaths: settingList(
@@ -18686,16 +20012,16 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
18686
20012
  ...headerFiles.flatMap(
18687
20013
  ({ file, visibility }) => visibility === "Project" ? [] : [
18688
20014
  [
18689
- import_node_path15.default.join(
20015
+ import_node_path20.default.join(
18690
20016
  wrapper,
18691
20017
  visibility === "Public" ? "Headers" : "PrivateHeaders",
18692
- import_node_path15.default.basename(file)
20018
+ import_node_path20.default.basename(file)
18693
20019
  ),
18694
20020
  file
18695
20021
  ]
18696
20022
  ]
18697
20023
  ),
18698
- ...moduleMap ? [[import_node_path15.default.join(wrapper, "Modules", "module.modulemap"), moduleMap]] : []
20024
+ ...moduleMap ? [[import_node_path20.default.join(wrapper, "Modules", "module.modulemap"), moduleMap]] : []
18699
20025
  ]) : Object.fromEntries(podHeaders.map((file) => [file, file]))
18700
20026
  }
18701
20027
  } : {}
@@ -18707,7 +20033,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
18707
20033
  const frameworkTargets = builtTargets.slice(0, -1).filter(({ ref }) => ref.target.isa === "PBXNativeTarget").map(({ ref, module: module3 }) => ({ ref, framework: module3 }));
18708
20034
  const frameworks = frameworkTargets.map(({ framework }) => framework);
18709
20035
  const podSourceDirs = frameworkTargets.flatMap(
18710
- ({ ref, framework }) => isPodsProject(ref.project.xcodeproj) ? [...framework.allSources, ...framework.objc?.headers ?? []].map((file) => import_node_path15.default.dirname(file)).filter((dir) => import_node_fs15.default.existsSync(dir)) : []
20036
+ ({ ref, framework }) => isPodsProject(ref.project.xcodeproj) ? [...framework.allSources, ...framework.objc?.headers ?? []].map((file) => import_node_path20.default.dirname(file)).filter((dir) => import_node_fs19.default.existsSync(dir)) : []
18711
20037
  );
18712
20038
  const expandValue = (value) => {
18713
20039
  if (typeof value === "string") return expand(value, settings);
@@ -18719,8 +20045,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
18719
20045
  }
18720
20046
  return value;
18721
20047
  };
18722
- const infoPlistFile = settings("INFOPLIST_FILE") ? import_node_path15.default.resolve(app.project.projectDir, settings("INFOPLIST_FILE")) : null;
18723
- const sourceInfo = infoPlistFile ? import_plist3.default.parse(import_node_fs15.default.readFileSync(infoPlistFile, "utf8")) : {};
20048
+ const infoPlistFile = settings("INFOPLIST_FILE") ? import_node_path20.default.resolve(app.project.projectDir, settings("INFOPLIST_FILE")) : null;
20049
+ const infoPlistPending = module2.generatedInfoPlist && !options.prepareGeneratedSources;
20050
+ const sourceInfo = infoPlistFile && !infoPlistPending ? import_plist3.default.parse(import_node_fs19.default.readFileSync(infoPlistFile, "utf8")) : {};
18724
20051
  if (!sourceInfo || typeof sourceInfo !== "object" || Array.isArray(sourceInfo) || sourceInfo instanceof Date || Buffer.isBuffer(sourceInfo)) {
18725
20052
  throw new Error(`${module2.name} Info.plist must contain a dictionary`);
18726
20053
  }
@@ -18748,7 +20075,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
18748
20075
  };
18749
20076
  }
18750
20077
  const localPackageDirs = [
18751
- ...listed.filter((reference) => import_node_fs15.default.existsSync(import_node_path15.default.join(reference, "Package.swift"))),
20078
+ ...listed.filter((reference) => import_node_fs19.default.existsSync(import_node_path20.default.join(reference, "Package.swift"))),
18752
20079
  ...projects.flatMap(
18753
20080
  (project) => Object.entries(project.objects).flatMap(([id, entry]) => {
18754
20081
  if (!isDict(entry)) return [];
@@ -18758,19 +20085,19 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
18758
20085
  const packages = [];
18759
20086
  while (pending.length > 0) {
18760
20087
  const dir = pending.pop();
18761
- if (import_node_fs15.default.existsSync(import_node_path15.default.join(dir, "Package.swift"))) {
20088
+ if (import_node_fs19.default.existsSync(import_node_path20.default.join(dir, "Package.swift"))) {
18762
20089
  packages.push(dir);
18763
20090
  continue;
18764
20091
  }
18765
20092
  if (!isDirectory(dir)) continue;
18766
- for (const child of import_node_fs15.default.readdirSync(dir, { withFileTypes: true }))
20093
+ for (const child of import_node_fs19.default.readdirSync(dir, { withFileTypes: true }))
18767
20094
  if (child.isDirectory() && !child.name.startsWith("."))
18768
- pending.push(import_node_path15.default.join(dir, child.name));
20095
+ pending.push(import_node_path20.default.join(dir, child.name));
18769
20096
  }
18770
20097
  return packages;
18771
20098
  }
18772
- const candidate = entry.isa === "XCLocalSwiftPackageReference" ? import_node_path15.default.resolve(project.projectDir, str(entry.relativePath) ?? "") : entry.isa === "PBXFileReference" ? project.resolvePath(id) : null;
18773
- return candidate && import_node_fs15.default.existsSync(import_node_path15.default.join(candidate, "Package.swift")) ? [candidate] : [];
20099
+ const candidate = entry.isa === "XCLocalSwiftPackageReference" ? import_node_path20.default.resolve(project.projectDir, str(entry.relativePath) ?? "") : entry.isa === "PBXFileReference" ? project.resolvePath(id) : null;
20100
+ return candidate && import_node_fs19.default.existsSync(import_node_path20.default.join(candidate, "Package.swift")) ? [candidate] : [];
18774
20101
  })
18775
20102
  )
18776
20103
  ];
@@ -18791,12 +20118,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
18791
20118
  const linkedProductKeys = /* @__PURE__ */ new Set();
18792
20119
  const binaryFrameworks = /* @__PURE__ */ new Map();
18793
20120
  for (const { ref, settings: settings2 } of builtTargets) {
18794
- const absolute = (raw) => import_node_path15.default.resolve(ref.project.projectDir, expand(raw, settings2));
20121
+ const absolute = (raw) => import_node_path20.default.resolve(ref.project.projectDir, expand(raw, settings2));
18795
20122
  for (const raw of settingList(settings2("SWIFT_INCLUDE_PATHS"))) {
18796
20123
  const dir = absolute(raw);
18797
- const modulemap = import_node_path15.default.join(dir, "module.modulemap");
18798
- if (!import_node_fs15.default.existsSync(modulemap)) continue;
18799
- const name2 = moduleMapName(import_node_fs15.default.readFileSync(modulemap, "utf8"));
20124
+ const modulemap = import_node_path20.default.join(dir, "module.modulemap");
20125
+ if (!import_node_fs19.default.existsSync(modulemap)) continue;
20126
+ const name2 = moduleMapName(import_node_fs19.default.readFileSync(modulemap, "utf8"));
18800
20127
  if (name2 && !binaryFrameworks.has(name2)) binaryFrameworks.set(name2, dir);
18801
20128
  }
18802
20129
  for (const phaseId of list(ref.target.buildPhases)) {
@@ -18805,7 +20132,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
18805
20132
  const inputs = list(phase.inputPaths).map(absolute);
18806
20133
  for (const raw of list(phase.inputFileListPaths)) {
18807
20134
  const file = absolute(raw);
18808
- if (!import_node_fs15.default.existsSync(file)) continue;
20135
+ if (!import_node_fs19.default.existsSync(file)) continue;
18809
20136
  xcconfigs.add(file);
18810
20137
  inputs.push(...fileListEntries(file, absolute));
18811
20138
  }
@@ -18815,10 +20142,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
18815
20142
  }
18816
20143
  }
18817
20144
  }
18818
- for (const { project, target } of order) {
20145
+ const productsByTarget = /* @__PURE__ */ new Map();
20146
+ for (const ref of order) {
20147
+ const { project, target } = ref;
18819
20148
  const productRef = (id) => {
18820
- const ref = str(project.object(id)?.productRef);
18821
- return ref ? [ref] : [];
20149
+ const ref2 = str(project.object(id)?.productRef);
20150
+ return ref2 ? [ref2] : [];
18822
20151
  };
18823
20152
  const productDependencies = [
18824
20153
  ...list(target.packageProductDependencies),
@@ -18828,6 +20157,8 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
18828
20157
  return phase?.isa === "PBXFrameworksBuildPhase" ? list(phase.files).flatMap(productRef) : [];
18829
20158
  })
18830
20159
  ];
20160
+ const ownProducts = [];
20161
+ const ownKeys = /* @__PURE__ */ new Set();
18831
20162
  for (const dependencyId of new Set(productDependencies)) {
18832
20163
  const dependency = project.object(dependencyId);
18833
20164
  const product = str(dependency?.productName)?.replace(/^plugin:/, "");
@@ -18840,7 +20171,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
18840
20171
  product,
18841
20172
  source: reference?.isa === "XCRemoteSwiftPackageReference" ? { kind: "remote", url: str(reference.repositoryURL) ?? "" } : reference?.isa === "XCLocalSwiftPackageReference" ? {
18842
20173
  kind: "local",
18843
- dir: import_node_path15.default.resolve(
20174
+ dir: import_node_path20.default.resolve(
18844
20175
  project.projectDir,
18845
20176
  str(reference.relativePath) ?? ""
18846
20177
  )
@@ -18849,7 +20180,13 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
18849
20180
  productReferences.push({ project: project.projectFile, linked });
18850
20181
  if (linked.source.kind !== "unnamed")
18851
20182
  qualifiedProductKeys.add(`${project.projectFile}\0${product}`);
20183
+ const key = JSON.stringify(linked);
20184
+ if (!ownKeys.has(key)) {
20185
+ ownKeys.add(key);
20186
+ ownProducts.push(linked);
20187
+ }
18852
20188
  }
20189
+ productsByTarget.set(ref, ownProducts);
18853
20190
  for (const phaseId of list(target.buildPhases)) {
18854
20191
  const phase = project.object(phaseId);
18855
20192
  if (phase?.isa !== "PBXFrameworksBuildPhase") continue;
@@ -18874,26 +20211,35 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
18874
20211
  linkedProductKeys.add(key);
18875
20212
  linkedProducts.push(linked);
18876
20213
  }
18877
- const resolvedFile = import_node_path15.default.join(
18878
- workspace ?? import_node_path15.default.join(xcodeprojOrWorkspace, "project.xcworkspace"),
20214
+ for (const built of builtTargets)
20215
+ built.module.packageProducts = productsByTarget.get(built.ref) ?? [];
20216
+ const resolvedFile = import_node_path20.default.join(
20217
+ workspace ?? import_node_path20.default.join(xcodeprojOrWorkspace, "project.xcworkspace"),
18879
20218
  "xcshareddata",
18880
20219
  "swiftpm",
18881
20220
  "Package.resolved"
18882
20221
  );
18883
- const packageResolved = import_node_fs15.default.existsSync(resolvedFile) ? [import_node_fs15.default.realpathSync(resolvedFile)] : [...new Set(localPackageDirs.map((dir) => import_node_path15.default.join(dir, "Package.resolved")))].filter((file) => import_node_fs15.default.existsSync(file)).map((file) => import_node_fs15.default.realpathSync(file)).sort();
20222
+ let packageResolved = import_node_fs19.default.existsSync(resolvedFile) ? [import_node_fs19.default.realpathSync(resolvedFile)] : [...new Set(localPackageDirs.map((dir) => import_node_path20.default.join(dir, "Package.resolved")))].filter((file) => import_node_fs19.default.existsSync(file)).map((file) => import_node_fs19.default.realpathSync(file)).sort();
20223
+ if (packageResolved.length === 0) {
20224
+ const requirements = remotePackageRequirements(projects);
20225
+ if (requirements.length > 0) {
20226
+ resolveSwiftPackageRequirements(requirements, resolvedFile);
20227
+ packageResolved = [import_node_fs19.default.realpathSync(resolvedFile)];
20228
+ }
20229
+ }
18884
20230
  const used = order.map((ref) => ref.project);
18885
20231
  return {
18886
20232
  ...module2,
18887
20233
  rootDir: commonAncestor(
18888
20234
  [
18889
- workspace ? import_node_path15.default.dirname(workspace) : app.project.projectDir,
20235
+ workspace ? import_node_path20.default.dirname(workspace) : app.project.projectDir,
18890
20236
  ...used.map((project) => project.projectDir),
18891
20237
  ...localPackageDirs,
18892
20238
  ...linkedProducts.flatMap(
18893
- ({ source }) => source.kind === "local" && import_node_fs15.default.existsSync(source.dir) ? [source.dir] : []
20239
+ ({ source }) => source.kind === "local" && import_node_fs19.default.existsSync(source.dir) ? [source.dir] : []
18894
20240
  ),
18895
20241
  ...new Set(podSourceDirs)
18896
- ].map((dir) => import_node_fs15.default.realpathSync(dir))
20242
+ ].map((dir) => import_node_fs19.default.realpathSync(dir))
18897
20243
  ),
18898
20244
  projectFiles: [
18899
20245
  .../* @__PURE__ */ new Set([
@@ -18904,12 +20250,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
18904
20250
  ].sort(),
18905
20251
  projectDirs: [...new Set(used.map((project) => project.projectDir))].sort(),
18906
20252
  appIconName: settings("ASSETCATALOG_COMPILER_APPICON_NAME"),
18907
- infoPlist: import_plist3.default.build(info),
20253
+ infoPlist: infoPlistPending ? null : import_plist3.default.build(info),
18908
20254
  infoPlistFile,
18909
20255
  frameworks,
18910
20256
  linkedProducts,
18911
20257
  localPackageDirs: [
18912
- ...new Set(localPackageDirs.map((dir) => import_node_fs15.default.realpathSync(dir)))
20258
+ ...new Set(localPackageDirs.map((dir) => import_node_fs19.default.realpathSync(dir)))
18913
20259
  ].sort(),
18914
20260
  binaryFrameworks: [...binaryFrameworks].map(([name2, file]) => ({ name: name2, path: file })).sort((left, right) => left.name.localeCompare(right.name)),
18915
20261
  packageResolved,
@@ -18925,6 +20271,10 @@ function nonEmptyString2(value) {
18925
20271
  return typeof value === "string" && value.length > 0 ? value : void 0;
18926
20272
  }
18927
20273
  function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSource) {
20274
+ if (app.infoPlist === null)
20275
+ throw new Error(
20276
+ "native app Info.plist is generated by a build phase and was not prepared"
20277
+ );
18928
20278
  const dictionary = parseInfoPlist(app.infoPlist);
18929
20279
  if (!isRecord(dictionary)) throw new Error("native app Info.plist is not a dictionary");
18930
20280
  const settings = app.settings;
@@ -18984,7 +20334,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
18984
20334
  const rtcAppGroupIdentifier = nonEmptyString2(dictionary.RTCAppGroupIdentifier);
18985
20335
  const screenShareExtensionBundleId = typeof dictionary.ScreenShareExtensionBundleId === "string" ? dictionary.ScreenShareExtensionBundleId : void 0;
18986
20336
  const rootModuleName = readRootModuleName(
18987
- app.allSources.filter((file) => /\.(?:swift|mm|m)$/.test(file) && import_node_fs16.default.existsSync(file)).map((file) => import_node_fs16.default.readFileSync(file, "utf8"))
20337
+ app.allSources.filter((file) => /\.(?:swift|mm|m)$/.test(file) && import_node_fs20.default.existsSync(file)).map((file) => import_node_fs20.default.readFileSync(file, "utf8"))
18988
20338
  );
18989
20339
  return {
18990
20340
  applicationName,
@@ -19005,7 +20355,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
19005
20355
  googleSignIn: readGoogleSignInConfiguration(
19006
20356
  dictionary,
19007
20357
  Object.fromEntries(
19008
- app.resources.filter((file) => file.endsWith(".plist")).map((file) => [file, parseInfoPlist(import_node_fs16.default.readFileSync(file, "utf8"))])
20358
+ app.resources.filter((file) => file.endsWith(".plist")).map((file) => [file, parseInfoPlist(import_node_fs20.default.readFileSync(file, "utf8"))])
19009
20359
  )
19010
20360
  ),
19011
20361
  supportedInterfaceOrientations,
@@ -19014,11 +20364,11 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
19014
20364
  alternateIconNames: [...alternateIconNames],
19015
20365
  appIconArtwork: resolveNativeAppIconArtwork(
19016
20366
  app.resources,
19017
- (file) => import_node_fs16.default.readFileSync(file, "utf8"),
20367
+ (file) => import_node_fs20.default.readFileSync(file, "utf8"),
19018
20368
  (file) => {
19019
- const extension = import_node_path16.default.extname(file).toLowerCase();
20369
+ const extension = import_node_path21.default.extname(file).toLowerCase();
19020
20370
  const contentType = extension === ".jpg" || extension === ".jpeg" ? "image/jpeg" : extension === ".webp" ? "image/webp" : "image/png";
19021
- return `data:${contentType};base64,${import_node_fs16.default.readFileSync(file).toString("base64")}`;
20371
+ return `data:${contentType};base64,${import_node_fs20.default.readFileSync(file).toString("base64")}`;
19022
20372
  },
19023
20373
  icons,
19024
20374
  app.appIconName,
@@ -19049,22 +20399,22 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
19049
20399
  const read = selectNativeAppIdentityReader(platform, {
19050
20400
  android: () => null,
19051
20401
  ios: () => {
19052
- const iosRoot = import_node_path16.default.join(projectRoot, "ios");
19053
- if (!import_node_fs16.default.existsSync(iosRoot)) return null;
20402
+ const iosRoot = import_node_path21.default.join(projectRoot, "ios");
20403
+ if (!import_node_fs20.default.existsSync(iosRoot)) return null;
19054
20404
  const files = {};
19055
- for (const entry of import_node_fs16.default.readdirSync(iosRoot, { withFileTypes: true })) {
20405
+ for (const entry of import_node_fs20.default.readdirSync(iosRoot, { withFileTypes: true })) {
19056
20406
  if (entry.name === "Pods") continue;
19057
20407
  if (entry.isDirectory()) {
19058
20408
  const names = entry.name.endsWith(".xcodeproj") ? ["project.pbxproj"] : ["Info.plist", "AppDelegate.swift", "AppDelegate.mm", "AppDelegate.m"];
19059
20409
  for (const name2 of names) {
19060
20410
  const relative3 = `ios/${entry.name}/${name2}`;
19061
- const file = import_node_path16.default.join(projectRoot, relative3);
19062
- if (import_node_fs16.default.existsSync(file)) files[relative3] = import_node_fs16.default.readFileSync(file, "utf8");
20411
+ const file = import_node_path21.default.join(projectRoot, relative3);
20412
+ if (import_node_fs20.default.existsSync(file)) files[relative3] = import_node_fs20.default.readFileSync(file, "utf8");
19063
20413
  }
19064
20414
  } else if (/AppDelegate\.(?:swift|mm|m)$/.test(entry.name)) {
19065
20415
  const relative3 = `ios/${entry.name}`;
19066
- const file = import_node_path16.default.join(projectRoot, relative3);
19067
- if (import_node_fs16.default.existsSync(file)) files[relative3] = import_node_fs16.default.readFileSync(file, "utf8");
20416
+ const file = import_node_path21.default.join(projectRoot, relative3);
20417
+ if (import_node_fs20.default.existsSync(file)) files[relative3] = import_node_fs20.default.readFileSync(file, "utf8");
19068
20418
  }
19069
20419
  }
19070
20420
  return extractNativeAppIdentityFromFiles(files, "ios", parseInfoPlist, iosTarget);
@@ -19075,41 +20425,41 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
19075
20425
  function readAndroidNativeAppIdentity(projectRoot, androidMergedManifest) {
19076
20426
  const files = {};
19077
20427
  if (androidMergedManifest) {
19078
- const file = import_node_path16.default.resolve(projectRoot, androidMergedManifest);
19079
- if (!import_node_fs16.default.existsSync(file)) return null;
19080
- files[androidMergedManifest] = import_node_fs16.default.readFileSync(file, "utf8");
20428
+ const file = import_node_path21.default.resolve(projectRoot, androidMergedManifest);
20429
+ if (!import_node_fs20.default.existsSync(file)) return null;
20430
+ files[androidMergedManifest] = import_node_fs20.default.readFileSync(file, "utf8");
19081
20431
  } else {
19082
- const androidRoot = import_node_path16.default.join(projectRoot, "android");
19083
- if (!import_node_fs16.default.existsSync(androidRoot)) return null;
20432
+ const androidRoot = import_node_path21.default.join(projectRoot, "android");
20433
+ if (!import_node_fs20.default.existsSync(androidRoot)) return null;
19084
20434
  const collect = (directory) => {
19085
- for (const entry of import_node_fs16.default.readdirSync(directory, { withFileTypes: true })) {
19086
- const file = import_node_path16.default.join(directory, entry.name);
20435
+ for (const entry of import_node_fs20.default.readdirSync(directory, { withFileTypes: true })) {
20436
+ const file = import_node_path21.default.join(directory, entry.name);
19087
20437
  if (entry.isDirectory()) collect(file);
19088
20438
  else if (entry.isFile() && entry.name === "AndroidManifest.xml")
19089
- files[import_node_path16.default.relative(projectRoot, file).split(import_node_path16.default.sep).join("/")] = import_node_fs16.default.readFileSync(file, "utf8");
20439
+ files[import_node_path21.default.relative(projectRoot, file).split(import_node_path21.default.sep).join("/")] = import_node_fs20.default.readFileSync(file, "utf8");
19090
20440
  }
19091
20441
  };
19092
- for (const module2 of import_node_fs16.default.readdirSync(androidRoot, { withFileTypes: true })) {
20442
+ for (const module2 of import_node_fs20.default.readdirSync(androidRoot, { withFileTypes: true })) {
19093
20443
  if (!module2.isDirectory()) continue;
19094
- const outputs = import_node_path16.default.join(
20444
+ const outputs = import_node_path21.default.join(
19095
20445
  androidRoot,
19096
20446
  module2.name,
19097
20447
  "build/intermediates/merged_manifests"
19098
20448
  );
19099
- if (import_node_fs16.default.existsSync(outputs)) collect(outputs);
20449
+ if (import_node_fs20.default.existsSync(outputs)) collect(outputs);
19100
20450
  }
19101
20451
  }
19102
20452
  for (const manifest of Object.keys(files)) {
19103
20453
  const resourceDirectory = androidMergedResourceValuesDirectory(manifest);
19104
20454
  if (!resourceDirectory) continue;
19105
- const absolute = import_node_path16.default.resolve(projectRoot, resourceDirectory);
19106
- if (!import_node_fs16.default.existsSync(absolute)) continue;
19107
- for (const entry of import_node_fs16.default.readdirSync(absolute, { withFileTypes: true })) {
20455
+ const absolute = import_node_path21.default.resolve(projectRoot, resourceDirectory);
20456
+ if (!import_node_fs20.default.existsSync(absolute)) continue;
20457
+ for (const entry of import_node_fs20.default.readdirSync(absolute, { withFileTypes: true })) {
19108
20458
  if (!entry.isDirectory() || !/^values(?:-|$)/.test(entry.name)) continue;
19109
- for (const resource of import_node_fs16.default.readdirSync(import_node_path16.default.join(absolute, entry.name))) {
20459
+ for (const resource of import_node_fs20.default.readdirSync(import_node_path21.default.join(absolute, entry.name))) {
19110
20460
  if (!resource.endsWith(".xml")) continue;
19111
20461
  const file = `${resourceDirectory}/${entry.name}/${resource}`;
19112
- files[file] = import_node_fs16.default.readFileSync(import_node_path16.default.resolve(projectRoot, file), "utf8");
20462
+ files[file] = import_node_fs20.default.readFileSync(import_node_path21.default.resolve(projectRoot, file), "utf8");
19113
20463
  }
19114
20464
  }
19115
20465
  }
@@ -19126,7 +20476,7 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget) {
19126
20476
  const app = readIosAppTarget(projectRoot, iosTarget);
19127
20477
  if (!app) return null;
19128
20478
  const identity = readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist);
19129
- const projectManifestPath = import_node_path16.default.join(projectRoot, "package.json");
20479
+ const projectManifestPath = import_node_path21.default.join(projectRoot, "package.json");
19130
20480
  const projectRequire = (0, import_node_module4.createRequire)(projectManifestPath);
19131
20481
  let reanimatedManifestPath;
19132
20482
  try {
@@ -19140,22 +20490,22 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget) {
19140
20490
  throw error;
19141
20491
  }
19142
20492
  const installedManifest = JSON.parse(
19143
- import_node_fs16.default.readFileSync(reanimatedManifestPath, "utf8")
20493
+ import_node_fs20.default.readFileSync(reanimatedManifestPath, "utf8")
19144
20494
  );
19145
20495
  const installedVersion = isRecord(installedManifest) ? nonEmptyString2(installedManifest.version) : void 0;
19146
20496
  if (!installedVersion) throw new Error("Reanimated package version is malformed");
19147
20497
  if (Number.parseInt(installedVersion, 10) < 4) return identity;
19148
20498
  const defaults = JSON.parse(
19149
- import_node_fs16.default.readFileSync(
19150
- import_node_path16.default.join(
19151
- import_node_path16.default.dirname(reanimatedManifestPath),
20499
+ import_node_fs20.default.readFileSync(
20500
+ import_node_path21.default.join(
20501
+ import_node_path21.default.dirname(reanimatedManifestPath),
19152
20502
  "src/featureFlags/staticFlags.json"
19153
20503
  ),
19154
20504
  "utf8"
19155
20505
  )
19156
20506
  );
19157
20507
  if (!isRecord(defaults)) throw new Error("Reanimated static flags are malformed");
19158
- const manifest = JSON.parse(import_node_fs16.default.readFileSync(projectManifestPath, "utf8"));
20508
+ const manifest = JSON.parse(import_node_fs20.default.readFileSync(projectManifestPath, "utf8"));
19159
20509
  const reanimated = isRecord(manifest) ? manifest.reanimated : void 0;
19160
20510
  const overrides = isRecord(reanimated) ? reanimated.staticFeatureFlags : void 0;
19161
20511
  if (overrides !== void 0 && !isRecord(overrides)) {
@@ -19178,9 +20528,9 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget) {
19178
20528
  return { ...identity, reanimatedStaticFeatureFlags: flags };
19179
20529
  }
19180
20530
  function readIosAppTarget(projectRoot, iosTarget) {
19181
- const iosRoot = import_node_path16.default.join(projectRoot, "ios");
19182
- if (!import_node_fs16.default.existsSync(iosRoot)) return null;
19183
- const projects = import_node_fs16.default.readdirSync(iosRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj"));
20531
+ const iosRoot = import_node_path21.default.join(projectRoot, "ios");
20532
+ if (!import_node_fs20.default.existsSync(iosRoot)) return null;
20533
+ const projects = import_node_fs20.default.readdirSync(iosRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj"));
19184
20534
  if (projects.length === 0) return null;
19185
20535
  if (projects.length > 1 && !iosTarget) {
19186
20536
  throw new NativeAppTargetSelectionError(
@@ -19190,7 +20540,7 @@ function readIosAppTarget(projectRoot, iosTarget) {
19190
20540
  let project = projects[0];
19191
20541
  if (iosTarget && projects.length > 1) {
19192
20542
  const matches = projects.filter(
19193
- (entry) => listXcodeAppTargets(import_node_path16.default.join(iosRoot, entry.name), {
20543
+ (entry) => listXcodeAppTargets(import_node_path21.default.join(iosRoot, entry.name), {
19194
20544
  requireSources: false
19195
20545
  }).includes(iosTarget)
19196
20546
  );
@@ -19204,7 +20554,7 @@ function readIosAppTarget(projectRoot, iosTarget) {
19204
20554
  }
19205
20555
  project = matches[0];
19206
20556
  }
19207
- const xcodeproj = import_node_path16.default.join(iosRoot, project.name);
20557
+ const xcodeproj = import_node_path21.default.join(iosRoot, project.name);
19208
20558
  const appTargets = listXcodeAppTargets(xcodeproj, { requireSources: false });
19209
20559
  if (!iosTarget && appTargets.length > 1) {
19210
20560
  throw new NativeAppTargetSelectionError(
@@ -19219,10 +20569,10 @@ function readIosAppTarget(projectRoot, iosTarget) {
19219
20569
 
19220
20570
  // src/native-firebase-config.ts
19221
20571
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
19222
- var import_node_child_process6 = require("node:child_process");
19223
- var import_node_fs17 = __toESM(require("node:fs"), 1);
19224
- var import_node_os4 = __toESM(require("node:os"), 1);
19225
- var import_node_path17 = __toESM(require("node:path"), 1);
20572
+ var import_node_child_process7 = require("node:child_process");
20573
+ var import_node_fs21 = __toESM(require("node:fs"), 1);
20574
+ var import_node_os6 = __toESM(require("node:os"), 1);
20575
+ var import_node_path22 = __toESM(require("node:path"), 1);
19226
20576
  init_is_record();
19227
20577
  var EXPO_CONFIG_SCRIPT = `const { createRequire } = require('node:module');
19228
20578
  const { writeFileSync } = require('node:fs');
@@ -19233,13 +20583,13 @@ const result = JSON.stringify(getConfig(root, { skipSDKVersionRequirement: true
19233
20583
  if (Buffer.byteLength(result) > 1024 * 1024) throw new Error('Expo native configuration exceeds 1 MiB.');
19234
20584
  writeFileSync(process.argv[2], result, { mode: 0o600 });`;
19235
20585
  function hasExpoConfig(projectRoot) {
19236
- const appJsonPath = import_node_path17.default.join(projectRoot, "app.json");
19237
- const appJson = import_node_fs17.default.existsSync(appJsonPath) ? JSON.parse(import_node_fs17.default.readFileSync(appJsonPath, "utf8")) : null;
20586
+ const appJsonPath = import_node_path22.default.join(projectRoot, "app.json");
20587
+ const appJson = import_node_fs21.default.existsSync(appJsonPath) ? JSON.parse(import_node_fs21.default.readFileSync(appJsonPath, "utf8")) : null;
19238
20588
  const staticExpo = isRecord(appJson) && (isRecord(appJson.expo) || [appJson.ios, appJson.android].some(
19239
20589
  (value) => isRecord(value) && typeof value.googleServicesFile === "string"
19240
20590
  ));
19241
20591
  return staticExpo || ["app.config.js", "app.config.ts", "app.config.cjs", "app.config.mjs"].some(
19242
- (name2) => import_node_fs17.default.existsSync(import_node_path17.default.join(projectRoot, name2))
20592
+ (name2) => import_node_fs21.default.existsSync(import_node_path22.default.join(projectRoot, name2))
19243
20593
  );
19244
20594
  }
19245
20595
  function expoConfigArgs(projectRoot, resultPath) {
@@ -19247,24 +20597,24 @@ function expoConfigArgs(projectRoot, resultPath) {
19247
20597
  "--input-type=commonjs",
19248
20598
  "-e",
19249
20599
  EXPO_CONFIG_SCRIPT,
19250
- import_node_path17.default.resolve(projectRoot),
20600
+ import_node_path22.default.resolve(projectRoot),
19251
20601
  resultPath
19252
20602
  ];
19253
20603
  }
19254
20604
  function readExpoConfigResult(resultPath, status, stderr) {
19255
20605
  if (status !== 0)
19256
20606
  throw new Error(stderr || "Expo native configuration evaluation failed.");
19257
- const resolved = JSON.parse(import_node_fs17.default.readFileSync(resultPath, "utf8"));
20607
+ const resolved = JSON.parse(import_node_fs21.default.readFileSync(resultPath, "utf8"));
19258
20608
  if (!isRecord(resolved)) throw new Error("Expo native configuration is unavailable.");
19259
20609
  return resolved;
19260
20610
  }
19261
- var resultDirectory = () => import_node_fs17.default.mkdtempSync(import_node_path17.default.join(import_node_os4.default.tmpdir(), "peach-expo-config-"));
20611
+ var resultDirectory = () => import_node_fs21.default.mkdtempSync(import_node_path22.default.join(import_node_os6.default.tmpdir(), "peach-expo-config-"));
19262
20612
  function readExpoConfig(projectRoot) {
19263
20613
  if (!hasExpoConfig(projectRoot)) return {};
19264
20614
  const directory = resultDirectory();
19265
- const resultPath = import_node_path17.default.join(directory, "config.json");
20615
+ const resultPath = import_node_path22.default.join(directory, "config.json");
19266
20616
  try {
19267
- const child = (0, import_node_child_process6.spawnSync)("node", expoConfigArgs(projectRoot, resultPath), {
20617
+ const child = (0, import_node_child_process7.spawnSync)("node", expoConfigArgs(projectRoot, resultPath), {
19268
20618
  cwd: projectRoot,
19269
20619
  encoding: "utf8",
19270
20620
  stdio: ["ignore", "ignore", "pipe"],
@@ -19274,7 +20624,7 @@ function readExpoConfig(projectRoot) {
19274
20624
  if (child.error) throw child.error;
19275
20625
  return readExpoConfigResult(resultPath, child.status, child.stderr);
19276
20626
  } finally {
19277
- import_node_fs17.default.rmSync(directory, { recursive: true, force: true });
20627
+ import_node_fs21.default.rmSync(directory, { recursive: true, force: true });
19278
20628
  }
19279
20629
  }
19280
20630
  function evaluateFirebaseGuard(header, resources) {
@@ -19296,7 +20646,7 @@ function evaluateFirebaseGuard(header, resources) {
19296
20646
  }
19297
20647
  clauses.push(condition.slice(start).trim());
19298
20648
  const sources = resources.filter(
19299
- (file) => import_node_path17.default.basename(file) === "GoogleService-Info.plist"
20649
+ (file) => import_node_path22.default.basename(file) === "GoogleService-Info.plist"
19300
20650
  );
19301
20651
  const bound = /* @__PURE__ */ new Map();
19302
20652
  for (const clause of clauses) {
@@ -19312,7 +20662,7 @@ function evaluateFirebaseGuard(header, resources) {
19312
20662
  const dictionary = /^let\s+(\w+)\s*=\s*NSDictionary\s*\(\s*contentsOfFile:\s*(\w+)\s*\)$/.exec(clause);
19313
20663
  if (dictionary && typeof bound.get(dictionary[2]) === "string") {
19314
20664
  const parsed = parsePlistSource(
19315
- import_node_fs17.default.readFileSync(String(bound.get(dictionary[2])), "utf8")
20665
+ import_node_fs21.default.readFileSync(String(bound.get(dictionary[2])), "utf8")
19316
20666
  );
19317
20667
  if (!isRecord(parsed)) return false;
19318
20668
  bound.set(dictionary[1], parsed);
@@ -19394,7 +20744,7 @@ function findDefaultConfigureCall(body, sources) {
19394
20744
  const [, type, name2] = call;
19395
20745
  for (const file of sources) {
19396
20746
  if (!file.endsWith(".swift")) continue;
19397
- const source = blankSwiftObjcLiterals(import_node_fs17.default.readFileSync(file, "utf8"));
20747
+ const source = blankSwiftObjcLiterals(import_node_fs21.default.readFileSync(file, "utf8"));
19398
20748
  const declaration = new RegExp(
19399
20749
  `\\b(?:enum|struct|class)\\s+${type}\\b[^{]*\\{`
19400
20750
  ).exec(source);
@@ -19410,15 +20760,16 @@ function findDefaultConfigureCall(body, sources) {
19410
20760
  }
19411
20761
  return null;
19412
20762
  }
19413
- function readTargetGoogleServicesFile(projectRoot, xcodeproj, target) {
20763
+ function readTargetGoogleServicesFile(projectRoot, xcodeproj, target, prepareGeneratedSources = false) {
19414
20764
  const app = readXcodeAppTarget(xcodeproj, target, void 0, {
19415
- requireSources: false
20765
+ requireSources: false,
20766
+ prepareGeneratedSources
19416
20767
  });
19417
20768
  const delegates = app.allSources.filter(
19418
- (file) => /^AppDelegate\.(swift|mm|m)$/.test(import_node_path17.default.basename(file))
20769
+ (file) => /^AppDelegate\.(swift|mm|m)$/.test(import_node_path22.default.basename(file))
19419
20770
  );
19420
20771
  const defaultConfigured = delegates.some((file) => {
19421
- const raw = import_node_fs17.default.readFileSync(file, "utf8");
20772
+ const raw = import_node_fs21.default.readFileSync(file, "utf8");
19422
20773
  const source = blankSwiftObjcLiterals(raw);
19423
20774
  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(
19424
20775
  source
@@ -19483,32 +20834,56 @@ function readTargetGoogleServicesFile(projectRoot, xcodeproj, target) {
19483
20834
  return guarded;
19484
20835
  });
19485
20836
  if (!defaultConfigured) return null;
19486
- const resources = app.resources.filter(
19487
- (file) => /^GoogleService-Info\.plist$/.test(import_node_path17.default.basename(file))
20837
+ const bundle = import_node_path22.default.join(
20838
+ app.settings("BUILT_PRODUCTS_DIR"),
20839
+ app.settings("WRAPPER_NAME") || `${app.settings("PRODUCT_NAME")}.app`
19488
20840
  );
20841
+ const staged = app.copiedFiles.filter(
20842
+ ({ from, to }) => to === import_node_path22.default.join(bundle, "GoogleService-Info.plist") && import_node_fs21.default.existsSync(from)
20843
+ ).map(({ from }) => import_node_fs21.default.realpathSync(from));
20844
+ const resources = [
20845
+ .../* @__PURE__ */ new Set([
20846
+ ...app.resources.filter(
20847
+ (file) => /^GoogleService-Info\.plist$/.test(import_node_path22.default.basename(file))
20848
+ ),
20849
+ ...staged
20850
+ ])
20851
+ ];
19489
20852
  if (resources.length !== 1)
19490
20853
  throw new Error(
19491
20854
  "native Firebase default initialization requires one GoogleService-Info.plist build resource"
19492
20855
  );
19493
- return import_node_path17.default.relative(import_node_fs17.default.realpathSync(projectRoot), resources[0]);
20856
+ return import_node_path22.default.relative(import_node_fs21.default.realpathSync(projectRoot), resources[0]);
19494
20857
  }
19495
- function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"], iosTarget, config = readExpoConfig(projectRoot)) {
20858
+ function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"], iosTarget, config = readExpoConfig(projectRoot), prepareGeneratedSources = false) {
19496
20859
  const result = {};
19497
20860
  const ios = config.ios;
19498
20861
  if (platforms.includes("ios") && (!isRecord(ios) || typeof ios.googleServicesFile !== "string")) {
19499
- const iosRoot = import_node_path17.default.join(projectRoot, "ios");
19500
- if (import_node_fs17.default.existsSync(iosRoot)) {
19501
- const projects = import_node_fs17.default.readdirSync(iosRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj"));
20862
+ const iosRoot = import_node_path22.default.join(projectRoot, "ios");
20863
+ if (import_node_fs21.default.existsSync(iosRoot)) {
20864
+ const projects = import_node_fs21.default.readdirSync(iosRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj"));
19502
20865
  if (projects.length > 1)
19503
20866
  throw new Error(
19504
20867
  `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(", ")}`
19505
20868
  );
19506
20869
  if (projects.length === 1) {
19507
- const xcodeproj = import_node_path17.default.join(iosRoot, projects[0].name);
20870
+ const xcodeproj = import_node_path22.default.join(iosRoot, projects[0].name);
19508
20871
  const appTargets = listXcodeAppTargets(xcodeproj, { requireSources: false });
20872
+ const bundleId = isRecord(ios) && typeof ios.bundleIdentifier === "string" ? ios.bundleIdentifier : null;
20873
+ const matching = bundleId ? appTargets.filter(
20874
+ (target) => readXcodeAppTarget(xcodeproj, target, void 0, {
20875
+ requireSources: false,
20876
+ prepareGeneratedSources
20877
+ }).settings("PRODUCT_BUNDLE_IDENTIFIER") === bundleId
20878
+ ) : [];
19509
20879
  const files = new Set(
19510
- (iosTarget ? [iosTarget] : appTargets).map(
19511
- (target) => readTargetGoogleServicesFile(projectRoot, xcodeproj, target)
20880
+ (iosTarget ? [iosTarget] : matching.length > 0 ? matching : appTargets).map(
20881
+ (target) => readTargetGoogleServicesFile(
20882
+ projectRoot,
20883
+ xcodeproj,
20884
+ target,
20885
+ prepareGeneratedSources
20886
+ )
19512
20887
  )
19513
20888
  );
19514
20889
  if (files.size > 1)
@@ -19524,8 +20899,8 @@ function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"], i
19524
20899
  const native = config[platform];
19525
20900
  if (!isRecord(native) || typeof native.googleServicesFile !== "string") continue;
19526
20901
  try {
19527
- const source = import_node_fs17.default.readFileSync(
19528
- import_node_path17.default.resolve(projectRoot, native.googleServicesFile),
20902
+ const source = import_node_fs21.default.readFileSync(
20903
+ import_node_path22.default.resolve(projectRoot, native.googleServicesFile),
19529
20904
  "utf8"
19530
20905
  );
19531
20906
  const parsed = platform === "ios" ? parsePlistSource(source) : JSON.parse(source);
@@ -19846,6 +21221,13 @@ function withPeach(config, options = {}) {
19846
21221
  annotated,
19847
21222
  (code) => insertAndroidAutolinkingFooter(code, androidAutolinkedPackages)
19848
21223
  );
21224
+ const rootModuleName = readAndroidLauncherRootModuleName(cfgProjectRoot);
21225
+ if (rootModuleName !== void 0) {
21226
+ annotated = await mapMetroSerializerCode(
21227
+ annotated,
21228
+ (code) => insertAndroidRootModuleFooter(code, rootModuleName)
21229
+ );
21230
+ }
19849
21231
  }
19850
21232
  const identity = readNativeAppIdentityFromProject(
19851
21233
  cfgProjectRoot,
@@ -20017,13 +21399,13 @@ var metro_plugin_default = withPeach;
20017
21399
 
20018
21400
  // src/jump-to-source-babel.ts
20019
21401
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
20020
- function normalizeSourcePath(path22) {
20021
- const queryStart = path22.indexOf("?");
20022
- const clean = queryStart >= 0 ? path22.slice(0, queryStart) : path22;
21402
+ function normalizeSourcePath(path26) {
21403
+ const queryStart = path26.indexOf("?");
21404
+ const clean = queryStart >= 0 ? path26.slice(0, queryStart) : path26;
20023
21405
  return clean.replace(/\\/g, "/");
20024
21406
  }
20025
- function matchesPath(path22, matcher) {
20026
- return typeof matcher === "string" ? path22.includes(matcher) : matcher.test(path22);
21407
+ function matchesPath(path26, matcher) {
21408
+ return typeof matcher === "string" ? path26.includes(matcher) : matcher.test(path26);
20027
21409
  }
20028
21410
  function shouldStampFile(filename, options) {
20029
21411
  const normalized = normalizeSourcePath(filename);
@@ -20043,11 +21425,11 @@ function sootsimJumpToSourceBabelPlugin(api, options = {}) {
20043
21425
  name: "sootsim-jump-to-source",
20044
21426
  visitor: {
20045
21427
  JSXElement: {
20046
- exit(path22, state) {
21428
+ exit(path26, state) {
20047
21429
  if (options.enabled === false) return;
20048
21430
  const filename = state.filename;
20049
21431
  if (!filename || !shouldStampFile(filename, options)) return;
20050
- const node = path22.node;
21432
+ const node = path26.node;
20051
21433
  if (stamped.has(node)) return;
20052
21434
  stamped.add(node);
20053
21435
  const opening = node.openingElement;
@@ -20066,12 +21448,12 @@ function sootsimJumpToSourceBabelPlugin(api, options = {}) {
20066
21448
  );
20067
21449
  return;
20068
21450
  }
20069
- const fn = path22.getFunctionParent();
21451
+ const fn = path26.getFunctionParent();
20070
21452
  const parameterDefault = Boolean(
20071
21453
  fn && opening.start != null && fn.node.body.start != null && opening.start < fn.node.body.start
20072
21454
  );
20073
- const type = path22.scope.generateUidIdentifier("PeachSourceType");
20074
- if (!parameterDefault) path22.scope.push({ id: type });
21455
+ const type = path26.scope.generateUidIdentifier("PeachSourceType");
21456
+ if (!parameterDefault) path26.scope.push({ id: type });
20075
21457
  function expression(tag) {
20076
21458
  return t.isJSXIdentifier(tag) ? t.identifier(tag.name) : t.memberExpression(
20077
21459
  expression(tag.object),
@@ -20106,10 +21488,10 @@ function sootsimJumpToSourceBabelPlugin(api, options = {}) {
20106
21488
  ),
20107
21489
  node
20108
21490
  );
20109
- if (path22.parentPath.isJSXElement() || path22.parentPath.isJSXFragment()) {
20110
- path22.replaceWith(t.jsxExpressionContainer(replacement));
21491
+ if (path26.parentPath.isJSXElement() || path26.parentPath.isJSXFragment()) {
21492
+ path26.replaceWith(t.jsxExpressionContainer(replacement));
20111
21493
  } else {
20112
- path22.replaceWith(replacement);
21494
+ path26.replaceWith(replacement);
20113
21495
  }
20114
21496
  }
20115
21497
  }