peachsim 0.1.2935 → 0.1.2937

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 (345) hide show
  1. package/LICENSE +6 -8
  2. package/cli/account-gate.ts +20 -3
  3. package/cli/app-bundle-resources.ts +66 -19
  4. package/cli/catalog/meta.ts +2 -106
  5. package/cli/command-agent.ts +7 -0
  6. package/cli/command-registry.ts +0 -1
  7. package/cli/commands/control.ts +13 -5
  8. package/cli/commands/daemon.ts +4 -2
  9. package/cli/commands/device.ts +78 -8
  10. package/cli/commands/do-chain.ts +11 -8
  11. package/cli/commands/inspect/core.ts +4 -9
  12. package/cli/commands/inspect/settling.ts +1 -0
  13. package/cli/commands/logout.ts +6 -1
  14. package/cli/commands/map.ts +2 -6
  15. package/cli/commands/package.ts +112 -57
  16. package/cli/commands/shell-url.ts +0 -1
  17. package/cli/download-auth.ts +2 -0
  18. package/cli/drivers/playwright-provisioning.ts +10 -38
  19. package/cli/github-workflow-identity.ts +8 -0
  20. package/cli/internal-child-contract.ts +1 -0
  21. package/cli/internal-child.ts +5 -0
  22. package/cli/main.ts +2 -10
  23. package/cli/outbound-endpoints.ts +26 -0
  24. package/detox/index.ts +227 -131
  25. package/dist-lib/agent-daemon-client.cjs +1 -1
  26. package/dist-lib/agent-events.cjs +1 -1
  27. package/dist-lib/attached-projects.cjs +1 -1
  28. package/dist-lib/auth/shared-session.cjs +1 -1
  29. package/dist-lib/backend-origin.cjs +1 -1
  30. package/dist-lib/beta.cjs +1 -1
  31. package/dist-lib/beta.mjs +2 -2
  32. package/dist-lib/bridge-constants.cjs +1 -1
  33. package/dist-lib/bridge-contract-input.cjs +47 -3
  34. package/dist-lib/bridge-contract-input.mjs +6 -6
  35. package/dist-lib/bridge-contract.cjs +10 -1
  36. package/dist-lib/bridge-contract.mjs +3 -3
  37. package/dist-lib/bundle-channel.cjs +12779 -9515
  38. package/dist-lib/capture-contract.cjs +39 -17
  39. package/dist-lib/capture-contract.mjs +3 -3
  40. package/dist-lib/cloud-contract.cjs +1 -1
  41. package/dist-lib/cloud-contract.mjs +3 -3
  42. package/dist-lib/cloud-test-args.cjs +1 -1
  43. package/dist-lib/cloud-test-args.mjs +2 -2
  44. package/dist-lib/cloud.cjs +1 -1
  45. package/dist-lib/cloud.mjs +8 -8
  46. package/dist-lib/config.cjs +1 -1
  47. package/dist-lib/config.mjs +6 -6
  48. package/dist-lib/detox/index.cjs +200 -132
  49. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  50. package/dist-lib/esm-chunks/{acorn-Q5TRRYSO.mjs → acorn-IIBLEO25.mjs} +3 -3
  51. package/dist-lib/esm-chunks/{chunk-UDWBTBVG.mjs → chunk-4FTPQKPT.mjs} +10 -1
  52. package/dist-lib/esm-chunks/chunk-4WIDTRBB.mjs +10232 -0
  53. package/dist-lib/esm-chunks/{chunk-LCMFYMT7.mjs → chunk-5QZOQ3NZ.mjs} +1 -1
  54. package/dist-lib/esm-chunks/{chunk-BJ2OGUX7.mjs → chunk-CIY67HNL.mjs} +39 -17
  55. package/dist-lib/esm-chunks/{chunk-SKQTNQYE.mjs → chunk-CQFEMJ64.mjs} +1 -1
  56. package/dist-lib/esm-chunks/{chunk-AXWVXRHX.mjs → chunk-CWVMCW23.mjs} +1 -1
  57. package/dist-lib/esm-chunks/{chunk-MTALOHQR.mjs → chunk-F6DZ4DS2.mjs} +1 -1
  58. package/dist-lib/esm-chunks/{chunk-I4R7IZRD.mjs → chunk-HJMF6O7L.mjs} +74 -46
  59. package/dist-lib/esm-chunks/chunk-I6T4PXJF.mjs +154 -0
  60. package/dist-lib/esm-chunks/{chunk-XWAUZKIA.mjs → chunk-IJU3JMWM.mjs} +1 -1
  61. package/dist-lib/esm-chunks/{chunk-CXWUIOCH.mjs → chunk-KODEPXQC.mjs} +4 -4
  62. package/dist-lib/esm-chunks/{chunk-WJE5QHSD.mjs → chunk-LD4K2VBL.mjs} +155 -36
  63. package/dist-lib/esm-chunks/{chunk-2TSM64HI.mjs → chunk-LTE7YMEG.mjs} +1 -1
  64. package/dist-lib/esm-chunks/{chunk-3GGOXUJA.mjs → chunk-M3CSKAJE.mjs} +1 -1
  65. package/dist-lib/esm-chunks/{chunk-7G5UETIG.mjs → chunk-NA6DJPB6.mjs} +43 -1
  66. package/dist-lib/esm-chunks/{chunk-MSUHMNAI.mjs → chunk-NNAX24FS.mjs} +1 -1
  67. package/dist-lib/esm-chunks/{chunk-VDJA4LP4.mjs → chunk-PZPJJBAS.mjs} +1 -1
  68. package/dist-lib/esm-chunks/{chunk-UEEEJVQA.mjs → chunk-QXSTHMWN.mjs} +1 -1
  69. package/dist-lib/esm-chunks/{chunk-S2RJB5I7.mjs → chunk-RBPVK5YI.mjs} +1 -1
  70. package/dist-lib/esm-chunks/{chunk-VRAXNGYT.mjs → chunk-SCT5OFDV.mjs} +1 -1
  71. package/dist-lib/esm-chunks/{chunk-T3M73LGP.mjs → chunk-U3CJGYSP.mjs} +50 -6
  72. package/dist-lib/esm-chunks/{chunk-SLUGTGQQ.mjs → chunk-VXTOQ522.mjs} +12 -6
  73. package/dist-lib/esm-chunks/{chunk-EL44SZMV.mjs → chunk-WMSVGYTH.mjs} +1 -1
  74. package/dist-lib/esm-chunks/{chunk-FEDEPSEV.mjs → chunk-WRWINRWK.mjs} +1 -1
  75. package/dist-lib/esm-chunks/{chunk-BNO52N2S.mjs → chunk-YZF2USRD.mjs} +1905 -8760
  76. package/dist-lib/esm-chunks/{chunk-TQLKYMVP.mjs → chunk-ZNHR6C3L.mjs} +1 -1
  77. package/dist-lib/esm-chunks/{download-auth-registry-G75MIT55.mjs → download-auth-registry-AHS5MSIB.mjs} +4 -4
  78. package/dist-lib/esm-chunks/{metro-layout-parser-FXLUDTYT.mjs → metro-layout-parser-24ZYK5UP.mjs} +3 -3
  79. package/dist-lib/esm-chunks/{swift-package-prebuilt-524D4MA2.mjs → swift-package-prebuilt-L4YNXQRD.mjs} +15 -15
  80. package/dist-lib/esm-chunks/{swift-sdk-app-module-EX544YJY.mjs → swift-sdk-app-module-RM652JSW.mjs} +87 -71
  81. package/dist-lib/esm-chunks/{swift-sdk-image-LOTMWVM7.mjs → swift-sdk-image-5PQ44UJT.mjs} +15 -15
  82. package/dist-lib/esm-chunks/{swift-sdk-image-producer-UO6B3M4U.mjs → swift-sdk-image-producer-GD3SM6YI.mjs} +5 -5
  83. package/dist-lib/esm-chunks/swift-sdk-later-data-62QYJ2KH.mjs +590 -0
  84. package/dist-lib/expo-swift-bundle.cjs +21037 -17896
  85. package/dist-lib/expo-swift-metadata.cjs +8 -2
  86. package/dist-lib/expo-swift-metadata.mjs +9 -8
  87. package/dist-lib/home-paths.cjs +1 -1
  88. package/dist-lib/host/bridge-host.cjs +22481 -18741
  89. package/dist-lib/host/fetch-proxy-handler.cjs +21079 -17980
  90. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  91. package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
  92. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  93. package/dist-lib/host/websocket-proxy.cjs +1 -1
  94. package/dist-lib/index.cjs +68 -38
  95. package/dist-lib/kotlin-host.cjs +97 -21
  96. package/dist-lib/menu.cjs +1 -1
  97. package/dist-lib/menu.mjs +3 -3
  98. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  99. package/dist-lib/metro-fingerprint-registry.mjs +3 -3
  100. package/dist-lib/metro-production-bundle.cjs +23 -1
  101. package/dist-lib/metro-production-bundle.mjs +24 -4
  102. package/dist-lib/native-app-identity-project.cjs +3582 -571
  103. package/dist-lib/native-app-identity-project.mjs +1024 -398
  104. package/dist-lib/native-app-identity.cjs +1 -1
  105. package/dist-lib/native-app-identity.mjs +6 -6
  106. package/dist-lib/native-firebase-metadata.cjs +1 -1
  107. package/dist-lib/native-firebase-metadata.mjs +3 -3
  108. package/dist-lib/pdfium-raster.cjs +1 -1
  109. package/dist-lib/pdfium-raster.mjs +2 -2
  110. package/dist-lib/plist.cjs +1 -1
  111. package/dist-lib/plist.mjs +3 -3
  112. package/dist-lib/profiles.cjs +1 -1
  113. package/dist-lib/public-brand.cjs +1 -1
  114. package/dist-lib/public-origins-lib-esm.json +132 -116
  115. package/dist-lib/public-origins-lib.json +215 -173
  116. package/dist-lib/react-native-host-modules.cjs +1 -1
  117. package/dist-lib/react-native-host-modules.mjs +2 -2
  118. package/dist-lib/reap-browser.cjs +17 -1
  119. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  120. package/dist-lib/sdk.cjs +6 -7
  121. package/dist-lib/sdk.mjs +13 -14
  122. package/dist-lib/skills.cjs +23216 -19650
  123. package/dist-lib/swift-compile.cjs +4337 -2905
  124. package/dist-lib/swift-compile.mjs +15 -13
  125. package/dist-lib/swift-package.cjs +1 -1
  126. package/dist-lib/swift-package.mjs +3 -3
  127. package/dist-lib/swift-submit.cjs +1 -1
  128. package/dist-lib/swift-submit.mjs +6 -6
  129. package/dist-lib/swift-svg-raster.cjs +1 -1
  130. package/dist-lib/swift-svg-raster.mjs +2 -2
  131. package/dist-lib/swift-toolchain.cjs +19 -1
  132. package/dist-lib/swift.cjs +1 -1
  133. package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
  134. package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
  135. package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
  136. package/dist-lib/vendor/acorn.cjs +1 -1
  137. package/dist-lib/vendor/stream-json.cjs +1 -1
  138. package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
  139. package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
  140. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
  141. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
  142. package/dist-lib/vendor/sucrase.cjs +1 -1
  143. package/dist-lib/vendor/terser.cjs +1 -1
  144. package/dist-lib/vendor/valibot.cjs +1 -1
  145. package/dist-lib/vendor/ws.cjs +94 -32
  146. package/dist-lib/vendor/zod.cjs +1 -1
  147. package/dist-lib/worklet-executable.cjs +8 -5
  148. package/dist-lib/worklet-executable.mjs +9 -6
  149. package/dist-types/packages/peach-engine/src/canvaskit-artifact-urls.d.ts +2 -1
  150. package/dist-types/packages/peach-engine/src/capture/compositor-presentation-recording.d.ts +1 -0
  151. package/dist-types/packages/peach-engine/src/engine/generated/canvaskit-artifact-hashes.d.ts +26 -0
  152. package/dist-types/packages/peach-engine/src/engine/guest-scene-inspect.d.ts +1 -1
  153. package/dist-types/packages/peach-engine/src/engine/inspect-info.d.ts +1 -0
  154. package/dist-types/packages/peach-engine/src/engine/metalTypes.d.ts +32 -2
  155. package/dist-types/packages/peach-engine/src/engine/portalContract.d.ts +24 -0
  156. package/dist-types/packages/peach-engine/src/engine/remote-display-protocol.d.ts +12 -2
  157. package/dist-types/packages/peach-engine/src/guest/http-cookie-storage.d.ts +73 -0
  158. package/dist-types/packages/peach-engine/src/guest/native-evaluation-lease.d.ts +5 -0
  159. package/dist-types/packages/peach-engine/src/guest/nitro-jsi-host.d.ts +3 -1
  160. package/dist-types/packages/peach-engine/src/ios/apps/canvas-map-data.d.ts +225 -9
  161. package/dist-types/packages/peach-engine/src/ios/chrome-metrics.d.ts +4 -1
  162. package/dist-types/packages/peach-engine/src/ios/duo-vertical-bar-geometry.d.ts +0 -1
  163. package/dist-types/packages/peach-engine/src/native-preview-bundle.d.ts +1 -0
  164. package/dist-types/packages/peach-engine/src/remote-stream/canvas-display-compositor.d.ts +1 -0
  165. package/dist-types/packages/peach-engine/src/remote-stream/canvas-display-contract.d.ts +44 -10
  166. package/dist-types/packages/peach-engine/src/remote-stream/cloud-display.d.ts +4 -3
  167. package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +2 -4
  168. package/dist-types/packages/peach-engine/src/render-worker/metro-bundle-metadata.d.ts +2 -0
  169. package/dist-types/packages/peach-engine/src/render-worker/native-widgetContract.d.ts +1 -1
  170. package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +15 -27
  171. package/dist-types/packages/peach-engine/src/render-worker/reanimated-readiness.d.ts +2 -6
  172. package/dist-types/packages/peach-engine/src/render-worker/shell-protocol.d.ts +11 -3
  173. package/dist-types/packages/peach-engine/src/settings/devices.d.ts +3 -1
  174. package/dist-types/packages/peach-engine/src/settings/duo-fold.d.ts +1 -1
  175. package/dist-types/packages/peach-engine/src/webview-automation-host.d.ts +1 -1
  176. package/dist-types/packages/peach-globals/src/app-bundle-resources.d.ts +10 -0
  177. package/dist-types/packages/peach-globals/src/compositorBridgeContract.d.ts +1 -1
  178. package/dist-types/packages/peach-globals/src/hostStorageBridgeContract.d.ts +1 -0
  179. package/dist-types/packages/peach-globals/src/index.d.ts +2 -2
  180. package/dist-types/packages/peach-globals/src/lockstepCaptureBridgeContract.d.ts +9 -6
  181. package/dist-types/packages/peach-globals/src/nodeContract.d.ts +11 -0
  182. package/dist-types/packages/peach-globals/src/oneWidgetContract.d.ts +28 -0
  183. package/package.json +2 -2
  184. package/runtime-companion.json +1 -1
  185. package/sdk/ios/System/Library/Frameworks/CoreHaptics.framework/Headers/CoreHaptics.h +251 -0
  186. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INImage.h +14 -0
  187. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INIntent.h +18 -0
  188. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INIntentIdentifiers.h +30 -0
  189. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INIntentResponse.h +12 -0
  190. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INInteraction.h +35 -0
  191. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INObjectCollection.h +0 -7
  192. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INObjectSection.h +0 -7
  193. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INOutgoingMessageType.h +7 -0
  194. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INPerson.h +36 -0
  195. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INPersonHandle.h +22 -0
  196. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INSendMessageIntent+UserNotifications.h +6 -0
  197. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INSendMessageIntent.h +33 -0
  198. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INSpeakableString.h +24 -0
  199. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/Intents.h +11 -7
  200. package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMailComposeViewController.h +1 -1
  201. package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMessageComposeViewController.h +1 -1
  202. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLRenderCommandEncoder.h +0 -8
  203. package/sdk/ios/System/Library/Frameworks/MetalTypes.framework/Headers/MetalTypes.h +8 -0
  204. package/sdk/ios/System/Library/Frameworks/Social.framework/Headers/SLServiceTypes.h +9 -0
  205. package/sdk/ios/System/Library/Frameworks/Social.framework/Headers/Social.h +1 -0
  206. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotification.h +1 -1
  207. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationAction.h +2 -2
  208. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationAttachment.h +1 -1
  209. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationCategory.h +1 -1
  210. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationContent.h +2 -2
  211. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationRequest.h +1 -1
  212. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationResponse.h +2 -2
  213. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationSound.h +1 -1
  214. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationTrigger.h +5 -5
  215. package/sdk/ios/usr/lib/swift/UIKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +4 -0
  216. package/sdk/ios/wasm/include/unistd.h +1 -0
  217. package/src/acorn-program.ts +3 -0
  218. package/src/audio-codec-archives.ts +141 -0
  219. package/src/bridge-contract-input.ts +61 -1
  220. package/src/bridge-contract.ts +45 -4
  221. package/src/bundle-channel.mjs +44 -30
  222. package/src/capture-contract.ts +57 -39
  223. package/src/conformance-comparison-contract.ts +2 -0
  224. package/src/expo-discovery-cache.ts +0 -2
  225. package/src/expo-macro-host.ts +8 -3
  226. package/src/expo-native-compiler-digest.ts +0 -1
  227. package/src/expo-native-prebuilt.ts +1 -1
  228. package/src/expo-native-workspace.ts +83 -45
  229. package/src/expo-pod-prebuilt.ts +1 -0
  230. package/src/expo-swift-host.ts +158 -77
  231. package/src/expo-swift-legacy-runtime-source.ts +12 -1
  232. package/src/expo-swift-view-source.ts +51 -20
  233. package/src/expo-workspace-exclusion.ts +7 -1
  234. package/src/expoSwiftContract.ts +10 -1
  235. package/src/ffmpeg-source-build.ts +123 -59
  236. package/src/genrule-archives.ts +7 -2
  237. package/src/genrule-library-builds.ts +101 -18
  238. package/src/host/bridge-host.ts +10 -1
  239. package/src/installed-native-libraries.ts +147 -23
  240. package/src/installed-package-versions.ts +30 -0
  241. package/src/ios-rn-bundle-request.ts +3 -1
  242. package/src/ios-rn-bundle.ts +38 -27
  243. package/src/ios-rn-compile.ts +23 -6
  244. package/src/ios-rn-startup.ts +2 -1
  245. package/src/java-module-abi.ts +4 -3
  246. package/src/kotlin-host.ts +4 -4
  247. package/src/kotlin-library-sources.ts +8 -5
  248. package/src/metro-production-bundle.ts +24 -0
  249. package/src/native-firebase-config.ts +2 -0
  250. package/src/native-framework-compiler.ts +5 -0
  251. package/src/native-package-slice-build.ts +3 -0
  252. package/src/native-package-slice.ts +15 -10
  253. package/src/native-preparation.ts +4 -1
  254. package/src/native-static-libraries.ts +107 -33
  255. package/src/nativeRuntimePackageIndex.ts +1 -4
  256. package/src/nitro-adapter.lock.json +286 -286
  257. package/src/nitro-app-providers.ts +20 -8
  258. package/src/nitro-compile.ts +131 -37
  259. package/src/nitro-dependencies.ts +42 -8
  260. package/src/nitro-source.ts +40 -36
  261. package/src/nitro-superset.lock.json +4 -4
  262. package/src/nitroAdapterContract.ts +32 -7
  263. package/src/nitroContract.ts +21 -37
  264. package/src/one-direct-host-source.ts +247 -140
  265. package/src/one-fabric.ts +129 -0
  266. package/src/one-native-controls-package.ts +95 -21
  267. package/src/one-native-controls-release.ts +147 -14
  268. package/src/one-native-source.ts +4 -1
  269. package/src/one-nitro-inputs.ts +1 -1
  270. package/src/one-nitro-source.ts +45 -1
  271. package/src/one-sdk/source.ts +10 -41
  272. package/src/one-widget-metadata.ts +2 -2
  273. package/src/one-widget-package.ts +1 -1
  274. package/src/oneSdkContract.ts +3 -0
  275. package/src/playwright-browser-paths.ts +30 -0
  276. package/src/pods-install.ts +6 -2
  277. package/src/pods-post-install.ts +2 -2
  278. package/src/pods-project.ts +10 -0
  279. package/src/podspec-ruby-stdlib.ts +73 -0
  280. package/src/podspec-ruby.ts +1 -1
  281. package/src/podspec-sources.ts +31 -13
  282. package/src/process-group.ts +135 -5
  283. package/src/published-swift-sdk.ts +25 -1
  284. package/src/react-native-bridge-modules.ts +35 -3
  285. package/src/react-native-core-build.ts +14 -2
  286. package/src/react-native-core.ts +12 -2
  287. package/src/rive-runtime-dependencies.ts +178 -40
  288. package/src/serverDiscoveryContract.ts +1 -1
  289. package/src/storageSnapshotContract.ts +1 -1
  290. package/src/swift-app-data-store.ts +35 -0
  291. package/src/swift-compile.ts +403 -121
  292. package/src/swift-compiler-digest.ts +4 -0
  293. package/src/swift-darwin-records.ts +6 -0
  294. package/src/swift-distribution-mirror.ts +10 -1
  295. package/src/swift-distribution.lock.json +19 -18
  296. package/src/swift-distribution.ts +17 -1
  297. package/src/swift-entry-module.ts +1 -0
  298. package/src/swift-guest-compile.ts +8 -1
  299. package/src/swift-host.ts +79 -23
  300. package/src/swift-installed-targets.ts +51 -20
  301. package/src/swift-objc-standin.ts +60 -8
  302. package/src/swift-packages.ts +104 -24
  303. package/src/swift-project-user.ts +2 -1
  304. package/src/swift-reproducible.ts +99 -1
  305. package/src/swift-root-lock.ts +52 -46
  306. package/src/swift-sdk-app-module.ts +65 -13
  307. package/src/swift-sdk-image-producer.ts +2 -1
  308. package/src/swift-sdk-image.ts +23 -8
  309. package/src/swift-sdk-later-data.ts +294 -44
  310. package/src/swift-sdk-surface.ts +233 -55
  311. package/src/swift-shared-sdk.ts +7 -0
  312. package/src/swift-standin-builtin-behavior.ts +18 -0
  313. package/src/swift-standin-emit.ts +242 -54
  314. package/src/swift-standins.ts +184 -38
  315. package/src/swift-startup-split.ts +19 -9
  316. package/src/swift-toolchain.ts +18 -0
  317. package/src/swift-wasm-prune.ts +179 -9
  318. package/src/swift-xcframework.ts +16 -0
  319. package/src/swiftContract.ts +4 -1
  320. package/src/swiftSdkLinkContract.ts +2 -0
  321. package/src/swiftTargetContract.ts +1 -0
  322. package/src/turbo-bundle.ts +6 -3
  323. package/src/turbo-codegen-intake.ts +106 -16
  324. package/src/turbo-compile.ts +89 -68
  325. package/src/turbo-fabric-app.ts +287 -23
  326. package/src/turbo-provider-host.ts +122 -31
  327. package/src/turbo-runtime.lock.json +26 -26
  328. package/src/turbo-source.ts +374 -157
  329. package/src/vite-plugin.ts +48 -112
  330. package/src/wasm-binary-sections.ts +40 -0
  331. package/src/wasm-code-immediates.ts +35 -5
  332. package/src/widget-extension-bundle.ts +15 -1
  333. package/src/worklet-executable.ts +2 -1
  334. package/src/worklet-kernel.ts +5 -3
  335. package/src/worklets-babel.ts +2 -1
  336. package/src/xcode-project.ts +151 -53
  337. package/src/xcode-scheme-actions.ts +104 -0
  338. package/cli/commands/canvas.ts +0 -1204
  339. package/dist-lib/esm-chunks/chunk-B5QD2KEV.mjs +0 -2787
  340. package/dist-lib/vendor/magic-string.cjs +0 -1693
  341. package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-cookies.d.ts +0 -127
  342. package/src/appBundleResourcesContract.ts +0 -51
  343. package/src/canvas-groups.ts +0 -28
  344. package/src/canvas-map-layout.ts +0 -161
  345. package/src/oneWidgetContract.ts +0 -134
@@ -73,6 +73,8 @@ export const SWIFT_DIGEST_SOURCES = [
73
73
  'swift-sdk-image-map.ts',
74
74
  'swift-sdk-image-wasm.ts',
75
75
  'swift-sdk-image.ts',
76
+ 'swift-sdk-later-data.ts',
77
+ 'swift-app-data-store.ts',
76
78
  'swift-object-meta-cache.ts',
77
79
  '../../peach-kit/src/nativeSdkBindingContract.ts',
78
80
  'swiftRuntimeProductContract.ts',
@@ -109,6 +111,8 @@ const LINKED_IMAGE_SOURCES = new Set([
109
111
  'swift-sdk-image-map.ts',
110
112
  'swift-sdk-image-wasm.ts',
111
113
  'swift-sdk-image.ts',
114
+ 'swift-sdk-later-data.ts',
115
+ 'swift-app-data-store.ts',
112
116
  'swift-wasm-prune.ts',
113
117
  'swiftGuestImageContract.ts',
114
118
  'swiftRuntimeProductContract.ts',
@@ -22,6 +22,12 @@ import { wasmThreadFlags } from './swiftTargetContract.ts'
22
22
  /** the prefix every provider object carries, in the sdk archive and in a distribution's lib/. */
23
23
  export const DARWIN_RECORDS_PREFIX = 'DarwinRecords-'
24
24
 
25
+ /** providers that require the scoped link's guest image tables. */
26
+ export const GUEST_IMAGE_RECORDS: ReadonlySet<string> = new Set([
27
+ 'DarwinRecords-guest-image-projection.o',
28
+ 'DarwinRecords-dyld-loader.o',
29
+ ])
30
+
25
31
  // the descriptor calls reached by Darwin, WASI libc and its buffered streams
26
32
  export const darwinSharedFileLinkFlags = [
27
33
  'fd_read',
@@ -31,7 +31,7 @@ import {
31
31
  SWIFT_SDK_PRODUCT_DIRECTORY,
32
32
  SWIFT_SDK_PRODUCT_FILE,
33
33
  } from './swiftRuntimeProductContract'
34
- import { SWIFT_WASM_TRIPLE } from './swiftTargetContract'
34
+ import { SWIFT_PROVIDED_MODULES_PREFIX, SWIFT_WASM_TRIPLE } from './swiftTargetContract'
35
35
 
36
36
  export const SWIFT_DISTRIBUTION_MIRROR = '.peach-distribution'
37
37
  export const SWIFT_SDK_MIRROR = '.peach-sdk'
@@ -376,6 +376,15 @@ function invalidateDependents(root: string, mirror: string, files: string[]): vo
376
376
  const spellings: [prefix: Buffer, base: string][] = [
377
377
  [Buffer.from(`${escapeDepPath(mirror)}/`), ''],
378
378
  ]
379
+ if (files.some((file) => file.startsWith('modules/'))) {
380
+ for (const entry of readdirSync(root, { withFileTypes: true })) {
381
+ if (entry.isDirectory() && entry.name.startsWith(SWIFT_PROVIDED_MODULES_PREFIX))
382
+ spellings.push([
383
+ Buffer.from(`${escapeDepPath(path.join(root, entry.name))}/`),
384
+ 'modules/',
385
+ ])
386
+ }
387
+ }
379
388
  if (files.some((file) => file.startsWith('sdk/ios/')))
380
389
  spellings.push([Buffer.from('/darwin/'), 'sdk/ios/'])
381
390
  // clang validates neither system headers nor the modules built from them
@@ -1,11 +1,11 @@
1
1
  {
2
- "id": "944ed304d340b3fc",
3
- "release": "swift-6.4.0-RELEASE-custom-3844400b8fd05718",
2
+ "id": "c5732325c62b3483",
3
+ "release": "swift-6.4.0-RELEASE-custom-79968b9717d332cb",
4
4
  "archive": "tar.zst",
5
- "wasmSdkId": "swift-6.4.0-RELEASE_wasm-peach-66828a29",
6
- "wasmSdkUrl": "https://r2.sootsim.com/swift-wasm-sdk/swift-6.4.0-RELEASE_wasm-peach-66828a29.artifactbundle.tar.zst",
7
- "wasmSdkChecksum": "514ca07b5d0ad3f432649d26236f89e91bddd4898615533a1e2d63a5ea5986e4",
8
- "source": "2e2b541a49941877cfb827f0ffe480e0fc4b8303",
5
+ "wasmSdkId": "swift-6.4.0-RELEASE_wasm-peach-1f09147d",
6
+ "wasmSdkUrl": "https://r2.sootsim.com/swift-wasm-sdk/swift-6.4.0-RELEASE_wasm-peach-1f09147d.artifactbundle.tar.zst",
7
+ "wasmSdkChecksum": "380189a8064140c7dc8e1e9c93b6a2d0ec0c1deb07a240c2f88b1d76316e0f79",
8
+ "source": "06e0aa60314ea0fea6eb17bf15a2c38b3c37466a",
9
9
  "targets": [
10
10
  "AddressBook",
11
11
  "AddressBookConstants",
@@ -139,6 +139,7 @@
139
139
  "PeachCFNetwork",
140
140
  "CommonCrypto",
141
141
  "PeachCodec",
142
+ "PeachImageEncoding",
142
143
  "Compression",
143
144
  "zlib",
144
145
  "CryptoKit",
@@ -258,28 +259,28 @@
258
259
  },
259
260
  "hosts": {
260
261
  "darwin-arm64": {
261
- "sha256": "f3a89492ecbc39a3da6785d7395868b47f3e72b100fce10d8106a60703dc1d99",
262
- "size": 97014462
262
+ "sha256": "cc7338adf3dd612980ea15563eed37c498320455c76f326904738ed1e88de19e",
263
+ "size": 97415538
263
264
  },
264
265
  "linux-x64": {
265
- "sha256": "3bbc08a147b27f0e820e7cc661808afdf09f5391f438c42a9b9e7d95d9b9b893",
266
- "size": 99900206
266
+ "sha256": "945ea06ff4007122b0606ec4cfa015b6b2822bbf38e1285bb1155fc80ccbb28c",
267
+ "size": 100295847
267
268
  },
268
269
  "linux-arm64": {
269
- "sha256": "f6d3e501be130f665f7242d192016dc1099a570fee83133f0eff7a16c4390566",
270
- "size": 99615136
270
+ "sha256": "0fcc82bd53704281a47e03e301ebe12a1d348b1092f7542777676848cec4e1cb",
271
+ "size": 100005807
271
272
  }
272
273
  },
273
274
  "sdkRuntime": {
274
- "source": "b49c64e0e08e7d495a040d72512ca035f4c8dd5e14c8cdf20d4051714c91ede4",
275
- "url": "https://contrast.dev/compile/asset/e7a28243938b11b3bb88ed11aaa57a32db97f53ba0a5226a1cea544c1525e606",
276
- "dataPlan": "b13c7efa3ac59b0b3e5319111b4e986136a747d887eeafb54d792c1683bb982c",
275
+ "source": "9df533f4e9b27f857c3ccf90c78ef24797248d8090c977e866d30a5a503aac2e",
276
+ "url": "https://contrast.dev/compile/asset/ebf518cf24576cae4a2b98c087e7dc7e6fb1a9315ceed2d8d3fca9d1e2475604",
277
+ "dataPlan": "8857ea50d9b939422053ca6505bb55ff3e4a2577b9964ec83aef4388ea9a28e2",
277
278
  "recipe": "6a2d22814f45f5ed"
278
279
  },
279
280
  "sdkGuestRuntime": {
280
- "source": "4f9aa1dbee0db8c704e3cd6cf34f566288b530933f00fabe7cc9f7843d827b31",
281
- "url": "https://contrast.dev/compile/asset/db8cdb379f94ae4c56e82a3cc74c64a506b65de78e5b5f6efaef85f9882bd818",
282
- "dataPlan": "45342fdfd026f9f319acb4537fc210681a03b86f75234a36424dd2bcc70c6c5b",
281
+ "source": "ba69581b288dfed3de195e5cb1d7aa765e5f07f77049c6fc7c7346359724f63f",
282
+ "url": "https://contrast.dev/compile/asset/282d284534438b895261a8a35fe547dec7dd6cb5680575328db3aa394639bb7b",
283
+ "dataPlan": "d45d6afe75153504b83d5a0f1d9fd093fdd33907ab59051b418d7ebf354e1862",
283
284
  "recipe": "6a2d22814f45f5ed"
284
285
  }
285
286
  }
@@ -22,6 +22,7 @@ import {
22
22
  SWIFT_DISTRIBUTION_MANIFEST,
23
23
  swiftDistributionHost,
24
24
  swiftDistributionKey,
25
+ type SwiftDistributionLock,
25
26
  type SwiftDistributionManifest,
26
27
  } from './swift-distribution-contract'
27
28
  import { swiftNativePin } from './swift-native-pin'
@@ -33,6 +34,7 @@ import {
33
34
  import {
34
35
  swiftDistributionAt,
35
36
  swiftModuleCompiler,
37
+ swiftModuleDigest,
36
38
  swiftModuleSdk,
37
39
  swiftModuleToolchain,
38
40
  } from './swift-sdk-surface'
@@ -40,6 +42,7 @@ import {
40
42
  confineSwiftScratch,
41
43
  ensureSwiftLinuxRuntime,
42
44
  installSwiftWasmSdk,
45
+ localSwiftModuleRoot,
43
46
  peachSwiftSdksDir,
44
47
  privateSwiftDistributionRoot,
45
48
  SWIFT_PRIVATE_DISTRIBUTION_ENV,
@@ -210,10 +213,23 @@ function checkPrivateDistributionCompatibility(
210
213
  )
211
214
  }
212
215
 
216
+ /** share the published build when its complete source inputs match the checkout. */
217
+ export async function swiftDevelopmentModuleRoot(): Promise<string> {
218
+ const source = localSwiftModuleRoot()
219
+ if (
220
+ source &&
221
+ swiftModuleDigest(source).toString('hex').slice(0, 16) !==
222
+ swiftNativePin().distribution.id
223
+ )
224
+ return source
225
+ return swiftDistributionRoot()
226
+ }
227
+
213
228
  /** the installed distribution's root, downloading it on first use. */
214
229
  export async function swiftDistributionRoot(
215
230
  signal?: AbortSignal,
216
231
  privateRoot = privateSwiftDistributionRoot(),
232
+ retainedLock?: SwiftDistributionLock,
217
233
  ): Promise<string> {
218
234
  signal?.throwIfAborted()
219
235
  const host = swiftDistributionHost(process.platform, process.arch)
@@ -235,7 +251,7 @@ export async function swiftDistributionRoot(
235
251
  return privateRoot
236
252
  }
237
253
  const endpoint = swiftEndpoint()
238
- const lock = swiftNativePin().distribution
254
+ const lock = retainedLock ?? swiftNativePin().distribution
239
255
  // the archive is useless without its compiler, so the toolchain installs
240
256
  // or fails before the download
241
257
  await installSwiftToolchain(lock.release, lock, signal)
@@ -24,6 +24,7 @@ function swiftOptions(args: SwiftEntryModuleArgs): string {
24
24
  designTimeValues: args.designTimeValues,
25
25
  walkPeakPages: args.walkPeakPages,
26
26
  startupParts: args.startupParts,
27
+ interactionParts: args.interactionParts,
27
28
  })
28
29
  }
29
30
 
@@ -752,7 +752,14 @@ export async function compileGuestLink(options: {
752
752
  : {}),
753
753
  },
754
754
  )
755
- return { ...binding, appLink }
755
+ const { swiftAppDataPieces } = await import('./swift-sdk-later-data')
756
+ const appData = swiftAppDataPieces(
757
+ layoutMap,
758
+ linked,
759
+ link.linkage.data,
760
+ new Set([appProjectionObject]),
761
+ )
762
+ return { ...binding, appLink, appData }
756
763
  }
757
764
  } finally {
758
765
  if (result.finalLinkDone) await Promise.allSettled([result.finalLinkDone])
package/src/swift-host.ts CHANGED
@@ -109,6 +109,7 @@ import {
109
109
  prefetchSwiftCheckouts,
110
110
  readPins as readSwiftPackagePins,
111
111
  remoteSwiftCheckouts,
112
+ resolveInstalledSourceFrameworks,
112
113
  resolveSwiftPackagesAsync,
113
114
  type SwiftPackageBinary,
114
115
  type SwiftPackageGap,
@@ -125,6 +126,7 @@ import { shippedBinaryDiffers } from './swift-shipped-binaries'
125
126
  import {
126
127
  packageInputPath,
127
128
  readPackageFile as readSwiftSourceFile,
129
+ relativeInside,
128
130
  replaceRoot,
129
131
  } from './swift-source-file'
130
132
  import { readSwiftStandinBehavior } from './swift-standin-config'
@@ -723,6 +725,7 @@ async function wasmPortableAssembly(
723
725
  async function swiftPackages(
724
726
  entry: XcodeProjectEntry,
725
727
  app: XcodeAppTarget,
728
+ sourceBinaries: ReadonlySet<string>,
726
729
  ): Promise<{
727
730
  packages: SwiftPackages
728
731
  standins: SwiftStandin[]
@@ -777,7 +780,7 @@ async function swiftPackages(
777
780
  // stands in the same way a package's binary target does.
778
781
  const vendored: SwiftPackageBinary[] = app.binaryFrameworks.flatMap(
779
782
  ({ name, path: dir, rustCrate, genrule }) =>
780
- dir
783
+ dir && !sourceBinaries.has(dir)
781
784
  ? [
782
785
  {
783
786
  target: name,
@@ -1028,20 +1031,25 @@ async function buildXcodeLayout(root: string): Promise<XcodeLayout | null> {
1028
1031
  environment,
1029
1032
  headerAliases: expoHeaderAliases,
1030
1033
  } = await expoModulesJsiSource(originalTarget)
1034
+ const podSources = await resolveInstalledSourceFrameworks(appTarget)
1035
+ const sourceBinaries = new Set(podSources.map(({ packageTarget }) => packageTarget))
1031
1036
  const { packages, standins, dynamicFrameworks, projectGaps, binaries } =
1032
1037
  await withSwiftPackageEnvironment(environment, () =>
1033
- swiftPackages(registered, appTarget),
1038
+ swiftPackages(registered, appTarget, sourceBinaries),
1034
1039
  )
1035
- for (const { project, prepare } of packages.sourceFrameworks) {
1040
+ const sources = [...packages.sourceFrameworks, ...podSources]
1041
+ for (const { project, prepare } of sources) {
1036
1042
  if (!prepare) continue
1037
- if (!registered.moduleRoot)
1043
+ const moduleRoot = registered.moduleRoot ?? registered.interfaceRoot
1044
+ if (!moduleRoot) {
1038
1045
  throw new Error(
1039
1046
  `${project}: building its linked libraries needs a local module root`,
1040
1047
  )
1041
- await prepare(path.dirname(project), registered.moduleRoot)
1048
+ }
1049
+ await prepare(path.dirname(project), moduleRoot)
1042
1050
  }
1043
1051
  const sourceFrameworks = new Map(
1044
- packages.sourceFrameworks.map(
1052
+ sources.map(
1045
1053
  ({
1046
1054
  packageTarget,
1047
1055
  project,
@@ -1070,26 +1078,61 @@ async function buildXcodeLayout(root: string): Promise<XcodeLayout | null> {
1070
1078
  ),
1071
1079
  )
1072
1080
  const frameworkTargets = [...sourceFrameworks.values()]
1081
+ const podFrameworks = new Map(
1082
+ podSources.map(({ module, packageTarget }) => [
1083
+ module,
1084
+ sourceFrameworks.get(packageTarget)!,
1085
+ ]),
1086
+ )
1087
+ const podLinks = new Map(
1088
+ appTarget.sourceLinkGraph.targets.map(({ id, linkerFlags }) => [
1089
+ id,
1090
+ [
1091
+ ...new Set(
1092
+ linkerFlags.flatMap((name, index) => {
1093
+ if (linkerFlags[index - 1] !== '-framework') return []
1094
+ const target = podFrameworks.get(name)
1095
+ return target ? [target] : []
1096
+ }),
1097
+ ),
1098
+ ],
1099
+ ]),
1100
+ )
1073
1101
  const packageFrameworkSearchPaths = frameworkTargets.flatMap(
1074
1102
  ({ objc }) => objc?.frameworkSearchPaths.slice(0, 1) ?? [],
1075
1103
  )
1076
- const withPackageFrameworks = <T extends XcodeModuleTarget>(target: T): T =>
1077
- target.objc && packageFrameworkSearchPaths.length > 0
1078
- ? {
1079
- ...target,
1080
- objc: {
1081
- ...target.objc,
1082
- frameworkSearchPaths: [
1083
- ...new Set([
1084
- ...target.objc.frameworkSearchPaths,
1085
- ...packageFrameworkSearchPaths,
1086
- ]),
1087
- ],
1088
- },
1089
- }
1090
- : target
1104
+ const withPackageFrameworks = <T extends XcodeModuleTarget>(target: T): T => {
1105
+ if (frameworkTargets.length === 0) return target
1106
+ return {
1107
+ ...target,
1108
+ targetDependencies: [
1109
+ ...target.targetDependencies,
1110
+ ...(podLinks.get(target.id) ?? []).map(({ targetIdentity }) => targetIdentity),
1111
+ ],
1112
+ ...(target.objc && {
1113
+ objc: {
1114
+ ...target.objc,
1115
+ frameworkSearchPaths: [
1116
+ ...new Set([
1117
+ ...target.objc.frameworkSearchPaths.filter(
1118
+ (directory) =>
1119
+ !podSources.some(
1120
+ ({ packageTarget }) =>
1121
+ relativeInside(packageTarget, directory) !== null,
1122
+ ),
1123
+ ),
1124
+ ...packageFrameworkSearchPaths,
1125
+ ]),
1126
+ ],
1127
+ },
1128
+ }),
1129
+ }
1130
+ }
1091
1131
  const app = {
1092
1132
  ...withPackageFrameworks(appTarget),
1133
+ binaryFrameworks: appTarget.binaryFrameworks.filter(
1134
+ ({ path: dir }) => !dir || !sourceBinaries.has(dir),
1135
+ ),
1093
1136
  frameworks: [
1094
1137
  ...appTarget.frameworks.map(withPackageFrameworks),
1095
1138
  ...frameworkTargets.flatMap((framework) => [...framework.frameworks, framework]),
@@ -1726,7 +1769,16 @@ async function buildXcodeLayout(root: string): Promise<XcodeLayout | null> {
1726
1769
  })
1727
1770
  }
1728
1771
  const graphTargets = [
1729
- ...app.sourceLinkGraph.targets,
1772
+ ...app.sourceLinkGraph.targets.map((target) => ({
1773
+ ...target,
1774
+ dependencies: [
1775
+ ...target.dependencies,
1776
+ ...(podLinks.get(target.id) ?? []).map(({ id }) => ({
1777
+ target: id,
1778
+ attributes: [],
1779
+ })),
1780
+ ],
1781
+ })),
1730
1782
  ...frameworkTargets.flatMap((framework) => framework.sourceLinkGraph.targets),
1731
1783
  ...packages.sourceLinks.targets.map((target) => {
1732
1784
  const source = sourceFrameworks.get(target.id)
@@ -4578,10 +4630,14 @@ export async function ensureSwiftStartupRuntimeRoot(): Promise<string | null> {
4578
4630
  return withSwiftRootLock(path.join(repo, 'public', 'sootsim'), async () => {
4579
4631
  const built = current()
4580
4632
  if (built) return built
4633
+ const env: NodeJS.ProcessEnv = { ...process.env, TM_WINDOW_WAIT: '1' }
4634
+ delete env.SOOTSIM_ENGINE_OUT_DIR
4635
+ delete env.SOOTSIM_TENANT_OUT_DIR
4636
+ delete env.SOOTSIM_SHELL_OUT_DIR
4581
4637
  await new Promise<void>((resolveBuild, rejectBuild) => {
4582
4638
  const child = spawn('bun', [path.join(repo, 'scripts/build/peach-public.ts')], {
4583
4639
  cwd: repo,
4584
- env: { ...process.env, TM_WINDOW_WAIT: '1' },
4640
+ env,
4585
4641
  stdio: 'inherit',
4586
4642
  })
4587
4643
  child.once('error', rejectBuild)
@@ -67,12 +67,13 @@ export function applyInstalledSwiftTargets(
67
67
  const original = projectSourceKey(sourceRoots, source)
68
68
  if (!canonical.has(original) || source === real) canonical.set(original, key)
69
69
  }
70
- const originalKeys = new Map(
71
- collection.sources.map((source) => [
72
- projectSourceKey(sourceRoots, source.source),
73
- source.file,
74
- ]),
75
- )
70
+ const originalKeys = new Map<string, string[]>()
71
+ for (const source of collection.sources) {
72
+ const key = projectSourceKey(sourceRoots, source.source)
73
+ const list = originalKeys.get(key)
74
+ if (list) list.push(source.file)
75
+ else originalKeys.set(key, [source.file])
76
+ }
76
77
  const originalSources = new Map(
77
78
  collection.sources.map((source) => [source.file, source.source]),
78
79
  )
@@ -125,6 +126,27 @@ export function applyInstalledSwiftTargets(
125
126
  }
126
127
  }
127
128
  collection.swiftPackageDeclarations = packageDeclarations
129
+ const linkTargets = new Map(
130
+ snapshot.input.sourceLinkGraph?.targets.map((target) => [target.id, target]),
131
+ )
132
+ const reached = new Set<string>()
133
+ const pending = [...linkTargets.values()].filter(
134
+ ({ sourceTarget }) =>
135
+ sourceTarget !== null && snapshot.selectedTargets.has(sourceTarget),
136
+ )
137
+ for (let target = pending.pop(); target; target = pending.pop()) {
138
+ if (reached.has(target.id)) continue
139
+ reached.add(target.id)
140
+ const library = target.sourceTarget && snapshot.input.libraries?.[target.sourceTarget]
141
+ if (library && target.sourceTarget) {
142
+ collection.libraries ??= {}
143
+ collection.libraries[target.sourceTarget] = library
144
+ }
145
+ for (const { target: dependency } of target.dependencies) {
146
+ const linked = linkTargets.get(dependency)
147
+ if (linked) pending.push(linked)
148
+ }
149
+ }
128
150
  // a header the installed search paths already supply, and its module covers,
129
151
  // must not also reach a generated target as a second textual copy. returns the
130
152
  // search roots that now supply what the target lost
@@ -204,15 +226,23 @@ export function applyInstalledSwiftTargets(
204
226
  const consumers = new Set((target.dependencies ?? []).map(({ name }) => name))
205
227
  for (const file of Object.keys(native.sourceDirectories)) {
206
228
  const original = snapshot.sourcePaths[file]
207
- const key = original && originalKeys.get(projectSourceKey(sourceRoots, original))
208
- if (!key) continue
209
- for (const candidate of collection.targets)
210
- if (key.startsWith(candidate.path + '/')) consumers.add(candidate.name)
229
+ const keys = original
230
+ ? originalKeys.get(projectSourceKey(sourceRoots, original))
231
+ : undefined
232
+ if (!keys) continue
233
+ for (const key of keys)
234
+ for (const candidate of collection.targets)
235
+ if (key.startsWith(candidate.path + '/')) consumers.add(candidate.name)
211
236
  }
212
237
  for (const generated of collection.targets) {
213
238
  if (!generatedTargets.has(generated.name) || !consumers.has(generated.name))
214
239
  continue
240
+ const flattenedHeaders =
241
+ native.flattensPublicHeaders && native.publicHeaders.length > 0
242
+ ? ['-I', `$(PEACH_INPUT_ROOT)/.build/peach-cxx-headers/${native.name}`]
243
+ : []
215
244
  const search = [
245
+ ...flattenedHeaders,
216
246
  ...native.headerSearchPaths.flatMap((directory) => [
217
247
  '-I',
218
248
  `$(PEACH_INPUT_ROOT)/${directory}`,
@@ -235,13 +265,10 @@ export function applyInstalledSwiftTargets(
235
265
  return !collection.targets.some((target) => target.name === module)
236
266
  })
237
267
  dropSuppliedHeaders(generated, native)
238
- if (native.flattensPublicHeaders && native.publicHeaders.length > 0)
268
+ if (flattenedHeaders.length > 0)
239
269
  generated.swiftFlags = [
240
270
  ...(generated.swiftFlags ?? []),
241
- '-Xcc',
242
- '-I',
243
- '-Xcc',
244
- `$(PEACH_INPUT_ROOT)/.build/peach-cxx-headers/${native.name}`,
271
+ ...flattenedHeaders.flatMap((flag) => ['-Xcc', flag]),
245
272
  ]
246
273
  const flags = originalModuleFlags(native.flags)
247
274
  generated.clangSettings = [
@@ -264,15 +291,19 @@ export function applyInstalledSwiftTargets(
264
291
  const original = snapshot.sourcePaths[file]
265
292
  if (original && viewComponents.has(projectSourceKey(sourceRoots, original)))
266
293
  continue
267
- const previous =
268
- original && originalKeys.get(projectSourceKey(sourceRoots, original))
269
- if (!previous) continue
294
+ const previous = original
295
+ ? originalKeys.get(projectSourceKey(sourceRoots, original))
296
+ : undefined
297
+ if (!previous?.length) continue
270
298
  const output = `${target.path}/native/${file}`
271
299
  collection.files[output] = snapshot.input.files[file]!
272
300
  sourceDirectories[output] = directory
273
301
  fileFlags[output] = native.fileFlags[file] ?? []
274
- delete collection.files[previous]
275
- collection.sources = collection.sources.filter((source) => source.file !== previous)
302
+ const removed = new Set(previous)
303
+ for (const key of removed) delete collection.files[key]
304
+ collection.sources = collection.sources.filter(
305
+ (source) => !removed.has(source.file),
306
+ )
276
307
  }
277
308
  collection.nativeTargets ??= []
278
309
  collection.nativeTargets.push({
@@ -25,6 +25,7 @@ import { swiftObjCPlatformFlags } from './swift-objc-platform'
25
25
  import { IOS_SDK_TARGET, iosSdk } from './swift-objc-sdk'
26
26
  import { clangImportNames, moduleMapTokens } from './swift-package'
27
27
  import {
28
+ exposeObjCOnlyDeclarations,
28
29
  objcProtocolsInSwiftSignatures,
29
30
  type GraphSymbol,
30
31
  type SymbolGraph,
@@ -565,7 +566,11 @@ function intakeInterface(text: string, keepDefaults = false): string {
565
566
 
566
567
  // a vendor framework directory the headers import, its swift interfaces read
567
568
  // as the intake reads the surface's own.
568
- function stageVendorFrameworks(dir: string, stage: string): string {
569
+ function stageVendorFrameworks(
570
+ dir: string,
571
+ stage: string,
572
+ staged: { headers: Map<string, string>; interfaces: string[] },
573
+ ): string {
569
574
  fs.mkdirSync(stage, { recursive: true })
570
575
  for (const entry of fs.readdirSync(dir)) {
571
576
  if (!entry.endsWith('.framework')) continue
@@ -574,11 +579,16 @@ function stageVendorFrameworks(dir: string, stage: string): string {
574
579
  fs.mkdirSync(target, { recursive: true })
575
580
  for (const child of fs.readdirSync(source)) {
576
581
  if (child !== 'Modules') {
577
- if (child === 'Headers')
582
+ if (child === 'Headers') {
578
583
  fs.cpSync(path.join(source, child), path.join(target, child), {
579
584
  recursive: true,
580
585
  })
581
- else fs.symlinkSync(path.join(source, child), path.join(target, child))
586
+ for (const file of headerFiles(path.join(source, child)))
587
+ staged.headers.set(
588
+ path.join(target, child, file),
589
+ fs.readFileSync(path.join(source, child, file), 'utf8'),
590
+ )
591
+ } else fs.symlinkSync(path.join(source, child), path.join(target, child))
582
592
  continue
583
593
  }
584
594
  for (const file of fs.readdirSync(path.join(source, child), {
@@ -592,9 +602,10 @@ function stageVendorFrameworks(dir: string, stage: string): string {
592
602
  continue
593
603
  }
594
604
  fs.mkdirSync(path.dirname(to), { recursive: true })
595
- if (file.endsWith('.swiftinterface'))
605
+ if (file.endsWith('.swiftinterface')) {
596
606
  fs.writeFileSync(to, intakeInterface(fs.readFileSync(from, 'utf8')))
597
- else fs.copyFileSync(from, to)
607
+ staged.interfaces.push(to)
608
+ } else fs.copyFileSync(from, to)
598
609
  }
599
610
  }
600
611
  }
@@ -682,12 +693,17 @@ export function objcView(
682
693
  path.basename(from),
683
694
  )
684
695
  fs.mkdirSync(to, { recursive: true })
696
+ const shipsObjC = originals.has(path.join(headersDir, `${surface.module}-Swift.h`))
685
697
  for (const name of fs.readdirSync(from))
686
698
  if (name.endsWith('.swiftinterface')) {
699
+ const source = fs.readFileSync(path.join(from, name), 'utf8')
687
700
  interfaceCopies.push(path.join(to, name))
688
701
  fs.writeFileSync(
689
702
  path.join(to, name),
690
- intakeInterface(fs.readFileSync(path.join(from, name), 'utf8'), true),
703
+ intakeInterface(
704
+ shipsObjC ? exposeObjCOnlyDeclarations(source) : source,
705
+ true,
706
+ ),
691
707
  )
692
708
  }
693
709
  }
@@ -720,6 +736,12 @@ export function objcView(
720
736
  : `module ${dependency.module} { umbrella "." export * }\n`,
721
737
  )
722
738
  }
739
+ // a vendor framework's headers and interfaces name sdk types the intake
740
+ // lacks just as the surface's do, and take the same learned declarations.
741
+ const vendor: { headers: Map<string, string>; interfaces: string[] } = {
742
+ headers: new Map(),
743
+ interfaces: [],
744
+ }
723
745
  const stubs = path.join(work, 'stubs')
724
746
  const stubIncludes = path.join(work, 'stub-include')
725
747
  fs.mkdirSync(stubs, { recursive: true })
@@ -755,7 +777,11 @@ export function objcView(
755
777
  stubIncludes,
756
778
  ...vendorFrameworks.flatMap((dir, index) => [
757
779
  '-F',
758
- stageVendorFrameworks(dir, path.join(work, 'vendor-frameworks', String(index))),
780
+ stageVendorFrameworks(
781
+ dir,
782
+ path.join(work, 'vendor-frameworks', String(index)),
783
+ vendor,
784
+ ),
759
785
  ]),
760
786
  ]
761
787
  const missing: Missing = new Map()
@@ -840,7 +866,7 @@ export function objcView(
840
866
  ...(missing.size > 0 ? [MISSING_IMPORT] : []),
841
867
  ].join('')
842
868
  if (prefix === '') return
843
- for (const [file, text] of [...originals, ...dependencyOriginals])
869
+ for (const [file, text] of [...originals, ...dependencyOriginals, ...vendor.headers])
844
870
  fs.writeFileSync(file, `${prefix}${text}`)
845
871
  }
846
872
  // the identifier a diagnostic points at, read from the header as compiled.
@@ -982,6 +1008,32 @@ export function objcView(
982
1008
  )
983
1009
  }
984
1010
  }
1011
+ // an interface qualifies a type by the sdk module the intake lacks it in;
1012
+ // the learned declaration answers the bare name
1013
+ for (const [, name, module] of run.stderr.matchAll(
1014
+ /no type named '(\w+)' in module '(\w+)'/g,
1015
+ )) {
1016
+ const reference = `${module}.${name}`
1017
+ if (selectors.has(reference) || importSdk(name!)) continue
1018
+ learn(name!, 'class')
1019
+ selectors.add(reference)
1020
+ progress = true
1021
+ for (const file of [...interfaceCopies, ...vendor.interfaces])
1022
+ fs.writeFileSync(
1023
+ file,
1024
+ fs
1025
+ .readFileSync(file, 'utf8')
1026
+ .replace(new RegExp(`\\b${module}\\.${name}\\b`, 'g'), name!),
1027
+ )
1028
+ }
1029
+ // a learned name an interface conforms to is a protocol
1030
+ for (const [, name] of run.stderr.matchAll(
1031
+ /inheritance from non-protocol type '(\w+)'/g,
1032
+ ))
1033
+ if (missing.get(name!) === 'class') {
1034
+ missing.set(name!, 'protocol')
1035
+ progress = true
1036
+ }
985
1037
  // a default argument value the intake cannot type-check fails the whole
986
1038
  // interface, so the declarations load without any
987
1039
  if ((!progress || round === ROUNDS) && keepDefaults && interfaceCopies.length > 0) {