peachsim 0.1.2406 → 0.1.2408

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 (96) hide show
  1. package/cli/agent-note.ts +231 -0
  2. package/cli/cloud-dispatch.ts +1 -1
  3. package/cli/commands/agent.ts +29 -26
  4. package/cli/commands/stream.ts +11 -7
  5. package/cli/main.ts +16 -2
  6. package/cli/outbound-endpoints.ts +15 -0
  7. package/dist-lib/agent-daemon-client.cjs +23 -3
  8. package/dist-lib/agent-events.cjs +1 -1
  9. package/dist-lib/attached-projects.cjs +1 -1
  10. package/dist-lib/auth/shared-session.cjs +1 -1
  11. package/dist-lib/backend-origin.cjs +1 -1
  12. package/dist-lib/beta.cjs +1 -1
  13. package/dist-lib/beta.mjs +1 -1
  14. package/dist-lib/bridge-constants.cjs +1 -1
  15. package/dist-lib/bridge-contract-input.cjs +1 -1
  16. package/dist-lib/bridge-contract-input.mjs +1 -1
  17. package/dist-lib/bridge-contract.cjs +1 -1
  18. package/dist-lib/bridge-contract.mjs +1 -1
  19. package/dist-lib/bundle-channel.cjs +201 -60
  20. package/dist-lib/capture-contract.cjs +1 -1
  21. package/dist-lib/capture-contract.mjs +1 -1
  22. package/dist-lib/cloud-contract.cjs +1 -1
  23. package/dist-lib/cloud-contract.mjs +1 -1
  24. package/dist-lib/cloud-test-args.cjs +1 -1
  25. package/dist-lib/cloud-test-args.mjs +1 -1
  26. package/dist-lib/cloud.cjs +1 -1
  27. package/dist-lib/cloud.mjs +1 -1
  28. package/dist-lib/config.cjs +1 -1
  29. package/dist-lib/config.mjs +1 -1
  30. package/dist-lib/detox/index.cjs +1 -1
  31. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  32. package/dist-lib/expo-swift-bundle.cjs +200 -59
  33. package/dist-lib/expo-swift-metadata.cjs +1 -1
  34. package/dist-lib/expo-swift-metadata.mjs +1 -1
  35. package/dist-lib/home-paths.cjs +1 -1
  36. package/dist-lib/host/bridge-host.cjs +356 -100
  37. package/dist-lib/host/fetch-proxy-handler.cjs +4 -4
  38. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  39. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  40. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  41. package/dist-lib/host/websocket-proxy.cjs +1 -1
  42. package/dist-lib/index.cjs +4 -4
  43. package/dist-lib/jump-to-source-babel.cjs +1 -1
  44. package/dist-lib/jump-to-source-native.cjs +1 -1
  45. package/dist-lib/kotlin-host.cjs +1 -1
  46. package/dist-lib/menu.cjs +1 -1
  47. package/dist-lib/menu.mjs +1 -1
  48. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  49. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  50. package/dist-lib/metro-production-bundle.cjs +1 -1
  51. package/dist-lib/metro-production-bundle.mjs +1 -1
  52. package/dist-lib/metro.cjs +4 -4
  53. package/dist-lib/native-app-identity-project.cjs +3 -3
  54. package/dist-lib/native-app-identity-project.mjs +3 -3
  55. package/dist-lib/native-app-identity.cjs +1 -1
  56. package/dist-lib/native-app-identity.mjs +1 -1
  57. package/dist-lib/native-firebase-metadata.cjs +1 -1
  58. package/dist-lib/native-firebase-metadata.mjs +1 -1
  59. package/dist-lib/pdfium-raster.cjs +1 -1
  60. package/dist-lib/pdfium-raster.mjs +1 -1
  61. package/dist-lib/plist.cjs +1 -1
  62. package/dist-lib/plist.mjs +1 -1
  63. package/dist-lib/profiles.cjs +1 -1
  64. package/dist-lib/public-brand.cjs +1 -1
  65. package/dist-lib/public-origins-lib-esm.json +24 -24
  66. package/dist-lib/public-origins-lib.json +56 -55
  67. package/dist-lib/react-native-host-modules.cjs +1 -1
  68. package/dist-lib/react-native-host-modules.mjs +1 -1
  69. package/dist-lib/reap-browser.cjs +1 -1
  70. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  71. package/dist-lib/sdk.cjs +1 -1
  72. package/dist-lib/sdk.mjs +1 -1
  73. package/dist-lib/skills.cjs +367 -106
  74. package/dist-lib/swift-compile.cjs +195 -54
  75. package/dist-lib/swift-compile.mjs +195 -54
  76. package/dist-lib/swift-package.cjs +1 -1
  77. package/dist-lib/swift-package.mjs +1 -1
  78. package/dist-lib/swift-submit.cjs +1 -1
  79. package/dist-lib/swift-submit.mjs +1 -1
  80. package/dist-lib/swift-toolchain.cjs +1 -1
  81. package/dist-lib/swift.cjs +1 -1
  82. package/dist-lib/vite-swift.cjs +198 -57
  83. package/dist-lib/vite.cjs +4 -4
  84. package/dist-lib/worklet-executable.cjs +1 -1
  85. package/dist-lib/worklet-executable.mjs +1 -1
  86. package/kotlin/sdk.tar.gz +0 -0
  87. package/package.json +1 -1
  88. package/skills/peach-setup/SKILL.md +8 -3
  89. package/src/agent-daemon-client.ts +35 -2
  90. package/src/agent-prompt.ts +68 -0
  91. package/src/canvas-agent-note-delivery.ts +83 -0
  92. package/src/host/agent-host.ts +128 -18
  93. package/src/swift-compile.ts +124 -66
  94. package/src/swift-host.ts +2 -1
  95. package/src/swift-objc-import.ts +99 -0
  96. package/src/xcode-header-search.ts +33 -0
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2406 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2408 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  var __defProp = Object.defineProperty;
3
3
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
4
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -12047,6 +12047,78 @@ function swiftClangImporterFlags(flags) {
12047
12047
  (flag) => flag !== "-fobjc-arc" && flag !== "-fno-objc-arc" && !/^-std=(?:c(?!\+\+)|gnu(?!\+\+)|iso9899:)/.test(flag)
12048
12048
  );
12049
12049
  }
12050
+ var CLANG_PATH_OPTIONS = /* @__PURE__ */ new Set([
12051
+ "-I",
12052
+ "-F",
12053
+ "-idirafter",
12054
+ "-iframework",
12055
+ "-iframeworkwithsysroot",
12056
+ "-imacros",
12057
+ "-include",
12058
+ "-iprefix",
12059
+ "-iquote",
12060
+ "-isystem",
12061
+ "-isysroot",
12062
+ "-ivfsoverlay",
12063
+ "-iwithprefix",
12064
+ "-iwithprefixbefore",
12065
+ "--sysroot"
12066
+ ]);
12067
+ function compactSwiftClangDefines(flags) {
12068
+ const definitions = /* @__PURE__ */ new Map();
12069
+ const macros = [];
12070
+ for (let index = 0; index < flags.length; index++) {
12071
+ if (flags[index].startsWith("@")) return flags;
12072
+ if (flags[index] !== "-Xcc") continue;
12073
+ const flag = flags[++index];
12074
+ if (flag === void 0 || flags[index - 2] === "-Xfrontend" || flag === "-Xclang" || flag === "-Xpreprocessor" || flag.startsWith("-Wp,") || flag.startsWith("--config") || flag.startsWith("@"))
12075
+ return flags;
12076
+ if (CLANG_PATH_OPTIONS.has(flag) && flags[index + 1] === "-Xcc") {
12077
+ index += 2;
12078
+ continue;
12079
+ }
12080
+ if (!flag.startsWith("-D") && !flag.startsWith("-U")) continue;
12081
+ const name2 = /^-[DU]([A-Za-z_$][\w$]*)(?=[(=]|$)/.exec(flag)?.[1];
12082
+ if (!name2) return flags;
12083
+ const previous = definitions.get(name2);
12084
+ definitions.set(name2, previous === void 0 || previous === flag ? flag : null);
12085
+ macros.push({ index, name: name2, flag });
12086
+ }
12087
+ const seen = /* @__PURE__ */ new Set();
12088
+ const duplicates = /* @__PURE__ */ new Set();
12089
+ for (const { index, name: name2, flag } of macros) {
12090
+ if (definitions.get(name2) !== flag) continue;
12091
+ if (seen.has(name2)) {
12092
+ duplicates.add(index - 1);
12093
+ duplicates.add(index);
12094
+ }
12095
+ seen.add(name2);
12096
+ }
12097
+ return duplicates.size === 0 ? flags : flags.filter((_, index) => !duplicates.has(index));
12098
+ }
12099
+ function compactSwiftClangOverlays(flags, generated) {
12100
+ if (generated.size === 0) return flags;
12101
+ const overlays = /* @__PURE__ */ new Map();
12102
+ const duplicates = /* @__PURE__ */ new Set();
12103
+ for (let index = 0; index < flags.length; index++) {
12104
+ const flag = flags[index];
12105
+ if (flag.startsWith("@")) return flags;
12106
+ if (flag === "-Xcc" && flags[index - 1] === "-Xfrontend") return flags;
12107
+ if (flags[index - 1] === "-Xcc" && (flag.startsWith("--config") || flag === "-Xclang"))
12108
+ return flags;
12109
+ if (!flag.startsWith("-ivfsoverlay") && !flag.startsWith("-vfsoverlay")) continue;
12110
+ if (flag !== "-ivfsoverlay" || flags[index - 1] !== "-Xcc" || flags[index + 1] !== "-Xcc")
12111
+ return flags;
12112
+ const file = flags[index + 2];
12113
+ if (file === void 0 || !generated.has(file)) return flags;
12114
+ const previous = overlays.get(file);
12115
+ if (previous !== void 0)
12116
+ for (let offset = -1; offset < 3; offset++) duplicates.add(previous + offset);
12117
+ overlays.set(file, index);
12118
+ index += 2;
12119
+ }
12120
+ return duplicates.size === 0 ? flags : flags.filter((_, index) => !duplicates.has(index));
12121
+ }
12050
12122
  var SWIFT_SUBMODULE_IMPORT = /^[ \t]*(?:@\w+(?:\([^)]*\))?[ \t]+)*import[ \t]+([A-Za-z_]\w*)\.([A-Za-z_]\w*)[ \t]*(?:\/\/.*)?$/gm;
12051
12123
  function swiftSubmoduleImports(sources) {
12052
12124
  const imports = /* @__PURE__ */ new Map();
@@ -12586,6 +12658,30 @@ function isSwiftResourceBundles(value) {
12586
12658
  // src/xcode-header-search.ts
12587
12659
  import fs11 from "node:fs";
12588
12660
  import path27 from "node:path";
12661
+ function coalescibleHeaderOverlays(files) {
12662
+ const aliases = /* @__PURE__ */ new Map();
12663
+ const key = (file) => file.replace(/[A-Z]/g, (letter) => letter.toLowerCase());
12664
+ const index = (directory, entry) => {
12665
+ const name2 = path27.resolve(directory, entry.name);
12666
+ if (entry.type === "directory")
12667
+ return entry.contents.every((child) => index(name2, child));
12668
+ const source = entry["external-contents"];
12669
+ const previous = aliases.get(key(name2));
12670
+ if (previous !== void 0 && previous !== source) return false;
12671
+ aliases.set(key(name2), source);
12672
+ return true;
12673
+ };
12674
+ for (const file of files) {
12675
+ const overlay = JSON.parse(fs11.readFileSync(file, "utf8"));
12676
+ if (!overlay.roots.every((entry) => index(path27.dirname(file), entry)))
12677
+ return /* @__PURE__ */ new Set();
12678
+ }
12679
+ for (const file of [...files, ...aliases.values()]) {
12680
+ const source = aliases.get(key(path27.normalize(file)));
12681
+ if (source !== void 0 && source !== file) return /* @__PURE__ */ new Set();
12682
+ }
12683
+ return files;
12684
+ }
12589
12685
  function headerMap(entries) {
12590
12686
  const unique = /* @__PURE__ */ new Map();
12591
12687
  for (const entry of entries)
@@ -13658,6 +13754,15 @@ function swiftTargetDependencies(files, targets, frameworks = OPTIONAL_FRAMEWORK
13658
13754
  )
13659
13755
  );
13660
13756
  const names = /* @__PURE__ */ new Set([...frameworks, ...targets.map((target) => target.name)]);
13757
+ const entriesByPrefix = new Map(
13758
+ targets.map(({ path: path29 }) => [path29 === "." ? "" : `${path29}/`, []])
13759
+ );
13760
+ for (const entry of Object.entries(files)) {
13761
+ const [file] = entry;
13762
+ entriesByPrefix.get("")?.push(entry);
13763
+ for (let end = file.indexOf("/"); end !== -1; end = file.indexOf("/", end + 1))
13764
+ entriesByPrefix.get(file.slice(0, end + 1))?.push(entry);
13765
+ }
13661
13766
  const siblings = /* @__PURE__ */ new Map();
13662
13767
  for (const target of targets) {
13663
13768
  const prefix = target.path === "." ? "" : `${target.path}/`;
@@ -13671,8 +13776,11 @@ function swiftTargetDependencies(files, targets, frameworks = OPTIONAL_FRAMEWORK
13671
13776
  (dependency) => dependency.kind === "target" && dependency.name !== target.name && names.has(dependency.name) || dependency.kind === "product" && dependency.package === "sootsim-swift" && OPTIONAL_FRAMEWORKS.has(dependency.name) ? [dependency.name] : []
13672
13777
  )
13673
13778
  );
13674
- for (const [file, contents2] of Object.entries(files)) {
13675
- if (file === "Package.swift" || !file.startsWith(prefix)) continue;
13779
+ const nested = target.sources === void 0 ? targets.flatMap(
13780
+ (candidate) => candidate.name !== target.name && candidate.path !== "." && candidate.path.startsWith(prefix) ? [`${candidate.path}/`] : []
13781
+ ) : [];
13782
+ for (const [file, contents2] of entriesByPrefix.get(prefix) ?? []) {
13783
+ if (file === "Package.swift") continue;
13676
13784
  const relative = file.slice(prefix.length);
13677
13785
  if (target.sources !== void 0 && !target.sources.some(
13678
13786
  (source) => source === "." || relative === source || relative.startsWith(`${source}/`)
@@ -13682,10 +13790,7 @@ function swiftTargetDependencies(files, targets, frameworks = OPTIONAL_FRAMEWORK
13682
13790
  (excluded) => relative === excluded || relative.startsWith(`${excluded}/`)
13683
13791
  ))
13684
13792
  continue;
13685
- if (target.sources === void 0 && targets.some(
13686
- (candidate) => candidate.name !== target.name && candidate.path !== "." && candidate.path.startsWith(prefix) && file.startsWith(`${candidate.path}/`)
13687
- ))
13688
- continue;
13793
+ if (nested.some((path29) => file.startsWith(path29))) continue;
13689
13794
  const imports = file.endsWith(".swift") ? swiftImportNames(contents2) : SWIFT_NATIVE_SOURCE_EXTENSIONS.some((extension) => file.endsWith(extension)) ? clangImportNames(contents2, ownsHeader) : [];
13690
13795
  for (const name2 of imports) {
13691
13796
  if (names.has(name2) && name2 !== target.name && !(target.dependencies !== void 0 && localNames.has(name2)))
@@ -13746,9 +13851,9 @@ var executableLinkFlags = (root) => ` "-Xclang-linker", "-O0",
13746
13851
  `;
13747
13852
  var darwinRecordsRegion = (quoted2) => quoted2.length ? ["-Wl,--start-lib", ...quoted2, "-Wl,--end-lib"] : [];
13748
13853
  var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
13749
- var MULTI_MANIFEST_VERSION = 69;
13854
+ var MULTI_MANIFEST_VERSION = 71;
13750
13855
  var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
13751
- var compilerSourceDigest = true ? "5f7b13ec00e56a1f8e36b1e4f1688c4eb10836e9afffb80f5e63e4fbf23e9070" : swiftCompilerSourceDigest(import.meta.dirname);
13856
+ var compilerSourceDigest = true ? "36b1496faf39a688e5ab3ee63bdab89a3afde2b9c6355443c3162f4b1e3b9144" : swiftCompilerSourceDigest(import.meta.dirname);
13752
13857
  function swiftArtifactHash(input, release, moduleRoot) {
13753
13858
  const hash = createHash14("sha256");
13754
13859
  hash.update(`swift-compile
@@ -13980,7 +14085,9 @@ function emitSwiftPackageManifest(args) {
13980
14085
  const flags = JSON.parse(literal2.replace(/,\s*]$/, "]")).filter(
13981
14086
  (flag, index, all) => !mapsPackageModule(flag) && !(flag === "-Xcc" && mapsPackageModule(all[index + 1] ?? ""))
13982
14087
  );
13983
- const content = flags.map((flag) => JSON.stringify(flag)).join("\n") + "\n";
14088
+ const macros = compactSwiftClangDefines(flags);
14089
+ const compact = args.coalescibleOverlays ? compactSwiftClangOverlays(macros, args.coalescibleOverlays) : macros;
14090
+ const content = compact.map((flag) => JSON.stringify(flag)).join("\n") + "\n";
13984
14091
  const digest = createHash14("sha256").update(content).digest("hex");
13985
14092
  const file = path28.join(args.root, ".peach-swift-arguments", `${digest}.rsp`);
13986
14093
  args.files.set(file, content);
@@ -14071,7 +14178,7 @@ function emitSwiftPackageManifest(args) {
14071
14178
  ].map((flag) => `, ${JSON.stringify(flag)}`).join("");
14072
14179
  const header = args.headerDirectory && (args.nativeHeaderDeclarations?.[target.name] || [...args.native?.values() ?? []].some(
14073
14180
  (value) => value.late?.producers.includes(target.name)
14074
- )) ? `, "-emit-objc-header-path", ${JSON.stringify(path28.join(args.headerDirectory, `${target.name}-Swift${args.nativeHeaderDeclarations?.[target.name] ? ".original" : ""}.h`))}` : "";
14181
+ )) ? `, "-emit-objc-header-path", ${JSON.stringify(path28.join(args.headerDirectory, `${target.name}-Swift.original.h`))}` : "";
14075
14182
  const clangMode = target.cxxInterop ? "" : ', "-Xcc", "-fno-cxx-modules"';
14076
14183
  const deployment = `, "-Xfrontend", "-peach-ios-deployment-target", "-Xfrontend", ${JSON.stringify(target.iosDeploymentTarget ?? SWIFTPM_DEFAULT_IOS_DEPLOYMENT_TARGET)}`;
14077
14184
  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}${deployment}${upstream}]`)})]`;
@@ -16719,6 +16826,9 @@ module ${moduleName}.Swift {
16719
16826
  nativeHeaderDeclarations[module] = [...declared];
16720
16827
  }
16721
16828
  const nativeFlags = native.size > 0 ? /* @__PURE__ */ new Map() : void 0;
16829
+ const generatedOverlays = new Set(
16830
+ headerSearch.files.filter((file) => file.endsWith(".yaml"))
16831
+ );
16722
16832
  if (nativeFlags) {
16723
16833
  const toolchainBin = nativeToolchain();
16724
16834
  const headers = path28.join(swiftSdkPaths(moduleRoot, toolchainBin).sysroot, "darwin");
@@ -16739,8 +16849,11 @@ module ${moduleName}.Swift {
16739
16849
  throw new Error(
16740
16850
  target.name + ": missing or unsupported declared iOS deployment target " + JSON.stringify(version2)
16741
16851
  );
16852
+ const sdkIntake = objcSdkIntakeFlags(headers, toolchainBin, minimum);
16853
+ const sdkOverlay = sdkIntake.indexOf("-ivfsoverlay");
16854
+ if (sdkOverlay >= 0) generatedOverlays.add(sdkIntake[sdkOverlay + 1]);
16742
16855
  const intake = [
16743
- ...objcSdkIntakeFlags(headers, toolchainBin, minimum),
16856
+ ...sdkIntake,
16744
16857
  "-ivfsoverlay",
16745
16858
  headerSearch.files[0],
16746
16859
  "-I",
@@ -16909,6 +17022,7 @@ module ${moduleName}.Swift {
16909
17022
  sourceSwiftTargets: swiftTargets,
16910
17023
  nativeFlags,
16911
17024
  nativeImportFlags,
17025
+ coalescibleOverlays: nativeFlags ? coalescibleHeaderOverlays(generatedOverlays) : void 0,
16912
17026
  nativeHeaderFlags,
16913
17027
  nativeSwiftHeaderMaps,
16914
17028
  nativeHeaderDeclarations,
@@ -18219,6 +18333,7 @@ function compileSwiftProjectOnce(input, options) {
18219
18333
  report("compiling and linking Swift modules");
18220
18334
  const frameworkInterfaces = /* @__PURE__ */ new Map();
18221
18335
  const nativeDeclarations = /* @__PURE__ */ new Map();
18336
+ const nativeHeaders = Object.entries(input.files).filter(([name2]) => name2.endsWith(".h") && !name2.endsWith("-Swift.h")).map(([, source]) => source);
18222
18337
  for (const [file, contents2] of Object.entries(input.files)) {
18223
18338
  if (!file.endsWith(".modulemap")) continue;
18224
18339
  const name2 = moduleMapName(contents2);
@@ -18306,54 +18421,83 @@ function compileSwiftProjectOnce(input, options) {
18306
18421
  );
18307
18422
  return value;
18308
18423
  };
18309
- try {
18310
- for (const build of preparation.headerBuilds) {
18311
- await runCompiler(
18312
- swift,
18313
- [...buildArgs, "--target", build.target],
18314
- appOptions,
18315
- SWIFTPM_PROGRESS,
18316
- SWIFTPM_NOISE
18424
+ const compileApp = async () => {
18425
+ const stages = [
18426
+ ...preparation.headerBuilds,
18427
+ ...preparation.nativeProductTarget ? [{ target: preparation.nativeProductTarget, producers: [] }] : []
18428
+ ];
18429
+ const checkpoints = path28.join(root, ".build", "peach-product-checkpoints");
18430
+ const recipe = createHash14("sha256").update(hash).update(readFileSync17(path28.join(root, "Package.swift"))).update(JSON.stringify(buildArgs)).digest("hex");
18431
+ for (const { target, producers } of stages) {
18432
+ const receipt = path28.join(
18433
+ checkpoints,
18434
+ createHash14("sha256").update(target).digest("hex")
18317
18435
  );
18318
- for (const producer of build.producers) {
18319
- const emitted = path28.join(
18436
+ const headers = producers.map((producer) => {
18437
+ const stem = path28.join(
18320
18438
  root,
18321
18439
  ".build",
18322
18440
  "peach-cxx-headers",
18323
- `${producer}-Swift.h`
18441
+ `${producer}-Swift`
18324
18442
  );
18325
- const original = preparation.nativeHeaderDeclarations[producer] ? emitted.replace(/-Swift\.h$/, "-Swift.original.h") : emitted;
18326
- if (existsSync6(original)) {
18327
- const generated = clangInterfaceHeader(
18328
- readFileSync17(original, "utf8")
18329
- );
18330
- writeBuildFile(
18331
- emitted,
18332
- withoutSwiftDeclarations(
18333
- swiftHeaderWithSuperclassImports(generated, frameworkInterface),
18334
- /* @__PURE__ */ new Set([
18335
- ...preparation.nativeHeaderDeclarations[producer] ?? [],
18336
- ...nativelyDeclaredFunctions(
18337
- generated,
18338
- Object.entries(input.files).filter(
18339
- ([name2]) => name2.endsWith(".h") && !name2.endsWith("-Swift.h")
18340
- ).map(([, source]) => source)
18341
- )
18342
- ]),
18343
- `#import <${producer}/${producer}.h>`
18344
- )
18443
+ return {
18444
+ producer,
18445
+ original: `${stem}.original.h`,
18446
+ emitted: `${stem}.h`
18447
+ };
18448
+ });
18449
+ const fingerprint = () => {
18450
+ const digest = createHash14("sha256").update(recipe);
18451
+ for (const { emitted } of headers) {
18452
+ if (!existsSync6(emitted)) return;
18453
+ digest.update(
18454
+ createHash14("sha256").update(readFileSync17(emitted)).digest()
18345
18455
  );
18346
18456
  }
18347
- }
18348
- }
18349
- if (preparation.nativeProductTarget) {
18457
+ return digest.digest("hex");
18458
+ };
18459
+ if (!options.project && existsSync6(receipt) && readFileSync17(receipt, "utf8") === fingerprint())
18460
+ continue;
18461
+ if (!options.project) rmSync7(receipt, { force: true });
18462
+ for (const { producer, original } of headers)
18463
+ if (!existsSync6(original))
18464
+ rmSync7(
18465
+ path28.join(
18466
+ root,
18467
+ ".build",
18468
+ WASM_TRIPLE,
18469
+ "release",
18470
+ "Modules",
18471
+ `${swiftTargetModuleName(producer)}.swiftmodule`
18472
+ ),
18473
+ { force: true }
18474
+ );
18350
18475
  await runCompiler(
18351
18476
  swift,
18352
- [...buildArgs, "--target", preparation.nativeProductTarget],
18477
+ [...buildArgs, "--target", target],
18353
18478
  appOptions,
18354
18479
  SWIFTPM_PROGRESS,
18355
18480
  SWIFTPM_NOISE
18356
18481
  );
18482
+ for (const { producer, original, emitted } of headers) {
18483
+ const generated = clangInterfaceHeader(readFileSync17(original, "utf8"));
18484
+ writeBuildFile(
18485
+ emitted,
18486
+ withoutSwiftDeclarations(
18487
+ swiftHeaderWithSuperclassImports(generated, frameworkInterface),
18488
+ /* @__PURE__ */ new Set([
18489
+ ...preparation.nativeHeaderDeclarations[producer] ?? [],
18490
+ ...nativelyDeclaredFunctions(generated, nativeHeaders)
18491
+ ]),
18492
+ `#import <${producer}/${producer}.h>`
18493
+ )
18494
+ );
18495
+ }
18496
+ if (!options.project) {
18497
+ mkdirSync7(checkpoints, { recursive: true });
18498
+ writeFileSync8(`${receipt}.partial`, fingerprint());
18499
+ renameSync2(`${receipt}.partial`, receipt);
18500
+ }
18357
18501
  }
18358
18502
  await runCompiler(
18359
18503
  swift,
@@ -18362,6 +18506,9 @@ function compileSwiftProjectOnce(input, options) {
18362
18506
  SWIFTPM_PROGRESS,
18363
18507
  SWIFTPM_NOISE
18364
18508
  );
18509
+ };
18510
+ try {
18511
+ await compileApp();
18365
18512
  } catch (error) {
18366
18513
  const output2 = outputOf(error);
18367
18514
  const moduleCache = path28.join(
@@ -18374,13 +18521,7 @@ function compileSwiftProjectOnce(input, options) {
18374
18521
  if (output2.includes("was compiled with module cache path") && existsSync6(moduleCache)) {
18375
18522
  rmSync7(moduleCache, { recursive: true, force: true });
18376
18523
  try {
18377
- await runCompiler(
18378
- swift,
18379
- buildArgs,
18380
- appOptions,
18381
- SWIFTPM_PROGRESS,
18382
- SWIFTPM_NOISE
18383
- );
18524
+ await compileApp();
18384
18525
  } catch (retryError) {
18385
18526
  throw new Error(
18386
18527
  [
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2406 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2408 | (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.2406 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2408 | (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.2406 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2408 | (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.2406 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2408 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/is-record.ts
4
4
  function isRecord(value) {
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2406 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2408 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2406 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2408 | (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;