peachsim 0.1.1817 → 0.1.1821

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 (144) hide show
  1. package/cli/commands/agent-indicator-mode.ts +2 -1
  2. package/cli/commands/coverage-swift.ts +4 -3
  3. package/cli/commands/flow.ts +7 -0
  4. package/cli/commands/inspect/core.ts +14 -4
  5. package/cli/commands/inspect/wait-selector.ts +9 -1
  6. package/cli/commands/maestro-compare.ts +7 -0
  7. package/cli/commands/package.ts +5 -0
  8. package/cli/commands/screenshot-mode.ts +2 -1
  9. package/cli/commands/shell-boolean-mode.ts +7 -3
  10. package/cli/commands/shell-url.ts +4 -0
  11. package/cli/commands/show-touches-mode.ts +2 -1
  12. package/cli/commands/test.ts +3 -2
  13. package/cli/commands/three-mode.ts +2 -1
  14. package/cli/outbound-endpoints.ts +5 -0
  15. package/dist-lib/agent-daemon-client.cjs +1 -1
  16. package/dist-lib/agent-events.cjs +1 -1
  17. package/dist-lib/attached-projects.cjs +1 -1
  18. package/dist-lib/auth/shared-session.cjs +1 -1
  19. package/dist-lib/backend-origin.cjs +1 -1
  20. package/dist-lib/beta.cjs +1 -1
  21. package/dist-lib/beta.mjs +1 -1
  22. package/dist-lib/bridge-constants.cjs +1 -1
  23. package/dist-lib/bridge-contract-input.cjs +1 -1
  24. package/dist-lib/bridge-contract-input.mjs +1 -1
  25. package/dist-lib/bridge-contract.cjs +1 -1
  26. package/dist-lib/bridge-contract.mjs +1 -1
  27. package/dist-lib/bundle-channel.cjs +2842 -3830
  28. package/dist-lib/capture-contract.cjs +1 -1
  29. package/dist-lib/capture-contract.mjs +1 -1
  30. package/dist-lib/cloud-contract.cjs +1 -1
  31. package/dist-lib/cloud-contract.mjs +1 -1
  32. package/dist-lib/cloud-test-args.cjs +1 -1
  33. package/dist-lib/cloud-test-args.mjs +1 -1
  34. package/dist-lib/cloud.cjs +1 -1
  35. package/dist-lib/cloud.mjs +1 -1
  36. package/dist-lib/config.cjs +1 -1
  37. package/dist-lib/config.mjs +1 -1
  38. package/dist-lib/detox/index.cjs +2 -2
  39. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  40. package/dist-lib/expo-swift-bundle.cjs +1722 -1580
  41. package/dist-lib/expo-swift-metadata.cjs +1 -1
  42. package/dist-lib/expo-swift-metadata.mjs +1 -1
  43. package/dist-lib/home-paths.cjs +1 -1
  44. package/dist-lib/host/bridge-host.cjs +2800 -3794
  45. package/dist-lib/host/fetch-proxy-handler.cjs +2 -2
  46. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  47. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  48. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  49. package/dist-lib/host/websocket-proxy.cjs +1 -1
  50. package/dist-lib/index.cjs +32 -11
  51. package/dist-lib/jump-to-source-babel.cjs +1 -1
  52. package/dist-lib/jump-to-source-native.cjs +1 -1
  53. package/dist-lib/kotlin-host.cjs +1 -1
  54. package/dist-lib/menu.cjs +1 -1
  55. package/dist-lib/menu.mjs +1 -1
  56. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  57. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  58. package/dist-lib/metro-production-bundle.cjs +1 -1
  59. package/dist-lib/metro-production-bundle.mjs +1 -1
  60. package/dist-lib/metro.cjs +28 -7
  61. package/dist-lib/native-app-identity-project.cjs +31 -6
  62. package/dist-lib/native-app-identity-project.mjs +295 -259
  63. package/dist-lib/native-app-identity.cjs +1 -1
  64. package/dist-lib/native-app-identity.mjs +1 -1
  65. package/dist-lib/native-firebase-metadata.cjs +1 -1
  66. package/dist-lib/native-firebase-metadata.mjs +1 -1
  67. package/dist-lib/pdfium-raster.cjs +1 -1
  68. package/dist-lib/pdfium-raster.mjs +1 -1
  69. package/dist-lib/plist.cjs +1 -1
  70. package/dist-lib/plist.mjs +1 -1
  71. package/dist-lib/profiles.cjs +1 -1
  72. package/dist-lib/public-brand.cjs +1 -1
  73. package/dist-lib/public-origins-lib-esm.json +29 -24
  74. package/dist-lib/public-origins-lib.json +100 -80
  75. package/dist-lib/react-native-host-modules.cjs +1 -1
  76. package/dist-lib/react-native-host-modules.mjs +1 -1
  77. package/dist-lib/reap-browser.cjs +1 -1
  78. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  79. package/dist-lib/sdk.cjs +8 -6
  80. package/dist-lib/sdk.mjs +8 -6
  81. package/dist-lib/skills.cjs +3192 -4150
  82. package/dist-lib/swift-compile.cjs +136 -29
  83. package/dist-lib/swift-compile.mjs +143 -34
  84. package/dist-lib/swift-package.cjs +1 -1
  85. package/dist-lib/swift-package.mjs +1 -1
  86. package/dist-lib/swift-submit.cjs +1 -1
  87. package/dist-lib/swift-submit.mjs +1 -1
  88. package/dist-lib/swift-toolchain.cjs +52 -6
  89. package/dist-lib/swift.cjs +1 -1
  90. package/dist-lib/vite-swift.cjs +2206 -2060
  91. package/dist-lib/vite.cjs +2 -2
  92. package/dist-lib/worklet-executable.cjs +1 -1
  93. package/dist-lib/worklet-executable.mjs +1 -1
  94. package/dist-types/packages/peach-engine/src/ios/photoLibraryContract.d.ts +1 -1
  95. package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +5 -0
  96. package/dist-types/packages/peach-engine/src/render-worker/map-command-channel.d.ts +41 -0
  97. package/dist-types/packages/peach-engine/src/render-worker/mapServicesContract.d.ts +45 -0
  98. package/package.json +2 -1
  99. package/runtime-companion.json +1 -1
  100. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes +1 -1
  101. package/sdk/ios/usr/include/module.modulemap +3 -0
  102. package/sdk/ios/usr/include/notify.modulemap +9 -0
  103. package/sdk/ios/usr/lib/swift/Darwin.swiftmodule/arm64-apple-ios-simulator.swiftinterface +4 -0
  104. package/sdk/ios/usr/lib/swift/Dispatch.swiftmodule/arm64-apple-ios-simulator.swiftinterface +1 -1
  105. package/sdk/ios/usr/lib/swift/Foundation.swiftmodule/arm64-apple-ios-simulator.swiftinterface +7 -1
  106. package/sdk/ios/usr/lib/swift/ObjectiveC.swiftmodule/arm64-apple-ios-simulator.swiftinterface +1 -0
  107. package/sdk/ios/usr/lib/swift/SwiftUI.swiftmodule/arm64-apple-ios-simulator.swiftinterface +21 -0
  108. package/sdk/ios/usr/lib/swift/SwiftUICore.swiftmodule/arm64-apple-ios-simulator.swiftinterface +6 -1
  109. package/sdk/ios/wasm/include/__header_time.h +4 -0
  110. package/sdk/ios/wasm/include/pthread.h +2 -0
  111. package/sdk/ios/wasm/include/sys/mman.h +1 -1
  112. package/sdk/ios/wasm/include/sys/resource.h +31 -0
  113. package/sdk/ios/wasm/include/unistd.h +4 -0
  114. package/src/answeredNativePackages.ts +11 -9
  115. package/src/expo-discovery-cache.ts +69 -52
  116. package/src/expo-native-workspace.ts +3 -1
  117. package/src/expo-swift-host.ts +45 -7
  118. package/src/installed-native-libraries.ts +103 -20
  119. package/src/native-static-libraries.ts +69 -33
  120. package/src/nitro-adapter.ts +0 -9
  121. package/src/nitro-compile.ts +45 -16
  122. package/src/nitro-superset.ts +4 -5
  123. package/src/plist-bytes.ts +9 -0
  124. package/src/portable-expo-workspace.ts +4 -3
  125. package/src/react-native-bridge-modules.ts +11 -15
  126. package/src/swift-compile.ts +146 -18
  127. package/src/swift-cxx-reachable.ts +13 -0
  128. package/src/swift-distribution.ts +3 -4
  129. package/src/swift-host.ts +5 -3
  130. package/src/swift-installed-targets.ts +32 -14
  131. package/src/swift-native-pin.ts +45 -0
  132. package/src/swift-objc-compile.ts +23 -1
  133. package/src/swift-objc-standin.ts +4 -1
  134. package/src/swift-package-manifest.ts +2 -2
  135. package/src/swift-root-lock.ts +4 -3
  136. package/src/swift-standins.ts +5 -26
  137. package/src/swift-toolchain.ts +69 -12
  138. package/src/swift-wasm-prune.ts +1 -0
  139. package/src/swift-xcframework.ts +23 -12
  140. package/src/swiftContract.ts +2 -0
  141. package/src/swiftNativePinContract.ts +68 -0
  142. package/src/turbo-bundle.ts +14 -6
  143. package/src/turbo-compile.ts +76 -11
  144. package/src/turbo-source.ts +91 -15
@@ -1,8 +1,8 @@
1
- /*! peach v0.1.1817 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1821 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/swift-compile.ts
4
4
  import {
5
- spawn as spawn3,
5
+ spawn as spawn4,
6
6
  execFileSync as execFileSync9
7
7
  } from "node:child_process";
8
8
  import { createHash as createHash8, randomUUID as randomUUID5 } from "node:crypto";
@@ -2585,13 +2585,15 @@ import { spawnSync as spawnSync4 } from "node:child_process";
2585
2585
  import path5 from "node:path";
2586
2586
 
2587
2587
  // src/swift-toolchain.ts
2588
- import { execFile, execFileSync } from "node:child_process";
2588
+ import { execFile, execFileSync, spawn as spawn2 } from "node:child_process";
2589
2589
  import { createHash as createHash2 } from "node:crypto";
2590
2590
  import fs from "node:fs";
2591
2591
  import os from "node:os";
2592
2592
  import path4 from "node:path";
2593
+ import { pipeline } from "node:stream/promises";
2593
2594
  import { fileURLToPath } from "node:url";
2594
2595
  import { promisify } from "node:util";
2596
+ import zlib from "node:zlib";
2595
2597
  function peachsimPackageRoot() {
2596
2598
  let dir = import.meta.dirname;
2597
2599
  while (!fs.existsSync(path4.join(dir, "package.json")) && dir !== path4.dirname(dir))
@@ -2620,6 +2622,7 @@ var SWIFT_HOST_COMPILER_ID = "81b2c791c27276bf";
2620
2622
  var compilerArchives = {
2621
2623
  "swift-6.4.0-RELEASE-custom-0b2d0a9011c88e66": {
2622
2624
  identity: "0b2d0a9011c88e66",
2625
+ archive: "tar.gz",
2623
2626
  hosts: {
2624
2627
  "darwin-arm64": {
2625
2628
  checksum: "dc6a494227297ea657e8e5f7c5b4a861cb5e142bdbcfcb028ace2aeb19db90cc",
@@ -2637,6 +2640,7 @@ var compilerArchives = {
2637
2640
  },
2638
2641
  "swift-6.4.0-RELEASE-custom-f7c03c3f59ec5d83": {
2639
2642
  identity: "f7c03c3f59ec5d83",
2643
+ archive: "tar.gz",
2640
2644
  hosts: {
2641
2645
  "darwin-arm64": {
2642
2646
  checksum: "8946a2d4716d3b0784cef7a85a35f66537bd319c4c5a48c63457d607260df5c5",
@@ -2654,6 +2658,7 @@ var compilerArchives = {
2654
2658
  },
2655
2659
  "swift-6.4.0-RELEASE-custom-3e3dca8fd1d82975": {
2656
2660
  identity: "3e3dca8fd1d82975",
2661
+ archive: "tar.gz",
2657
2662
  hosts: {
2658
2663
  "darwin-arm64": {
2659
2664
  checksum: "dfad56454f5e1e465071ff708bf485be65b438cf55d02b04d26d17d26df9f54a",
@@ -2671,6 +2676,7 @@ var compilerArchives = {
2671
2676
  },
2672
2677
  "swift-6.4.0-RELEASE-custom-b082ac5437336790": {
2673
2678
  identity: "b082ac5437336790",
2679
+ archive: "tar.gz",
2674
2680
  hosts: {
2675
2681
  "darwin-arm64": {
2676
2682
  checksum: "85e601982321d3a6f81f05928bc9bbe7a61bc75b27ce24508e79f6b5b537254d",
@@ -2688,6 +2694,7 @@ var compilerArchives = {
2688
2694
  },
2689
2695
  "swift-6.4.0-RELEASE-custom-9cdaffdb6b37fb47": {
2690
2696
  identity: "9cdaffdb6b37fb47",
2697
+ archive: "tar.gz",
2691
2698
  hosts: {
2692
2699
  "darwin-arm64": {
2693
2700
  checksum: "fdd3f88cf76a8dc2083275d4253255030068a25b5ba68acbf59e0407c45677dd",
@@ -2705,6 +2712,7 @@ var compilerArchives = {
2705
2712
  },
2706
2713
  "swift-6.4.0-RELEASE-custom-bd49e2f77434e7b1": {
2707
2714
  identity: "bd49e2f77434e7b1",
2715
+ archive: "tar.gz",
2708
2716
  hosts: {
2709
2717
  "darwin-arm64": {
2710
2718
  checksum: "e815b06394566e8125475afc8f1807f7f465318c845549c5831043cdc28eca64",
@@ -2722,6 +2730,7 @@ var compilerArchives = {
2722
2730
  },
2723
2731
  "swift-6.4.0-RELEASE-custom-13450179a7e01c81": {
2724
2732
  identity: "13450179a7e01c81",
2733
+ archive: "tar.gz",
2725
2734
  hosts: {
2726
2735
  "darwin-arm64": {
2727
2736
  checksum: "a29be6b722f15c7aafac26ba5703a7392f49ce7ea5e1c56548846b7e458290f7",
@@ -2739,6 +2748,7 @@ var compilerArchives = {
2739
2748
  },
2740
2749
  "swift-6.4.0-RELEASE-custom-f6868fa6054e83d6": {
2741
2750
  identity: "f6868fa6054e83d6",
2751
+ archive: "tar.gz",
2742
2752
  hosts: {
2743
2753
  "darwin-arm64": {
2744
2754
  checksum: "bd80c2f35864ec29883dd22001d0165821e80d78002fc12f92406c3c708694a4",
@@ -2756,23 +2766,25 @@ var compilerArchives = {
2756
2766
  },
2757
2767
  "swift-6.4.0-RELEASE-custom-a560ff35bf882b5c": {
2758
2768
  identity: "a560ff35bf882b5c",
2769
+ archive: "tar.zst",
2759
2770
  hosts: {
2760
2771
  "darwin-arm64": {
2761
- checksum: "ec20a41851ac558fe663d78def6b93d0d47c5a0cb69688ee270fd85de637a522",
2772
+ checksum: "36c50bcdfba88a4c0989af0bd60371497eb4403aa7b80644b479fa509a2187a9",
2762
2773
  manifest: "253e891527d2213f54eace768b902de89de5e9495a3c5f4018de1985516bd553"
2763
2774
  },
2764
2775
  "linux-x64": {
2765
- checksum: "f0126a2e63d275895036d02d75a901070da0343dbf03bf17342e10cb6f893dee",
2776
+ checksum: "ba25da9182314fc7b7dd2fc041280e1c7b409f80a1fbccdfa5c342669d164c8e",
2766
2777
  manifest: "6f951cc4071dd0d6054d85711a7c5fe272273658847831b477a8b24be7254ca0"
2767
2778
  },
2768
2779
  "linux-arm64": {
2769
- checksum: "315fa766559a6e69bfd10dcddf40e04c91155f0db3047d210d74ac87652fb7e6",
2780
+ checksum: "5f0f4456e9fe22b5486025db9f679c865841660797d71761245291c2c6811c20",
2770
2781
  manifest: "b6f62fca2ec37593e274ee5bac474f21ffc5db14cd82f492ccbc774f8e9b75d8"
2771
2782
  }
2772
2783
  }
2773
2784
  },
2774
2785
  [SWIFT_HOST_COMPILER_RELEASE]: {
2775
2786
  identity: SWIFT_HOST_COMPILER_ID,
2787
+ archive: "tar.gz",
2776
2788
  hosts: {
2777
2789
  "darwin-arm64": {
2778
2790
  checksum: "bc51b83d9e2e01c9873875326544734486d3ff3a868d650379c304045e8838d3",
@@ -2805,15 +2817,20 @@ function privateSwiftRelease() {
2805
2817
  throw new Error(`${root} holds no Swift distribution release`);
2806
2818
  return release;
2807
2819
  }
2808
- function swiftHostCompilerArchive(release, host2 = `${process.platform}-${process.arch}`) {
2820
+ function swiftHostCompilerPin(release) {
2809
2821
  const compiler = compilerArchives[release];
2810
2822
  if (!compiler) throw new Error(`unqualified host compiler ${release}`);
2823
+ return compiler;
2824
+ }
2825
+ function swiftHostCompilerArchive(release, host2 = `${process.platform}-${process.arch}`) {
2826
+ const compiler = swiftHostCompilerPin(release);
2811
2827
  const archive = compiler.hosts[host2];
2812
2828
  if (!archive) throw new Error(`unsupported Swift compiler host ${host2}`);
2813
2829
  return {
2814
2830
  ...archive,
2815
2831
  identity: compiler.identity,
2816
- url: `https://r2.sootsim.com/swift-host-compiler/${compiler.identity}/${release}-${host2}.tar.gz`
2832
+ archive: compiler.archive,
2833
+ url: `https://r2.sootsim.com/swift-host-compiler/${compiler.identity}/${archive.checksum}.${compiler.archive}`
2817
2834
  };
2818
2835
  }
2819
2836
  function swiftUpstreamRelease(release) {
@@ -3771,6 +3788,9 @@ function objcSdkIntakeFlags(headers, toolchainBin, minimum) {
3771
3788
  path7.join(headers, "System/Library/Frameworks"),
3772
3789
  "-isystem",
3773
3790
  path7.join(headers, "wasm/include"),
3791
+ // compiler intrinsics an arm64 unit includes, ahead of clang's arm-only ones.
3792
+ "-isystem",
3793
+ path7.join(headers, "wasm/intrinsics"),
3774
3794
  // libxml2 headers sit one level deeper, as in the iOS sdk: a unit
3775
3795
  // includes <libxml/parser.h> through usr/include/libxml2, never the parent.
3776
3796
  "-I",
@@ -4992,7 +5012,7 @@ function swiftReproducibleBuildFlags(roots) {
4992
5012
 
4993
5013
  // src/swift-root-lock.ts
4994
5014
  import {
4995
- spawn as spawn2
5015
+ spawn as spawn3
4996
5016
  } from "node:child_process";
4997
5017
  import { createHash as createHash6, randomUUID as randomUUID4 } from "node:crypto";
4998
5018
  import {
@@ -5156,18 +5176,18 @@ async function withSwiftRootLock(root, work, signal, wait = true) {
5156
5176
  const children = [];
5157
5177
  const lease = {
5158
5178
  register(child) {
5159
- children.push(child);
5179
+ const index = children.push(child);
5160
5180
  if (child.pid === void 0) throw new Error("could not register compiler process");
5161
- const childPending = `${pending}.child.${child.pid}`;
5181
+ const childPending = `${pending}.child.${index}`;
5162
5182
  try {
5163
5183
  writeFileSync2(childPending, JSON.stringify(ownIdentity(child.pid)));
5164
- linkSync(childPending, path14.join(directory, name(held, `child.${child.pid}`)));
5184
+ linkSync(childPending, path14.join(directory, name(held, `child.${index}`)));
5165
5185
  } finally {
5166
5186
  rmSync4(childPending, { force: true });
5167
5187
  }
5168
5188
  },
5169
5189
  spawn(command, args, options, companion) {
5170
- const child = spawn2(
5190
+ const child = spawn3(
5171
5191
  "/bin/sh",
5172
5192
  ["-c", 'IFS= read -r go || exit 1; exec "$@" </dev/null', "sh", command, ...args],
5173
5193
  { ...options, detached: true, stdio: ["pipe", "pipe", "pipe"] }
@@ -6737,7 +6757,8 @@ function pruneSwiftWasmLink(directory, toolchainBin, moduleRoot, staticClangTarg
6737
6757
  const prunedRspPath = path16.join(directory, ".peach-link.pruned.rsp");
6738
6758
  fs6.writeFileSync(prunedRspPath, outTokens.map((t) => JSON.stringify(t)).join(" "));
6739
6759
  execFileSync7(path16.join(toolchainBin, "wasm-ld"), [`@${prunedRspPath}`], {
6740
- stdio: "pipe"
6760
+ stdio: "pipe",
6761
+ maxBuffer: Infinity
6741
6762
  });
6742
6763
  fs6.rmSync(rspPath, { force: true });
6743
6764
  }
@@ -7044,7 +7065,7 @@ async function runCompiler(command, args, options, stream = false, quiet) {
7044
7065
  detached: true,
7045
7066
  stdio: ["ignore", "pipe", "pipe"]
7046
7067
  };
7047
- const child = options.lease ? options.lease.spawn(command, args, launch, options.frameworkLease) : spawn3(command, args, launch);
7068
+ const child = options.lease ? options.lease.spawn(command, args, launch, options.frameworkLease) : spawn4(command, args, launch);
7048
7069
  let stopping;
7049
7070
  try {
7050
7071
  return await new Promise((resolve, reject) => {
@@ -7261,7 +7282,7 @@ function swiftModuleInputFiles(root) {
7261
7282
  walk("ios-simulator-stdlib");
7262
7283
  return files.sort();
7263
7284
  }
7264
- function swiftMacroPlugins(moduleRoot) {
7285
+ function swiftMacroPlugins(moduleRoot, dir = path19.join(moduleRoot, ".build/host/RnxPreviewMacros")) {
7265
7286
  const distribution = swiftDistributionAt(moduleRoot);
7266
7287
  if (distribution)
7267
7288
  return {
@@ -7269,7 +7290,6 @@ function swiftMacroPlugins(moduleRoot) {
7269
7290
  executables: distribution.plugins.filter((plugin) => path19.basename(plugin) === "ExpoModulesMacros").map((plugin) => path19.join(moduleRoot, plugin)),
7270
7291
  stale: false
7271
7292
  };
7272
- const dir = path19.join(moduleRoot, ".build/host/RnxPreviewMacros");
7273
7293
  const release = JSON.parse(
7274
7294
  readFileSync11(path19.join(moduleRoot, "toolchain.json"), "utf8")
7275
7295
  ).release;
@@ -7663,14 +7683,20 @@ function swiftAvailableModules(moduleRoot, toolchainBin) {
7663
7683
  for (const match of readFileSync11(map, "utf8").matchAll(/^module\s+([A-Za-z_]\w*)/gm))
7664
7684
  modules.add(match[1]);
7665
7685
  }
7666
- const libc = path19.join(darwin, "usr/include");
7667
- for (const entry of readdirSync8(libc)) {
7668
- if (!entry.endsWith(".modulemap")) continue;
7669
- for (const match of readFileSync11(path19.join(libc, entry), "utf8").matchAll(
7670
- /^module\s+([A-Za-z_]\w*)/gm
7671
- ))
7672
- modules.add(match[1]);
7673
- }
7686
+ for (const libc of [
7687
+ path19.join(darwin, "usr/include"),
7688
+ path19.join(
7689
+ swiftSharedSdkRoot(moduleRoot, swiftDistributionAt(moduleRoot) !== null),
7690
+ "usr/include"
7691
+ )
7692
+ ])
7693
+ for (const entry of readdirSync8(libc)) {
7694
+ if (!entry.endsWith(".modulemap")) continue;
7695
+ for (const match of readFileSync11(path19.join(libc, entry), "utf8").matchAll(
7696
+ /^module\s+([A-Za-z_]\w*)/gm
7697
+ ))
7698
+ modules.add(match[1]);
7699
+ }
7674
7700
  for (const directory of frameworks) {
7675
7701
  for (const entry of readdirSync8(directory)) {
7676
7702
  const map = path19.join(directory, entry, "Modules/module.modulemap");
@@ -7802,7 +7828,7 @@ var darwinRecordsRegion = (quoted) => quoted.length ? ["-Wl,--start-lib", ...quo
7802
7828
  var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
7803
7829
  var MULTI_MANIFEST_VERSION = 65;
7804
7830
  var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
7805
- var compilerSourceDigest = true ? "1519f1f37c446535792f7bb0c9ba9c5e59b0b0f87d7b5c849346abe684325aa7" : swiftCompilerSourceDigest(import.meta.dirname);
7831
+ var compilerSourceDigest = true ? "3d055fb169dadbe3931422242039d4edc7f595c6301256776bac390c04b04fff" : swiftCompilerSourceDigest(import.meta.dirname);
7806
7832
  function swiftArtifactHash(input, release, moduleRoot) {
7807
7833
  const hash = createHash8("sha256");
7808
7834
  hash.update(`swift-compile
@@ -7999,6 +8025,14 @@ function emitSwiftPackageManifest(args) {
7999
8025
  );
8000
8026
  const macroSettings = (values) => (values ?? []).map((value) => ` ${clangMacroSetting(value)},`).join("");
8001
8027
  const flagArray = (literal) => `peachCompilerArguments(${JSON.stringify(literal.replace(/,\s*]$/, "]"))})`;
8028
+ const swiftFlagArray = (literal) => {
8029
+ const flags = JSON.parse(literal.replace(/,\s*]$/, "]"));
8030
+ const content = flags.map((flag) => JSON.stringify(flag)).join("\n") + "\n";
8031
+ const digest = createHash8("sha256").update(content).digest("hex");
8032
+ const file = path19.join(args.root, ".peach-swift-arguments", `${digest}.rsp`);
8033
+ args.files.set(file, content);
8034
+ return JSON.stringify([`@${file}`]);
8035
+ };
8002
8036
  const declaredClangSettings = (target, tool) => clangSettingEntries(
8003
8037
  target?.clangSettings?.map(
8004
8038
  (setting) => "flags" in setting ? {
@@ -8061,7 +8095,7 @@ function emitSwiftPackageManifest(args) {
8061
8095
  (value) => value.late?.producers.includes(target.name)
8062
8096
  )) ? `, "-emit-objc-header-path", ${JSON.stringify(path19.join(args.headerDirectory, `${target.name}-Swift${args.nativeHeaderDeclarations?.[target.name] ? ".original" : ""}.h`))}` : "";
8063
8097
  const clangMode = target.cxxInterop ? "" : ', "-Xcc", "-fno-cxx-modules"';
8064
- const swiftSettings = `swiftSettings: [.swiftLanguageMode(.v${target.languageMode}),${isolation}${interoperability}${defines}${features}${upcoming} .unsafeFlags(${flagArray(`["-Osize", "-Xfrontend", "-enable-cross-import-overlays"${overlayFlags}${FOUNDATION_IMPLICIT_FLAGS}${oneModule ? ONE_IMPLICIT_FLAGS : ""}${imports}${nativeImportFlags}${objcFlags}${header}${clangMode}${upstream}]`)})]`;
8098
+ const swiftSettings = `swiftSettings: [.swiftLanguageMode(.v${target.languageMode}),${isolation}${interoperability}${defines}${features}${upcoming} .unsafeFlags(${swiftFlagArray(`["-Osize", "-Xfrontend", "-enable-cross-import-overlays"${overlayFlags}${FOUNDATION_IMPLICIT_FLAGS}${oneModule ? ONE_IMPLICIT_FLAGS : ""}${imports}${nativeImportFlags}${objcFlags}${header}${clangMode}${upstream}]`)})]`;
8065
8099
  const deps = [
8066
8100
  .../* @__PURE__ */ new Set([
8067
8101
  ...(target.dependencies ?? []).flatMap(
@@ -9763,7 +9797,13 @@ function namesLibxml2(input) {
9763
9797
  }
9764
9798
  return false;
9765
9799
  }
9800
+ function needsNativeToolset(input, prebuilt) {
9801
+ return Boolean(
9802
+ input.packageFiles || prebuilt || Object.keys(input.files).some(isSwiftNativeTranslationUnit)
9803
+ );
9804
+ }
9766
9805
  function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
9806
+ const nativeToolset = needsNativeToolset(input, prebuilt);
9767
9807
  if (input.headerAliases !== void 0 && !isSwiftHeaderAliases(input.headerAliases))
9768
9808
  throw new Error("swift compile input has invalid original header aliases");
9769
9809
  if (input.nativeTargets !== void 0 && !isSwiftNativeTargets(input.nativeTargets))
@@ -10109,7 +10149,11 @@ ${swiftProjectFilesProblems(input.projectFiles).join("\n")}`
10109
10149
  importModuleMaps,
10110
10150
  generatedModuleMaps
10111
10151
  );
10112
- const flags = [...stageFlags(originalFlags, sdkInclude), ...dependencyModuleMaps];
10152
+ const flags = [
10153
+ ...stageFlags(originalFlags, sdkInclude),
10154
+ ...dependencyModuleMaps,
10155
+ ...target.defines?.includes(SWIFT_XCODE_BUILD_CONDITION) && !target.defines.includes("SWIFT_PACKAGE") ? ["-USWIFT_PACKAGE"] : []
10156
+ ];
10113
10157
  const prefixHeader = settings?.prefixHeader ? ["-include", path19.join(layout.root, settings.prefixHeader)] : [];
10114
10158
  const bundleName = entries.some(([file]) => file.endsWith(".swift")) ? void 0 : swiftObjCResourceBundleName({
10115
10159
  target: target.name,
@@ -10211,6 +10255,24 @@ ${swiftProjectFilesProblems(input.projectFiles).join("\n")}`
10211
10255
  stageTargetFile(target.name, path19.join(layout.root, modulemap), moduleContents, {
10212
10256
  allowExisting: true
10213
10257
  });
10258
+ if (modulemap.endsWith("/Modules/module.modulemap")) {
10259
+ const headers = path19.posix.join(
10260
+ path19.posix.dirname(path19.posix.dirname(modulemap)),
10261
+ "Headers"
10262
+ );
10263
+ const mirrored = path19.posix.join(path19.posix.dirname(modulemap), "Headers");
10264
+ for (const [, umbrella] of moduleContents.toString().matchAll(/\bumbrella\s+header\s+"([^"]+)"/g)) {
10265
+ const source = settings.productHeaders[path19.posix.join(headers, umbrella)];
10266
+ const contents = source === void 0 ? void 0 : input.files[source];
10267
+ if (contents !== void 0)
10268
+ stageTargetFile(
10269
+ target.name,
10270
+ path19.join(layout.root, mirrored, umbrella),
10271
+ contents,
10272
+ { allowExisting: true }
10273
+ );
10274
+ }
10275
+ }
10214
10276
  if (nativeC && path19.posix.basename(modulemap) !== "module.modulemap") {
10215
10277
  stageTargetFile(
10216
10278
  target.name,
@@ -10265,7 +10327,8 @@ ${swiftProjectFilesProblems(input.projectFiles).join("\n")}`
10265
10327
  ).digest("hex").slice(0, 12);
10266
10328
  const name2 = `${target.name}${nativeC ? "Native" : "Swift"}Implementation_${identity}`;
10267
10329
  const groupPath = path19.posix.join("PeachNativeSources", name2);
10268
- const sourceIdentity = `-ffile-prefix-map=${path19.join(layout.root, groupPath)}=${path19.join(layout.root, target.path)}`;
10330
+ const identityRoot = nativeToolset ? "/peach/build" : layout.root;
10331
+ const sourceIdentity = `-ffile-prefix-map=${path19.join(identityRoot, groupPath)}=${path19.join(identityRoot, target.path)}`;
10269
10332
  const group = groups.get(identity) ?? {
10270
10333
  name: name2,
10271
10334
  path: groupPath,
@@ -10790,6 +10853,7 @@ module ${moduleName}.Swift {
10790
10853
  path19.join(layout.root, "Package.swift"),
10791
10854
  emitSwiftPackageManifest({
10792
10855
  root: layout.root,
10856
+ files,
10793
10857
  targets: manifestTargets,
10794
10858
  packages,
10795
10859
  native,
@@ -10844,7 +10908,7 @@ module ${moduleName}.Swift {
10844
10908
  if (files.has(destination)) continue;
10845
10909
  files.set(destination, Buffer.from(bytes, "base64"));
10846
10910
  }
10847
- if (input.packageFiles || prebuilt) {
10911
+ if (nativeToolset) {
10848
10912
  files.set(
10849
10913
  path19.join(layout.root, ".peach-target-toolset.json"),
10850
10914
  JSON.stringify({
@@ -10935,6 +10999,10 @@ module ${moduleName}.Swift {
10935
10999
  for (const producer of producers)
10936
11000
  for (const dependency of dependencies.get(producer) ?? []) include(dependency);
10937
11001
  return {
11002
+ nativeBuildTargets: [...native].flatMap(([name2, plan]) => [
11003
+ ...!plan.mixed && plan.sources.length > 0 ? [name2] : [],
11004
+ ...plan.groups?.map((group) => group.name) ?? (plan.late ? [plan.late.name] : [])
11005
+ ]),
10938
11006
  headerProducers: [
10939
11007
  .../* @__PURE__ */ new Set([
10940
11008
  ...Object.keys(nativeHeaderDeclarations),
@@ -10957,7 +11025,7 @@ function outputOf(error) {
10957
11025
  streamText(Reflect.get(error, "stdout")),
10958
11026
  streamText(Reflect.get(error, "stderr"))
10959
11027
  ].filter(Boolean);
10960
- if (error instanceof Error) streams.push(error.message);
11028
+ if (error instanceof Error) streams.unshift(error.message);
10961
11029
  if (streams.length > 0) return streams.join("\n");
10962
11030
  }
10963
11031
  return error instanceof Error ? error.message : String(error);
@@ -11506,7 +11574,17 @@ function retireStaleSwiftLink(root, stamp) {
11506
11574
  rmSync5(retired, { recursive: true, force: true });
11507
11575
  return true;
11508
11576
  }
11509
- function compileSwiftProjectUnit(input, options) {
11577
+ async function compileSwiftProjectUnit(input, options) {
11578
+ for (let attempt = 1; ; attempt++) {
11579
+ try {
11580
+ return await compileSwiftProjectOnce(input, options);
11581
+ } catch (error) {
11582
+ if (attempt >= 3 || !outputOf(error).includes("differs from the caller"))
11583
+ throw error;
11584
+ }
11585
+ }
11586
+ }
11587
+ function compileSwiftProjectOnce(input, options) {
11510
11588
  options.signal?.throwIfAborted();
11511
11589
  mkdirSync4(options.buildRoot, { recursive: true });
11512
11590
  const root = realpathSync3(options.buildRoot);
@@ -11675,6 +11753,7 @@ function compileSwiftProjectUnit(input, options) {
11675
11753
  })
11676
11754
  ))
11677
11755
  report("framework revision changed; rebuilding the app link");
11756
+ const nativeToolset = needsNativeToolset(input, prebuilt);
11678
11757
  const preparation = writeSwiftProject(layout, input, frameworkRoot, prebuilt);
11679
11758
  writeSwiftAutolinkLinker(root, options.toolchainBin);
11680
11759
  const projectProcess = options.project ? prepareSwiftProjectProcess(root, options.project) : void 0;
@@ -11709,7 +11788,7 @@ function compileSwiftProjectUnit(input, options) {
11709
11788
  ...swiftCompileSdkOptions(frameworkRoot, options.toolchainBin),
11710
11789
  "--swift-sdk",
11711
11790
  sdk,
11712
- ...input.packageFiles || prebuilt ? ["--toolset", path19.join(root, ".peach-target-toolset.json")] : [],
11791
+ ...nativeToolset ? ["--toolset", path19.join(root, ".peach-target-toolset.json")] : [],
11713
11792
  "-c",
11714
11793
  "release",
11715
11794
  "-Xswiftc",
@@ -11721,7 +11800,12 @@ function compileSwiftProjectUnit(input, options) {
11721
11800
  [frameworkRoot, "framework"],
11722
11801
  [root, "build"],
11723
11802
  ...forwarders
11724
- ]),
11803
+ ]).flatMap((flag, index, flags) => {
11804
+ if (!nativeToolset || !flag.startsWith("-ffile-prefix-map="))
11805
+ return [flag];
11806
+ const mapped = flag.replaceAll(root, "/peach/build").replaceAll(frameworkRoot, "/peach/framework").replaceAll(path19.dirname(options.toolchainBin), "/peach/toolchain");
11807
+ return flags[index - 1] === "-Xcc" ? [mapped, "-Xswiftc", "-Xcc", "-Xswiftc", flag] : [mapped];
11808
+ }),
11725
11809
  ...macroPlugins.libraries.flatMap((plugin) => [
11726
11810
  "-Xswiftc",
11727
11811
  "-load-plugin-library",
@@ -11774,6 +11858,31 @@ function compileSwiftProjectUnit(input, options) {
11774
11858
  );
11775
11859
  }
11776
11860
  }
11861
+ const checkpoints = path19.join(
11862
+ root,
11863
+ ".build",
11864
+ "peach-native-targets",
11865
+ createHash8("sha256").update(readFileSync11(path19.join(root, "Package.swift"))).digest("hex")
11866
+ );
11867
+ mkdirSync4(checkpoints, { recursive: true });
11868
+ for (const target of /* @__PURE__ */ new Set([
11869
+ ...input.staticClangTargets ?? [],
11870
+ ...preparation.nativeBuildTargets
11871
+ ])) {
11872
+ const checkpoint = path19.join(
11873
+ checkpoints,
11874
+ createHash8("sha256").update(target).digest("hex")
11875
+ );
11876
+ if (existsSync4(checkpoint)) continue;
11877
+ await runCompiler(
11878
+ swift,
11879
+ [...buildArgs, "--target", target],
11880
+ appOptions,
11881
+ SWIFTPM_PROGRESS,
11882
+ SWIFTPM_NOISE
11883
+ );
11884
+ writeFileSync4(checkpoint, "");
11885
+ }
11777
11886
  await runCompiler(
11778
11887
  swift,
11779
11888
  buildArgs,
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1817 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1821 | (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 __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1817 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1821 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/swift-package.ts
4
4
  function swiftManifestSettings(target) {
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1817 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1821 | (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 __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1817 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1821 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/is-record.ts
4
4
  function isRecord(value) {