peachsim 0.1.1684 → 0.1.1692

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (254) hide show
  1. package/cli/commands/coverage-swift.ts +72 -5
  2. package/cli/commands/inspect/actions.ts +1 -0
  3. package/cli/commands/screenshot.ts +12 -0
  4. package/dist-lib/agent-daemon-client.cjs +1 -1
  5. package/dist-lib/agent-events.cjs +1 -1
  6. package/dist-lib/attached-projects.cjs +1 -1
  7. package/dist-lib/auth/shared-session.cjs +1 -1
  8. package/dist-lib/backend-origin.cjs +1 -1
  9. package/dist-lib/beta.cjs +1 -1
  10. package/dist-lib/beta.mjs +1 -1
  11. package/dist-lib/bridge-constants.cjs +1 -1
  12. package/dist-lib/bridge-contract-input.cjs +1 -1
  13. package/dist-lib/bridge-contract-input.mjs +1 -1
  14. package/dist-lib/bridge-contract.cjs +1 -1
  15. package/dist-lib/bridge-contract.mjs +1 -1
  16. package/dist-lib/bundle-channel.cjs +2252 -1462
  17. package/dist-lib/capture-contract.cjs +1 -1
  18. package/dist-lib/capture-contract.mjs +1 -1
  19. package/dist-lib/cloud-contract.cjs +1 -1
  20. package/dist-lib/cloud-contract.mjs +1 -1
  21. package/dist-lib/cloud-test-args.cjs +1 -1
  22. package/dist-lib/cloud-test-args.mjs +1 -1
  23. package/dist-lib/cloud.cjs +1 -1
  24. package/dist-lib/cloud.mjs +1 -1
  25. package/dist-lib/config.cjs +1 -1
  26. package/dist-lib/config.mjs +1 -1
  27. package/dist-lib/detox/index.cjs +1 -1
  28. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  29. package/dist-lib/expo-swift-bundle.cjs +1762 -995
  30. package/dist-lib/expo-swift-metadata.cjs +1 -1
  31. package/dist-lib/expo-swift-metadata.mjs +1 -1
  32. package/dist-lib/home-paths.cjs +1 -1
  33. package/dist-lib/host/bridge-host.cjs +2184 -1417
  34. package/dist-lib/host/fetch-proxy-handler.cjs +3 -3
  35. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  36. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  37. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  38. package/dist-lib/host/websocket-proxy.cjs +1 -1
  39. package/dist-lib/index.cjs +175 -69
  40. package/dist-lib/jump-to-source-babel.cjs +1 -1
  41. package/dist-lib/jump-to-source-native.cjs +1 -1
  42. package/dist-lib/kotlin-host.cjs +1 -1
  43. package/dist-lib/menu.cjs +1 -1
  44. package/dist-lib/menu.mjs +1 -1
  45. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  46. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  47. package/dist-lib/metro-production-bundle.cjs +1 -1
  48. package/dist-lib/metro-production-bundle.mjs +1 -1
  49. package/dist-lib/metro.cjs +174 -68
  50. package/dist-lib/native-app-identity-project.cjs +163 -51
  51. package/dist-lib/native-app-identity-project.mjs +206 -82
  52. package/dist-lib/native-app-identity.cjs +1 -1
  53. package/dist-lib/native-app-identity.mjs +1 -1
  54. package/dist-lib/native-firebase-metadata.cjs +1 -1
  55. package/dist-lib/native-firebase-metadata.mjs +1 -1
  56. package/dist-lib/plist.cjs +1 -1
  57. package/dist-lib/plist.mjs +1 -1
  58. package/dist-lib/profiles.cjs +1 -1
  59. package/dist-lib/public-brand.cjs +1 -1
  60. package/dist-lib/public-origins-lib-esm.json +26 -23
  61. package/dist-lib/public-origins-lib.json +74 -61
  62. package/dist-lib/react-native-host-modules.cjs +1 -1
  63. package/dist-lib/react-native-host-modules.mjs +1 -1
  64. package/dist-lib/reap-browser.cjs +1 -1
  65. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  66. package/dist-lib/sdk.cjs +2 -2
  67. package/dist-lib/sdk.mjs +2 -2
  68. package/dist-lib/skills.cjs +2633 -1840
  69. package/dist-lib/swift-compile.cjs +2478 -100
  70. package/dist-lib/swift-compile.mjs +2475 -100
  71. package/dist-lib/swift-package.cjs +108 -50
  72. package/dist-lib/swift-package.mjs +104 -50
  73. package/dist-lib/swift-submit.cjs +1 -1
  74. package/dist-lib/swift-submit.mjs +1 -1
  75. package/dist-lib/swift-toolchain.cjs +1 -1
  76. package/dist-lib/swift.cjs +1 -1
  77. package/dist-lib/vite-swift.cjs +3979 -985
  78. package/dist-lib/vite.cjs +12 -18
  79. package/dist-lib/worklet-executable.cjs +7 -4
  80. package/dist-lib/worklet-executable.mjs +7 -4
  81. package/dist-types/packages/peach-engine/src/engine/clipboardContract.d.ts +15 -1
  82. package/dist-types/packages/peach-globals/src/clipboardBridgeContract.d.ts +6 -0
  83. package/dist-types/packages/peach-globals/src/index.d.ts +1 -1
  84. package/dist-types/packages/peach-globals/src/nodeContract.d.ts +3 -2
  85. package/dist-types/packages/peach-kit/src/capabilities.d.ts +1 -0
  86. package/package.json +1 -1
  87. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h +9 -0
  88. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLAvailability.h +22 -0
  89. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLBackgroundActivitySession.h +145 -0
  90. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLBeaconIdentityCondition.h +113 -0
  91. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLBeaconIdentityConstraint.h +34 -0
  92. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLBeaconRegion.h +225 -0
  93. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLBody.h +26 -0
  94. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLCircularGeographicCondition.h +59 -0
  95. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLCircularRegion.h +64 -0
  96. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLCondition.h +48 -0
  97. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLError.h +52 -0
  98. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLErrorDomain.h +24 -0
  99. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLGeocoder.h +55 -0
  100. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLHeading.h +117 -0
  101. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocation.h +9 -0
  102. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationManager+CLVisitExtensions.h +45 -0
  103. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationManager.h +877 -0
  104. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationManagerDelegate.h +225 -0
  105. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationPushServiceError.h +33 -0
  106. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationPushServiceExtension.h +28 -0
  107. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationUpdater.h +250 -0
  108. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLMonitor.h +140 -0
  109. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLMonitorConfiguration.h +77 -0
  110. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLMonitoringEvent.h +184 -0
  111. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLMonitoringRecord.h +57 -0
  112. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLPlacemark.h +98 -0
  113. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLRegion.h +123 -0
  114. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLServiceSession.h +211 -0
  115. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLVisit.h +66 -0
  116. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.h +46 -0
  117. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Modules/module.modulemap +7 -0
  118. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +96 -2
  119. package/sdk/ios/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceBase.h +52 -0
  120. package/sdk/ios/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceObjC.h +240 -0
  121. package/sdk/ios/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceRef.h +474 -0
  122. package/sdk/ios/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceTypes.h +66 -0
  123. package/sdk/ios/System/Library/Frameworks/IOSurface.framework/Modules/module.modulemap +10 -0
  124. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4AccelerationStructure.h +9 -0
  125. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4Archive.h +16 -0
  126. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4ArgumentTable.h +17 -0
  127. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4BinaryFunction.h +13 -0
  128. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4BinaryFunctionDescriptor.h +14 -0
  129. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4BufferRange.h +79 -0
  130. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4CommandAllocator.h +15 -0
  131. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4CommandBuffer.h +17 -0
  132. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4CommandEncoder.h +16 -0
  133. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4CommandQueue.h +19 -0
  134. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4CommitFeedback.h +15 -0
  135. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4Compiler.h +13 -0
  136. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4CompilerTask.h +13 -0
  137. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4ComputeCommandEncoder.h +19 -0
  138. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4ComputePipeline.h +13 -0
  139. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4Counters.h +19 -0
  140. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4FunctionDescriptor.h +13 -0
  141. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4LibraryDescriptor.h +13 -0
  142. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4LibraryFunctionDescriptor.h +13 -0
  143. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4LinkingDescriptor.h +13 -0
  144. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4MachineLearningCommandEncoder.h +17 -0
  145. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4MachineLearningPipeline.h +13 -0
  146. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4MeshRenderPipeline.h +13 -0
  147. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4PipelineDataSetSerializer.h +13 -0
  148. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4PipelineState.h +13 -0
  149. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4RenderCommandEncoder.h +17 -0
  150. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4RenderPass.h +17 -0
  151. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4RenderPipeline.h +13 -0
  152. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4SpecializedFunctionDescriptor.h +13 -0
  153. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4StitchedFunctionDescriptor.h +13 -0
  154. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4TileRenderPipeline.h +13 -0
  155. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLAccelerationStructure.h +1212 -0
  156. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLAccelerationStructureCommandEncoder.h +322 -0
  157. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLAccelerationStructureTypes.h +224 -0
  158. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLAllocation.h +22 -0
  159. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLArgument.h +279 -0
  160. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLArgumentEncoder.h +199 -0
  161. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLBinaryArchive.h +142 -0
  162. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLBlitCommandEncoder.h +266 -0
  163. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLBlitPass.h +82 -0
  164. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLBuffer.h +94 -0
  165. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLCaptureManager.h +113 -0
  166. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLCaptureScope.h +43 -0
  167. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLCommandBuffer.h +449 -0
  168. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLCommandEncoder.h +148 -0
  169. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLCommandQueue.h +102 -0
  170. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLComputeCommandEncoder.h +350 -0
  171. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLComputePass.h +90 -0
  172. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLComputePipeline.h +274 -0
  173. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLCounters.h +225 -0
  174. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDataType.h +232 -0
  175. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDefines.h +39 -0
  176. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDepthStencil.h +93 -0
  177. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDevice.h +1122 -0
  178. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDeviceCertification.h +29 -0
  179. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDrawable.h +36 -0
  180. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDynamicLibrary.h +81 -0
  181. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLEvent.h +79 -0
  182. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLFence.h +22 -0
  183. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLFunctionConstantValues.h +30 -0
  184. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLFunctionDescriptor.h +95 -0
  185. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLFunctionHandle.h +29 -0
  186. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLFunctionLog.h +37 -0
  187. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLFunctionStitching.h +131 -0
  188. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLGPUAddress.h +19 -0
  189. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLHeap.h +284 -0
  190. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLIOCommandBuffer.h +10 -0
  191. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLIOCommandQueue.h +11 -0
  192. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLIOCompressor.h +10 -0
  193. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLIndirectCommandBuffer.h +157 -0
  194. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLIndirectCommandEncoder.h +110 -0
  195. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLIntersectionFunctionTable.h +186 -0
  196. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLLibrary.h +549 -0
  197. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLLinkedFunctions.h +57 -0
  198. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLLogState.h +65 -0
  199. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLParallelRenderCommandEncoder.h +77 -0
  200. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLPipeline.h +57 -0
  201. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLPixelFormat.h +342 -0
  202. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLRasterizationRate.h +323 -0
  203. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLRenderCommandEncoder.h +1068 -0
  204. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLRenderPass.h +411 -0
  205. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLRenderPipeline.h +788 -0
  206. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLResidencySet.h +141 -0
  207. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLResource.h +307 -0
  208. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLResourceStateCommandEncoder.h +125 -0
  209. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLResourceStatePass.h +85 -0
  210. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLResourceViewPool.h +22 -0
  211. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLSampler.h +252 -0
  212. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLStageInputOutputDescriptor.h +158 -0
  213. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLTensor.h +17 -0
  214. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLTexture.h +460 -0
  215. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLTextureViewPool.h +18 -0
  216. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLTypes.h +125 -0
  217. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLVertexDescriptor.h +153 -0
  218. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLVisibleFunctionTable.h +45 -0
  219. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/Metal.h +94 -0
  220. package/sdk/ios/System/Library/Frameworks/Metal.framework/Modules/module.modulemap +6 -0
  221. package/sdk/ios/System/Library/Frameworks/UniformTypeIdentifiers.framework/Headers/UTDefines.h +35 -0
  222. package/sdk/ios/System/Library/Frameworks/UniformTypeIdentifiers.framework/Headers/UTTagClass.h +33 -0
  223. package/sdk/ios/System/Library/Frameworks/UniformTypeIdentifiers.framework/Headers/UTType.h +504 -0
  224. package/sdk/ios/System/Library/Frameworks/_LocationEssentials.framework/Headers/CLEssentialsAvailability.h +14 -0
  225. package/sdk/ios/System/Library/Frameworks/_LocationEssentials.framework/Headers/CLLocationEssentials.h +444 -0
  226. package/sdk/ios/System/Library/Frameworks/_LocationEssentials.framework/Headers/LocationEssentials.h +14 -0
  227. package/sdk/ios/System/Library/Frameworks/_LocationEssentials.framework/Modules/module.modulemap +14 -0
  228. package/sdk/ios/usr/include/complex.h +167 -0
  229. package/sdk/ios/usr/include/dispatch/dispatch.h +5 -0
  230. package/sdk/ios/usr/include/mach/mach_types.h +1 -0
  231. package/sdk/ios/usr/include/math.h +835 -2
  232. package/sdk/ios/usr/include/sys/cdefs.h +0 -1
  233. package/src/generated/swift-c-predefines.json +1988 -0
  234. package/src/nitro-bundle.ts +1 -0
  235. package/src/nitro-compile.ts +4 -0
  236. package/src/nitroContract.ts +18 -2
  237. package/src/swift-compile.ts +446 -49
  238. package/src/swift-coverage/package.ts +3 -1
  239. package/src/swift-coverage/xcode-assets.ts +62 -2
  240. package/src/swift-coverage/xcode-packages.ts +11 -6
  241. package/src/swift-host.ts +333 -57
  242. package/src/swift-objc-compile.ts +20 -5
  243. package/src/swift-objc-standin.ts +21 -11
  244. package/src/swift-package-manifest.ts +151 -28
  245. package/src/swift-package.ts +134 -58
  246. package/src/swift-packages.ts +141 -44
  247. package/src/swift-source-file.ts +10 -15
  248. package/src/swift-standins.ts +87 -13
  249. package/src/swift-submit.ts +5 -0
  250. package/src/swiftContract.ts +160 -75
  251. package/src/target-matcher.ts +15 -2
  252. package/src/worklet-executable.ts +7 -3
  253. package/src/xcode-json-project.ts +14 -2
  254. package/src/xcode-project.ts +154 -59
@@ -18,10 +18,15 @@ import {
18
18
  OBJC_IMPORT_VERSION,
19
19
  objcSdkIntakeFlags,
20
20
  } from './swift-objc-standin'
21
- import { SWIFT_NATIVE_SOURCE_EXTENSIONS, swiftTargetModuleName } from './swift-package'
21
+ import {
22
+ isSwiftNativeTranslationUnit,
23
+ SWIFT_NATIVE_SOURCE_EXTENSIONS,
24
+ swiftTargetModuleName,
25
+ } from './swift-package'
22
26
  import { swiftPackageManifest, swiftTargetFiles } from './swift-package-manifest'
23
27
  import { remoteSwiftCheckouts, type SwiftPackageBinary } from './swift-packages'
24
28
  import { readPackageFile } from './swift-source-file'
29
+ import { binaryFrameworkSearchPath } from './swift-standins'
25
30
  import { swiftEnvironment } from './swift-toolchain'
26
31
  import { writeXcodeHeaderSearch } from './xcode-header-search'
27
32
  import type {
@@ -138,7 +143,7 @@ export function xcodeObjCInputs(
138
143
  targets.push({
139
144
  name: target.name,
140
145
  deploymentTarget: app.iosDeploymentTarget,
141
- files: files.filter((file) => /\.(c|cc|cpp|cxx|m|mm)$/.test(file)),
146
+ files: files.filter(isSwiftNativeTranslationUnit),
142
147
  includes: [
143
148
  path.join(target.dir, target.publicHeadersPath),
144
149
  ...(binary.headerDependencies ?? []).map((dependency) =>
@@ -167,9 +172,19 @@ export function xcodeObjCInputs(
167
172
  productHeaders: {},
168
173
  })
169
174
  }
175
+ // xcode searches the frameworks of the package binary targets the app links
176
+ const binaryFrameworks = binaries.flatMap((binary) => {
177
+ if (!binary.reached || binary.publicHeaders !== undefined) return []
178
+ const search = binaryFrameworkSearchPath(binary, checkouts)
179
+ return search ? [search] : []
180
+ })
170
181
  for (const target of [...app.frameworks, app]) {
171
182
  if (!target.objc) continue
172
- const files = target.allSources.filter((file) => /\.(c|cc|cpp|cxx|m|mm)$/.test(file))
183
+ const frameworkSearchPaths = [
184
+ ...target.objc.frameworkSearchPaths,
185
+ ...binaryFrameworks,
186
+ ]
187
+ const files = target.allSources.filter(isSwiftNativeTranslationUnit)
173
188
  for (const file of files) add(file)
174
189
  for (const file of [
175
190
  ...target.objc.headers,
@@ -188,7 +203,7 @@ export function xcodeObjCInputs(
188
203
  for (const directory of [
189
204
  ...target.objc.headerSearchPaths,
190
205
  ...target.objc.userHeaderSearchPaths,
191
- ...target.objc.frameworkSearchPaths,
206
+ ...frameworkSearchPaths,
192
207
  ])
193
208
  if (!isSdkInclude(directory) && isDirectory(directory)) addHeaders(directory)
194
209
  const flags = [
@@ -215,7 +230,7 @@ export function xcodeObjCInputs(
215
230
  files,
216
231
  includes: target.objc.headerSearchPaths,
217
232
  userIncludes: target.objc.userHeaderSearchPaths,
218
- frameworks: target.objc.frameworkSearchPaths,
233
+ frameworks: frameworkSearchPaths,
219
234
  flags: target.objc.flags,
220
235
  cxxFlags: target.objc.cxxFlags,
221
236
  prefix: target.objc.prefixHeader,
@@ -42,7 +42,7 @@ export interface ObjcView {
42
42
  }
43
43
 
44
44
  /** bump when importer behavior changes the Swift view independently of SDK headers. */
45
- export const OBJC_IMPORT_VERSION = '4'
45
+ export const OBJC_IMPORT_VERSION = '5'
46
46
 
47
47
  export const NATIVE_GRAPH_SDK_VERSION = '27.1'
48
48
 
@@ -235,6 +235,24 @@ const headerFiles = (dir: string): string[] =>
235
235
  .filter((file) => file.endsWith('.h'))
236
236
  .sort()
237
237
 
238
+ /** headers a module map includes, without its explicitly excluded headers. */
239
+ export function moduleMapHeaders(
240
+ modulemap: string,
241
+ directoryHeaders: readonly string[] = [],
242
+ ): string[] {
243
+ const headers: string[] = []
244
+ const excluded = new Set<string>()
245
+ for (const match of fs
246
+ .readFileSync(modulemap, 'utf8')
247
+ .matchAll(/\b(?:(exclude)\s+)?header\s+"([^"]+)"/g)) {
248
+ if (match[1] === 'exclude') excluded.add(match[2]!)
249
+ else headers.push(match[2]!)
250
+ }
251
+ return (headers.length > 0 ? headers : directoryHeaders).filter(
252
+ (header) => !excluded.has(header),
253
+ )
254
+ }
255
+
238
256
  // the opaque declarations, behind the sdk's own frameworks so they can name
239
257
  // NSObject and UIView. a vendor header imports them first.
240
258
  function missingHeader(missing: Missing): string {
@@ -540,11 +558,7 @@ function objcDeclarationAST(
540
558
  originalFlags: readonly string[],
541
559
  target: string,
542
560
  ): unknown {
543
- const roots = [
544
- ...fs
545
- .readFileSync(surface.modulemap, 'utf8')
546
- .matchAll(/(?:umbrella\s+)?header\s+"([^"]+)"/g),
547
- ].map((match) => match[1]!)
561
+ const roots = moduleMapHeaders(surface.modulemap)
548
562
  const probe = path.join(work, 'declarations.m')
549
563
  fs.writeFileSync(
550
564
  probe,
@@ -668,11 +682,7 @@ function enumValues(
668
682
  if (wanted.size === 0) return values
669
683
  // the module's own headers compile as part of the file, so their
670
684
  // declarations are the file's, where the AST dump reaches them
671
- const roots = [
672
- ...fs
673
- .readFileSync(surface.modulemap, 'utf8')
674
- .matchAll(/(?:umbrella\s+)?header\s+"([^"]+)"/g),
675
- ].map((match) => match[1]!)
685
+ const roots = moduleMapHeaders(surface.modulemap)
676
686
  const probe = path.join(work, 'values.m')
677
687
  fs.writeFileSync(
678
688
  probe,
@@ -59,6 +59,8 @@ export interface SwiftManifestTarget {
59
59
  }[]
60
60
  /** true when the target declares `resources:`. */
61
61
  declaresResources: boolean
62
+ /** explicit process/copy inputs, relative to the target directory. */
63
+ resourcePaths: string[]
62
64
  /** coverage must not silently omit plugin-generated input or Swift flags. */
63
65
  hasPluginUsages: boolean
64
66
  unsupportedSwiftSettings: string[]
@@ -80,7 +82,10 @@ export interface SwiftManifestToolchain {
80
82
  export interface SwiftPackageManifest {
81
83
  toolchain: SwiftManifestToolchain
82
84
  name: string
85
+ toolsVersion: string
83
86
  dir: string
87
+ /** the iOS version the manifest declares in platforms, null when it declares none. */
88
+ iosDeployment: string | null
84
89
  /** library product name to the targets it vends. */
85
90
  products: Map<string, string[]>
86
91
  targets: Map<string, SwiftManifestTarget>
@@ -88,6 +93,51 @@ export interface SwiftPackageManifest {
88
93
  packages: Map<string, { url: string } | { dir: string }>
89
94
  }
90
95
 
96
+ /** resolve an unqualified product against its declared package providers. */
97
+ export function swiftProductDependency<T extends { manifest: SwiftPackageManifest }>(
98
+ manifest: SwiftPackageManifest,
99
+ dependency: Extract<SwiftTargetDependency, { kind: 'product' }>,
100
+ load: (source: { url: string } | { dir: string }) => T | string,
101
+ ): T | string
102
+ export function swiftProductDependency<T extends { manifest: SwiftPackageManifest }>(
103
+ manifest: SwiftPackageManifest,
104
+ dependency: Extract<SwiftTargetDependency, { kind: 'product' }>,
105
+ load: (source: { url: string } | { dir: string }) => T | string | undefined,
106
+ ): T | string | undefined
107
+ export function swiftProductDependency<T extends { manifest: SwiftPackageManifest }>(
108
+ manifest: SwiftPackageManifest,
109
+ dependency: Extract<SwiftTargetDependency, { kind: 'product' }>,
110
+ load: (source: { url: string } | { dir: string }) => T | string | undefined,
111
+ ): T | string | undefined {
112
+ if (dependency.package !== null) {
113
+ const source = manifest.packages.get(dependency.package)
114
+ return source
115
+ ? load(source)
116
+ : `${manifest.name} names no package ${dependency.package}`
117
+ }
118
+ const sources = new Map(
119
+ [...manifest.packages.values()].map((source) => [
120
+ 'dir' in source ? source.dir : source.url,
121
+ source,
122
+ ]),
123
+ )
124
+ const matches: T[] = []
125
+ const failures: string[] = []
126
+ let unresolved = false
127
+ for (const source of sources.values()) {
128
+ const loaded = load(source)
129
+ if (typeof loaded === 'string') failures.push(loaded)
130
+ else if (loaded?.manifest.products.has(dependency.name)) matches.push(loaded)
131
+ else if (loaded === undefined) unresolved = true
132
+ }
133
+ if (matches.length > 1)
134
+ return `ambiguous library product ${dependency.name} is vended by ${matches.map(({ manifest }) => manifest.dir).join(', ')}`
135
+ if (matches[0]) return matches[0]
136
+ if (failures.length) return failures.join('; ')
137
+ if (unresolved) return undefined
138
+ return `${manifest.name} has no dependency vending ${dependency.name}`
139
+ }
140
+
91
141
  // the dump's tagged unions: `{ "<case>": [payload...] }`
92
142
  type Json = null | boolean | number | string | Json[] | { [key: string]: Json }
93
143
  const record = (value: Json | undefined): Record<string, Json> =>
@@ -190,26 +240,34 @@ function defaultTraits(manifest: Record<string, Json>): Set<string> {
190
240
  return enabled
191
241
  }
192
242
 
193
- // a condition holds on iOS when it names no platforms or names iOS, and its
243
+ // a condition holds when it names no platforms or names the destination, and its
194
244
  // traits, if any, include one the package enables by default
195
- function linksOnIOS(condition: Json | undefined, traits: Set<string>): boolean {
245
+ function linksOnPlatform(
246
+ condition: Json | undefined,
247
+ traits: Set<string>,
248
+ platform: string,
249
+ ): boolean {
196
250
  const { platformNames, traits: needed } = record(condition)
197
251
  const platforms = array(platformNames)
198
- if (platforms.length > 0 && !platforms.includes('ios')) return false
252
+ if (platforms.length > 0 && !platforms.includes(platform)) return false
199
253
  const gates = array(needed)
200
254
  return gates.length === 0 || gates.some((name) => traits.has(string(name) ?? ''))
201
255
  }
202
256
 
203
257
  /** the manifest of the package at `dir`, evaluated once per manifest content. */
204
- export function swiftPackageManifest(dir: string): SwiftPackageManifest {
258
+ export function swiftPackageManifest(
259
+ dir: string,
260
+ platform = 'ios',
261
+ ): SwiftPackageManifest {
205
262
  dir = fs.realpathSync(dir)
206
263
  const { key, raw, toolchain } = dump(dir)
207
- const known = evaluated.get(key)
264
+ const evaluatedKey = `${key}:${platform}`
265
+ const known = evaluated.get(evaluatedKey)
208
266
  if (known) return known
209
267
  const traits = defaultTraits(raw)
210
- const tools = Number(
211
- /^(\d+)/.exec(string(record(raw.toolsVersion)._version) ?? '5')?.[1] ?? 5,
212
- )
268
+ const toolsVersion = string(record(raw.toolsVersion)._version) ?? '5.0'
269
+ const [tools = 5, minor = 0] = toolsVersion.split('.').map(Number)
270
+ const namedProducts = tools > 5 || (tools === 5 && minor >= 2)
213
271
  const declaredModeValues = array(raw.swiftLanguageVersions).flatMap(
214
272
  (mode) => string(mode) ?? [],
215
273
  )
@@ -268,24 +326,24 @@ export function swiftPackageManifest(dir: string): SwiftPackageManifest {
268
326
  for (const dependency of array(target.dependencies)) {
269
327
  const { target: local, product, byName } = record(dependency)
270
328
  const payload = array(local ?? product ?? byName)
271
- if (!linksOnIOS(payload[payload.length - 1], traits)) continue
329
+ if (!linksOnPlatform(payload[payload.length - 1], traits, platform)) continue
272
330
  const dependencyName = string(payload[0])
273
331
  if (!dependencyName) continue
274
332
  if (product)
275
333
  dependencies.push({
276
334
  kind: 'product',
277
335
  name: dependencyName,
278
- package: (string(payload[1]) ?? '').toLowerCase(),
336
+ package: string(payload[1])?.toLowerCase() ?? null,
279
337
  })
280
- // a by-name dependency that is no target here is the product of that
281
- // name in the dependency package of the same name
338
+ // tools 5.2 introduced target-based resolution, where a by-name
339
+ // product must match its package's dependency resolution name.
282
340
  else if (local || names.has(dependencyName))
283
341
  dependencies.push({ kind: 'target', name: dependencyName })
284
342
  else
285
343
  dependencies.push({
286
344
  kind: 'product',
287
345
  name: dependencyName,
288
- package: dependencyName.toLowerCase(),
346
+ package: namedProducts ? dependencyName.toLowerCase() : null,
289
347
  })
290
348
  }
291
349
  let languageMode = packageMode
@@ -346,7 +404,10 @@ export function swiftPackageManifest(dir: string): SwiftPackageManifest {
346
404
  if (!supported)
347
405
  unsupportedSwiftSettings.push(JSON.stringify({ kind: rawKind, condition }))
348
406
  }
349
- if ((tool === 'c' || tool === 'cxx') && linksOnIOS(condition, traits)) {
407
+ if (
408
+ (tool === 'c' || tool === 'cxx') &&
409
+ linksOnPlatform(condition, traits, platform)
410
+ ) {
350
411
  const config = string(record(condition).config)
351
412
  const header = string(record(settingKind.headerSearchPath)._0)
352
413
  const definition = string(record(settingKind.define)._0)
@@ -383,7 +444,7 @@ export function swiftPackageManifest(dir: string): SwiftPackageManifest {
383
444
  define &&
384
445
  string(tool) === 'swift' &&
385
446
  /^[A-Za-z_][A-Za-z0-9_]*$/.test(define) &&
386
- linksOnIOS(condition, traits)
447
+ linksOnPlatform(condition, traits, platform)
387
448
  ) {
388
449
  const config = string(record(condition).config)
389
450
  defines.push({
@@ -394,7 +455,7 @@ export function swiftPackageManifest(dir: string): SwiftPackageManifest {
394
455
  // experimental and upcoming features and raw swift flags ride the same
395
456
  // conditions a define does; a target that needs BuiltinModule or library
396
457
  // evolution compiles with it exactly as swiftpm builds it.
397
- if (string(tool) === 'swift' && linksOnIOS(condition, traits)) {
458
+ if (string(tool) === 'swift' && linksOnPlatform(condition, traits, platform)) {
398
459
  const config = string(record(condition).config)
399
460
  const configuration = config === 'debug' || config === 'release' ? config : null
400
461
  for (const [kind, into] of [
@@ -413,7 +474,11 @@ export function swiftPackageManifest(dir: string): SwiftPackageManifest {
413
474
  })
414
475
  }
415
476
  const library = string(record(settingKind.linkedLibrary)._0)
416
- if (library && string(tool) === 'linker' && linksOnIOS(condition, traits)) {
477
+ if (
478
+ library &&
479
+ string(tool) === 'linker' &&
480
+ linksOnPlatform(condition, traits, platform)
481
+ ) {
417
482
  const config = string(record(condition).config)
418
483
  libraries.push({
419
484
  name: library,
@@ -444,6 +509,9 @@ export function swiftPackageManifest(dir: string): SwiftPackageManifest {
444
509
  swiftFlags,
445
510
  nativeSettings,
446
511
  declaresResources: array(target.resources).length > 0,
512
+ resourcePaths: array(target.resources).flatMap(
513
+ (resource) => string(record(resource).path) ?? [],
514
+ ),
447
515
  hasPluginUsages: array(target.pluginUsages).length > 0,
448
516
  unsupportedSwiftSettings,
449
517
  publicHeadersPath: string(target.publicHeadersPath) ?? 'include',
@@ -453,33 +521,82 @@ export function swiftPackageManifest(dir: string): SwiftPackageManifest {
453
521
  }
454
522
  const name = string(raw.name)
455
523
  if (!name) throw new Error(`swiftpm returned no package name for ${dir}`)
456
- const manifest = { name, dir, products, targets, packages, toolchain }
457
- evaluated.set(key, manifest)
524
+ const iosDeployment =
525
+ array(raw.platforms)
526
+ .map(record)
527
+ .flatMap((platform) =>
528
+ platform.platformName === 'ios' ? (string(platform.version) ?? []) : [],
529
+ )[0] ?? null
530
+ const manifest = {
531
+ name,
532
+ toolsVersion,
533
+ dir,
534
+ iosDeployment,
535
+ products,
536
+ targets,
537
+ packages,
538
+ toolchain,
539
+ }
540
+ evaluated.set(evaluatedKey, manifest)
458
541
  return manifest
459
542
  }
460
543
 
461
544
  const within = (file: string, roots: string[]) =>
462
545
  roots.some((root) => file === root || file.startsWith(`${root}${path.sep}`))
463
546
 
464
- function walk(dir: string): string[] {
547
+ function walk(
548
+ dir: string,
549
+ boundary: string,
550
+ ancestors: ReadonlySet<string> = new Set(),
551
+ resources = false,
552
+ ): string[] {
465
553
  if (!fs.existsSync(dir)) return []
554
+ const real = fs.realpathSync(dir)
555
+ const relative = path.relative(boundary, real)
556
+ if (
557
+ relative === '..' ||
558
+ relative.startsWith(`..${path.sep}`) ||
559
+ path.isAbsolute(relative)
560
+ )
561
+ throw new Error(`swift package input escapes ${boundary}: ${dir}`)
466
562
  if (fs.statSync(dir).isFile()) return [dir]
563
+ if (ancestors.has(real))
564
+ throw new Error(`swift package input has a directory cycle: ${dir}`)
565
+ const parents = new Set([...ancestors, real])
467
566
  const out: string[] = []
468
567
  for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
469
- if (entry.name.startsWith('.')) continue
568
+ if (!resources && entry.name.startsWith('.')) continue
470
569
  // swiftpm never assigns a documentation catalog's contents to a target
471
570
  // (`swift package describe` omits them; other dotted directories stay).
472
- if (entry.isDirectory() && entry.name.endsWith('.docc')) continue
571
+ if (!resources && entry.isDirectory() && entry.name.endsWith('.docc')) continue
473
572
  const full = path.join(dir, entry.name)
474
- if (entry.isDirectory()) out.push(...walk(full))
573
+ if (entry.isDirectory() || entry.isSymbolicLink())
574
+ out.push(...walk(full, boundary, parents, resources))
475
575
  else if (entry.isFile()) out.push(full)
476
576
  }
477
577
  return out
478
578
  }
479
579
 
580
+ /** original resource bytes are independent of the target's explicit sources. */
581
+ export function swiftTargetResourceFiles(
582
+ manifest: SwiftPackageManifest,
583
+ target: SwiftManifestTarget,
584
+ ): string[] {
585
+ const excluded = target.exclude.map((file) => path.resolve(target.dir, file))
586
+ return [
587
+ ...new Set(
588
+ target.resourcePaths.flatMap((resource) =>
589
+ walk(path.resolve(target.dir, resource), manifest.dir, new Set(), true),
590
+ ),
591
+ ),
592
+ ]
593
+ .filter((file) => !within(file, excluded))
594
+ .sort()
595
+ }
596
+
480
597
  /**
481
598
  * the files swiftpm assigns a target, absolute and sorted: its `sources:`
482
- * (else its whole directory), less its `exclude:`, documentation catalogs
599
+ * (else its whole directory), plus its public headers, less its `exclude:`, documentation catalogs
483
600
  * and the directories of the package's other targets nested inside it.
484
601
  */
485
602
  export function swiftTargetFiles(
@@ -497,10 +614,16 @@ export function swiftTargetFiles(
497
614
  : [],
498
615
  ),
499
616
  ]
500
- return included
501
- .flatMap(walk)
502
- .filter((file) => !within(file, excluded))
503
- .sort()
617
+ return [
618
+ ...new Set(
619
+ [
620
+ ...included.flatMap((directory) => walk(directory, manifest.dir)),
621
+ ...walk(path.resolve(target.dir, target.publicHeadersPath), manifest.dir).filter(
622
+ (file) => /\.(?:h|hh|hpp|hxx|inc|inl|modulemap)$/.test(file),
623
+ ),
624
+ ].filter((file) => !within(file, excluded)),
625
+ ),
626
+ ].sort()
504
627
  }
505
628
 
506
629
  /** validated membership from SwiftPM's PackageBuilder, never a second directory walker. */