peachsim 0.1.2737 → 0.1.2742

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 +214 -97
  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-N65DFKKS.mjs → acorn-I6YLE7RH.mjs} +3 -3
  27. package/dist-lib/esm-chunks/{chunk-BLZBR4EF.mjs → chunk-2SC45KUK.mjs} +185 -89
  28. package/dist-lib/esm-chunks/{chunk-ZNSVZBWL.mjs → chunk-4CNYVYQW.mjs} +4 -4
  29. package/dist-lib/esm-chunks/{chunk-PISYS5VV.mjs → chunk-6LMI5DE3.mjs} +1 -1
  30. package/dist-lib/esm-chunks/{chunk-TKYSVJ6N.mjs → chunk-6QTRZNLH.mjs} +1 -1
  31. package/dist-lib/esm-chunks/{chunk-PGMWOIWH.mjs → chunk-CFPPESX7.mjs} +1 -1
  32. package/dist-lib/esm-chunks/{chunk-X4KKXB5Z.mjs → chunk-FKC5RBXR.mjs} +1 -1
  33. package/dist-lib/esm-chunks/{chunk-ZLZG22TP.mjs → chunk-G44GUBAL.mjs} +1 -1
  34. package/dist-lib/esm-chunks/{chunk-S4WPF4LQ.mjs → chunk-GMFZTGVJ.mjs} +13 -7
  35. package/dist-lib/esm-chunks/{chunk-GHLVVIYA.mjs → chunk-GPVGYC45.mjs} +1 -1
  36. package/dist-lib/esm-chunks/{chunk-RZSEAJNK.mjs → chunk-HJBL2ND3.mjs} +1 -1
  37. package/dist-lib/esm-chunks/{chunk-NK3Y2DEM.mjs → chunk-IVVVYJKG.mjs} +1 -1
  38. package/dist-lib/esm-chunks/{chunk-2VEJSLIG.mjs → chunk-MHRTZ6I7.mjs} +1 -1
  39. package/dist-lib/esm-chunks/{chunk-YHSLBUGG.mjs → chunk-MXADGMSE.mjs} +1 -1
  40. package/dist-lib/esm-chunks/{chunk-Y2WJJWHK.mjs → chunk-NWGCI4JC.mjs} +3 -3
  41. package/dist-lib/esm-chunks/{chunk-EJAMKRK2.mjs → chunk-OXFGIZC4.mjs} +2 -2
  42. package/dist-lib/esm-chunks/{chunk-CMN7STHV.mjs → chunk-PLXC42XF.mjs} +1 -1
  43. package/dist-lib/esm-chunks/{chunk-YA6VMXKS.mjs → chunk-QDTQYGJB.mjs} +1 -1
  44. package/dist-lib/esm-chunks/{chunk-M3T47BLB.mjs → chunk-RC3JQV7D.mjs} +1 -1
  45. package/dist-lib/esm-chunks/{chunk-3BDZ7ZVC.mjs → chunk-U262IRGM.mjs} +1 -1
  46. package/dist-lib/esm-chunks/{chunk-PXHA5JY3.mjs → chunk-VH5KY2GM.mjs} +1 -1
  47. package/dist-lib/esm-chunks/{chunk-K5SO6HTC.mjs → chunk-VWRLBFID.mjs} +8 -5
  48. package/dist-lib/esm-chunks/{chunk-P3XPAQTO.mjs → chunk-Y4Q3W36I.mjs} +6 -6
  49. package/dist-lib/esm-chunks/{chunk-MMV3ZU2G.mjs → chunk-YQSNOLNM.mjs} +1 -1
  50. package/dist-lib/esm-chunks/{chunk-GJYNPYLJ.mjs → chunk-ZRA35GYC.mjs} +5 -5
  51. package/dist-lib/esm-chunks/{metro-layout-parser-BB2OJQAM.mjs → metro-layout-parser-QGTUKU6T.mjs} +3 -3
  52. package/dist-lib/esm-chunks/{swift-package-prebuilt-2CNPBFJR.mjs → swift-package-prebuilt-M2IXDM7B.mjs} +12 -12
  53. package/dist-lib/esm-chunks/{swift-sdk-app-module-FZXV77OV.mjs → swift-sdk-app-module-4KYBNEBW.mjs} +16 -16
  54. package/dist-lib/esm-chunks/{swift-sdk-image-BLP7UKX5.mjs → swift-sdk-image-Z37PPINV.mjs} +16 -16
  55. package/dist-lib/esm-chunks/{swift-sdk-image-producer-S5O7TW4E.mjs → swift-sdk-image-producer-7KFCU6Y6.mjs} +5 -5
  56. package/dist-lib/expo-swift-bundle.cjs +214 -97
  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 +3686 -1596
  61. package/dist-lib/host/fetch-proxy-handler.cjs +43 -12
  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 +5 -3
  75. package/dist-lib/native-app-identity-project.mjs +16 -16
  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 +4117 -2027
  95. package/dist-lib/swift-compile.cjs +206 -89
  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 +8 -5
  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-style-store.d.ts +1 -2
  125. package/dist-types/packages/peach-engine/src/engine/node.d.ts +0 -1
  126. package/dist-types/packages/peach-engine/src/engine/scene-native-binding.d.ts +0 -2
  127. package/package.json +1 -1
  128. package/src/one-direct-host-source.ts +254 -0
  129. package/src/one-native-controls-package.ts +99 -21
  130. package/src/swift-compile.ts +9 -1
  131. package/src/swift-sdk-image-map.ts +35 -0
  132. package/src/swift-sdk-image.ts +12 -2
  133. package/src/swift-toolchain.ts +11 -6
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2737 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2742 | (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;
@@ -2899,7 +2899,9 @@ exec ${JSON.stringify(import_node_path5.default.join(toolchainBin, "wasm-ld"))}
2899
2899
  }
2900
2900
  function peachHome() {
2901
2901
  const override = process.env.PEACH_HOME;
2902
- if (override) return import_node_path5.default.resolve(override);
2902
+ return override ? import_node_path5.default.resolve(override) : defaultPeachHome();
2903
+ }
2904
+ function defaultPeachHome() {
2903
2905
  const home = import_node_path5.default.join(import_node_os3.default.homedir(), ".peach");
2904
2906
  return import_node_fs7.default.existsSync(home) ? import_node_fs7.default.realpathSync(home) : home;
2905
2907
  }
@@ -2907,7 +2909,8 @@ function peachSwiftSdksDir() {
2907
2909
  return process.env.PEACH_SWIFT_SDKS_PATH ?? import_node_path5.default.join(peachHome(), "swift", "sdks");
2908
2910
  }
2909
2911
  function agentSharedCacheRoot() {
2910
- if (process.platform !== "darwin" || !process.env.TM_SESSION) return null;
2912
+ if (!process.env.TM_SESSION || process.platform !== "darwin" && process.platform !== "linux")
2913
+ return null;
2911
2914
  if (agentBuildersRoot) return agentBuildersRoot;
2912
2915
  const policy = JSON.parse(
2913
2916
  (0, import_node_child_process4.execFileSync)("tm", ["machine", "policy", "--json"], {
@@ -2946,11 +2949,11 @@ function buildersRootEnv() {
2946
2949
  return root ? root : null;
2947
2950
  }
2948
2951
  function resolvedBuildersRoot() {
2949
- return buildersRootEnv() ?? (process.env.PEACH_HOME ? null : agentSharedCacheRoot());
2952
+ return buildersRootEnv() ?? agentSharedCacheRoot();
2950
2953
  }
2951
2954
  function swiftCacheDir() {
2952
2955
  const root = resolvedBuildersRoot();
2953
- return root ? import_node_path5.default.join(root, "peach-cache") : import_node_path5.default.join(peachHome(), "cache");
2956
+ return root ? import_node_path5.default.join(root, "peach-cache") : import_node_path5.default.join(defaultPeachHome(), "cache");
2954
2957
  }
2955
2958
  function refreshSwiftCacheHold(directory) {
2956
2959
  const cache = swiftCacheDir();
@@ -6139,6 +6142,27 @@ var init_swift_resource_class_names = __esm({
6139
6142
  }
6140
6143
  });
6141
6144
 
6145
+ // ../peach-kit/src/guest-engine-services.ts
6146
+ var PEACH_GUEST_SERVICE_MODULE, PEACH_GUEST_SERVICE_PREFIX, peachGuestServiceNames, peachGuestServiceSymbols, peachGuestServiceAllowlist;
6147
+ var init_guest_engine_services = __esm({
6148
+ "../peach-kit/src/guest-engine-services.ts"() {
6149
+ "use strict";
6150
+ PEACH_GUEST_SERVICE_MODULE = "peach_guest_services";
6151
+ PEACH_GUEST_SERVICE_PREFIX = "peach_guest_service_";
6152
+ peachGuestServiceNames = [
6153
+ "peach_app_config_resolve",
6154
+ "peach_audio_host_request",
6155
+ "peach_site_origin",
6156
+ "services_request",
6157
+ "services_storage_error"
6158
+ ];
6159
+ peachGuestServiceSymbols = peachGuestServiceNames.map(
6160
+ (name3) => PEACH_GUEST_SERVICE_PREFIX + name3
6161
+ );
6162
+ peachGuestServiceAllowlist = peachGuestServiceSymbols.join("\n") + "\n";
6163
+ }
6164
+ });
6165
+
6142
6166
  // src/swift-guest-linked-spans.ts
6143
6167
  function number(bytes, start) {
6144
6168
  let value = 0;
@@ -6898,7 +6922,146 @@ var init_swift_guest_linked_spans = __esm({
6898
6922
  }
6899
6923
  });
6900
6924
 
6925
+ // src/wasm-binary-sections.ts
6926
+ function encodeWasmNumber(value) {
6927
+ const bytes = [];
6928
+ for (let rest = value; ; ) {
6929
+ const byte = rest % 128;
6930
+ rest = Math.floor(rest / 128);
6931
+ if (rest === 0) return [...bytes, byte];
6932
+ bytes.push(byte | 128);
6933
+ }
6934
+ }
6935
+ function encodeWasmName(name3) {
6936
+ const bytes = new TextEncoder().encode(name3);
6937
+ return [...encodeWasmNumber(bytes.length), ...bytes];
6938
+ }
6939
+ function readWasmSection(bytes, start, end) {
6940
+ let at = start;
6941
+ const number3 = () => {
6942
+ let value = 0;
6943
+ for (let shift = 0; ; shift += 7) {
6944
+ if (at >= end || shift > 63) throw new Error("invalid wasm integer");
6945
+ const byte = bytes[at++];
6946
+ value += (byte & 127) * 2 ** shift;
6947
+ if (!(byte & 128)) return value;
6948
+ }
6949
+ };
6950
+ return {
6951
+ number: number3,
6952
+ byte: () => {
6953
+ if (at >= end) throw new Error("truncated wasm section");
6954
+ return bytes[at++];
6955
+ },
6956
+ name: () => {
6957
+ const length = number3();
6958
+ at += length;
6959
+ if (at > end) throw new Error("truncated wasm name");
6960
+ return Buffer.from(bytes.buffer, bytes.byteOffset + at - length, length).toString();
6961
+ },
6962
+ position: () => at,
6963
+ done: () => at === end
6964
+ };
6965
+ }
6966
+ function wasmSections(bytes) {
6967
+ if (Buffer.from(bytes.subarray(0, 8)).toString("hex") !== "0061736d01000000")
6968
+ throw new Error("not a wasm module");
6969
+ const found = [];
6970
+ for (let at = 8; at < bytes.length; ) {
6971
+ const header = readWasmSection(bytes, at, bytes.length);
6972
+ const id = header.byte();
6973
+ const size = header.number();
6974
+ const start = header.position();
6975
+ if (start + size > bytes.length) throw new Error("truncated wasm section");
6976
+ found.push({ id, offset: at, start, end: start + size });
6977
+ at = start + size;
6978
+ }
6979
+ return found;
6980
+ }
6981
+ var init_wasm_binary_sections = __esm({
6982
+ "src/wasm-binary-sections.ts"() {
6983
+ "use strict";
6984
+ }
6985
+ });
6986
+
6987
+ // src/wasm-imports.ts
6988
+ function readWasmImports(bytes, section2, visit) {
6989
+ const input = readWasmSection(bytes, section2.start, section2.end);
6990
+ const count = input.number();
6991
+ const valueType = () => {
6992
+ const first = input.byte();
6993
+ if (first === 99 || first === 100) input.number();
6994
+ };
6995
+ const limits = () => {
6996
+ const flags = input.number();
6997
+ input.number();
6998
+ if (flags & 1) input.number();
6999
+ if (flags & 8) input.number();
7000
+ };
7001
+ for (let index = 0; index < count; index++) {
7002
+ const start = input.position();
7003
+ const module2 = input.name();
7004
+ const name3 = input.name();
7005
+ const type = input.position();
7006
+ const kind = input.byte();
7007
+ switch (kind) {
7008
+ case 0:
7009
+ input.number();
7010
+ break;
7011
+ case 1:
7012
+ valueType();
7013
+ limits();
7014
+ break;
7015
+ case 2:
7016
+ limits();
7017
+ break;
7018
+ case 3:
7019
+ valueType();
7020
+ input.byte();
7021
+ break;
7022
+ case 4:
7023
+ input.byte();
7024
+ input.number();
7025
+ break;
7026
+ default:
7027
+ throw new Error(`unsupported Wasm import kind ${kind}`);
7028
+ }
7029
+ visit({ module: module2, name: name3, kind, start, type, end: input.position() });
7030
+ }
7031
+ if (!input.done()) throw new Error("invalid Wasm imports");
7032
+ return count;
7033
+ }
7034
+ var init_wasm_imports = __esm({
7035
+ "src/wasm-imports.ts"() {
7036
+ "use strict";
7037
+ init_wasm_binary_sections();
7038
+ }
7039
+ });
7040
+
6901
7041
  // src/swift-sdk-image-map.ts
7042
+ function assertPeachGuestEngineLink(map, linked) {
7043
+ const guestSymbol = /^peach_guest_(sdk|removed|service)_/;
7044
+ const unresolved = /* @__PURE__ */ new Set();
7045
+ for (const chunk of map.code) {
7046
+ if (chunk.inputFile !== "<internal>" || chunk.section !== "undefined_stub") continue;
7047
+ for (const { name: name3 } of chunk.symbols) if (guestSymbol.test(name3)) unresolved.add(name3);
7048
+ }
7049
+ if (unresolved.size)
7050
+ throw new Error(
7051
+ `unresolved PeachEngine calls in the Swift SDK:
7052
+ ${[...unresolved].sort().join("\n")}`
7053
+ );
7054
+ const imports = wasmSections(linked).find((section2) => section2.id === 2);
7055
+ if (imports)
7056
+ readWasmImports(linked, imports, ({ kind, module: module2, name: name3 }) => {
7057
+ if (module2 !== PEACH_GUEST_SERVICE_MODULE && !guestSymbol.test(name3)) return;
7058
+ if (kind === 0 && module2 === PEACH_GUEST_SERVICE_MODULE && peachGuestServiceSymbols.includes(name3))
7059
+ return;
7060
+ throw new Error(
7061
+ `unexpected PeachEngine host import in the Swift SDK: ${module2}.${name3}`
7062
+ );
7063
+ });
7064
+ }
6902
7065
  function isHexChar(code) {
6903
7066
  return code >= 48 && code <= 57 || code >= 97 && code <= 102;
6904
7067
  }
@@ -7067,7 +7230,10 @@ var init_swift_sdk_image_map = __esm({
7067
7230
  "src/swift-sdk-image-map.ts"() {
7068
7231
  "use strict";
7069
7232
  import_node_path16 = require("node:path");
7233
+ init_guest_engine_services();
7070
7234
  init_swift_guest_linked_spans();
7235
+ init_wasm_binary_sections();
7236
+ init_wasm_imports();
7071
7237
  PARTITIONED = [
7072
7238
  ".rodata",
7073
7239
  ".data",
@@ -7140,7 +7306,7 @@ function wasmReader(bytes, start) {
7140
7306
  }
7141
7307
  };
7142
7308
  }
7143
- function wasmSections(bytes) {
7309
+ function wasmSections2(bytes) {
7144
7310
  const out = [];
7145
7311
  for (let at = 8; at < bytes.length; ) {
7146
7312
  const r = wasmReader(bytes, at);
@@ -7233,7 +7399,7 @@ function* readFunctionNames(bytes, names) {
7233
7399
  }
7234
7400
  }
7235
7401
  function orderObjCConstructors(bytes) {
7236
- const sections = wasmSections(bytes);
7402
+ const sections = wasmSections2(bytes);
7237
7403
  const names = sections.find((s) => s.name === "name");
7238
7404
  if (!names) return bytes;
7239
7405
  let constructors;
@@ -7281,7 +7447,7 @@ function orderObjCConstructors(bytes) {
7281
7447
  return ordered;
7282
7448
  }
7283
7449
  function readModule(bytes) {
7284
- const sections = wasmSections(bytes);
7450
+ const sections = wasmSections2(bytes);
7285
7451
  const get = (id) => sections.find((s) => s.id === id);
7286
7452
  const types = [];
7287
7453
  const typeSection = get(1);
@@ -7485,7 +7651,7 @@ function finishSdkImage(bytes, hostExports, libraries, guestMap) {
7485
7651
  return { image: Buffer.concat(parts), sdkInterface, functionSlots };
7486
7652
  }
7487
7653
  function passiveSegments(bytes) {
7488
- const data = wasmSections(bytes).find((s) => s.id === 11);
7654
+ const data = wasmSections2(bytes).find((s) => s.id === 11);
7489
7655
  if (!data) throw new Error("sdk image has no data section");
7490
7656
  const r = wasmReader(bytes, data.start);
7491
7657
  const out = [];
@@ -7590,7 +7756,7 @@ function codeOnlySdkImage(bytes, constructorMask) {
7590
7756
  function constructorKeys(map, bytes) {
7591
7757
  const first = map.code[0];
7592
7758
  if (!first) throw new Error("link has no code");
7593
- const sections = wasmSections(bytes);
7759
+ const sections = wasmSections2(bytes);
7594
7760
  const code = sections.find((s) => s.id === 10);
7595
7761
  if (!code) throw new Error("link has no code");
7596
7762
  const ctors = map.code.find((chunk) => chunk.section === "__wasm_call_ctors");
@@ -7662,7 +7828,7 @@ function constructorKeys(map, bytes) {
7662
7828
  return keys;
7663
7829
  }
7664
7830
  function relocationEdges(bytes, segmentAddress) {
7665
- const sections = wasmSections(bytes);
7831
+ const sections = wasmSections2(bytes);
7666
7832
  const linking = sections.find((s) => s.name === "linking");
7667
7833
  if (!linking) throw new Error("relocation link has no linking section");
7668
7834
  let symKind = new Uint8Array(0);
@@ -7830,7 +7996,7 @@ function relocationEdges(bytes, segmentAddress) {
7830
7996
  return { data, code, dataFunctions, calls };
7831
7997
  }
7832
7998
  function strongDefinitions(bytes) {
7833
- const linking = wasmSections(bytes).find((s) => s.name === "linking");
7999
+ const linking = wasmSections2(bytes).find((s) => s.name === "linking");
7834
8000
  if (!linking) return [];
7835
8001
  const r = wasmReader(bytes, linking.start);
7836
8002
  r.u();
@@ -7873,7 +8039,7 @@ function strongDefinitions(bytes) {
7873
8039
  ).map((s) => s.name);
7874
8040
  }
7875
8041
  function unslottedFunctions(bytes) {
7876
- const sections = wasmSections(bytes);
8042
+ const sections = wasmSections2(bytes);
7877
8043
  const importedFuncs = countImportedFunctions(
7878
8044
  bytes,
7879
8045
  sections.find((s) => s.id === 2)
@@ -12016,68 +12182,6 @@ var init_swift_guest_image_ledger = __esm({
12016
12182
  }
12017
12183
  });
12018
12184
 
12019
- // src/wasm-binary-sections.ts
12020
- function encodeWasmNumber(value) {
12021
- const bytes = [];
12022
- for (let rest = value; ; ) {
12023
- const byte = rest % 128;
12024
- rest = Math.floor(rest / 128);
12025
- if (rest === 0) return [...bytes, byte];
12026
- bytes.push(byte | 128);
12027
- }
12028
- }
12029
- function encodeWasmName(name3) {
12030
- const bytes = new TextEncoder().encode(name3);
12031
- return [...encodeWasmNumber(bytes.length), ...bytes];
12032
- }
12033
- function readWasmSection(bytes, start, end) {
12034
- let at = start;
12035
- const number3 = () => {
12036
- let value = 0;
12037
- for (let shift = 0; ; shift += 7) {
12038
- if (at >= end || shift > 63) throw new Error("invalid wasm integer");
12039
- const byte = bytes[at++];
12040
- value += (byte & 127) * 2 ** shift;
12041
- if (!(byte & 128)) return value;
12042
- }
12043
- };
12044
- return {
12045
- number: number3,
12046
- byte: () => {
12047
- if (at >= end) throw new Error("truncated wasm section");
12048
- return bytes[at++];
12049
- },
12050
- name: () => {
12051
- const length = number3();
12052
- at += length;
12053
- if (at > end) throw new Error("truncated wasm name");
12054
- return Buffer.from(bytes.buffer, bytes.byteOffset + at - length, length).toString();
12055
- },
12056
- position: () => at,
12057
- done: () => at === end
12058
- };
12059
- }
12060
- function wasmSections2(bytes) {
12061
- if (Buffer.from(bytes.subarray(0, 8)).toString("hex") !== "0061736d01000000")
12062
- throw new Error("not a wasm module");
12063
- const found = [];
12064
- for (let at = 8; at < bytes.length; ) {
12065
- const header = readWasmSection(bytes, at, bytes.length);
12066
- const id = header.byte();
12067
- const size = header.number();
12068
- const start = header.position();
12069
- if (start + size > bytes.length) throw new Error("truncated wasm section");
12070
- found.push({ id, offset: at, start, end: start + size });
12071
- at = start + size;
12072
- }
12073
- return found;
12074
- }
12075
- var init_wasm_binary_sections = __esm({
12076
- "src/wasm-binary-sections.ts"() {
12077
- "use strict";
12078
- }
12079
- });
12080
-
12081
12185
  // src/wasm-narrow-boundary.ts
12082
12186
  function writeWasmCustomSections(bytes, entries2) {
12083
12187
  if (entries2.length === 0) return Buffer.concat([bytes]);
@@ -12085,7 +12189,7 @@ function writeWasmCustomSections(bytes, entries2) {
12085
12189
  const parts = [];
12086
12190
  let sliceStart = 0;
12087
12191
  let sliceEnd = 8;
12088
- for (const { id, start, end } of wasmSections2(bytes)) {
12192
+ for (const { id, start, end } of wasmSections(bytes)) {
12089
12193
  if (id === 0 && replaced.has(readWasmSection(bytes, start, end).name())) {
12090
12194
  if (sliceEnd > sliceStart) parts.push(bytes.subarray(sliceStart, sliceEnd));
12091
12195
  sliceStart = end;
@@ -12109,7 +12213,7 @@ function writeWasmCustomSection(bytes, name3, data) {
12109
12213
  return writeWasmCustomSections(bytes, [[name3, data]]);
12110
12214
  }
12111
12215
  function readWasmMemory(bytes) {
12112
- return readWasmMemoryAndTableImports(bytes, wasmSections2(bytes)).memory;
12216
+ return readWasmMemoryAndTableImports(bytes, wasmSections(bytes)).memory;
12113
12217
  }
12114
12218
  function readWasmMemoryAndTableImports(bytes, layout2) {
12115
12219
  let memory;
@@ -12170,7 +12274,7 @@ function withSections(bytes, layout2, replacements) {
12170
12274
  return Buffer.concat(parts);
12171
12275
  }
12172
12276
  function narrowWasmBoundary(bytes, wideExports) {
12173
- const layout2 = wasmSections2(bytes);
12277
+ const layout2 = wasmSections(bytes);
12174
12278
  const section2 = (id) => {
12175
12279
  const found = layout2.find((entry) => entry.id === id);
12176
12280
  return found && readWasmSection(bytes, found.start, found.end);
@@ -12296,7 +12400,7 @@ ${[...imports, ...functions].join("\n")}
12296
12400
  };
12297
12401
  }
12298
12402
  function dropBoundaryExports(bytes) {
12299
- const layout2 = wasmSections2(bytes);
12403
+ const layout2 = wasmSections(bytes);
12300
12404
  const found = layout2.find((entry) => entry.id === 7);
12301
12405
  if (!found) throw new Error("merged module has no exports");
12302
12406
  const exportSection = readWasmSection(bytes, found.start, found.end);
@@ -12315,7 +12419,7 @@ function dropBoundaryExports(bytes) {
12315
12419
  );
12316
12420
  }
12317
12421
  function withWasmTableMinimum(bytes, minimum) {
12318
- const layout2 = wasmSections2(bytes);
12422
+ const layout2 = wasmSections(bytes);
12319
12423
  const table = layout2.find(({ id }) => id === 4);
12320
12424
  if (!table) {
12321
12425
  if (readWasmMemoryAndTableImports(bytes, layout2).tableImports === 1) return bytes;
@@ -12592,7 +12696,7 @@ function entries(bytes, section2, entry) {
12592
12696
  return out;
12593
12697
  }
12594
12698
  function appendLazyPlacement(bytes, functions, table) {
12595
- const sections = wasmSections(bytes);
12699
+ const sections = wasmSections2(bytes);
12596
12700
  const section2 = (id) => sections.find((s) => s.id === id);
12597
12701
  const imports = readImports2(bytes, sections);
12598
12702
  const changes = /* @__PURE__ */ new Map();
@@ -12710,7 +12814,7 @@ function skipElementSegment(r) {
12710
12814
  else r.u();
12711
12815
  }
12712
12816
  function placeGuestLazyFunctions(bytes, lazy) {
12713
- const sections = wasmSections(bytes);
12817
+ const sections = wasmSections2(bytes);
12714
12818
  const lazyIndex = new Map(lazy.map((name3, index) => [name3, index]));
12715
12819
  const functions = new Array(lazy.length);
12716
12820
  let found = 0;
@@ -19695,6 +19799,8 @@ async function linkSwiftSdkImage(moduleRoot, key, directory, work, scopedLookups
19695
19799
  import_node_path37.default.join(work, "exports.rsp"),
19696
19800
  [...defined].map((name3) => quote2(`--export-if-defined=${name3}`)).join("\n")
19697
19801
  );
19802
+ const guestServices = import_node_path37.default.join(work, "peach-guest-services.allow");
19803
+ (0, import_node_fs37.writeFileSync)(guestServices, peachGuestServiceAllowlist);
19698
19804
  const args = [
19699
19805
  ...link.flags,
19700
19806
  `--global-base=${SWIFT_SDK_MEMORY_BASE}`,
@@ -19706,6 +19812,7 @@ async function linkSwiftSdkImage(moduleRoot, key, directory, work, scopedLookups
19706
19812
  ...lazy,
19707
19813
  "--end-lib",
19708
19814
  "--unresolved-symbols=ignore-all",
19815
+ `--allow-undefined-file=${guestServices}`,
19709
19816
  "--export-dynamic",
19710
19817
  ...[
19711
19818
  "__peach_sdk_register",
@@ -19738,8 +19845,9 @@ async function linkSwiftSdkImage(moduleRoot, key, directory, work, scopedLookups
19738
19845
  if (result.status === "rejected") throw result.reason;
19739
19846
  }
19740
19847
  const rawLink = (0, import_node_fs37.readFileSync)(linked);
19741
- const linkedBytes = lookups ? rawLink : orderObjCConstructors(rawLink);
19742
19848
  const linkMap = readWasmLinkMap(map, true);
19849
+ assertPeachGuestEngineLink(linkMap, rawLink);
19850
+ const linkedBytes = lookups ? rawLink : orderObjCConstructors(rawLink);
19743
19851
  const {
19744
19852
  image: finished,
19745
19853
  sdkInterface,
@@ -19844,7 +19952,7 @@ function sdkLinkInputs(appRoot) {
19844
19952
  return { flags, libraries, objects: [crt, ...objects], providers };
19845
19953
  }
19846
19954
  function autolinkLibraries(bytes) {
19847
- const entries2 = wasmSections(bytes).find((s) => s.name === ".swift1_autolink_entries");
19955
+ const entries2 = wasmSections2(bytes).find((s) => s.name === ".swift1_autolink_entries");
19848
19956
  if (!entries2) return [];
19849
19957
  const raw2 = Buffer.isBuffer(bytes) ? bytes : Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength);
19850
19958
  return raw2.toString("utf8", entries2.start, entries2.end).split("\0").filter((entry) => entry.startsWith("-l"));
@@ -19854,7 +19962,7 @@ function sdkHostExports(appRoot) {
19854
19962
  const linked = (0, import_node_fs37.readdirSync)(release).find((name3) => name3.endsWith(".wasm"));
19855
19963
  if (!linked) throw new Error("the sdk image link found no empty app image");
19856
19964
  const bytes = (0, import_node_fs37.readFileSync)(import_node_path37.default.join(release, linked));
19857
- const exports2 = wasmSections(bytes).find((s) => s.id === 7);
19965
+ const exports2 = wasmSections2(bytes).find((s) => s.id === 7);
19858
19966
  if (!exports2) return [];
19859
19967
  const names = [];
19860
19968
  let at = exports2.start;
@@ -20056,6 +20164,7 @@ var init_swift_sdk_image = __esm({
20056
20164
  import_node_fs37 = require("node:fs");
20057
20165
  import_node_path37 = __toESM(require("node:path"), 1);
20058
20166
  import_node_util7 = require("node:util");
20167
+ init_guest_engine_services();
20059
20168
  init_native_prebuilt();
20060
20169
  init_swift_compile();
20061
20170
  init_swift_darwin_records();
@@ -20633,7 +20742,7 @@ async function linkSwiftAppModule(options) {
20633
20742
  };
20634
20743
  }
20635
20744
  function sdkImportThunks(bytes) {
20636
- const sections = wasmSections(bytes);
20745
+ const sections = wasmSections2(bytes);
20637
20746
  const section2 = (id) => sections.find((s) => s.id === id);
20638
20747
  const valueType = (r) => {
20639
20748
  const type = r.byte();
@@ -20764,7 +20873,7 @@ function sdkImportThunks(bytes) {
20764
20873
  function resolveSdkReferences(source, sdk, forwarders) {
20765
20874
  const bytes = new Uint8Array(source.buffer, source.byteOffset, source.byteLength);
20766
20875
  const { data: sdkData, signatures } = sdk.sdkInterface;
20767
- const sections = wasmSections(bytes);
20876
+ const sections = wasmSections2(bytes);
20768
20877
  const linking = sections.find((s) => s.name === "linking");
20769
20878
  if (!linking) throw new Error("app link has no linking section");
20770
20879
  const symbols = [];
@@ -28396,8 +28505,16 @@ async function withSwiftFrameworkSlot(frameworkKey, release, moduleRoot, signal,
28396
28505
  if (mode === "restage" && !matches && !allowHotForeign && isRecentForeignReceipt(slot, Date.now()))
28397
28506
  return;
28398
28507
  if (!matches) logSelection?.();
28508
+ if (mode === "extend")
28509
+ console.error(
28510
+ `[swift-framework-cache] ${import_node_path49.default.basename(slot)} miss=products release=${release}`
28511
+ );
28399
28512
  const value = await work(slot, lease, allowWrite);
28400
28513
  if (value === void 0) return;
28514
+ if (mode === "reuse")
28515
+ console.error(
28516
+ `[swift-framework-cache] ${import_node_path49.default.basename(slot)} hit=products release=${release}`
28517
+ );
28401
28518
  const now = /* @__PURE__ */ new Date();
28402
28519
  (0, import_node_fs47.utimesSync)(slot, now, now);
28403
28520
  return { value };
@@ -28473,7 +28590,7 @@ async function withSwiftFrameworkSlot(frameworkKey, release, moduleRoot, signal,
28473
28590
  "restage",
28474
28591
  () => {
28475
28592
  console.error(
28476
- `[swift-framework-cache] ${import_node_path49.default.basename(slot)} release=${release} tier=${tier} changedInputs=${changes} totalInputs=${inputs.size}`
28593
+ `[swift-framework-cache] ${import_node_path49.default.basename(slot)} miss=revision release=${release} tier=${tier} changedInputs=${changes} totalInputs=${inputs.size}`
28477
28594
  );
28478
28595
  },
28479
28596
  tier >= 2
@@ -29730,7 +29847,7 @@ ${wasmThreadLinkFlags.map((flag) => ` "-Xlinker", ${JSON.stringify(flag
29730
29847
  REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
29731
29848
  MULTI_MANIFEST_VERSION = 76;
29732
29849
  SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
29733
- compilerSourceDigest = true ? "97e56f880988b86233aa6fa82009e0743ec570daba3814eaf1af72111e3301d9" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
29850
+ compilerSourceDigest = true ? "07651c3448f918d1873b3ecc1d3db59948c7cbfdd917cd5b69da610a327f857a" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
29734
29851
  nativeCxxCompilerFlags = ["-fno-cxx-modules"];
29735
29852
  MODULE_MAP_RESPONSE_FILE_RUN = 16;
29736
29853
  cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2737 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2742 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  import {
3
3
  MULTI_MANIFEST_VERSION,
4
4
  WASM_TRIPLE,
@@ -40,8 +40,8 @@ import {
40
40
  withNativeSourceGlue,
41
41
  wrapUIApplicationMainEntry,
42
42
  writeSwiftProject
43
- } from "./esm-chunks/chunk-BLZBR4EF.mjs";
44
- import "./esm-chunks/chunk-EJAMKRK2.mjs";
43
+ } from "./esm-chunks/chunk-2SC45KUK.mjs";
44
+ import "./esm-chunks/chunk-OXFGIZC4.mjs";
45
45
  import {
46
46
  FOUNDATION_IMPLICIT_MODULES,
47
47
  REACH_STAGED_FRAMEWORKS,
@@ -66,15 +66,15 @@ import {
66
66
  swiftSdkPaths,
67
67
  withFrameworkCompanionImports,
68
68
  withoutSwiftDeclarations
69
- } from "./esm-chunks/chunk-P3XPAQTO.mjs";
70
- import "./esm-chunks/chunk-K5SO6HTC.mjs";
71
- import "./esm-chunks/chunk-NK3Y2DEM.mjs";
72
- import "./esm-chunks/chunk-3BDZ7ZVC.mjs";
73
- import "./esm-chunks/chunk-PXHA5JY3.mjs";
74
- import "./esm-chunks/chunk-PGMWOIWH.mjs";
75
- import "./esm-chunks/chunk-2VEJSLIG.mjs";
76
- import "./esm-chunks/chunk-M3T47BLB.mjs";
77
- import "./esm-chunks/chunk-TKYSVJ6N.mjs";
69
+ } from "./esm-chunks/chunk-Y4Q3W36I.mjs";
70
+ import "./esm-chunks/chunk-VWRLBFID.mjs";
71
+ import "./esm-chunks/chunk-IVVVYJKG.mjs";
72
+ import "./esm-chunks/chunk-U262IRGM.mjs";
73
+ import "./esm-chunks/chunk-VH5KY2GM.mjs";
74
+ import "./esm-chunks/chunk-CFPPESX7.mjs";
75
+ import "./esm-chunks/chunk-MHRTZ6I7.mjs";
76
+ import "./esm-chunks/chunk-RC3JQV7D.mjs";
77
+ import "./esm-chunks/chunk-6QTRZNLH.mjs";
78
78
  export {
79
79
  FOUNDATION_IMPLICIT_MODULES,
80
80
  MULTI_MANIFEST_VERSION,
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2737 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2742 | (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.2737 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2742 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  import {
3
3
  OBJC_RESOURCE_ACCESSOR_BODY,
4
4
  OBJC_RESOURCE_ACCESSOR_HEADER,
@@ -33,8 +33,8 @@ import {
33
33
  swiftResourceBundles,
34
34
  swiftTargetModuleName,
35
35
  withoutGlogModuleMap
36
- } from "./esm-chunks/chunk-3BDZ7ZVC.mjs";
37
- import "./esm-chunks/chunk-TKYSVJ6N.mjs";
36
+ } from "./esm-chunks/chunk-U262IRGM.mjs";
37
+ import "./esm-chunks/chunk-6QTRZNLH.mjs";
38
38
  export {
39
39
  OBJC_RESOURCE_ACCESSOR_BODY,
40
40
  OBJC_RESOURCE_ACCESSOR_HEADER,
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2737 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2742 | (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,16 +1,16 @@
1
- /*! peach v0.1.2737 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2742 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  import {
3
3
  SWIFT_HMR_PATH,
4
4
  SWIFT_PACKAGE_PATH
5
- } from "./esm-chunks/chunk-X4KKXB5Z.mjs";
5
+ } from "./esm-chunks/chunk-FKC5RBXR.mjs";
6
6
  import {
7
7
  isSwiftMetalLibrarySources
8
- } from "./esm-chunks/chunk-NK3Y2DEM.mjs";
9
- import "./esm-chunks/chunk-PXHA5JY3.mjs";
8
+ } from "./esm-chunks/chunk-IVVVYJKG.mjs";
9
+ import "./esm-chunks/chunk-VH5KY2GM.mjs";
10
10
  import {
11
11
  isRecord
12
- } from "./esm-chunks/chunk-M3T47BLB.mjs";
13
- import "./esm-chunks/chunk-TKYSVJ6N.mjs";
12
+ } from "./esm-chunks/chunk-RC3JQV7D.mjs";
13
+ import "./esm-chunks/chunk-6QTRZNLH.mjs";
14
14
 
15
15
  // src/swift-submit.ts
16
16
  var SWIFT_COMPILE_PATH = "/api/swift-compile";
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2737 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2742 | (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;