peachsim 0.1.2423 → 0.1.2425

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 (90) hide show
  1. package/cli/outbound-endpoints.ts +138 -23
  2. package/dist-lib/agent-daemon-client.cjs +1 -1
  3. package/dist-lib/agent-events.cjs +1 -1
  4. package/dist-lib/attached-projects.cjs +1 -1
  5. package/dist-lib/auth/shared-session.cjs +1 -1
  6. package/dist-lib/backend-origin.cjs +1 -1
  7. package/dist-lib/beta.cjs +1 -1
  8. package/dist-lib/beta.mjs +1 -1
  9. package/dist-lib/bridge-constants.cjs +1 -1
  10. package/dist-lib/bridge-contract-input.cjs +1 -1
  11. package/dist-lib/bridge-contract-input.mjs +1 -1
  12. package/dist-lib/bridge-contract.cjs +1 -1
  13. package/dist-lib/bridge-contract.mjs +1 -1
  14. package/dist-lib/bundle-channel.cjs +113 -26
  15. package/dist-lib/capture-contract.cjs +1 -1
  16. package/dist-lib/capture-contract.mjs +1 -1
  17. package/dist-lib/cloud-contract.cjs +1 -1
  18. package/dist-lib/cloud-contract.mjs +1 -1
  19. package/dist-lib/cloud-test-args.cjs +1 -1
  20. package/dist-lib/cloud-test-args.mjs +1 -1
  21. package/dist-lib/cloud.cjs +1 -1
  22. package/dist-lib/cloud.mjs +1 -1
  23. package/dist-lib/config.cjs +1 -1
  24. package/dist-lib/config.mjs +1 -1
  25. package/dist-lib/detox/index.cjs +1 -1
  26. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  27. package/dist-lib/expo-swift-bundle.cjs +112 -25
  28. package/dist-lib/expo-swift-metadata.cjs +1 -1
  29. package/dist-lib/expo-swift-metadata.mjs +1 -1
  30. package/dist-lib/home-paths.cjs +1 -1
  31. package/dist-lib/host/bridge-host.cjs +113 -26
  32. package/dist-lib/host/fetch-proxy-handler.cjs +3 -3
  33. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  34. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  35. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  36. package/dist-lib/host/websocket-proxy.cjs +1 -1
  37. package/dist-lib/index.cjs +24 -9
  38. package/dist-lib/jump-to-source-babel.cjs +1 -1
  39. package/dist-lib/jump-to-source-native.cjs +22 -7
  40. package/dist-lib/kotlin-host.cjs +1 -1
  41. package/dist-lib/menu.cjs +1 -1
  42. package/dist-lib/menu.mjs +1 -1
  43. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  44. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  45. package/dist-lib/metro-production-bundle.cjs +1 -1
  46. package/dist-lib/metro-production-bundle.mjs +1 -1
  47. package/dist-lib/metro.cjs +24 -9
  48. package/dist-lib/native-app-identity-project.cjs +2 -2
  49. package/dist-lib/native-app-identity-project.mjs +2 -2
  50. package/dist-lib/native-app-identity.cjs +1 -1
  51. package/dist-lib/native-app-identity.mjs +1 -1
  52. package/dist-lib/native-firebase-metadata.cjs +1 -1
  53. package/dist-lib/native-firebase-metadata.mjs +1 -1
  54. package/dist-lib/pdfium-raster.cjs +1 -1
  55. package/dist-lib/pdfium-raster.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 +24 -24
  61. package/dist-lib/public-origins-lib.json +53 -53
  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 +1 -1
  67. package/dist-lib/sdk.mjs +1 -1
  68. package/dist-lib/skills.cjs +115 -28
  69. package/dist-lib/swift-compile.cjs +87 -15
  70. package/dist-lib/swift-compile.mjs +87 -15
  71. package/dist-lib/swift-package.cjs +1 -1
  72. package/dist-lib/swift-package.mjs +1 -1
  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 +88 -16
  78. package/dist-lib/vite.cjs +24 -9
  79. package/dist-lib/worklet-executable.cjs +1 -1
  80. package/dist-lib/worklet-executable.mjs +1 -1
  81. package/dist-types/packages/peach-globals/src/lockstepCaptureBridgeContract.d.ts +1 -0
  82. package/kotlin/README.md +4 -3
  83. package/kotlin/sdk.tar.gz +0 -0
  84. package/kotlin/toolchain.json +2 -2
  85. package/package.json +1 -1
  86. package/src/swift-compile.ts +1 -0
  87. package/src/swift-guest-compile.ts +2 -0
  88. package/src/swift-guest-image-ledger.ts +37 -2
  89. package/src/swift-guest-source-inputs.ts +45 -6
  90. package/src/visit-parsed-program.ts +21 -6
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2423 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2425 | (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;
@@ -15982,8 +15982,8 @@ var init_registry = __esm({
15982
15982
  {
15983
15983
  range: ">=1.0.0",
15984
15984
  coverage: 0.75,
15985
- note: "native-seam only \u2014 upstream JS runs from the bundle; SpotlightSearch accepts index/delete calls and initial item reads without a CoreSpotlight index",
15986
- working: "getInitialSearchItem, indexItem, indexItems, deleteItemsWithIdentifiers, deleteItemsInDomains, deleteAllItems, listener bookkeeping",
15985
+ note: "the published JS runs over the native seam. Index mutations reject with the CoreSpotlight indexingUnsupported error from an unavailable index.",
15986
+ working: "getInitialSearchItem resolves null without a tap-through launch; index and delete calls report CoreSpotlight indexingUnsupported through the React Native error bridge",
15987
15987
  missing: "no OS Spotlight index or tap-through launch events in the browser"
15988
15988
  }
15989
15989
  ]
@@ -45193,19 +45193,34 @@ var init_nitro_source = __esm({
45193
45193
 
45194
45194
  // src/visit-parsed-program.ts
45195
45195
  function visitParsedProgram(program, visitor) {
45196
+ const enterByType = /* @__PURE__ */ new Map();
45197
+ const exitByType = /* @__PURE__ */ new Map();
45198
+ for (const key2 of Object.keys(visitor)) {
45199
+ const handler = Reflect.get(visitor, key2);
45200
+ if (typeof handler !== "function") continue;
45201
+ const invoke = (node) => {
45202
+ handler(node);
45203
+ };
45204
+ if (key2.endsWith(":exit")) exitByType.set(key2.slice(0, -5), invoke);
45205
+ else enterByType.set(key2, invoke);
45206
+ }
45207
+ if (enterByType.size === 0 && exitByType.size === 0) return;
45208
+ const hasExit = exitByType.size > 0;
45196
45209
  function visit3(value) {
45197
45210
  if (Array.isArray(value)) {
45198
- for (const child of value) visit3(child);
45211
+ for (let i = 0; i < value.length; i++) visit3(value[i]);
45199
45212
  return;
45200
45213
  }
45201
45214
  if (!isRecord(value) || typeof value.type !== "string") return;
45202
45215
  const keys = import_oxc_parser.visitorKeys[value.type];
45203
45216
  if (!keys) return;
45204
- const enter = Reflect.get(visitor, value.type);
45205
- if (typeof enter === "function") enter(value);
45206
- for (const key2 of keys) visit3(value[key2]);
45207
- const exit = Reflect.get(visitor, `${value.type}:exit`);
45208
- if (typeof exit === "function") exit(value);
45217
+ const enter = enterByType.get(value.type);
45218
+ if (enter) enter(value);
45219
+ for (let i = 0; i < keys.length; i++) visit3(value[keys[i]]);
45220
+ if (hasExit) {
45221
+ const exit = exitByType.get(value.type);
45222
+ if (exit) exit(value);
45223
+ }
45209
45224
  }
45210
45225
  visit3(program);
45211
45226
  }
@@ -60718,7 +60733,8 @@ function rewriteObject(bytes, names, callerAlias, binding, instrumentDynamicLook
60718
60733
  if (sectionName === "linking") {
60719
60734
  const version2 = number4();
60720
60735
  if (version2 !== 2) throw new Error("unsupported wasm linking version");
60721
- const parts = [encodedString(sectionName), encodeNumber(version2)];
60736
+ const subsections = [];
60737
+ let objcLoader;
60722
60738
  while (offset < section.length) {
60723
60739
  const kind = section[offset++];
60724
60740
  const length = number4();
@@ -60781,6 +60797,9 @@ function rewriteObject(bytes, names, callerAlias, binding, instrumentDynamicLook
60781
60797
  }
60782
60798
  } else if (symbolKind === 3) number4();
60783
60799
  else throw new Error("unsupported wasm symbol kind");
60800
+ if (name3 === OBJC_LOAD_FUNCTION && symbolKind === 0 && !(flags & 16)) {
60801
+ objcLoader = i;
60802
+ }
60784
60803
  const alias = names.get(name3);
60785
60804
  if (flags & 16 && symbolKind === 1 && alias) usedSymbols.add(name3);
60786
60805
  if ((name3 === "dlsym" && usesDlsym || name3 === "dlerror" && usesDlerror) && flags & 16 && flags & 64 && symbolKind === 0) {
@@ -60830,7 +60849,36 @@ function rewriteObject(bytes, names, callerAlias, binding, instrumentDynamicLook
60830
60849
  content = Buffer.concat([...entries, ...extraEntries]);
60831
60850
  }
60832
60851
  offset = stop;
60833
- parts.push(Buffer.from([kind]), encodeNumber(content.length), content);
60852
+ subsections.push({ kind, content });
60853
+ }
60854
+ const parts = [encodedString(sectionName), encodeNumber(version2)];
60855
+ for (const subsection of subsections) {
60856
+ let content = subsection.content;
60857
+ if (subsection.kind === 6 && objcLoader !== void 0) {
60858
+ const [count, entriesStart] = readNumber(content, 0);
60859
+ const entries = [content.subarray(0, entriesStart)];
60860
+ let entryStart = entriesStart;
60861
+ for (let i = 0; i < count; i++) {
60862
+ const [, symbolStart] = readNumber(content, entryStart);
60863
+ const [symbol2, entryEnd] = readNumber(content, symbolStart);
60864
+ if (symbol2 === objcLoader) entries.push(encodeNumber(1));
60865
+ entries.push(
60866
+ content.subarray(
60867
+ symbol2 === objcLoader ? symbolStart : entryStart,
60868
+ entryEnd
60869
+ )
60870
+ );
60871
+ entryStart = entryEnd;
60872
+ }
60873
+ if (entryStart !== content.length)
60874
+ throw new Error("invalid init functions subsection");
60875
+ content = Buffer.concat(entries);
60876
+ }
60877
+ parts.push(
60878
+ Buffer.from([subsection.kind]),
60879
+ encodeNumber(content.length),
60880
+ content
60881
+ );
60834
60882
  }
60835
60883
  section = Buffer.concat(parts);
60836
60884
  }
@@ -61124,11 +61172,12 @@ function createGuestImageLedger(input) {
61124
61172
  llvmIR: ir.join("\n") + "\n"
61125
61173
  };
61126
61174
  }
61127
- var OBJC_INIT_RECORD;
61175
+ var OBJC_INIT_RECORD, OBJC_LOAD_FUNCTION;
61128
61176
  var init_swift_guest_image_ledger = __esm({
61129
61177
  "src/swift-guest-image-ledger.ts"() {
61130
61178
  "use strict";
61131
61179
  OBJC_INIT_RECORD = ".objc_init";
61180
+ OBJC_LOAD_FUNCTION = ".objcv2_load_function";
61132
61181
  }
61133
61182
  });
61134
61183
 
@@ -63785,7 +63834,7 @@ function sourceGuestClangLinkOptions(options) {
63785
63834
  commands.set(file, { tool, args: value });
63786
63835
  }
63787
63836
  }
63788
- const result = /* @__PURE__ */ new Map();
63837
+ const replays = [];
63789
63838
  for (const [index, file] of [...wanted].entries()) {
63790
63839
  const command = commands.get(file);
63791
63840
  if (!command) throw new Error(`missing source object producer ${file}`);
@@ -63811,16 +63860,33 @@ function sourceGuestClangLinkOptions(options) {
63811
63860
  throw new Error(`missing clang ${flag} for ${file}`);
63812
63861
  args[index2 + 1] = flag === "-o" ? output2 : `${output2}.d`;
63813
63862
  }
63814
- (0, import_node_child_process29.execFileSync)(
63815
- command.args[0],
63816
- [...args, "-S", "-emit-llvm", "-Xclang", "-disable-llvm-passes"],
63817
- { stdio: "inherit" }
63818
- );
63863
+ replays.push({
63864
+ file,
63865
+ compiler: command.args[0],
63866
+ args: [...args, "-S", "-emit-llvm", "-Xclang", "-disable-llvm-passes"],
63867
+ output: output2
63868
+ });
63869
+ }
63870
+ const plan = import_node_path49.default.join(options.directory, "clang-link-replays.json");
63871
+ (0, import_node_fs53.writeFileSync)(
63872
+ plan,
63873
+ JSON.stringify(replays.map(({ compiler, args }) => [compiler, ...args]))
63874
+ );
63875
+ (0, import_node_child_process29.execFileSync)(process.execPath, ["-e", PARALLEL_REPLAY], {
63876
+ stdio: "inherit",
63877
+ env: {
63878
+ ...process.env,
63879
+ PEACH_CLANG_REPLAYS: plan,
63880
+ PEACH_CLANG_JOBS: String(options.jobs)
63881
+ }
63882
+ });
63883
+ const result = /* @__PURE__ */ new Map();
63884
+ for (const { file, output: output2 } of replays) {
63819
63885
  const flags = clangIrLinkOptions((0, import_node_fs53.readFileSync)(output2, "utf8"));
63820
- for (let index2 = 0; index2 < flags.length; index2++) {
63821
- const flag = flags[index2];
63886
+ for (let index = 0; index < flags.length; index++) {
63887
+ const flag = flags[index];
63822
63888
  if (flag === "-framework" || flag === "-l" || flag === "--library") {
63823
- const name3 = flags[++index2];
63889
+ const name3 = flags[++index];
63824
63890
  if (!name3 || name3.startsWith("-"))
63825
63891
  throw new Error(`missing clang link name after ${flag}`);
63826
63892
  } else if (!/^(-l.+|--library=.+)$/.test(flag)) {
@@ -64046,7 +64112,7 @@ function logicalGuestLinkOptions(args, identities, roots) {
64046
64112
  }
64047
64113
  return output2;
64048
64114
  }
64049
- var import_node_child_process29, import_node_crypto28, import_node_fs53, import_node_path49, CLANG_TARGET_MODULE_WRAPPER;
64115
+ var import_node_child_process29, import_node_crypto28, import_node_fs53, import_node_path49, CLANG_TARGET_MODULE_WRAPPER, PARALLEL_REPLAY;
64050
64116
  var init_swift_guest_source_inputs = __esm({
64051
64117
  "src/swift-guest-source-inputs.ts"() {
64052
64118
  "use strict";
@@ -64057,6 +64123,25 @@ var init_swift_guest_source_inputs = __esm({
64057
64123
  init_swift_guest_source_plan();
64058
64124
  init_swift_runtime_products();
64059
64125
  CLANG_TARGET_MODULE_WRAPPER = ".peach-clang";
64126
+ PARALLEL_REPLAY = `
64127
+ const { spawn } = require('node:child_process')
64128
+ const commands = JSON.parse(require('node:fs').readFileSync(process.env.PEACH_CLANG_REPLAYS, 'utf8'))
64129
+ let next = 0
64130
+ const run = () => {
64131
+ if (next >= commands.length) return Promise.resolve()
64132
+ const [file, ...args] = commands[next++]
64133
+ return new Promise((resolve, reject) => {
64134
+ const child = spawn(file, args, { stdio: 'inherit' })
64135
+ child.on('error', reject)
64136
+ child.on('close', (code) => (code === 0 ? resolve() : reject(new Error('clang link replay failed: ' + file))))
64137
+ }).then(run)
64138
+ }
64139
+ const jobs = Math.max(1, Number(process.env.PEACH_CLANG_JOBS) || 1)
64140
+ Promise.all(Array.from({ length: jobs }, run)).catch((error) => {
64141
+ console.error(error.message)
64142
+ process.exit(1)
64143
+ })
64144
+ `;
64060
64145
  }
64061
64146
  });
64062
64147
 
@@ -64631,7 +64716,8 @@ async function compileGuestLink(options) {
64631
64716
  directory: directory2,
64632
64717
  toolchainBin: options.toolchainBin,
64633
64718
  swiftCompiler: options.swiftCompiler,
64634
- objects: selectedSource.map((artifact) => artifact.path)
64719
+ objects: selectedSource.map((artifact) => artifact.path),
64720
+ jobs: options.jobs
64635
64721
  });
64636
64722
  const links = sourceGuestRuntimeLinks({
64637
64723
  toolchainBin: options.toolchainBin,
@@ -71308,7 +71394,8 @@ function compileSwiftProjectOnce(input, options) {
71308
71394
  generatedOwners: preparation.generatedOwners,
71309
71395
  output: output2,
71310
71396
  optimized,
71311
- optimize: input.optimize === true
71397
+ optimize: input.optimize === true,
71398
+ jobs: swiftBuildJobs()
71312
71399
  });
71313
71400
  else
71314
71401
  await lowerWasm(output2, optimized, { optimize: input.optimize === true });
@@ -71578,7 +71665,7 @@ int EXUpdatesApplyBSDiffPatch(const char * _Nonnull oldFilePath,
71578
71665
  REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
71579
71666
  MULTI_MANIFEST_VERSION = 72;
71580
71667
  SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
71581
- compilerSourceDigest = true ? "886349932526d72a5a1493acbcd1799ec941afd89998ad0eab64bbe9c48afb95" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
71668
+ compilerSourceDigest = true ? "714dbca336e958240697a0238ee5b0640b2b212c34df4843e82d0c1abe3e8c43" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
71582
71669
  nativeCxxCompilerFlags = ["-fno-cxx-modules"];
71583
71670
  cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
71584
71671
  cxxFlagArray = (flags) => JSON.stringify([...nativeCxxCompilerFlags, ...withoutGlogModuleMap(flags)]);
@@ -78327,7 +78414,7 @@ var init_swift_standin_digest = __esm({
78327
78414
  STANDIN_DIGEST_ENTRYPOINTS = ["swift-standins.ts", "swift-objc-compile.ts"];
78328
78415
  SPECIFIER = /from\s*['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
78329
78416
  standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
78330
- STANDIN_SOURCE_DIGEST = true ? "2913d6a693b8a1c42193c1962c3468c2f8bc68c78a2f2f52961ca5efe03d1e67" : standinSourceDigest();
78417
+ STANDIN_SOURCE_DIGEST = true ? "3a0e0016967d34924d12848e05752d3902596cc16a0f603a5fda32cb024d02f8" : standinSourceDigest();
78331
78418
  }
78332
78419
  });
78333
78420
 
@@ -78822,7 +78909,7 @@ __export(expo_native_prebuilt_exports, {
78822
78909
  servedExpoSwift: () => servedExpoSwift
78823
78910
  });
78824
78911
  function expoNativeCompilerDigestValue() {
78825
- return true ? "5a193936cb2c362dd919d9127e9318122bd8e86f9c6e05cbe56c4c6580a4636a" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
78912
+ return true ? "305cb9d6b64ebf2397b29848afd9b634d4012fc3eb51d696e9bdda10ea074097" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
78826
78913
  }
78827
78914
  function readSources(value) {
78828
78915
  const sources = isRecord(value) ? value.sources : null;
@@ -102025,7 +102112,7 @@ var init_nitro_superset = __esm({
102025
102112
  init_nitroContract();
102026
102113
  init_swift_standin_digest();
102027
102114
  NITRO_SUPERSET_ENTRY_NAME = "superset";
102028
- NITRO_COMPILER_DIGEST = true ? "a6905cb4da4fec9b5ef03b34b0b2891e3ed553f5571d77e24e075fa7c483b0a9" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
102115
+ NITRO_COMPILER_DIGEST = true ? "5e8f14caf06af284e971f4107b94fe6d6979dd2ac0da718416a93c6e36e8e2a0" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
102029
102116
  nitroSupersetLock = parseLock(nitro_superset_lock_default);
102030
102117
  nitroSupersetKey = (inputs) => nativeEntryKey({ ...inputs, compiler: NITRO_COMPILER_DIGEST });
102031
102118
  published2 = /* @__PURE__ */ new Map();
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2423 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2425 | (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;
@@ -7147,6 +7147,7 @@ function llvmType(value) {
7147
7147
  }
7148
7148
  }
7149
7149
  var OBJC_INIT_RECORD = ".objc_init";
7150
+ var OBJC_LOAD_FUNCTION = ".objcv2_load_function";
7150
7151
  function rewriteObject(bytes, names, callerAlias, binding, instrumentDynamicLookups, preserveCanonical) {
7151
7152
  if (Buffer.from(bytes.subarray(0, 8)).toString("hex") !== "0061736d01000000")
7152
7153
  throw new Error("expected wasm object");
@@ -7256,7 +7257,8 @@ function rewriteObject(bytes, names, callerAlias, binding, instrumentDynamicLook
7256
7257
  if (sectionName === "linking") {
7257
7258
  const version2 = number3();
7258
7259
  if (version2 !== 2) throw new Error("unsupported wasm linking version");
7259
- const parts = [encodedString(sectionName), encodeNumber(version2)];
7260
+ const subsections = [];
7261
+ let objcLoader;
7260
7262
  while (offset < section.length) {
7261
7263
  const kind = section[offset++];
7262
7264
  const length = number3();
@@ -7319,6 +7321,9 @@ function rewriteObject(bytes, names, callerAlias, binding, instrumentDynamicLook
7319
7321
  }
7320
7322
  } else if (symbolKind === 3) number3();
7321
7323
  else throw new Error("unsupported wasm symbol kind");
7324
+ if (name2 === OBJC_LOAD_FUNCTION && symbolKind === 0 && !(flags & 16)) {
7325
+ objcLoader = i;
7326
+ }
7322
7327
  const alias = names.get(name2);
7323
7328
  if (flags & 16 && symbolKind === 1 && alias) usedSymbols.add(name2);
7324
7329
  if ((name2 === "dlsym" && usesDlsym || name2 === "dlerror" && usesDlerror) && flags & 16 && flags & 64 && symbolKind === 0) {
@@ -7368,7 +7373,36 @@ function rewriteObject(bytes, names, callerAlias, binding, instrumentDynamicLook
7368
7373
  content = Buffer.concat([...entries, ...extraEntries]);
7369
7374
  }
7370
7375
  offset = stop;
7371
- parts.push(Buffer.from([kind]), encodeNumber(content.length), content);
7376
+ subsections.push({ kind, content });
7377
+ }
7378
+ const parts = [encodedString(sectionName), encodeNumber(version2)];
7379
+ for (const subsection of subsections) {
7380
+ let content = subsection.content;
7381
+ if (subsection.kind === 6 && objcLoader !== void 0) {
7382
+ const [count, entriesStart] = readNumber(content, 0);
7383
+ const entries = [content.subarray(0, entriesStart)];
7384
+ let entryStart = entriesStart;
7385
+ for (let i = 0; i < count; i++) {
7386
+ const [, symbolStart] = readNumber(content, entryStart);
7387
+ const [symbol, entryEnd] = readNumber(content, symbolStart);
7388
+ if (symbol === objcLoader) entries.push(encodeNumber(1));
7389
+ entries.push(
7390
+ content.subarray(
7391
+ symbol === objcLoader ? symbolStart : entryStart,
7392
+ entryEnd
7393
+ )
7394
+ );
7395
+ entryStart = entryEnd;
7396
+ }
7397
+ if (entryStart !== content.length)
7398
+ throw new Error("invalid init functions subsection");
7399
+ content = Buffer.concat(entries);
7400
+ }
7401
+ parts.push(
7402
+ Buffer.from([subsection.kind]),
7403
+ encodeNumber(content.length),
7404
+ content
7405
+ );
7372
7406
  }
7373
7407
  section = Buffer.concat(parts);
7374
7408
  }
@@ -10206,6 +10240,25 @@ function clangIrLinkOptions(ir) {
10206
10240
  return result;
10207
10241
  }
10208
10242
  var CLANG_TARGET_MODULE_WRAPPER = ".peach-clang";
10243
+ var PARALLEL_REPLAY = `
10244
+ const { spawn } = require('node:child_process')
10245
+ const commands = JSON.parse(require('node:fs').readFileSync(process.env.PEACH_CLANG_REPLAYS, 'utf8'))
10246
+ let next = 0
10247
+ const run = () => {
10248
+ if (next >= commands.length) return Promise.resolve()
10249
+ const [file, ...args] = commands[next++]
10250
+ return new Promise((resolve, reject) => {
10251
+ const child = spawn(file, args, { stdio: 'inherit' })
10252
+ child.on('error', reject)
10253
+ child.on('close', (code) => (code === 0 ? resolve() : reject(new Error('clang link replay failed: ' + file))))
10254
+ }).then(run)
10255
+ }
10256
+ const jobs = Math.max(1, Number(process.env.PEACH_CLANG_JOBS) || 1)
10257
+ Promise.all(Array.from({ length: jobs }, run)).catch((error) => {
10258
+ console.error(error.message)
10259
+ process.exit(1)
10260
+ })
10261
+ `;
10209
10262
  function sourceGuestClangLinkOptions(options) {
10210
10263
  const wanted = new Set(options.objects.map((file) => import_node_path15.default.resolve(file)));
10211
10264
  const commands = /* @__PURE__ */ new Map();
@@ -10239,7 +10292,7 @@ function sourceGuestClangLinkOptions(options) {
10239
10292
  commands.set(file, { tool, args: value });
10240
10293
  }
10241
10294
  }
10242
- const result = /* @__PURE__ */ new Map();
10295
+ const replays = [];
10243
10296
  for (const [index, file] of [...wanted].entries()) {
10244
10297
  const command = commands.get(file);
10245
10298
  if (!command) throw new Error(`missing source object producer ${file}`);
@@ -10265,16 +10318,33 @@ function sourceGuestClangLinkOptions(options) {
10265
10318
  throw new Error(`missing clang ${flag} for ${file}`);
10266
10319
  args[index2 + 1] = flag === "-o" ? output : `${output}.d`;
10267
10320
  }
10268
- (0, import_node_child_process11.execFileSync)(
10269
- command.args[0],
10270
- [...args, "-S", "-emit-llvm", "-Xclang", "-disable-llvm-passes"],
10271
- { stdio: "inherit" }
10272
- );
10321
+ replays.push({
10322
+ file,
10323
+ compiler: command.args[0],
10324
+ args: [...args, "-S", "-emit-llvm", "-Xclang", "-disable-llvm-passes"],
10325
+ output
10326
+ });
10327
+ }
10328
+ const plan = import_node_path15.default.join(options.directory, "clang-link-replays.json");
10329
+ (0, import_node_fs15.writeFileSync)(
10330
+ plan,
10331
+ JSON.stringify(replays.map(({ compiler, args }) => [compiler, ...args]))
10332
+ );
10333
+ (0, import_node_child_process11.execFileSync)(process.execPath, ["-e", PARALLEL_REPLAY], {
10334
+ stdio: "inherit",
10335
+ env: {
10336
+ ...process.env,
10337
+ PEACH_CLANG_REPLAYS: plan,
10338
+ PEACH_CLANG_JOBS: String(options.jobs)
10339
+ }
10340
+ });
10341
+ const result = /* @__PURE__ */ new Map();
10342
+ for (const { file, output } of replays) {
10273
10343
  const flags = clangIrLinkOptions((0, import_node_fs15.readFileSync)(output, "utf8"));
10274
- for (let index2 = 0; index2 < flags.length; index2++) {
10275
- const flag = flags[index2];
10344
+ for (let index = 0; index < flags.length; index++) {
10345
+ const flag = flags[index];
10276
10346
  if (flag === "-framework" || flag === "-l" || flag === "--library") {
10277
- const name2 = flags[++index2];
10347
+ const name2 = flags[++index];
10278
10348
  if (!name2 || name2.startsWith("-"))
10279
10349
  throw new Error(`missing clang link name after ${flag}`);
10280
10350
  } else if (!/^(-l.+|--library=.+)$/.test(flag)) {
@@ -11339,7 +11409,8 @@ async function compileGuestLink(options) {
11339
11409
  directory,
11340
11410
  toolchainBin: options.toolchainBin,
11341
11411
  swiftCompiler: options.swiftCompiler,
11342
- objects: selectedSource.map((artifact) => artifact.path)
11412
+ objects: selectedSource.map((artifact) => artifact.path),
11413
+ jobs: options.jobs
11343
11414
  });
11344
11415
  const links = sourceGuestRuntimeLinks({
11345
11416
  toolchainBin: options.toolchainBin,
@@ -13985,7 +14056,7 @@ var darwinRecordsRegion = (quoted2) => quoted2.length ? ["-Wl,--start-lib", ...q
13985
14056
  var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
13986
14057
  var MULTI_MANIFEST_VERSION = 72;
13987
14058
  var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
13988
- var compilerSourceDigest = true ? "886349932526d72a5a1493acbcd1799ec941afd89998ad0eab64bbe9c48afb95" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
14059
+ var compilerSourceDigest = true ? "714dbca336e958240697a0238ee5b0640b2b212c34df4843e82d0c1abe3e8c43" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
13989
14060
  function swiftArtifactHash(input, release, moduleRoot) {
13990
14061
  const hash = (0, import_node_crypto15.createHash)("sha256");
13991
14062
  hash.update(`swift-compile
@@ -18840,7 +18911,8 @@ function compileSwiftProjectOnce(input, options) {
18840
18911
  generatedOwners: preparation.generatedOwners,
18841
18912
  output,
18842
18913
  optimized,
18843
- optimize: input.optimize === true
18914
+ optimize: input.optimize === true,
18915
+ jobs: swiftBuildJobs()
18844
18916
  });
18845
18917
  else
18846
18918
  await lowerWasm(output, optimized, { optimize: input.optimize === true });
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2423 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2425 | (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);
@@ -7101,6 +7101,7 @@ function llvmType(value) {
7101
7101
  }
7102
7102
  }
7103
7103
  var OBJC_INIT_RECORD = ".objc_init";
7104
+ var OBJC_LOAD_FUNCTION = ".objcv2_load_function";
7104
7105
  function rewriteObject(bytes, names, callerAlias, binding, instrumentDynamicLookups, preserveCanonical) {
7105
7106
  if (Buffer.from(bytes.subarray(0, 8)).toString("hex") !== "0061736d01000000")
7106
7107
  throw new Error("expected wasm object");
@@ -7210,7 +7211,8 @@ function rewriteObject(bytes, names, callerAlias, binding, instrumentDynamicLook
7210
7211
  if (sectionName === "linking") {
7211
7212
  const version2 = number3();
7212
7213
  if (version2 !== 2) throw new Error("unsupported wasm linking version");
7213
- const parts = [encodedString(sectionName), encodeNumber(version2)];
7214
+ const subsections = [];
7215
+ let objcLoader;
7214
7216
  while (offset < section.length) {
7215
7217
  const kind = section[offset++];
7216
7218
  const length = number3();
@@ -7273,6 +7275,9 @@ function rewriteObject(bytes, names, callerAlias, binding, instrumentDynamicLook
7273
7275
  }
7274
7276
  } else if (symbolKind === 3) number3();
7275
7277
  else throw new Error("unsupported wasm symbol kind");
7278
+ if (name2 === OBJC_LOAD_FUNCTION && symbolKind === 0 && !(flags & 16)) {
7279
+ objcLoader = i;
7280
+ }
7276
7281
  const alias = names.get(name2);
7277
7282
  if (flags & 16 && symbolKind === 1 && alias) usedSymbols.add(name2);
7278
7283
  if ((name2 === "dlsym" && usesDlsym || name2 === "dlerror" && usesDlerror) && flags & 16 && flags & 64 && symbolKind === 0) {
@@ -7322,7 +7327,36 @@ function rewriteObject(bytes, names, callerAlias, binding, instrumentDynamicLook
7322
7327
  content = Buffer.concat([...entries, ...extraEntries]);
7323
7328
  }
7324
7329
  offset = stop;
7325
- parts.push(Buffer.from([kind]), encodeNumber(content.length), content);
7330
+ subsections.push({ kind, content });
7331
+ }
7332
+ const parts = [encodedString(sectionName), encodeNumber(version2)];
7333
+ for (const subsection of subsections) {
7334
+ let content = subsection.content;
7335
+ if (subsection.kind === 6 && objcLoader !== void 0) {
7336
+ const [count, entriesStart] = readNumber(content, 0);
7337
+ const entries = [content.subarray(0, entriesStart)];
7338
+ let entryStart = entriesStart;
7339
+ for (let i = 0; i < count; i++) {
7340
+ const [, symbolStart] = readNumber(content, entryStart);
7341
+ const [symbol, entryEnd] = readNumber(content, symbolStart);
7342
+ if (symbol === objcLoader) entries.push(encodeNumber(1));
7343
+ entries.push(
7344
+ content.subarray(
7345
+ symbol === objcLoader ? symbolStart : entryStart,
7346
+ entryEnd
7347
+ )
7348
+ );
7349
+ entryStart = entryEnd;
7350
+ }
7351
+ if (entryStart !== content.length)
7352
+ throw new Error("invalid init functions subsection");
7353
+ content = Buffer.concat(entries);
7354
+ }
7355
+ parts.push(
7356
+ Buffer.from([subsection.kind]),
7357
+ encodeNumber(content.length),
7358
+ content
7359
+ );
7326
7360
  }
7327
7361
  section = Buffer.concat(parts);
7328
7362
  }
@@ -10161,6 +10195,25 @@ function clangIrLinkOptions(ir) {
10161
10195
  return result;
10162
10196
  }
10163
10197
  var CLANG_TARGET_MODULE_WRAPPER = ".peach-clang";
10198
+ var PARALLEL_REPLAY = `
10199
+ const { spawn } = require('node:child_process')
10200
+ const commands = JSON.parse(require('node:fs').readFileSync(process.env.PEACH_CLANG_REPLAYS, 'utf8'))
10201
+ let next = 0
10202
+ const run = () => {
10203
+ if (next >= commands.length) return Promise.resolve()
10204
+ const [file, ...args] = commands[next++]
10205
+ return new Promise((resolve, reject) => {
10206
+ const child = spawn(file, args, { stdio: 'inherit' })
10207
+ child.on('error', reject)
10208
+ child.on('close', (code) => (code === 0 ? resolve() : reject(new Error('clang link replay failed: ' + file))))
10209
+ }).then(run)
10210
+ }
10211
+ const jobs = Math.max(1, Number(process.env.PEACH_CLANG_JOBS) || 1)
10212
+ Promise.all(Array.from({ length: jobs }, run)).catch((error) => {
10213
+ console.error(error.message)
10214
+ process.exit(1)
10215
+ })
10216
+ `;
10164
10217
  function sourceGuestClangLinkOptions(options) {
10165
10218
  const wanted = new Set(options.objects.map((file) => path17.resolve(file)));
10166
10219
  const commands = /* @__PURE__ */ new Map();
@@ -10194,7 +10247,7 @@ function sourceGuestClangLinkOptions(options) {
10194
10247
  commands.set(file, { tool, args: value });
10195
10248
  }
10196
10249
  }
10197
- const result = /* @__PURE__ */ new Map();
10250
+ const replays = [];
10198
10251
  for (const [index, file] of [...wanted].entries()) {
10199
10252
  const command = commands.get(file);
10200
10253
  if (!command) throw new Error(`missing source object producer ${file}`);
@@ -10220,16 +10273,33 @@ function sourceGuestClangLinkOptions(options) {
10220
10273
  throw new Error(`missing clang ${flag} for ${file}`);
10221
10274
  args[index2 + 1] = flag === "-o" ? output : `${output}.d`;
10222
10275
  }
10223
- execFileSync8(
10224
- command.args[0],
10225
- [...args, "-S", "-emit-llvm", "-Xclang", "-disable-llvm-passes"],
10226
- { stdio: "inherit" }
10227
- );
10276
+ replays.push({
10277
+ file,
10278
+ compiler: command.args[0],
10279
+ args: [...args, "-S", "-emit-llvm", "-Xclang", "-disable-llvm-passes"],
10280
+ output
10281
+ });
10282
+ }
10283
+ const plan = path17.join(options.directory, "clang-link-replays.json");
10284
+ writeFileSync4(
10285
+ plan,
10286
+ JSON.stringify(replays.map(({ compiler, args }) => [compiler, ...args]))
10287
+ );
10288
+ execFileSync8(process.execPath, ["-e", PARALLEL_REPLAY], {
10289
+ stdio: "inherit",
10290
+ env: {
10291
+ ...process.env,
10292
+ PEACH_CLANG_REPLAYS: plan,
10293
+ PEACH_CLANG_JOBS: String(options.jobs)
10294
+ }
10295
+ });
10296
+ const result = /* @__PURE__ */ new Map();
10297
+ for (const { file, output } of replays) {
10228
10298
  const flags = clangIrLinkOptions(readFileSync11(output, "utf8"));
10229
- for (let index2 = 0; index2 < flags.length; index2++) {
10230
- const flag = flags[index2];
10299
+ for (let index = 0; index < flags.length; index++) {
10300
+ const flag = flags[index];
10231
10301
  if (flag === "-framework" || flag === "-l" || flag === "--library") {
10232
- const name2 = flags[++index2];
10302
+ const name2 = flags[++index];
10233
10303
  if (!name2 || name2.startsWith("-"))
10234
10304
  throw new Error(`missing clang link name after ${flag}`);
10235
10305
  } else if (!/^(-l.+|--library=.+)$/.test(flag)) {
@@ -11302,7 +11372,8 @@ async function compileGuestLink(options) {
11302
11372
  directory,
11303
11373
  toolchainBin: options.toolchainBin,
11304
11374
  swiftCompiler: options.swiftCompiler,
11305
- objects: selectedSource.map((artifact) => artifact.path)
11375
+ objects: selectedSource.map((artifact) => artifact.path),
11376
+ jobs: options.jobs
11306
11377
  });
11307
11378
  const links = sourceGuestRuntimeLinks({
11308
11379
  toolchainBin: options.toolchainBin,
@@ -13984,7 +14055,7 @@ var darwinRecordsRegion = (quoted2) => quoted2.length ? ["-Wl,--start-lib", ...q
13984
14055
  var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
13985
14056
  var MULTI_MANIFEST_VERSION = 72;
13986
14057
  var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
13987
- var compilerSourceDigest = true ? "886349932526d72a5a1493acbcd1799ec941afd89998ad0eab64bbe9c48afb95" : swiftCompilerSourceDigest(import.meta.dirname);
14058
+ var compilerSourceDigest = true ? "714dbca336e958240697a0238ee5b0640b2b212c34df4843e82d0c1abe3e8c43" : swiftCompilerSourceDigest(import.meta.dirname);
13988
14059
  function swiftArtifactHash(input, release, moduleRoot) {
13989
14060
  const hash = createHash15("sha256");
13990
14061
  hash.update(`swift-compile
@@ -18839,7 +18910,8 @@ function compileSwiftProjectOnce(input, options) {
18839
18910
  generatedOwners: preparation.generatedOwners,
18840
18911
  output,
18841
18912
  optimized,
18842
- optimize: input.optimize === true
18913
+ optimize: input.optimize === true,
18914
+ jobs: swiftBuildJobs()
18843
18915
  });
18844
18916
  else
18845
18917
  await lowerWasm(output, optimized, { optimize: input.optimize === true });
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2423 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2425 | (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.2423 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2425 | (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.2423 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2425 | (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.2423 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2425 | (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.2423 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2425 | (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;