peachsim 0.1.2738 → 0.1.2743

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 (133) hide show
  1. package/dist-lib/agent-daemon-client.cjs +1 -1
  2. package/dist-lib/agent-events.cjs +1 -1
  3. package/dist-lib/attached-projects.cjs +1 -1
  4. package/dist-lib/auth/shared-session.cjs +1 -1
  5. package/dist-lib/backend-origin.cjs +1 -1
  6. package/dist-lib/beta.cjs +1 -1
  7. package/dist-lib/beta.mjs +2 -2
  8. package/dist-lib/bridge-constants.cjs +1 -1
  9. package/dist-lib/bridge-contract-input.cjs +1 -1
  10. package/dist-lib/bridge-contract-input.mjs +5 -5
  11. package/dist-lib/bridge-contract.cjs +1 -1
  12. package/dist-lib/bridge-contract.mjs +3 -3
  13. package/dist-lib/bundle-channel.cjs +310 -185
  14. package/dist-lib/capture-contract.cjs +1 -1
  15. package/dist-lib/capture-contract.mjs +3 -3
  16. package/dist-lib/cloud-contract.cjs +1 -1
  17. package/dist-lib/cloud-contract.mjs +3 -3
  18. package/dist-lib/cloud-test-args.cjs +1 -1
  19. package/dist-lib/cloud-test-args.mjs +2 -2
  20. package/dist-lib/cloud.cjs +1 -1
  21. package/dist-lib/cloud.mjs +7 -7
  22. package/dist-lib/config.cjs +1 -1
  23. package/dist-lib/config.mjs +5 -5
  24. package/dist-lib/detox/index.cjs +1 -1
  25. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  26. package/dist-lib/esm-chunks/{acorn-Q6ATHJ5Q.mjs → acorn-4LW63VJO.mjs} +3 -3
  27. package/dist-lib/esm-chunks/{chunk-WCK2HANP.mjs → chunk-23OQSLRP.mjs} +289 -182
  28. package/dist-lib/esm-chunks/{chunk-PKLW5P4C.mjs → chunk-2HP5FPCA.mjs} +1 -1
  29. package/dist-lib/esm-chunks/{chunk-V3CW4EN6.mjs → chunk-6FHNPTCA.mjs} +13 -7
  30. package/dist-lib/esm-chunks/{chunk-7JFDXIZQ.mjs → chunk-7NBU6OXB.mjs} +4 -4
  31. package/dist-lib/esm-chunks/{chunk-5NOBLXKV.mjs → chunk-B3F4HKM6.mjs} +5 -5
  32. package/dist-lib/esm-chunks/{chunk-3FBJGWPT.mjs → chunk-BJSA6VP6.mjs} +1 -1
  33. package/dist-lib/esm-chunks/{chunk-YMCYBEB7.mjs → chunk-BNJ5YG7V.mjs} +2 -2
  34. package/dist-lib/esm-chunks/{chunk-BQW3EWAQ.mjs → chunk-BQUYNIMY.mjs} +1 -1
  35. package/dist-lib/esm-chunks/{chunk-EU6UNSUW.mjs → chunk-BW3KZJV5.mjs} +1 -1
  36. package/dist-lib/esm-chunks/{chunk-YU4ISPGO.mjs → chunk-EAAYQS4L.mjs} +1 -1
  37. package/dist-lib/esm-chunks/{chunk-ZXORDMAT.mjs → chunk-EES2SLJK.mjs} +1 -1
  38. package/dist-lib/esm-chunks/{chunk-XJDM6LFX.mjs → chunk-GIZQHA6L.mjs} +6 -6
  39. package/dist-lib/esm-chunks/{chunk-ONFP5RP7.mjs → chunk-HOUFNDEV.mjs} +1 -1
  40. package/dist-lib/esm-chunks/{chunk-3CPES2EZ.mjs → chunk-JHOZWSFF.mjs} +1 -1
  41. package/dist-lib/esm-chunks/{chunk-NMGEJJ2J.mjs → chunk-LVCSLWR2.mjs} +1 -1
  42. package/dist-lib/esm-chunks/{chunk-GI5VVEKN.mjs → chunk-OEQBNK6V.mjs} +1 -1
  43. package/dist-lib/esm-chunks/{chunk-P72RUOTY.mjs → chunk-SG7MN2KW.mjs} +3 -3
  44. package/dist-lib/esm-chunks/{chunk-6Q3JLKPD.mjs → chunk-THJMTM3L.mjs} +1 -1
  45. package/dist-lib/esm-chunks/{chunk-KDIDYS42.mjs → chunk-THSR72MV.mjs} +1 -1
  46. package/dist-lib/esm-chunks/{chunk-HLWFKLLD.mjs → chunk-V3SRJIBE.mjs} +1 -1
  47. package/dist-lib/esm-chunks/{chunk-TBX7JBPC.mjs → chunk-VJKLZAU2.mjs} +1 -1
  48. package/dist-lib/esm-chunks/{chunk-JDLZMI2L.mjs → chunk-WKGJ6LAU.mjs} +1 -1
  49. package/dist-lib/esm-chunks/{chunk-2FSMFZ42.mjs → chunk-XP5F6PNN.mjs} +1 -1
  50. package/dist-lib/esm-chunks/{chunk-2EW5XIGF.mjs → chunk-ZLQX4SVV.mjs} +1 -1
  51. package/dist-lib/esm-chunks/{metro-layout-parser-R2UJPOJL.mjs → metro-layout-parser-L57PU3TD.mjs} +3 -3
  52. package/dist-lib/esm-chunks/{swift-package-prebuilt-W34QYBXU.mjs → swift-package-prebuilt-UNXWJN7B.mjs} +12 -12
  53. package/dist-lib/esm-chunks/{swift-sdk-app-module-RO5AZPWM.mjs → swift-sdk-app-module-DZV3XYCP.mjs} +16 -16
  54. package/dist-lib/esm-chunks/{swift-sdk-image-CWTI76JI.mjs → swift-sdk-image-WRYMP64Z.mjs} +16 -16
  55. package/dist-lib/esm-chunks/{swift-sdk-image-producer-JGTU2ZCE.mjs → swift-sdk-image-producer-D6DOCCCR.mjs} +5 -5
  56. package/dist-lib/expo-swift-bundle.cjs +310 -185
  57. package/dist-lib/expo-swift-metadata.cjs +1 -1
  58. package/dist-lib/expo-swift-metadata.mjs +7 -7
  59. package/dist-lib/home-paths.cjs +1 -1
  60. package/dist-lib/host/bridge-host.cjs +3782 -1684
  61. package/dist-lib/host/fetch-proxy-handler.cjs +41 -10
  62. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  63. package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
  64. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  65. package/dist-lib/host/websocket-proxy.cjs +1 -1
  66. package/dist-lib/index.cjs +1 -1
  67. package/dist-lib/kotlin-host.cjs +1 -1
  68. package/dist-lib/menu.cjs +1 -1
  69. package/dist-lib/menu.mjs +3 -3
  70. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  71. package/dist-lib/metro-fingerprint-registry.mjs +3 -3
  72. package/dist-lib/metro-production-bundle.cjs +1 -1
  73. package/dist-lib/metro-production-bundle.mjs +4 -4
  74. package/dist-lib/native-app-identity-project.cjs +1 -1
  75. package/dist-lib/native-app-identity-project.mjs +15 -15
  76. package/dist-lib/native-app-identity.cjs +1 -1
  77. package/dist-lib/native-app-identity.mjs +6 -6
  78. package/dist-lib/native-firebase-metadata.cjs +1 -1
  79. package/dist-lib/native-firebase-metadata.mjs +3 -3
  80. package/dist-lib/pdfium-raster.cjs +1 -1
  81. package/dist-lib/pdfium-raster.mjs +2 -2
  82. package/dist-lib/plist.cjs +1 -1
  83. package/dist-lib/plist.mjs +3 -3
  84. package/dist-lib/profiles.cjs +1 -1
  85. package/dist-lib/public-brand.cjs +1 -1
  86. package/dist-lib/public-origins-lib-esm.json +88 -86
  87. package/dist-lib/public-origins-lib.json +86 -72
  88. package/dist-lib/react-native-host-modules.cjs +1 -1
  89. package/dist-lib/react-native-host-modules.mjs +2 -2
  90. package/dist-lib/reap-browser.cjs +1 -1
  91. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  92. package/dist-lib/sdk.cjs +1 -1
  93. package/dist-lib/sdk.mjs +8 -8
  94. package/dist-lib/skills.cjs +4213 -2115
  95. package/dist-lib/swift-compile.cjs +303 -178
  96. package/dist-lib/swift-compile.mjs +12 -12
  97. package/dist-lib/swift-package.cjs +1 -1
  98. package/dist-lib/swift-package.mjs +3 -3
  99. package/dist-lib/swift-submit.cjs +1 -1
  100. package/dist-lib/swift-submit.mjs +6 -6
  101. package/dist-lib/swift-svg-raster.cjs +1 -1
  102. package/dist-lib/swift-svg-raster.mjs +2 -2
  103. package/dist-lib/swift-toolchain.cjs +1 -1
  104. package/dist-lib/swift.cjs +1 -1
  105. package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
  106. package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
  107. package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
  108. package/dist-lib/vendor/acorn.cjs +1 -1
  109. package/dist-lib/vendor/magic-string.cjs +1 -1
  110. package/dist-lib/vendor/stream-json.cjs +1 -1
  111. package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
  112. package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
  113. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
  114. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
  115. package/dist-lib/vendor/sucrase.cjs +1 -1
  116. package/dist-lib/vendor/terser.cjs +1 -1
  117. package/dist-lib/vendor/valibot.cjs +1 -1
  118. package/dist-lib/vendor/ws.cjs +1 -1
  119. package/dist-lib/vendor/zod.cjs +1 -1
  120. package/dist-lib/worklet-executable.cjs +1 -1
  121. package/dist-lib/worklet-executable.mjs +3 -3
  122. package/dist-types/packages/peach-engine/src/engine/canvaskit-api.d.ts +1 -1
  123. package/dist-types/packages/peach-engine/src/engine/effects-shader-registry.d.ts +2 -12
  124. package/dist-types/packages/peach-engine/src/engine/native-font-dataContract.d.ts +1 -0
  125. package/dist-types/packages/peach-engine/src/engine/native-style-store.d.ts +1 -1
  126. package/dist-types/packages/peach-engine/src/engine/scene-native-binding.d.ts +0 -1
  127. package/dist-types/packages/peach-kit/src/ui/hosting-safe-area.d.ts +17 -1
  128. package/package.json +1 -1
  129. package/src/one-direct-host-source.ts +254 -0
  130. package/src/one-native-controls-package.ts +99 -21
  131. package/src/swift-compile.ts +145 -120
  132. package/src/swift-sdk-image-map.ts +35 -0
  133. package/src/swift-sdk-image.ts +12 -2
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2738 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2743 | (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;
@@ -19556,7 +19556,7 @@ var init_react_native_core_digest = __esm({
19556
19556
 
19557
19557
  // src/swift-compiler-digest.ts
19558
19558
  function swiftArchiveCompilerDigestValue() {
19559
- return true ? "ba57c6602ec67731a03d03d9b6cfb00b968bcaebed666965114ef2e2ce60a22e" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname, "archive");
19559
+ return true ? "e036567f599b9df239e4332b34b546043c5d1c41996348475482e91ed8b42366" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname, "archive");
19560
19560
  }
19561
19561
  var import_node_crypto16, import_node_fs32, import_node_path31, SWIFT_DIGEST_SOURCES, LINKED_IMAGE_SOURCES, SWIFT_ARCHIVE_DIGEST_SOURCES;
19562
19562
  var init_swift_compiler_digest = __esm({
@@ -19707,7 +19707,7 @@ var init_swift_standin_digest = __esm({
19707
19707
 
19708
19708
  // src/expo-native-compiler-digest.ts
19709
19709
  function expoNativeCompilerDigestValue() {
19710
- return true ? "46089d0b4c697526f51a8ccb5f266fb988a3ce3cde1ae3b819ed7e47dd57f0f3" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
19710
+ return true ? "5e0423a14cd4a805f390c706e22f3074ba5a6fccf294d23bf6702b83379bff79" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
19711
19711
  }
19712
19712
  var import_node_crypto18;
19713
19713
  var init_expo_native_compiler_digest = __esm({
@@ -24483,6 +24483,27 @@ var init_swift_resource_class_names = __esm({
24483
24483
  }
24484
24484
  });
24485
24485
 
24486
+ // ../peach-kit/src/guest-engine-services.ts
24487
+ var PEACH_GUEST_SERVICE_MODULE, PEACH_GUEST_SERVICE_PREFIX, peachGuestServiceNames, peachGuestServiceSymbols, peachGuestServiceAllowlist;
24488
+ var init_guest_engine_services = __esm({
24489
+ "../peach-kit/src/guest-engine-services.ts"() {
24490
+ "use strict";
24491
+ PEACH_GUEST_SERVICE_MODULE = "peach_guest_services";
24492
+ PEACH_GUEST_SERVICE_PREFIX = "peach_guest_service_";
24493
+ peachGuestServiceNames = [
24494
+ "peach_app_config_resolve",
24495
+ "peach_audio_host_request",
24496
+ "peach_site_origin",
24497
+ "services_request",
24498
+ "services_storage_error"
24499
+ ];
24500
+ peachGuestServiceSymbols = peachGuestServiceNames.map(
24501
+ (name3) => PEACH_GUEST_SERVICE_PREFIX + name3
24502
+ );
24503
+ peachGuestServiceAllowlist = peachGuestServiceSymbols.join("\n") + "\n";
24504
+ }
24505
+ });
24506
+
24486
24507
  // src/swift-guest-linked-spans.ts
24487
24508
  function number(bytes, start) {
24488
24509
  let value = 0;
@@ -25242,7 +25263,146 @@ var init_swift_guest_linked_spans = __esm({
25242
25263
  }
25243
25264
  });
25244
25265
 
25266
+ // src/wasm-binary-sections.ts
25267
+ function encodeWasmNumber(value) {
25268
+ const bytes = [];
25269
+ for (let rest = value; ; ) {
25270
+ const byte = rest % 128;
25271
+ rest = Math.floor(rest / 128);
25272
+ if (rest === 0) return [...bytes, byte];
25273
+ bytes.push(byte | 128);
25274
+ }
25275
+ }
25276
+ function encodeWasmName(name3) {
25277
+ const bytes = new TextEncoder().encode(name3);
25278
+ return [...encodeWasmNumber(bytes.length), ...bytes];
25279
+ }
25280
+ function readWasmSection(bytes, start, end) {
25281
+ let at = start;
25282
+ const number3 = () => {
25283
+ let value = 0;
25284
+ for (let shift = 0; ; shift += 7) {
25285
+ if (at >= end || shift > 63) throw new Error("invalid wasm integer");
25286
+ const byte = bytes[at++];
25287
+ value += (byte & 127) * 2 ** shift;
25288
+ if (!(byte & 128)) return value;
25289
+ }
25290
+ };
25291
+ return {
25292
+ number: number3,
25293
+ byte: () => {
25294
+ if (at >= end) throw new Error("truncated wasm section");
25295
+ return bytes[at++];
25296
+ },
25297
+ name: () => {
25298
+ const length = number3();
25299
+ at += length;
25300
+ if (at > end) throw new Error("truncated wasm name");
25301
+ return Buffer.from(bytes.buffer, bytes.byteOffset + at - length, length).toString();
25302
+ },
25303
+ position: () => at,
25304
+ done: () => at === end
25305
+ };
25306
+ }
25307
+ function wasmSections(bytes) {
25308
+ if (Buffer.from(bytes.subarray(0, 8)).toString("hex") !== "0061736d01000000")
25309
+ throw new Error("not a wasm module");
25310
+ const found = [];
25311
+ for (let at = 8; at < bytes.length; ) {
25312
+ const header = readWasmSection(bytes, at, bytes.length);
25313
+ const id = header.byte();
25314
+ const size2 = header.number();
25315
+ const start = header.position();
25316
+ if (start + size2 > bytes.length) throw new Error("truncated wasm section");
25317
+ found.push({ id, offset: at, start, end: start + size2 });
25318
+ at = start + size2;
25319
+ }
25320
+ return found;
25321
+ }
25322
+ var init_wasm_binary_sections = __esm({
25323
+ "src/wasm-binary-sections.ts"() {
25324
+ "use strict";
25325
+ }
25326
+ });
25327
+
25328
+ // src/wasm-imports.ts
25329
+ function readWasmImports(bytes, section2, visit3) {
25330
+ const input = readWasmSection(bytes, section2.start, section2.end);
25331
+ const count = input.number();
25332
+ const valueType = () => {
25333
+ const first = input.byte();
25334
+ if (first === 99 || first === 100) input.number();
25335
+ };
25336
+ const limits = () => {
25337
+ const flags = input.number();
25338
+ input.number();
25339
+ if (flags & 1) input.number();
25340
+ if (flags & 8) input.number();
25341
+ };
25342
+ for (let index = 0; index < count; index++) {
25343
+ const start = input.position();
25344
+ const module2 = input.name();
25345
+ const name3 = input.name();
25346
+ const type = input.position();
25347
+ const kind = input.byte();
25348
+ switch (kind) {
25349
+ case 0:
25350
+ input.number();
25351
+ break;
25352
+ case 1:
25353
+ valueType();
25354
+ limits();
25355
+ break;
25356
+ case 2:
25357
+ limits();
25358
+ break;
25359
+ case 3:
25360
+ valueType();
25361
+ input.byte();
25362
+ break;
25363
+ case 4:
25364
+ input.byte();
25365
+ input.number();
25366
+ break;
25367
+ default:
25368
+ throw new Error(`unsupported Wasm import kind ${kind}`);
25369
+ }
25370
+ visit3({ module: module2, name: name3, kind, start, type, end: input.position() });
25371
+ }
25372
+ if (!input.done()) throw new Error("invalid Wasm imports");
25373
+ return count;
25374
+ }
25375
+ var init_wasm_imports = __esm({
25376
+ "src/wasm-imports.ts"() {
25377
+ "use strict";
25378
+ init_wasm_binary_sections();
25379
+ }
25380
+ });
25381
+
25245
25382
  // src/swift-sdk-image-map.ts
25383
+ function assertPeachGuestEngineLink(map2, linked) {
25384
+ const guestSymbol = /^peach_guest_(sdk|removed|service)_/;
25385
+ const unresolved = /* @__PURE__ */ new Set();
25386
+ for (const chunk of map2.code) {
25387
+ if (chunk.inputFile !== "<internal>" || chunk.section !== "undefined_stub") continue;
25388
+ for (const { name: name3 } of chunk.symbols) if (guestSymbol.test(name3)) unresolved.add(name3);
25389
+ }
25390
+ if (unresolved.size)
25391
+ throw new Error(
25392
+ `unresolved PeachEngine calls in the Swift SDK:
25393
+ ${[...unresolved].sort().join("\n")}`
25394
+ );
25395
+ const imports2 = wasmSections(linked).find((section2) => section2.id === 2);
25396
+ if (imports2)
25397
+ readWasmImports(linked, imports2, ({ kind, module: module2, name: name3 }) => {
25398
+ if (module2 !== PEACH_GUEST_SERVICE_MODULE && !guestSymbol.test(name3)) return;
25399
+ if (kind === 0 && module2 === PEACH_GUEST_SERVICE_MODULE && peachGuestServiceSymbols.includes(name3))
25400
+ return;
25401
+ throw new Error(
25402
+ `unexpected PeachEngine host import in the Swift SDK: ${module2}.${name3}`
25403
+ );
25404
+ });
25405
+ }
25246
25406
  function isHexChar(code) {
25247
25407
  return code >= 48 && code <= 57 || code >= 97 && code <= 102;
25248
25408
  }
@@ -25411,7 +25571,10 @@ var init_swift_sdk_image_map = __esm({
25411
25571
  "src/swift-sdk-image-map.ts"() {
25412
25572
  "use strict";
25413
25573
  import_node_path43 = require("node:path");
25574
+ init_guest_engine_services();
25414
25575
  init_swift_guest_linked_spans();
25576
+ init_wasm_binary_sections();
25577
+ init_wasm_imports();
25415
25578
  PARTITIONED = [
25416
25579
  ".rodata",
25417
25580
  ".data",
@@ -25484,7 +25647,7 @@ function wasmReader(bytes, start) {
25484
25647
  }
25485
25648
  };
25486
25649
  }
25487
- function wasmSections(bytes) {
25650
+ function wasmSections2(bytes) {
25488
25651
  const out = [];
25489
25652
  for (let at = 8; at < bytes.length; ) {
25490
25653
  const r = wasmReader(bytes, at);
@@ -25577,7 +25740,7 @@ function* readFunctionNames(bytes, names) {
25577
25740
  }
25578
25741
  }
25579
25742
  function orderObjCConstructors(bytes) {
25580
- const sections = wasmSections(bytes);
25743
+ const sections = wasmSections2(bytes);
25581
25744
  const names = sections.find((s) => s.name === "name");
25582
25745
  if (!names) return bytes;
25583
25746
  let constructors;
@@ -25625,7 +25788,7 @@ function orderObjCConstructors(bytes) {
25625
25788
  return ordered;
25626
25789
  }
25627
25790
  function readModule(bytes) {
25628
- const sections = wasmSections(bytes);
25791
+ const sections = wasmSections2(bytes);
25629
25792
  const get = (id) => sections.find((s) => s.id === id);
25630
25793
  const types2 = [];
25631
25794
  const typeSection = get(1);
@@ -25829,7 +25992,7 @@ function finishSdkImage(bytes, hostExports, libraries, guestMap) {
25829
25992
  return { image: Buffer.concat(parts), sdkInterface, functionSlots };
25830
25993
  }
25831
25994
  function passiveSegments(bytes) {
25832
- const data = wasmSections(bytes).find((s) => s.id === 11);
25995
+ const data = wasmSections2(bytes).find((s) => s.id === 11);
25833
25996
  if (!data) throw new Error("sdk image has no data section");
25834
25997
  const r = wasmReader(bytes, data.start);
25835
25998
  const out = [];
@@ -25934,7 +26097,7 @@ function codeOnlySdkImage(bytes, constructorMask) {
25934
26097
  function constructorKeys(map2, bytes) {
25935
26098
  const first = map2.code[0];
25936
26099
  if (!first) throw new Error("link has no code");
25937
- const sections = wasmSections(bytes);
26100
+ const sections = wasmSections2(bytes);
25938
26101
  const code = sections.find((s) => s.id === 10);
25939
26102
  if (!code) throw new Error("link has no code");
25940
26103
  const ctors = map2.code.find((chunk) => chunk.section === "__wasm_call_ctors");
@@ -26006,7 +26169,7 @@ function constructorKeys(map2, bytes) {
26006
26169
  return keys;
26007
26170
  }
26008
26171
  function relocationEdges(bytes, segmentAddress) {
26009
- const sections = wasmSections(bytes);
26172
+ const sections = wasmSections2(bytes);
26010
26173
  const linking = sections.find((s) => s.name === "linking");
26011
26174
  if (!linking) throw new Error("relocation link has no linking section");
26012
26175
  let symKind = new Uint8Array(0);
@@ -26174,7 +26337,7 @@ function relocationEdges(bytes, segmentAddress) {
26174
26337
  return { data, code, dataFunctions, calls };
26175
26338
  }
26176
26339
  function strongDefinitions(bytes) {
26177
- const linking = wasmSections(bytes).find((s) => s.name === "linking");
26340
+ const linking = wasmSections2(bytes).find((s) => s.name === "linking");
26178
26341
  if (!linking) return [];
26179
26342
  const r = wasmReader(bytes, linking.start);
26180
26343
  r.u();
@@ -26217,7 +26380,7 @@ function strongDefinitions(bytes) {
26217
26380
  ).map((s) => s.name);
26218
26381
  }
26219
26382
  function unslottedFunctions(bytes) {
26220
- const sections = wasmSections(bytes);
26383
+ const sections = wasmSections2(bytes);
26221
26384
  const importedFuncs = countImportedFunctions(
26222
26385
  bytes,
26223
26386
  sections.find((s) => s.id === 2)
@@ -30523,71 +30686,9 @@ var init_swift_guest_image_ledger = __esm({
30523
30686
  }
30524
30687
  });
30525
30688
 
30526
- // src/wasm-binary-sections.ts
30527
- function encodeWasmNumber(value) {
30528
- const bytes = [];
30529
- for (let rest = value; ; ) {
30530
- const byte = rest % 128;
30531
- rest = Math.floor(rest / 128);
30532
- if (rest === 0) return [...bytes, byte];
30533
- bytes.push(byte | 128);
30534
- }
30535
- }
30536
- function encodeWasmName(name3) {
30537
- const bytes = new TextEncoder().encode(name3);
30538
- return [...encodeWasmNumber(bytes.length), ...bytes];
30539
- }
30540
- function readWasmSection(bytes, start, end) {
30541
- let at = start;
30542
- const number3 = () => {
30543
- let value = 0;
30544
- for (let shift = 0; ; shift += 7) {
30545
- if (at >= end || shift > 63) throw new Error("invalid wasm integer");
30546
- const byte = bytes[at++];
30547
- value += (byte & 127) * 2 ** shift;
30548
- if (!(byte & 128)) return value;
30549
- }
30550
- };
30551
- return {
30552
- number: number3,
30553
- byte: () => {
30554
- if (at >= end) throw new Error("truncated wasm section");
30555
- return bytes[at++];
30556
- },
30557
- name: () => {
30558
- const length = number3();
30559
- at += length;
30560
- if (at > end) throw new Error("truncated wasm name");
30561
- return Buffer.from(bytes.buffer, bytes.byteOffset + at - length, length).toString();
30562
- },
30563
- position: () => at,
30564
- done: () => at === end
30565
- };
30566
- }
30567
- function wasmSections2(bytes) {
30568
- if (Buffer.from(bytes.subarray(0, 8)).toString("hex") !== "0061736d01000000")
30569
- throw new Error("not a wasm module");
30570
- const found = [];
30571
- for (let at = 8; at < bytes.length; ) {
30572
- const header = readWasmSection(bytes, at, bytes.length);
30573
- const id = header.byte();
30574
- const size2 = header.number();
30575
- const start = header.position();
30576
- if (start + size2 > bytes.length) throw new Error("truncated wasm section");
30577
- found.push({ id, offset: at, start, end: start + size2 });
30578
- at = start + size2;
30579
- }
30580
- return found;
30581
- }
30582
- var init_wasm_binary_sections = __esm({
30583
- "src/wasm-binary-sections.ts"() {
30584
- "use strict";
30585
- }
30586
- });
30587
-
30588
30689
  // src/wasm-narrow-boundary.ts
30589
30690
  function readWasmCustomSection(bytes, name3) {
30590
- for (const { id, start, end } of wasmSections2(bytes)) {
30691
+ for (const { id, start, end } of wasmSections(bytes)) {
30591
30692
  if (id !== 0) continue;
30592
30693
  const contents2 = readWasmSection(bytes, start, end);
30593
30694
  if (contents2.name() === name3) return bytes.subarray(contents2.position(), end);
@@ -30596,7 +30697,7 @@ function readWasmCustomSection(bytes, name3) {
30596
30697
  }
30597
30698
  function dropWasmCustomSection(bytes, name3) {
30598
30699
  const parts = [bytes.subarray(0, 8)];
30599
- for (const { id, offset, start, end } of wasmSections2(bytes)) {
30700
+ for (const { id, offset, start, end } of wasmSections(bytes)) {
30600
30701
  if (id === 0 && readWasmSection(bytes, start, end).name() === name3) continue;
30601
30702
  parts.push(bytes.subarray(offset, end));
30602
30703
  }
@@ -30608,7 +30709,7 @@ function writeWasmCustomSections(bytes, entries2) {
30608
30709
  const parts = [];
30609
30710
  let sliceStart = 0;
30610
30711
  let sliceEnd = 8;
30611
- for (const { id, start, end } of wasmSections2(bytes)) {
30712
+ for (const { id, start, end } of wasmSections(bytes)) {
30612
30713
  if (id === 0 && replaced.has(readWasmSection(bytes, start, end).name())) {
30613
30714
  if (sliceEnd > sliceStart) parts.push(bytes.subarray(sliceStart, sliceEnd));
30614
30715
  sliceStart = end;
@@ -30632,7 +30733,7 @@ function writeWasmCustomSection(bytes, name3, data) {
30632
30733
  return writeWasmCustomSections(bytes, [[name3, data]]);
30633
30734
  }
30634
30735
  function readWasmMemory(bytes) {
30635
- return readWasmMemoryAndTableImports(bytes, wasmSections2(bytes)).memory;
30736
+ return readWasmMemoryAndTableImports(bytes, wasmSections(bytes)).memory;
30636
30737
  }
30637
30738
  function readWasmMemoryAndTableImports(bytes, layout2) {
30638
30739
  let memory;
@@ -30693,7 +30794,7 @@ function withSections(bytes, layout2, replacements) {
30693
30794
  return Buffer.concat(parts);
30694
30795
  }
30695
30796
  function narrowWasmBoundary(bytes, wideExports) {
30696
- const layout2 = wasmSections2(bytes);
30797
+ const layout2 = wasmSections(bytes);
30697
30798
  const section2 = (id) => {
30698
30799
  const found = layout2.find((entry) => entry.id === id);
30699
30800
  return found && readWasmSection(bytes, found.start, found.end);
@@ -30819,7 +30920,7 @@ ${[...imports2, ...functions].join("\n")}
30819
30920
  };
30820
30921
  }
30821
30922
  function dropBoundaryExports(bytes) {
30822
- const layout2 = wasmSections2(bytes);
30923
+ const layout2 = wasmSections(bytes);
30823
30924
  const found = layout2.find((entry) => entry.id === 7);
30824
30925
  if (!found) throw new Error("merged module has no exports");
30825
30926
  const exportSection = readWasmSection(bytes, found.start, found.end);
@@ -30838,7 +30939,7 @@ function dropBoundaryExports(bytes) {
30838
30939
  );
30839
30940
  }
30840
30941
  function withWasmTableMinimum(bytes, minimum) {
30841
- const layout2 = wasmSections2(bytes);
30942
+ const layout2 = wasmSections(bytes);
30842
30943
  const table = layout2.find(({ id }) => id === 4);
30843
30944
  if (!table) {
30844
30945
  if (readWasmMemoryAndTableImports(bytes, layout2).tableImports === 1) return bytes;
@@ -31135,7 +31236,7 @@ function entries(bytes, section2, entry) {
31135
31236
  return out;
31136
31237
  }
31137
31238
  function appendLazyPlacement(bytes, functions, table) {
31138
- const sections = wasmSections(bytes);
31239
+ const sections = wasmSections2(bytes);
31139
31240
  const section2 = (id) => sections.find((s) => s.id === id);
31140
31241
  const imports2 = readImports2(bytes, sections);
31141
31242
  const changes = /* @__PURE__ */ new Map();
@@ -31253,7 +31354,7 @@ function skipElementSegment(r) {
31253
31354
  else r.u();
31254
31355
  }
31255
31356
  function placeGuestLazyFunctions(bytes, lazy) {
31256
- const sections = wasmSections(bytes);
31357
+ const sections = wasmSections2(bytes);
31257
31358
  const lazyIndex = new Map(lazy.map((name3, index) => [name3, index]));
31258
31359
  const functions = new Array(lazy.length);
31259
31360
  let found = 0;
@@ -40099,6 +40200,8 @@ async function linkSwiftSdkImage(moduleRoot, key2, directory2, work, scopedLooku
40099
40200
  import_node_path58.default.join(work, "exports.rsp"),
40100
40201
  [...defined].map((name3) => quote3(`--export-if-defined=${name3}`)).join("\n")
40101
40202
  );
40203
+ const guestServices = import_node_path58.default.join(work, "peach-guest-services.allow");
40204
+ (0, import_node_fs60.writeFileSync)(guestServices, peachGuestServiceAllowlist);
40102
40205
  const args = [
40103
40206
  ...link.flags,
40104
40207
  `--global-base=${SWIFT_SDK_MEMORY_BASE}`,
@@ -40110,6 +40213,7 @@ async function linkSwiftSdkImage(moduleRoot, key2, directory2, work, scopedLooku
40110
40213
  ...lazy,
40111
40214
  "--end-lib",
40112
40215
  "--unresolved-symbols=ignore-all",
40216
+ `--allow-undefined-file=${guestServices}`,
40113
40217
  "--export-dynamic",
40114
40218
  ...[
40115
40219
  "__peach_sdk_register",
@@ -40142,8 +40246,9 @@ async function linkSwiftSdkImage(moduleRoot, key2, directory2, work, scopedLooku
40142
40246
  if (result.status === "rejected") throw result.reason;
40143
40247
  }
40144
40248
  const rawLink = (0, import_node_fs60.readFileSync)(linked);
40145
- const linkedBytes = lookups2 ? rawLink : orderObjCConstructors(rawLink);
40146
40249
  const linkMap = readWasmLinkMap(map2, true);
40250
+ assertPeachGuestEngineLink(linkMap, rawLink);
40251
+ const linkedBytes = lookups2 ? rawLink : orderObjCConstructors(rawLink);
40147
40252
  const {
40148
40253
  image: finished,
40149
40254
  sdkInterface,
@@ -40248,7 +40353,7 @@ function sdkLinkInputs(appRoot) {
40248
40353
  return { flags, libraries, objects: [crt, ...objects], providers };
40249
40354
  }
40250
40355
  function autolinkLibraries(bytes) {
40251
- const entries2 = wasmSections(bytes).find((s) => s.name === ".swift1_autolink_entries");
40356
+ const entries2 = wasmSections2(bytes).find((s) => s.name === ".swift1_autolink_entries");
40252
40357
  if (!entries2) return [];
40253
40358
  const raw2 = Buffer.isBuffer(bytes) ? bytes : Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength);
40254
40359
  return raw2.toString("utf8", entries2.start, entries2.end).split("\0").filter((entry) => entry.startsWith("-l"));
@@ -40258,7 +40363,7 @@ function sdkHostExports(appRoot) {
40258
40363
  const linked = (0, import_node_fs60.readdirSync)(release).find((name3) => name3.endsWith(".wasm"));
40259
40364
  if (!linked) throw new Error("the sdk image link found no empty app image");
40260
40365
  const bytes = (0, import_node_fs60.readFileSync)(import_node_path58.default.join(release, linked));
40261
- const exports2 = wasmSections(bytes).find((s) => s.id === 7);
40366
+ const exports2 = wasmSections2(bytes).find((s) => s.id === 7);
40262
40367
  if (!exports2) return [];
40263
40368
  const names = [];
40264
40369
  let at = exports2.start;
@@ -40460,6 +40565,7 @@ var init_swift_sdk_image = __esm({
40460
40565
  import_node_fs60 = require("node:fs");
40461
40566
  import_node_path58 = __toESM(require("node:path"), 1);
40462
40567
  import_node_util10 = require("node:util");
40568
+ init_guest_engine_services();
40463
40569
  init_native_prebuilt();
40464
40570
  init_swift_compile();
40465
40571
  init_swift_darwin_records();
@@ -41155,7 +41261,7 @@ async function linkSwiftAppModule(options2) {
41155
41261
  };
41156
41262
  }
41157
41263
  function sdkImportThunks(bytes) {
41158
- const sections = wasmSections(bytes);
41264
+ const sections = wasmSections2(bytes);
41159
41265
  const section2 = (id) => sections.find((s) => s.id === id);
41160
41266
  const valueType = (r) => {
41161
41267
  const type = r.byte();
@@ -41286,7 +41392,7 @@ function sdkImportThunks(bytes) {
41286
41392
  function resolveSdkReferences(source, sdk2, forwarders) {
41287
41393
  const bytes = new Uint8Array(source.buffer, source.byteOffset, source.byteLength);
41288
41394
  const { data: sdkData, signatures } = sdk2.sdkInterface;
41289
- const sections = wasmSections(bytes);
41395
+ const sections = wasmSections2(bytes);
41290
41396
  const linking = sections.find((s) => s.name === "linking");
41291
41397
  if (!linking) throw new Error("app link has no linking section");
41292
41398
  const symbols = [];
@@ -45496,7 +45602,7 @@ function findTargetForFile(file, byDir, predicate) {
45496
45602
  }
45497
45603
  return void 0;
45498
45604
  }
45499
- function compiledSwiftSources(files2, targets, overlayFrameworks, headers, nativeSourceGlue = false) {
45605
+ function compiledSwiftSources(files2, targets, overlayFrameworks, headers) {
45500
45606
  const ordered = [...targets].sort((a, b) => b.path.length - a.path.length);
45501
45607
  const byDir = indexTargetsByDirectory(ordered);
45502
45608
  const excludeSets = /* @__PURE__ */ new Map();
@@ -45522,7 +45628,7 @@ function compiledSwiftSources(files2, targets, overlayFrameworks, headers, nativ
45522
45628
  const { onWasm, withoutWasm } = swiftTargetArchitectures(targets, swiftSources, headers);
45523
45629
  return new Map(
45524
45630
  [...owners].map(([file, { source, owner }]) => {
45525
- if (nativeSourceGlue && import_node_path70.default.posix.basename(file) === "OneNativeSource.generated.swift")
45631
+ if (import_node_path70.default.posix.basename(file) === "OneNativeSource.generated.swift")
45526
45632
  return [file, source];
45527
45633
  const manifest = /(?:^|\/)Package(?:@swift-[\d.]+)?\.swift$/.test(file);
45528
45634
  if (manifest && (!owner || /^Package(?:@swift-[\d.]+)?\.swift$/.test(file)))
@@ -47047,8 +47153,7 @@ module ${moduleName}.Swift {
47047
47153
  ([file]) => /\.(?:h|hh|hpp)$/.test(file)
47048
47154
  );
47049
47155
  return headerFiles3.filter(([file]) => file.startsWith(`${directory2}/`)).map(([, contents2]) => contents2);
47050
- },
47051
- input.oneModule
47156
+ }
47052
47157
  );
47053
47158
  const libraryEntryFiles = /* @__PURE__ */ new Map();
47054
47159
  for (const target of [...targets]) {
@@ -48301,9 +48406,10 @@ function removeCaseCollidingModuleArtifacts(modulesDir, keep) {
48301
48406
  (0, import_node_fs70.rmSync)(import_node_path70.default.join(modulesDir, name3), { recursive: true, force: true });
48302
48407
  }
48303
48408
  }
48304
- function readFrameworkProductsReceipt(scratch2, receiptKey) {
48409
+ function readFrameworkProductsReceipt(scratch2, receiptKey, planChangedAt = 0n) {
48305
48410
  const receiptFile2 = import_node_path70.default.join(scratch2, "products-ready", `${receiptKey}.json`);
48306
- if (!(0, import_node_fs70.existsSync)(receiptFile2)) return null;
48411
+ const receiptStat = (0, import_node_fs70.statSync)(receiptFile2, { bigint: true, throwIfNoEntry: false });
48412
+ if (!receiptStat || receiptStat.mtimeNs < planChangedAt) return null;
48307
48413
  let parsed2;
48308
48414
  try {
48309
48415
  parsed2 = v6.parse(
@@ -48427,117 +48533,136 @@ async function buildFrameworkProducts(scratch2, args, allowWrite) {
48427
48533
  const unoptimized = args.input.unoptimized === true;
48428
48534
  const sdkOptions = swiftCompileSdkOptions(args.moduleRoot, args.toolchainBin);
48429
48535
  const selectorOptions = swiftObjCSelectorOptions(args.moduleRoot);
48430
- const receiptKey = (0, import_node_crypto45.createHash)("sha256").update(
48536
+ const receiptKeyFor = (products) => (0, import_node_crypto45.createHash)("sha256").update(
48431
48537
  JSON.stringify([
48432
48538
  "framework-products/v2",
48433
48539
  args.frameworkKey,
48434
48540
  unoptimized,
48435
48541
  args.sdk,
48436
48542
  args.toolchainBin,
48437
- [...linkedTargets.products].sort(),
48543
+ [...products].sort(),
48438
48544
  darwinRecordsMinimum(),
48439
48545
  args.plugins,
48440
48546
  sdkOptions,
48441
48547
  selectorOptions
48442
48548
  ])
48443
48549
  ).digest("hex").slice(0, 32);
48550
+ const receiptKey = receiptKeyFor(linkedTargets.products);
48444
48551
  const ready = readFrameworkProductsReceipt(scratch2, receiptKey);
48445
48552
  if (ready) return ready;
48446
48553
  if (!allowWrite) return;
48447
48554
  const linkRoot = import_node_path70.default.join(scratch2, "link");
48448
- writeFrameworkLinkPackage(linkRoot, args.moduleRoot, linkedTargets.products);
48449
- const frameworkTmp = import_node_path70.default.join(scratch2, "peach-compiler-tmp");
48450
- (0, import_node_fs70.mkdirSync)(frameworkTmp, { recursive: true });
48451
- const jobs = swiftCompilerJobs();
48452
- const targetJobs = jobs >= 4 ? 2 : 1;
48453
- const driverJobs = Math.max(1, Math.floor(jobs / targetJobs));
48454
- const cache = unoptimized ? null : prepareFrameworkCompileCache(
48555
+ const manifest = import_node_path70.default.join(linkRoot, "Package.swift");
48556
+ const manifestStat = (0, import_node_fs70.statSync)(manifest, { bigint: true, throwIfNoEntry: false });
48557
+ const planStat = (0, import_node_fs70.statSync)(import_node_path70.default.join(scratch2, "release.yaml"), {
48558
+ bigint: true,
48559
+ throwIfNoEntry: false
48560
+ });
48561
+ const builtProducts = manifestStat && planStat ? [
48562
+ ...(0, import_node_fs70.readFileSync)(manifest, "utf8").matchAll(
48563
+ /^\s*\.product\(name: "([^"]+)", package:/gm
48564
+ )
48565
+ ].map((match) => match[1]) : [];
48566
+ const reusePlan = manifestStat && planStat && linkedTargets.products.every((product) => builtProducts.includes(product)) && readFrameworkProductsReceipt(
48455
48567
  scratch2,
48456
- args.moduleRoot,
48457
- args.toolchainBin,
48458
- sdkOptions,
48459
- linkedTargets.products
48460
- );
48461
- await runCompiler(
48462
- args.swift,
48463
- [
48464
- "build",
48465
- ...swiftPackageCacheOptions(),
48466
- "--build-system",
48467
- "native",
48468
- "-j",
48469
- String(targetJobs),
48470
- "--package-path",
48471
- linkRoot,
48472
- "--scratch-path",
48568
+ receiptKeyFor(builtProducts),
48569
+ manifestStat.ctimeNs > planStat.ctimeNs ? manifestStat.ctimeNs : planStat.ctimeNs
48570
+ );
48571
+ if (!reusePlan) {
48572
+ writeFrameworkLinkPackage(linkRoot, args.moduleRoot, linkedTargets.products);
48573
+ const frameworkTmp = import_node_path70.default.join(scratch2, "peach-compiler-tmp");
48574
+ (0, import_node_fs70.mkdirSync)(frameworkTmp, { recursive: true });
48575
+ const jobs = swiftCompilerJobs();
48576
+ const targetJobs = jobs >= 4 ? 2 : 1;
48577
+ const driverJobs = Math.max(1, Math.floor(jobs / targetJobs));
48578
+ const cache = unoptimized ? null : prepareFrameworkCompileCache(
48473
48579
  scratch2,
48474
- "--target",
48475
- FRAMEWORK_LINK_TARGET,
48476
- ...sdkOptions,
48477
- ...selectorOptions,
48478
- "--swift-sdk",
48479
- args.sdk,
48480
- "-c",
48481
- "release",
48482
- ...cache ? ["-Xswiftc", "-driver-use-frontend-path", "-Xswiftc", cache.wrapper] : [],
48483
- "-Xswiftc",
48484
- unoptimized ? "-Onone" : "-Osize",
48485
- "-Xswiftc",
48486
- "-no-whole-module-optimization",
48487
- // optimized batches can move specialized definitions between object files.
48488
- ...unoptimized ? ["-Xswiftc", "-incremental"] : [],
48489
- "-Xswiftc",
48490
- "-enable-batch-mode",
48491
- // each batch repeats the same framework diagnostics.
48492
- ...unoptimized ? [] : ["-Xswiftc", "-suppress-warnings"],
48493
- "-Xswiftc",
48494
- "-j",
48495
- "-Xswiftc",
48496
- String(driverJobs),
48497
- // the release link strips all debug info, so none is generated.
48498
- "-Xswiftc",
48499
- "-gnone",
48500
- "-Xcc",
48501
- "-g0",
48502
- "-Xcxx",
48503
- "-g0",
48504
- "-Xswiftc",
48505
- "-num-threads",
48506
- "-Xswiftc",
48507
- "1",
48508
- ...swiftReproducibleBuildFlags([
48509
- [import_node_path70.default.dirname(args.toolchainBin), "toolchain"],
48510
- [args.moduleRoot, "framework"],
48511
- [scratch2, "framework-scratch"]
48512
- ]),
48513
- ...args.plugins.libraries.flatMap((plugin) => [
48580
+ args.moduleRoot,
48581
+ args.toolchainBin,
48582
+ sdkOptions,
48583
+ linkedTargets.products
48584
+ );
48585
+ await runCompiler(
48586
+ args.swift,
48587
+ [
48588
+ "build",
48589
+ ...swiftPackageCacheOptions(),
48590
+ "--build-system",
48591
+ "native",
48592
+ "-j",
48593
+ String(targetJobs),
48594
+ "--package-path",
48595
+ linkRoot,
48596
+ "--scratch-path",
48597
+ scratch2,
48598
+ "--target",
48599
+ FRAMEWORK_LINK_TARGET,
48600
+ ...sdkOptions,
48601
+ ...selectorOptions,
48602
+ "--swift-sdk",
48603
+ args.sdk,
48604
+ "-c",
48605
+ "release",
48606
+ ...cache ? ["-Xswiftc", "-driver-use-frontend-path", "-Xswiftc", cache.wrapper] : [],
48514
48607
  "-Xswiftc",
48515
- "-load-plugin-library",
48608
+ unoptimized ? "-Onone" : "-Osize",
48516
48609
  "-Xswiftc",
48517
- plugin
48518
- ]),
48519
- ...args.plugins.executables.flatMap((plugin) => [
48610
+ "-no-whole-module-optimization",
48611
+ // optimized batches can move specialized definitions between object files.
48612
+ ...unoptimized ? ["-Xswiftc", "-incremental"] : [],
48520
48613
  "-Xswiftc",
48521
- "-load-plugin-executable",
48614
+ "-enable-batch-mode",
48615
+ // each batch repeats the same framework diagnostics.
48616
+ ...unoptimized ? [] : ["-Xswiftc", "-suppress-warnings"],
48522
48617
  "-Xswiftc",
48523
- `${plugin}#ExpoModulesMacros`
48524
- ])
48525
- ],
48526
- // swiftpm hashes TMPDIR into its plan; keep one stable compiler scratch inside the locked slot.
48527
- // the framework build's warnings alone pass the default 1 MiB cap, which kills
48528
- // the build one step from the end.
48529
- {
48530
- ...args.buildOptions,
48531
- temporaryDirectory: frameworkTmp,
48532
- maxBuffer: 64 * 1024 * 1024
48533
- },
48534
- SWIFTPM_PROGRESS,
48535
- SWIFTPM_NOISE
48536
- ).catch((error) => {
48537
- throw new Error(outputOf(error), { cause: error });
48538
- }).finally(() => {
48539
- if (cache) reportFrameworkCompileCacheStats(scratch2, cache.statsFile);
48540
- });
48618
+ "-j",
48619
+ "-Xswiftc",
48620
+ String(driverJobs),
48621
+ // the release link strips all debug info, so none is generated.
48622
+ "-Xswiftc",
48623
+ "-gnone",
48624
+ "-Xcc",
48625
+ "-g0",
48626
+ "-Xcxx",
48627
+ "-g0",
48628
+ "-Xswiftc",
48629
+ "-num-threads",
48630
+ "-Xswiftc",
48631
+ "1",
48632
+ ...swiftReproducibleBuildFlags([
48633
+ [import_node_path70.default.dirname(args.toolchainBin), "toolchain"],
48634
+ [args.moduleRoot, "framework"],
48635
+ [scratch2, "framework-scratch"]
48636
+ ]),
48637
+ ...args.plugins.libraries.flatMap((plugin) => [
48638
+ "-Xswiftc",
48639
+ "-load-plugin-library",
48640
+ "-Xswiftc",
48641
+ plugin
48642
+ ]),
48643
+ ...args.plugins.executables.flatMap((plugin) => [
48644
+ "-Xswiftc",
48645
+ "-load-plugin-executable",
48646
+ "-Xswiftc",
48647
+ `${plugin}#ExpoModulesMacros`
48648
+ ])
48649
+ ],
48650
+ // swiftpm hashes TMPDIR into its plan; keep one stable compiler scratch inside the locked slot.
48651
+ // the framework build's warnings alone pass the default 1 MiB cap, which kills
48652
+ // the build one step from the end.
48653
+ {
48654
+ ...args.buildOptions,
48655
+ temporaryDirectory: frameworkTmp,
48656
+ maxBuffer: 64 * 1024 * 1024
48657
+ },
48658
+ SWIFTPM_PROGRESS,
48659
+ SWIFTPM_NOISE
48660
+ ).catch((error) => {
48661
+ throw new Error(outputOf(error), { cause: error });
48662
+ }).finally(() => {
48663
+ if (cache) reportFrameworkCompileCacheStats(scratch2, cache.statsFile);
48664
+ });
48665
+ }
48541
48666
  const release = import_node_path70.default.join(scratch2, WASM_TRIPLE, "release");
48542
48667
  const linked = frameworkLinkClosure(scratch2, linkedTargets.targets);
48543
48668
  const objects = linked.objects;
@@ -50076,7 +50201,7 @@ ${wasmThreadLinkFlags.map((flag) => ` "-Xlinker", ${JSON.stringify(flag
50076
50201
  REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
50077
50202
  MULTI_MANIFEST_VERSION = 76;
50078
50203
  SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
50079
- compilerSourceDigest = true ? "e091b1d1136da1a4432f222cbd5e3fbaf60db69c87ca5439ded0f17f7a3b4980" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
50204
+ compilerSourceDigest = true ? "c83dc1b17f6e7fc01d5217313795b0276b66d9f33db641855c80c055d7d77edd" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
50080
50205
  nativeCxxCompilerFlags = ["-fno-cxx-modules"];
50081
50206
  MODULE_MAP_RESPONSE_FILE_RUN = 16;
50082
50207
  cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
@@ -93227,7 +93352,7 @@ function addressImmediates(bytes) {
93227
93352
  } else throw new Error(`sdk code has unknown instruction ${op.toString(16)}`);
93228
93353
  }
93229
93354
  };
93230
- for (const section2 of wasmSections2(bytes)) {
93355
+ for (const section2 of wasmSections(bytes)) {
93231
93356
  at = section2.start;
93232
93357
  if (section2.id === 6)
93233
93358
  for (let n = u(); n > 0; n--) {
@@ -105458,7 +105583,7 @@ var init_nitro_superset = __esm({
105458
105583
  init_nitroContract();
105459
105584
  init_swift_standin_digest();
105460
105585
  NITRO_SUPERSET_ENTRY_NAME = "superset";
105461
- NITRO_COMPILER_DIGEST = true ? "bbf8f0aaf9beb996313e2b52287c3f4852c46052afa8f7f9f81ca6264b804bec" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
105586
+ NITRO_COMPILER_DIGEST = true ? "880e684ade3a6398cfad03a94e2163815fcdc45e9f1be044e82a986570df5d2e" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
105462
105587
  nitroSupersetLock = parseLock(nitro_superset_lock_default);
105463
105588
  nitroSupersetKey = (inputs2) => nativeEntryKey({ ...inputs2, compiler: NITRO_COMPILER_DIGEST });
105464
105589
  published2 = /* @__PURE__ */ new Map();