peachsim 0.1.2521 → 0.1.2523

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 (141) 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 +18 -7
  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 +2 -2
  25. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  26. package/dist-lib/esm-chunks/{acorn-4JVXGEDW.mjs → acorn-NXIHV6CW.mjs} +3 -3
  27. package/dist-lib/esm-chunks/{chunk-MDWKX5GI.mjs → chunk-25AXI47D.mjs} +1 -1
  28. package/dist-lib/esm-chunks/{chunk-NSGZF3QW.mjs → chunk-34NH5JMC.mjs} +1 -1
  29. package/dist-lib/esm-chunks/{chunk-HSKIQSPO.mjs → chunk-3FLRJG7Z.mjs} +4 -4
  30. package/dist-lib/esm-chunks/{chunk-3HKF2MNZ.mjs → chunk-4O3KYDK6.mjs} +1 -1
  31. package/dist-lib/esm-chunks/{chunk-D37M2XQX.mjs → chunk-564FVBVS.mjs} +13 -13
  32. package/dist-lib/esm-chunks/{chunk-HY6PNY4A.mjs → chunk-5TQINN32.mjs} +1 -1
  33. package/dist-lib/esm-chunks/{chunk-FHMICG4V.mjs → chunk-75FOOVTJ.mjs} +1 -1
  34. package/dist-lib/esm-chunks/{chunk-EH47OK5J.mjs → chunk-7SYYIUX6.mjs} +3 -3
  35. package/dist-lib/esm-chunks/{chunk-D4MWPIVL.mjs → chunk-7WUGKS76.mjs} +1 -1
  36. package/dist-lib/esm-chunks/{chunk-4GCQVV36.mjs → chunk-AJIRKCRD.mjs} +5 -5
  37. package/dist-lib/esm-chunks/{chunk-WCBTD7CJ.mjs → chunk-BIEC4VVJ.mjs} +5 -5
  38. package/dist-lib/esm-chunks/{chunk-HBYQWZJW.mjs → chunk-E3E2UUV3.mjs} +1 -1
  39. package/dist-lib/esm-chunks/{chunk-KBUZQIKU.mjs → chunk-ENQ2Y2BX.mjs} +1 -1
  40. package/dist-lib/esm-chunks/{chunk-R2D667KZ.mjs → chunk-FA7GRXO4.mjs} +1 -1
  41. package/dist-lib/esm-chunks/{chunk-YNLZCNHF.mjs → chunk-MEFRUBSD.mjs} +1 -1
  42. package/dist-lib/esm-chunks/{chunk-TIH3DEXP.mjs → chunk-MTA5YBSW.mjs} +1 -1
  43. package/dist-lib/esm-chunks/{chunk-X3FFTU6E.mjs → chunk-Q665MVWH.mjs} +1 -1
  44. package/dist-lib/esm-chunks/{chunk-BYCC3XF7.mjs → chunk-UIWAOJNG.mjs} +1 -1
  45. package/dist-lib/esm-chunks/{chunk-YGYTY5RM.mjs → chunk-UYTMSUTD.mjs} +1 -1
  46. package/dist-lib/esm-chunks/{chunk-KFVMTY3M.mjs → chunk-W4IQ4HR4.mjs} +2 -2
  47. package/dist-lib/esm-chunks/{chunk-33NEBPBL.mjs → chunk-ZJNHWIHR.mjs} +1 -1
  48. package/dist-lib/esm-chunks/{metro-layout-parser-VJOMJGRY.mjs → metro-layout-parser-HS2DSJ2U.mjs} +3 -3
  49. package/dist-lib/esm-chunks/{swift-package-prebuilt-WDK4LE54.mjs → swift-package-prebuilt-S6E6UJUN.mjs} +10 -10
  50. package/dist-lib/esm-chunks/{swift-sdk-app-module-W22UVP5E.mjs → swift-sdk-app-module-HCHHQFJW.mjs} +13 -13
  51. package/dist-lib/esm-chunks/{swift-sdk-image-5P6YHUKB.mjs → swift-sdk-image-5HXI7CM7.mjs} +13 -13
  52. package/dist-lib/esm-chunks/{swift-sdk-image-producer-S5ZJTUTW.mjs → swift-sdk-image-producer-Z45DZJKU.mjs} +4 -4
  53. package/dist-lib/expo-swift-bundle.cjs +16 -5
  54. package/dist-lib/expo-swift-metadata.cjs +1 -1
  55. package/dist-lib/expo-swift-metadata.mjs +7 -7
  56. package/dist-lib/home-paths.cjs +1 -1
  57. package/dist-lib/host/bridge-host.cjs +124 -84
  58. package/dist-lib/host/fetch-proxy-handler.cjs +6 -5
  59. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  60. package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
  61. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  62. package/dist-lib/host/websocket-proxy.cjs +1 -1
  63. package/dist-lib/index.cjs +1 -1
  64. package/dist-lib/kotlin-host.cjs +1 -1
  65. package/dist-lib/menu.cjs +1 -1
  66. package/dist-lib/menu.mjs +3 -3
  67. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  68. package/dist-lib/metro-fingerprint-registry.mjs +3 -3
  69. package/dist-lib/metro-production-bundle.cjs +1 -1
  70. package/dist-lib/metro-production-bundle.mjs +4 -4
  71. package/dist-lib/native-app-identity-project.cjs +2 -2
  72. package/dist-lib/native-app-identity-project.mjs +15 -15
  73. package/dist-lib/native-app-identity.cjs +1 -1
  74. package/dist-lib/native-app-identity.mjs +6 -6
  75. package/dist-lib/native-firebase-metadata.cjs +1 -1
  76. package/dist-lib/native-firebase-metadata.mjs +3 -3
  77. package/dist-lib/pdfium-raster.cjs +1 -1
  78. package/dist-lib/pdfium-raster.mjs +2 -2
  79. package/dist-lib/plist.cjs +1 -1
  80. package/dist-lib/plist.mjs +3 -3
  81. package/dist-lib/profiles.cjs +1 -1
  82. package/dist-lib/public-brand.cjs +1 -1
  83. package/dist-lib/public-origins-lib-esm.json +79 -79
  84. package/dist-lib/public-origins-lib.json +69 -69
  85. package/dist-lib/react-native-host-modules.cjs +1 -1
  86. package/dist-lib/react-native-host-modules.mjs +2 -2
  87. package/dist-lib/reap-browser.cjs +1 -1
  88. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  89. package/dist-lib/sdk.cjs +1 -1
  90. package/dist-lib/sdk.mjs +7 -7
  91. package/dist-lib/skills.cjs +144 -104
  92. package/dist-lib/swift-compile.cjs +2 -2
  93. package/dist-lib/swift-compile.mjs +10 -10
  94. package/dist-lib/swift-package.cjs +1 -1
  95. package/dist-lib/swift-package.mjs +3 -3
  96. package/dist-lib/swift-submit.cjs +1 -1
  97. package/dist-lib/swift-submit.mjs +5 -5
  98. package/dist-lib/swift-svg-raster.cjs +1 -1
  99. package/dist-lib/swift-svg-raster.mjs +2 -2
  100. package/dist-lib/swift-toolchain.cjs +1 -1
  101. package/dist-lib/swift.cjs +1 -1
  102. package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
  103. package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
  104. package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
  105. package/dist-lib/vendor/@xmldom/xmldom.cjs +1 -1
  106. package/dist-lib/vendor/acorn.cjs +1 -1
  107. package/dist-lib/vendor/bplist-parser.cjs +1 -1
  108. package/dist-lib/vendor/ignore.cjs +1 -1
  109. package/dist-lib/vendor/magic-string.cjs +1 -1
  110. package/dist-lib/vendor/plist.cjs +1 -1
  111. package/dist-lib/vendor/smol-toml.cjs +1 -1
  112. package/dist-lib/vendor/stream-json.cjs +1 -1
  113. package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
  114. package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
  115. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
  116. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
  117. package/dist-lib/vendor/sucrase.cjs +1 -1
  118. package/dist-lib/vendor/terser.cjs +1 -1
  119. package/dist-lib/vendor/valibot.cjs +1 -1
  120. package/dist-lib/vendor/ws.cjs +1 -1
  121. package/dist-lib/vendor/zod.cjs +1 -1
  122. package/dist-lib/worklet-executable.cjs +1 -1
  123. package/dist-lib/worklet-executable.mjs +3 -3
  124. package/dist-types/packages/peach-engine/src/engine/image-fetch.d.ts +2 -1
  125. package/dist-types/packages/peach-engine/src/engine/native-image-scope.d.ts +12 -0
  126. package/dist-types/packages/peach-engine/src/engine/native-shell-services.d.ts +1 -0
  127. package/dist-types/packages/peach-engine/src/engine/remote-display-protocol.d.ts +35 -5
  128. package/dist-types/packages/peach-engine/src/engine/scene-stream-decoder.d.ts +62 -0
  129. package/dist-types/packages/peach-engine/src/engine/scene-stream-encoder.d.ts +66 -0
  130. package/dist-types/packages/peach-engine/src/engine/scene-stream-shared.d.ts +28 -0
  131. package/dist-types/packages/peach-engine/src/remote-stream/cloud-display.d.ts +2 -2
  132. package/dist-types/packages/peach-engine/src/render-worker/compositor-gpu.d.ts +2 -2
  133. package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +7 -1
  134. package/dist-types/packages/peach-engine/src/render-worker/compositor-surface-host.d.ts +1 -0
  135. package/dist-types/packages/peach-engine/src/render-worker/tree-sync-port.d.ts +4 -4
  136. package/kotlin/sdk.tar.gz +0 -0
  137. package/package.json +1 -1
  138. package/runtime-companion.json +1 -1
  139. package/src/host/bridge-host.ts +8 -1
  140. package/src/one-native-source.ts +19 -1
  141. package/src/swift-host.ts +31 -15
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2521 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2523 | (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;
@@ -29987,7 +29987,7 @@ var init_runtime_assets = __esm({
29987
29987
  var runtime_companion_default;
29988
29988
  var init_runtime_companion = __esm({
29989
29989
  "runtime-companion.json"() {
29990
- runtime_companion_default = { abi: 1, sha256: "368390e08d3df4162311512f9e518084ee7985676c712668fc9f3f299ddd6a17", file: "node/cli-368390e08d3df4162311512f9e518084ee7985676c712668fc9f3f299ddd6a17.cjs" };
29990
+ runtime_companion_default = { abi: 1, sha256: "20804d67689cee628419f18ac4a7845afcff248ade4ff2fbf1830f109911b778", file: "node/cli-20804d67689cee628419f18ac4a7845afcff248ade4ff2fbf1830f109911b778.cjs" };
29991
29991
  }
29992
29992
  });
29993
29993
 
@@ -35508,13 +35508,13 @@ var init_swift_standin_digest = __esm({
35508
35508
  STANDIN_DIGEST_ENTRYPOINTS = ["swift-standins.ts", "swift-objc-compile.ts"];
35509
35509
  SPECIFIER = /from\s*['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
35510
35510
  standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
35511
- STANDIN_SOURCE_DIGEST = true ? "ee755aef9b6ecca9f2c29b1a8f7591819e93663cfe22fee8c1bf4a9c03d6dcc8" : standinSourceDigest();
35511
+ STANDIN_SOURCE_DIGEST = true ? "f0b0ca3857062e6a7952520613c3225f9c50ba8242e781ff83bd00e9a2308146" : standinSourceDigest();
35512
35512
  }
35513
35513
  });
35514
35514
 
35515
35515
  // src/expo-native-compiler-digest.ts
35516
35516
  function expoNativeCompilerDigestValue() {
35517
- return true ? "541b4c3194b1acaa5a63ac6b080cd95b0af99fe7b2eebe6a428cc694e179928e" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
35517
+ return true ? "08c851b31b91b97d5539e61f74f9338a036b17331aed2d5cc1df1fc20cd243eb" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
35518
35518
  }
35519
35519
  var import_node_crypto12;
35520
35520
  var init_expo_native_compiler_digest = __esm({
@@ -47218,7 +47218,7 @@ function enumValues(graphs2, surface, framework, toolchainBin, search, work, ori
47218
47218
  throw new Error(
47219
47219
  `clang could not read its enum values: ${run18.stderr.trim().slice(0, 400)}`
47220
47220
  );
47221
- const constants4 = /* @__PURE__ */ new Map();
47221
+ const constants5 = /* @__PURE__ */ new Map();
47222
47222
  const walk4 = (node) => {
47223
47223
  if (Array.isArray(node)) {
47224
47224
  for (const child of node) walk4(child);
@@ -47237,7 +47237,7 @@ function enumValues(graphs2, surface, framework, toolchainBin, search, work, ori
47237
47237
  for (const child of inner) {
47238
47238
  if (Reflect.get(child, "kind") !== "EnumConstantDecl") continue;
47239
47239
  const current2 = wrap(constantValue(child) ?? next);
47240
- constants4.set(String(Reflect.get(child, "name")), current2);
47240
+ constants5.set(String(Reflect.get(child, "name")), current2);
47241
47241
  next = current2 + 1n;
47242
47242
  }
47243
47243
  return;
@@ -47246,7 +47246,7 @@ function enumValues(graphs2, surface, framework, toolchainBin, search, work, ori
47246
47246
  };
47247
47247
  walk4(JSON.parse(run18.stdout));
47248
47248
  for (const [id, name3] of wanted) {
47249
- const value = constants4.get(name3);
47249
+ const value = constants5.get(name3);
47250
47250
  if (value !== void 0) values.set(id, value.toString());
47251
47251
  }
47252
47252
  return values;
@@ -62521,7 +62521,7 @@ var init_swift_guest_archive = __esm({
62521
62521
  });
62522
62522
 
62523
62523
  // ../peach-kit/src/nativeWasmContract.ts
62524
- var NATIVE_IMAGE_SECTION, NATIVE_TABLE_ABI, NATIVE_TABLE_IMPORT_MODULE, NATIVE_TABLE_ADAPT_IMPORT, NATIVE_DYLD_FUNCTION_IMPORT, NATIVE_DYLD_PLACE_EXPORT, NATIVE_DYLD_SECTION, NATIVE_LAZY_IMPORT_MODULE, NATIVE_SDK_IMPORT_MODULE, NATIVE_SDK_THUNK_SECTION, NATIVE_LAZY_SLOT_IMPORT, NATIVE_LAZY_SECTION, NATIVE_LAZY_DIGEST_BYTES, NATIVE_LAZY_PART_BYTES, NATIVE_LAZY_MAX_PARTS, NATIVE_PROFILE_SECTION, NATIVE_PROFILE_IMPORT, NATIVE_PROFILE_MEMORY, NATIVE_PROFILE_DUMP, NATIVE_PROFILE_ENDPOINT, NATIVE_TABLE_RESERVE_SLOTS;
62524
+ var NATIVE_IMAGE_SECTION, NATIVE_TABLE_ABI, NATIVE_TABLE_IMPORT_MODULE, NATIVE_TABLE_ADAPT_IMPORT, NATIVE_DYLD_FUNCTION_IMPORT, NATIVE_DYLD_PLACE_EXPORT, NATIVE_DYLD_SECTION, NATIVE_LAZY_IMPORT_MODULE, NATIVE_SDK_IMPORT_MODULE, NATIVE_SDK_THUNK_SECTION, NATIVE_LAZY_SLOT_IMPORT, NATIVE_LAZY_SECTION, NATIVE_LAZY_DIGEST_BYTES, NATIVE_LAZY_PART_BYTES, NATIVE_LAZY_MAX_PARTS, NATIVE_PROFILE_SECTION, NATIVE_PROFILE_IMPORT, NATIVE_PROFILE_MEMORY, NATIVE_PROFILE_DUMP, NATIVE_PROFILE_ENDPOINT, SWIFT_ARTIFACT_SHA256_HEADER, NATIVE_TABLE_RESERVE_SLOTS;
62525
62525
  var init_nativeWasmContract = __esm({
62526
62526
  "../peach-kit/src/nativeWasmContract.ts"() {
62527
62527
  "use strict";
@@ -62545,6 +62545,7 @@ var init_nativeWasmContract = __esm({
62545
62545
  NATIVE_PROFILE_MEMORY = "profile-data";
62546
62546
  NATIVE_PROFILE_DUMP = "__write_profile";
62547
62547
  NATIVE_PROFILE_ENDPOINT = "/__peach/swift-startup-profile";
62548
+ SWIFT_ARTIFACT_SHA256_HEADER = "x-peach-swift-sha256";
62548
62549
  NATIVE_TABLE_RESERVE_SLOTS = 4096;
62549
62550
  }
62550
62551
  });
@@ -80523,7 +80524,7 @@ ${wasmThreadLinkFlags.map((flag) => ` "-Xlinker", ${JSON.stringify(flag
80523
80524
  REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
80524
80525
  MULTI_MANIFEST_VERSION = 76;
80525
80526
  SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
80526
- compilerSourceDigest = true ? "0a35c1fe96573a24f15be0960f7304577be9fe83880decfe8308ae43fed817c7" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
80527
+ compilerSourceDigest = true ? "952ab7240f001281c94c716af8613ec129cfe2f6373e7d4d07f9729dfcb1c640" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
80527
80528
  nativeCxxCompilerFlags = ["-fno-cxx-modules"];
80528
80529
  MODULE_MAP_RESPONSE_FILE_RUN = 16;
80529
80530
  cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
@@ -102236,16 +102237,16 @@ function findHelper(type, name3, label, sources) {
102236
102237
  const open = implementation.index + declaration.index + declaration[0].length - 1;
102237
102238
  const block2 = braceBlock(blank, open);
102238
102239
  if (!block2) continue;
102239
- const constants4 = /* @__PURE__ */ new Map();
102240
+ const constants5 = /* @__PURE__ */ new Map();
102240
102241
  for (const constant3 of stripComments(raw2).matchAll(
102241
102242
  /\bNSString\s*\*\s*const\s+(\w+)\s*=\s*@"([^"]*)"\s*;/g
102242
102243
  ))
102243
- constants4.set(constant3[1], constant3[2]);
102244
+ constants5.set(constant3[1], constant3[2]);
102244
102245
  found2.push({
102245
102246
  body: raw2.slice(open + 1, block2.end - 1),
102246
102247
  language: "objc",
102247
102248
  parameter: declaration[1] ?? null,
102248
- constants: constants4
102249
+ constants: constants5
102249
102250
  });
102250
102251
  }
102251
102252
  }
@@ -102276,14 +102277,14 @@ function evaluateSwiftBody(body, scope2, depth) {
102276
102277
  }
102277
102278
  return null;
102278
102279
  }
102279
- function evaluateObjcBody(body, bundle, constants4, scope2) {
102280
+ function evaluateObjcBody(body, bundle, constants5, scope2) {
102280
102281
  const plists = scope2.resources.filter(
102281
102282
  (file) => import_node_path105.default.basename(file) === "GoogleService-Info.plist"
102282
102283
  );
102283
102284
  const variables = /* @__PURE__ */ new Map();
102284
102285
  const literal6 = (text7) => {
102285
102286
  const quoted2 = /^@"([^"]*)"$/.exec(text7.trim());
102286
- return quoted2 ? quoted2[1] : constants4.get(text7.trim());
102287
+ return quoted2 ? quoted2[1] : constants5.get(text7.trim());
102287
102288
  };
102288
102289
  const truthy2 = (name3) => {
102289
102290
  const value = variables.get(name3);
@@ -115741,7 +115742,7 @@ var require_crc = __commonJS({
115741
115742
  var require_parser = __commonJS({
115742
115743
  "../../node_modules/pngjs/lib/parser.js"(exports2, module2) {
115743
115744
  "use strict";
115744
- var constants4 = require_constants();
115745
+ var constants5 = require_constants();
115745
115746
  var CrcCalculator = require_crc();
115746
115747
  var Parser2 = module2.exports = function(options2, dependencies) {
115747
115748
  this._options = options2;
@@ -115752,12 +115753,12 @@ var require_parser = __commonJS({
115752
115753
  this._palette = [];
115753
115754
  this._colorType = 0;
115754
115755
  this._chunks = {};
115755
- this._chunks[constants4.TYPE_IHDR] = this._handleIHDR.bind(this);
115756
- this._chunks[constants4.TYPE_IEND] = this._handleIEND.bind(this);
115757
- this._chunks[constants4.TYPE_IDAT] = this._handleIDAT.bind(this);
115758
- this._chunks[constants4.TYPE_PLTE] = this._handlePLTE.bind(this);
115759
- this._chunks[constants4.TYPE_tRNS] = this._handleTRNS.bind(this);
115760
- this._chunks[constants4.TYPE_gAMA] = this._handleGAMA.bind(this);
115756
+ this._chunks[constants5.TYPE_IHDR] = this._handleIHDR.bind(this);
115757
+ this._chunks[constants5.TYPE_IEND] = this._handleIEND.bind(this);
115758
+ this._chunks[constants5.TYPE_IDAT] = this._handleIDAT.bind(this);
115759
+ this._chunks[constants5.TYPE_PLTE] = this._handlePLTE.bind(this);
115760
+ this._chunks[constants5.TYPE_tRNS] = this._handleTRNS.bind(this);
115761
+ this._chunks[constants5.TYPE_gAMA] = this._handleGAMA.bind(this);
115761
115762
  this.read = dependencies.read;
115762
115763
  this.error = dependencies.error;
115763
115764
  this.metadata = dependencies.metadata;
@@ -115772,10 +115773,10 @@ var require_parser = __commonJS({
115772
115773
  };
115773
115774
  };
115774
115775
  Parser2.prototype.start = function() {
115775
- this.read(constants4.PNG_SIGNATURE.length, this._parseSignature.bind(this));
115776
+ this.read(constants5.PNG_SIGNATURE.length, this._parseSignature.bind(this));
115776
115777
  };
115777
115778
  Parser2.prototype._parseSignature = function(data) {
115778
- let signature2 = constants4.PNG_SIGNATURE;
115779
+ let signature2 = constants5.PNG_SIGNATURE;
115779
115780
  for (let i = 0; i < signature2.length; i++) {
115780
115781
  if (data[i] !== signature2[i]) {
115781
115782
  this.error(new Error("Invalid file signature"));
@@ -115792,7 +115793,7 @@ var require_parser = __commonJS({
115792
115793
  name3 += String.fromCharCode(data[i]);
115793
115794
  }
115794
115795
  let ancillary = Boolean(data[4] & 32);
115795
- if (!this._hasIHDR && type !== constants4.TYPE_IHDR) {
115796
+ if (!this._hasIHDR && type !== constants5.TYPE_IHDR) {
115796
115797
  this.error(new Error("Expected IHDR on beggining"));
115797
115798
  return;
115798
115799
  }
@@ -115840,7 +115841,7 @@ var require_parser = __commonJS({
115840
115841
  this.error(new Error("Unsupported bit depth " + depth));
115841
115842
  return;
115842
115843
  }
115843
- if (!(colorType in constants4.COLORTYPE_TO_BPP_MAP)) {
115844
+ if (!(colorType in constants5.COLORTYPE_TO_BPP_MAP)) {
115844
115845
  this.error(new Error("Unsupported color type"));
115845
115846
  return;
115846
115847
  }
@@ -115857,16 +115858,16 @@ var require_parser = __commonJS({
115857
115858
  return;
115858
115859
  }
115859
115860
  this._colorType = colorType;
115860
- let bpp = constants4.COLORTYPE_TO_BPP_MAP[this._colorType];
115861
+ let bpp = constants5.COLORTYPE_TO_BPP_MAP[this._colorType];
115861
115862
  this._hasIHDR = true;
115862
115863
  this.metadata({
115863
115864
  width,
115864
115865
  height,
115865
115866
  depth,
115866
115867
  interlace: Boolean(interlace),
115867
- palette: Boolean(colorType & constants4.COLORTYPE_PALETTE),
115868
- color: Boolean(colorType & constants4.COLORTYPE_COLOR),
115869
- alpha: Boolean(colorType & constants4.COLORTYPE_ALPHA),
115868
+ palette: Boolean(colorType & constants5.COLORTYPE_PALETTE),
115869
+ color: Boolean(colorType & constants5.COLORTYPE_COLOR),
115870
+ alpha: Boolean(colorType & constants5.COLORTYPE_ALPHA),
115870
115871
  bpp,
115871
115872
  colorType
115872
115873
  });
@@ -115890,7 +115891,7 @@ var require_parser = __commonJS({
115890
115891
  };
115891
115892
  Parser2.prototype._parseTRNS = function(data) {
115892
115893
  this._crc.write(data);
115893
- if (this._colorType === constants4.COLORTYPE_PALETTE_COLOR) {
115894
+ if (this._colorType === constants5.COLORTYPE_PALETTE_COLOR) {
115894
115895
  if (this._palette.length === 0) {
115895
115896
  this.error(new Error("Transparency chunk must be after palette"));
115896
115897
  return;
@@ -115904,10 +115905,10 @@ var require_parser = __commonJS({
115904
115905
  }
115905
115906
  this.palette(this._palette);
115906
115907
  }
115907
- if (this._colorType === constants4.COLORTYPE_GRAYSCALE) {
115908
+ if (this._colorType === constants5.COLORTYPE_GRAYSCALE) {
115908
115909
  this.transColor([data.readUInt16BE(0)]);
115909
115910
  }
115910
- if (this._colorType === constants4.COLORTYPE_COLOR) {
115911
+ if (this._colorType === constants5.COLORTYPE_COLOR) {
115911
115912
  this.transColor([
115912
115913
  data.readUInt16BE(0),
115913
115914
  data.readUInt16BE(2),
@@ -115921,7 +115922,7 @@ var require_parser = __commonJS({
115921
115922
  };
115922
115923
  Parser2.prototype._parseGAMA = function(data) {
115923
115924
  this._crc.write(data);
115924
- this.gamma(data.readUInt32BE(0) / constants4.GAMMA_DIVISION);
115925
+ this.gamma(data.readUInt32BE(0) / constants5.GAMMA_DIVISION);
115925
115926
  this._handleChunkEnd();
115926
115927
  };
115927
115928
  Parser2.prototype._handleIDAT = function(length) {
@@ -115933,7 +115934,7 @@ var require_parser = __commonJS({
115933
115934
  };
115934
115935
  Parser2.prototype._parseIDAT = function(length, data) {
115935
115936
  this._crc.write(data);
115936
- if (this._colorType === constants4.COLORTYPE_PALETTE_COLOR && this._palette.length === 0) {
115937
+ if (this._colorType === constants5.COLORTYPE_PALETTE_COLOR && this._palette.length === 0) {
115937
115938
  throw new Error("Expected palette not found");
115938
115939
  }
115939
115940
  this.inflateData(data);
@@ -116421,9 +116422,9 @@ var require_parser_async = __commonJS({
116421
116422
  var require_bitpacker = __commonJS({
116422
116423
  "../../node_modules/pngjs/lib/bitpacker.js"(exports2, module2) {
116423
116424
  "use strict";
116424
- var constants4 = require_constants();
116425
+ var constants5 = require_constants();
116425
116426
  module2.exports = function(dataIn, width, height, options2) {
116426
- let outHasAlpha = [constants4.COLORTYPE_COLOR_ALPHA, constants4.COLORTYPE_ALPHA].indexOf(
116427
+ let outHasAlpha = [constants5.COLORTYPE_COLOR_ALPHA, constants5.COLORTYPE_ALPHA].indexOf(
116427
116428
  options2.colorType
116428
116429
  ) !== -1;
116429
116430
  if (options2.colorType === options2.inputColorType) {
@@ -116443,11 +116444,11 @@ var require_bitpacker = __commonJS({
116443
116444
  }
116444
116445
  let data = options2.bitDepth !== 16 ? dataIn : new Uint16Array(dataIn.buffer);
116445
116446
  let maxValue = 255;
116446
- let inBpp = constants4.COLORTYPE_TO_BPP_MAP[options2.inputColorType];
116447
+ let inBpp = constants5.COLORTYPE_TO_BPP_MAP[options2.inputColorType];
116447
116448
  if (inBpp === 4 && !options2.inputHasAlpha) {
116448
116449
  inBpp = 3;
116449
116450
  }
116450
- let outBpp = constants4.COLORTYPE_TO_BPP_MAP[options2.colorType];
116451
+ let outBpp = constants5.COLORTYPE_TO_BPP_MAP[options2.colorType];
116451
116452
  if (options2.bitDepth === 16) {
116452
116453
  maxValue = 65535;
116453
116454
  outBpp *= 2;
@@ -116471,24 +116472,24 @@ var require_bitpacker = __commonJS({
116471
116472
  let blue;
116472
116473
  let alpha = maxValue;
116473
116474
  switch (options2.inputColorType) {
116474
- case constants4.COLORTYPE_COLOR_ALPHA:
116475
+ case constants5.COLORTYPE_COLOR_ALPHA:
116475
116476
  alpha = data[inIndex + 3];
116476
116477
  red = data[inIndex];
116477
116478
  green = data[inIndex + 1];
116478
116479
  blue = data[inIndex + 2];
116479
116480
  break;
116480
- case constants4.COLORTYPE_COLOR:
116481
+ case constants5.COLORTYPE_COLOR:
116481
116482
  red = data[inIndex];
116482
116483
  green = data[inIndex + 1];
116483
116484
  blue = data[inIndex + 2];
116484
116485
  break;
116485
- case constants4.COLORTYPE_ALPHA:
116486
+ case constants5.COLORTYPE_ALPHA:
116486
116487
  alpha = data[inIndex + 1];
116487
116488
  red = data[inIndex];
116488
116489
  green = red;
116489
116490
  blue = red;
116490
116491
  break;
116491
- case constants4.COLORTYPE_GRAYSCALE:
116492
+ case constants5.COLORTYPE_GRAYSCALE:
116492
116493
  red = data[inIndex];
116493
116494
  green = red;
116494
116495
  blue = red;
@@ -116521,8 +116522,8 @@ var require_bitpacker = __commonJS({
116521
116522
  for (let x = 0; x < width; x++) {
116522
116523
  let rgba = getRGBA(data, inIndex);
116523
116524
  switch (options2.colorType) {
116524
- case constants4.COLORTYPE_COLOR_ALPHA:
116525
- case constants4.COLORTYPE_COLOR:
116525
+ case constants5.COLORTYPE_COLOR_ALPHA:
116526
+ case constants5.COLORTYPE_COLOR:
116526
116527
  if (options2.bitDepth === 8) {
116527
116528
  outData[outIndex] = rgba.red;
116528
116529
  outData[outIndex + 1] = rgba.green;
@@ -116539,8 +116540,8 @@ var require_bitpacker = __commonJS({
116539
116540
  }
116540
116541
  }
116541
116542
  break;
116542
- case constants4.COLORTYPE_ALPHA:
116543
- case constants4.COLORTYPE_GRAYSCALE: {
116543
+ case constants5.COLORTYPE_ALPHA:
116544
+ case constants5.COLORTYPE_GRAYSCALE: {
116544
116545
  let grayscale = (rgba.red + rgba.green + rgba.blue) / 3;
116545
116546
  if (options2.bitDepth === 8) {
116546
116547
  outData[outIndex] = grayscale;
@@ -116713,7 +116714,7 @@ var require_filter_pack = __commonJS({
116713
116714
  var require_packer = __commonJS({
116714
116715
  "../../node_modules/pngjs/lib/packer.js"(exports2, module2) {
116715
116716
  "use strict";
116716
- var constants4 = require_constants();
116717
+ var constants5 = require_constants();
116717
116718
  var CrcStream = require_crc();
116718
116719
  var bitPacker = require_bitpacker();
116719
116720
  var filter = require_filter_pack();
@@ -116726,23 +116727,23 @@ var require_packer = __commonJS({
116726
116727
  options2.inputHasAlpha = options2.inputHasAlpha != null ? options2.inputHasAlpha : true;
116727
116728
  options2.deflateFactory = options2.deflateFactory || zlib4.createDeflate;
116728
116729
  options2.bitDepth = options2.bitDepth || 8;
116729
- options2.colorType = typeof options2.colorType === "number" ? options2.colorType : constants4.COLORTYPE_COLOR_ALPHA;
116730
- options2.inputColorType = typeof options2.inputColorType === "number" ? options2.inputColorType : constants4.COLORTYPE_COLOR_ALPHA;
116730
+ options2.colorType = typeof options2.colorType === "number" ? options2.colorType : constants5.COLORTYPE_COLOR_ALPHA;
116731
+ options2.inputColorType = typeof options2.inputColorType === "number" ? options2.inputColorType : constants5.COLORTYPE_COLOR_ALPHA;
116731
116732
  if ([
116732
- constants4.COLORTYPE_GRAYSCALE,
116733
- constants4.COLORTYPE_COLOR,
116734
- constants4.COLORTYPE_COLOR_ALPHA,
116735
- constants4.COLORTYPE_ALPHA
116733
+ constants5.COLORTYPE_GRAYSCALE,
116734
+ constants5.COLORTYPE_COLOR,
116735
+ constants5.COLORTYPE_COLOR_ALPHA,
116736
+ constants5.COLORTYPE_ALPHA
116736
116737
  ].indexOf(options2.colorType) === -1) {
116737
116738
  throw new Error(
116738
116739
  "option color type:" + options2.colorType + " is not supported at present"
116739
116740
  );
116740
116741
  }
116741
116742
  if ([
116742
- constants4.COLORTYPE_GRAYSCALE,
116743
- constants4.COLORTYPE_COLOR,
116744
- constants4.COLORTYPE_COLOR_ALPHA,
116745
- constants4.COLORTYPE_ALPHA
116743
+ constants5.COLORTYPE_GRAYSCALE,
116744
+ constants5.COLORTYPE_COLOR,
116745
+ constants5.COLORTYPE_COLOR_ALPHA,
116746
+ constants5.COLORTYPE_ALPHA
116746
116747
  ].indexOf(options2.inputColorType) === -1) {
116747
116748
  throw new Error(
116748
116749
  "option input color type:" + options2.inputColorType + " is not supported at present"
@@ -116766,7 +116767,7 @@ var require_packer = __commonJS({
116766
116767
  };
116767
116768
  Packer.prototype.filterData = function(data, width, height) {
116768
116769
  let packedData = bitPacker(data, width, height, this._options);
116769
- let bpp = constants4.COLORTYPE_TO_BPP_MAP[this._options.colorType];
116770
+ let bpp = constants5.COLORTYPE_TO_BPP_MAP[this._options.colorType];
116770
116771
  let filteredData = filter(packedData, width, height, this._options, bpp);
116771
116772
  return filteredData;
116772
116773
  };
@@ -116786,8 +116787,8 @@ var require_packer = __commonJS({
116786
116787
  };
116787
116788
  Packer.prototype.packGAMA = function(gamma) {
116788
116789
  let buf = Buffer.alloc(4);
116789
- buf.writeUInt32BE(Math.floor(gamma * constants4.GAMMA_DIVISION), 0);
116790
- return this._packChunk(constants4.TYPE_gAMA, buf);
116790
+ buf.writeUInt32BE(Math.floor(gamma * constants5.GAMMA_DIVISION), 0);
116791
+ return this._packChunk(constants5.TYPE_gAMA, buf);
116791
116792
  };
116792
116793
  Packer.prototype.packIHDR = function(width, height) {
116793
116794
  let buf = Buffer.alloc(13);
@@ -116798,13 +116799,13 @@ var require_packer = __commonJS({
116798
116799
  buf[10] = 0;
116799
116800
  buf[11] = 0;
116800
116801
  buf[12] = 0;
116801
- return this._packChunk(constants4.TYPE_IHDR, buf);
116802
+ return this._packChunk(constants5.TYPE_IHDR, buf);
116802
116803
  };
116803
116804
  Packer.prototype.packIDAT = function(data) {
116804
- return this._packChunk(constants4.TYPE_IDAT, data);
116805
+ return this._packChunk(constants5.TYPE_IDAT, data);
116805
116806
  };
116806
116807
  Packer.prototype.packIEND = function() {
116807
- return this._packChunk(constants4.TYPE_IEND, null);
116808
+ return this._packChunk(constants5.TYPE_IEND, null);
116808
116809
  };
116809
116810
  }
116810
116811
  });
@@ -116815,7 +116816,7 @@ var require_packer_async = __commonJS({
116815
116816
  "use strict";
116816
116817
  var util = require("util");
116817
116818
  var Stream = require("stream");
116818
- var constants4 = require_constants();
116819
+ var constants5 = require_constants();
116819
116820
  var Packer = require_packer();
116820
116821
  var PackerAsync = module2.exports = function(opt) {
116821
116822
  Stream.call(this);
@@ -116826,7 +116827,7 @@ var require_packer_async = __commonJS({
116826
116827
  };
116827
116828
  util.inherits(PackerAsync, Stream);
116828
116829
  PackerAsync.prototype.pack = function(data, width, height, gamma) {
116829
- this.emit("data", Buffer.from(constants4.PNG_SIGNATURE));
116830
+ this.emit("data", Buffer.from(constants5.PNG_SIGNATURE));
116830
116831
  this.emit("data", this._packer.packIHDR(width, height));
116831
116832
  if (gamma) {
116832
116833
  this.emit("data", this._packer.packGAMA(gamma));
@@ -117154,7 +117155,7 @@ var require_packer_sync = __commonJS({
117154
117155
  if (!zlib4.deflateSync) {
117155
117156
  hasSyncZlib = false;
117156
117157
  }
117157
- var constants4 = require_constants();
117158
+ var constants5 = require_constants();
117158
117159
  var Packer = require_packer();
117159
117160
  module2.exports = function(metaData, opt) {
117160
117161
  if (!hasSyncZlib) {
@@ -117165,7 +117166,7 @@ var require_packer_sync = __commonJS({
117165
117166
  let options2 = opt || {};
117166
117167
  let packer = new Packer(options2);
117167
117168
  let chunks = [];
117168
- chunks.push(Buffer.from(constants4.PNG_SIGNATURE));
117169
+ chunks.push(Buffer.from(constants5.PNG_SIGNATURE));
117169
117170
  chunks.push(packer.packIHDR(metaData.width, metaData.height));
117170
117171
  if (metaData.gamma) {
117171
117172
  chunks.push(packer.packGAMA(metaData.gamma));
@@ -120519,6 +120520,14 @@ function nativeSourceFiles(packagePath) {
120519
120520
  if (sourceEntries().has(packagePath)) return [];
120520
120521
  return [NATIVE_DESCRIPTOR, NATIVE_GLUE].map((name3) => import_node_path132.default.join(packagePath, name3)).filter((file) => import_node_fs132.default.existsSync(file));
120521
120522
  }
120523
+ function swiftArtifactContentDigest(bytes) {
120524
+ let digest3 = swiftArtifactDigests.get(bytes);
120525
+ if (!digest3) {
120526
+ digest3 = (0, import_node_crypto79.createHash)("sha256").update(bytes).digest("hex");
120527
+ swiftArtifactDigests.set(bytes, digest3);
120528
+ }
120529
+ return digest3;
120530
+ }
120522
120531
  function openSwiftFile(file) {
120523
120532
  file = import_node_fs132.default.realpathSync(file);
120524
120533
  const root = import_node_path132.default.dirname(file);
@@ -123031,6 +123040,7 @@ function scopedArtifact(project2, entry, moduleRoot, signal) {
123031
123040
  );
123032
123041
  }).then(
123033
123042
  (artifact) => {
123043
+ swiftArtifactContentDigest(artifact.bytes);
123034
123044
  project2.artifact = artifact;
123035
123045
  project2.artifacts = [
123036
123046
  artifact,
@@ -123211,7 +123221,7 @@ async function swiftPackageMetadata(packagePath, packageName2, moduleRoot, origi
123211
123221
  });
123212
123222
  const image = {
123213
123223
  ...artifact,
123214
- hash: (0, import_node_crypto79.createHash)("sha256").update(result.primary).digest("hex"),
123224
+ hash: swiftArtifactContentDigest(result.primary),
123215
123225
  bytes: result.primary,
123216
123226
  parts: result.parts
123217
123227
  };
@@ -123451,20 +123461,26 @@ async function serveSwiftPackageAsset(pathname, res) {
123451
123461
  const address = pathname.slice(ARTIFACT_PATH.length).replace(/\.wasm$/, "");
123452
123462
  for (const project2 of projects().values()) {
123453
123463
  if (pathname !== `${ARTIFACT_PATH}${address}.wasm`) continue;
123454
- const bytes = project2.artifacts.map(
123455
- (artifact) => artifact.hash === address ? artifact.bytes : artifact.parts?.get(address)
123456
- ).find((bytes2) => bytes2 !== void 0);
123457
- if (!bytes) continue;
123458
- res.setHeader("access-control-allow-origin", "*");
123459
- res.setHeader("content-type", "application/wasm");
123460
- res.setHeader("vary", "accept-encoding");
123461
- if (acceptsBr) {
123462
- res.setHeader("content-encoding", "br");
123463
- res.end(await brotliCompressQ4(bytes, address));
123464
- } else {
123465
- res.end(bytes);
123464
+ for (const artifact of project2.artifacts) {
123465
+ const primary = artifact.hash === address;
123466
+ const bytes = primary ? artifact.bytes : artifact.parts?.get(address);
123467
+ if (!bytes) continue;
123468
+ res.setHeader("access-control-allow-origin", "*");
123469
+ res.setHeader("access-control-expose-headers", SWIFT_ARTIFACT_SHA256_HEADER);
123470
+ res.setHeader(
123471
+ SWIFT_ARTIFACT_SHA256_HEADER,
123472
+ primary ? swiftArtifactContentDigest(bytes) : address
123473
+ );
123474
+ res.setHeader("content-type", "application/wasm");
123475
+ res.setHeader("vary", "accept-encoding");
123476
+ if (acceptsBr) {
123477
+ res.setHeader("content-encoding", "br");
123478
+ res.end(await brotliCompressQ4(bytes, address));
123479
+ } else {
123480
+ res.end(bytes);
123481
+ }
123482
+ return true;
123466
123483
  }
123467
- return true;
123468
123484
  }
123469
123485
  res.statusCode = 404;
123470
123486
  res.end("swift artifact is stale");
@@ -123549,7 +123565,7 @@ function disposeSwiftProject(packagePath, signal) {
123549
123565
  xcodeProjects().delete(packagePath);
123550
123566
  sourceEntries().delete(packagePath);
123551
123567
  }
123552
- var import_node_async_hooks2, import_node_child_process65, import_node_crypto79, import_node_fs132, import_node_os27, import_node_path132, ARTIFACT_PATH, RESOURCE_PATH, ICU_PATH, SDK_PATH, SDK_BINDING_PATH, SKIP_ROOT_DIRS, NATIVE_DESCRIPTOR, NATIVE_GLUE, SwiftMissingModulesError, startupImages, sharedProjects, projectScope, projects, sharedSourceEntries, sourceEntries, sharedXcodeProjects, xcodeProjects, preparedScriptInputs, emptyWasmAssembly, XCODE_APP_DIR, XCODE_FRAMEWORKS_DIR, XCODE_PACKAGES_DIR, layoutScope, HOSTED_LIMITS, LOCAL_LIMITS, inputLimits, RESOURCE_CONTENT_TYPES, API_GAP_PATTERNS, IOS_SDK_FRAMEWORKS, sdkStartups, sdkStartupParts, sdkStartupPlans, sdkPieces2, sdkSplitBindings, sdkBindingFiles, servedSdkBinding;
123568
+ var import_node_async_hooks2, import_node_child_process65, import_node_crypto79, import_node_fs132, import_node_os27, import_node_path132, ARTIFACT_PATH, RESOURCE_PATH, ICU_PATH, SDK_PATH, SDK_BINDING_PATH, SKIP_ROOT_DIRS, NATIVE_DESCRIPTOR, NATIVE_GLUE, SwiftMissingModulesError, startupImages, swiftArtifactDigests, sharedProjects, projectScope, projects, sharedSourceEntries, sourceEntries, sharedXcodeProjects, xcodeProjects, preparedScriptInputs, emptyWasmAssembly, XCODE_APP_DIR, XCODE_FRAMEWORKS_DIR, XCODE_PACKAGES_DIR, layoutScope, HOSTED_LIMITS, LOCAL_LIMITS, inputLimits, RESOURCE_CONTENT_TYPES, API_GAP_PATTERNS, IOS_SDK_FRAMEWORKS, sdkStartups, sdkStartupParts, sdkStartupPlans, sdkPieces2, sdkSplitBindings, sdkBindingFiles, servedSdkBinding;
123553
123569
  var init_swift_host = __esm({
123554
123570
  "src/swift-host.ts"() {
123555
123571
  "use strict";
@@ -123561,6 +123577,7 @@ var init_swift_host = __esm({
123561
123577
  import_node_path132 = __toESM(require("node:path"), 1);
123562
123578
  init_pngHeader();
123563
123579
  init_nativeSdkBindingContract();
123580
+ init_nativeWasmContract();
123564
123581
  init_bundleAssets();
123565
123582
  init_stringCatalog();
123566
123583
  init_core_data_entity_classes();
@@ -123609,6 +123626,7 @@ var init_swift_host = __esm({
123609
123626
  SwiftMissingModulesError = class extends Error {
123610
123627
  };
123611
123628
  startupImages = /* @__PURE__ */ new WeakMap();
123629
+ swiftArtifactDigests = /* @__PURE__ */ new WeakMap();
123612
123630
  sharedProjects = /* @__PURE__ */ new Map();
123613
123631
  projectScope = new import_node_async_hooks2.AsyncLocalStorage();
123614
123632
  projects = () => projectScope.getStore()?.projects ?? sharedProjects;
@@ -139934,8 +139952,20 @@ async function handleOneNativeSourceRequest(req, res) {
139934
139952
  url.pathname.slice(SWIFT_PACKAGE_PATH.length)
139935
139953
  );
139936
139954
  const metadata = await packageMetadata(app, packageName2);
139955
+ const body = JSON.stringify(metadata);
139956
+ const acceptsBrotli = req.headers["accept-encoding"]?.split(",").some((value) => {
139957
+ const [coding, quality] = value.trim().toLowerCase().split(/\s*;\s*q\s*=\s*/);
139958
+ return coding === "br" && (quality === void 0 || Number(quality) > 0);
139959
+ });
139937
139960
  res.setHeader("content-type", "application/json");
139938
- res.end(JSON.stringify(metadata));
139961
+ res.setHeader("vary", "origin, accept-encoding");
139962
+ if (acceptsBrotli) {
139963
+ const compressed = await compressMetadata(body, {
139964
+ params: { [import_node_zlib10.constants.BROTLI_PARAM_QUALITY]: 4 }
139965
+ });
139966
+ res.setHeader("content-encoding", "br");
139967
+ res.end(compressed);
139968
+ } else res.end(body);
139939
139969
  return true;
139940
139970
  }
139941
139971
  const kotlin = await Promise.resolve().then(() => (init_kotlin_host(), kotlin_host_exports));
@@ -139969,7 +139999,7 @@ function handleOneNativeSourceUpgrade(req, socket, head) {
139969
139999
  });
139970
140000
  return true;
139971
140001
  }
139972
- var import_node_fs159, import_node_module22, import_node_path159, import_node_url8, import_ws2, apps;
140002
+ var import_node_fs159, import_node_module22, import_node_path159, import_node_url8, import_node_util22, import_node_zlib10, import_ws2, apps, compressMetadata;
139973
140003
  var init_one_native_source = __esm({
139974
140004
  "src/one-native-source.ts"() {
139975
140005
  "use strict";
@@ -139977,6 +140007,8 @@ var init_one_native_source = __esm({
139977
140007
  import_node_module22 = require("node:module");
139978
140008
  import_node_path159 = __toESM(require("node:path"), 1);
139979
140009
  import_node_url8 = require("node:url");
140010
+ import_node_util22 = require("node:util");
140011
+ import_node_zlib10 = require("node:zlib");
139980
140012
  init_kotlinDiscoveryContract();
139981
140013
  import_ws2 = require("peachsim/vendor/ws");
139982
140014
  init_backend_origin();
@@ -139987,6 +140019,7 @@ var init_one_native_source = __esm({
139987
140019
  init_swift_submit();
139988
140020
  init_swift_toolchain();
139989
140021
  apps = /* @__PURE__ */ new Map();
140022
+ compressMetadata = (0, import_node_util22.promisify)(import_node_zlib10.brotliCompress);
139990
140023
  }
139991
140024
  });
139992
140025
 
@@ -141527,7 +141560,7 @@ var init_nitro_superset = __esm({
141527
141560
  init_nitroContract();
141528
141561
  init_swift_standin_digest();
141529
141562
  NITRO_SUPERSET_ENTRY_NAME = "superset";
141530
- NITRO_COMPILER_DIGEST = true ? "7f1e5731bb309484c0c703c7fd7799cf42e6abd3024f4c1e898b097d57e28be8" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
141563
+ NITRO_COMPILER_DIGEST = true ? "9ee7e1048e4322b01a587e2d8a5b133696932ab5f05f1e160b96da8b1df52733" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
141531
141564
  nitroSupersetLock = parseLock(nitro_superset_lock_default);
141532
141565
  nitroSupersetKey = (inputs2) => nativeEntryKey({ ...inputs2, compiler: NITRO_COMPILER_DIGEST });
141533
141566
  published3 = /* @__PURE__ */ new Map();
@@ -141728,7 +141761,7 @@ async function buildExpoWidgetsBundle(appRoot, origin = "") {
141728
141761
  const runtimeBundle = await withSwiftRootLock(
141729
141762
  import_node_path169.default.join(await import_promises19.default.realpath(packageDir), "bundle"),
141730
141763
  async () => {
141731
- await (0, import_node_util22.promisify)(import_node_child_process76.execFile)(
141764
+ await (0, import_node_util23.promisify)(import_node_child_process76.execFile)(
141732
141765
  process.env.NODE_BINARY || "node",
141733
141766
  [import_node_path169.default.join(packageDir, "scripts/build-bundle.mjs"), appRoot],
141734
141767
  { cwd: appRoot, maxBuffer: 16 * 1024 * 1024 }
@@ -141744,7 +141777,7 @@ async function buildExpoWidgetsBundle(appRoot, origin = "") {
141744
141777
  }
141745
141778
  };
141746
141779
  }
141747
- var import_node_child_process76, import_promises19, import_node_module24, import_node_path169, import_node_util22, EXPO_WIDGETS_ROUTE, handleExpoWidgetsRequest;
141780
+ var import_node_child_process76, import_promises19, import_node_module24, import_node_path169, import_node_util23, EXPO_WIDGETS_ROUTE, handleExpoWidgetsRequest;
141748
141781
  var init_expo_widgets_bundle = __esm({
141749
141782
  "src/expo-widgets-bundle.ts"() {
141750
141783
  "use strict";
@@ -141752,7 +141785,7 @@ var init_expo_widgets_bundle = __esm({
141752
141785
  import_promises19 = __toESM(require("node:fs/promises"), 1);
141753
141786
  import_node_module24 = require("node:module");
141754
141787
  import_node_path169 = __toESM(require("node:path"), 1);
141755
- import_node_util22 = require("node:util");
141788
+ import_node_util23 = require("node:util");
141756
141789
  init_expo_widget_assets();
141757
141790
  init_staged_host_files();
141758
141791
  init_nitro_bundle();
@@ -148251,7 +148284,8 @@ var init_bridge_host = __esm({
148251
148284
  this.wireWebSocketServer();
148252
148285
  server.on("upgrade", (req, socket, head) => {
148253
148286
  if (rejectUntrustedBridgeUpgrade(req, socket)) return;
148254
- if (new URL(req.url ?? "/", "http://localhost").pathname === SWIFT_HMR_PATH) {
148287
+ const pathname = new URL(req.url ?? "/", "http://localhost").pathname;
148288
+ if (pathname === SWIFT_HMR_PATH) {
148255
148289
  void Promise.resolve().then(() => (init_one_native_source(), one_native_source_exports)).then(({ handleOneNativeSourceUpgrade: handleOneNativeSourceUpgrade2 }) => {
148256
148290
  if (!handleOneNativeSourceUpgrade2(req, socket, head)) socket.destroy();
148257
148291
  }).catch(() => {
@@ -148261,6 +148295,12 @@ var init_bridge_host = __esm({
148261
148295
  }
148262
148296
  if (handleWebSocketProxyUpgrade(req, socket, head)) return;
148263
148297
  this.wss?.handleUpgrade(req, socket, head, (ws) => {
148298
+ if (pathname === "/hot") {
148299
+ ws.on("error", () => {
148300
+ });
148301
+ ws.close(1013, "bundle has no development server");
148302
+ return;
148303
+ }
148264
148304
  this.wss?.emit("connection", ws, req);
148265
148305
  });
148266
148306
  });
@@ -151943,7 +151983,7 @@ function extractAppBinaryBundle(binary2) {
151943
151983
  const manifest = readPeachSidecarManifest(
151944
151984
  JSON.parse(import_node_fs182.default.readFileSync(import_node_path185.default.join(extracted, manifestEntry), "utf8"))
151945
151985
  );
151946
- const bundle = (0, import_node_zlib10.brotliDecompressSync)(
151986
+ const bundle = (0, import_node_zlib11.brotliDecompressSync)(
151947
151987
  import_node_fs182.default.readFileSync(import_node_path185.default.join(extracted, sidecar, PEACH_SIDECAR_BUNDLE))
151948
151988
  );
151949
151989
  if ((0, import_node_crypto106.createHash)("sha256").update(bundle).digest("hex") !== manifest.bundleSha256)
@@ -151966,7 +152006,7 @@ function extractAppBinaryBundle(binary2) {
151966
152006
  );
151967
152007
  return { bundlePath, platform: platform3 };
151968
152008
  }
151969
- var import_node_child_process78, import_node_crypto106, import_node_fs182, import_node_path185, import_node_zlib10;
152009
+ var import_node_child_process78, import_node_crypto106, import_node_fs182, import_node_path185, import_node_zlib11;
151970
152010
  var init_binary_sidecar = __esm({
151971
152011
  "cli/binary-sidecar.ts"() {
151972
152012
  "use strict";
@@ -151974,7 +152014,7 @@ var init_binary_sidecar = __esm({
151974
152014
  import_node_crypto106 = require("node:crypto");
151975
152015
  import_node_fs182 = __toESM(require("node:fs"), 1);
151976
152016
  import_node_path185 = __toESM(require("node:path"), 1);
151977
- import_node_zlib10 = require("node:zlib");
152017
+ import_node_zlib11 = require("node:zlib");
151978
152018
  init_package_versions();
151979
152019
  init_binarySidecarContract();
151980
152020
  init_home_paths();
@@ -152929,12 +152969,12 @@ function redactText(text7, configurationOnly, decodedString = false) {
152929
152969
  (line, prefix, name3, value) => SECRET_NAME.test(name3) ? `${prefix}${mask(value)}` : line
152930
152970
  ).replace(EMAIL, mask).replace(OPAQUE_ID, mask);
152931
152971
  }
152932
- var import_node_crypto107, import_node_util23, SECRET_NAME, JWT, GOOGLE_API_KEY, BEARER, EMAIL, OPAQUE_ID, STRING, NUMBER, PAIR2, STRING_TOKEN, QUERY_PAIR, HEADER_LINE, MASKED, CONFIG_CONTAINER, utf8;
152972
+ var import_node_crypto107, import_node_util24, SECRET_NAME, JWT, GOOGLE_API_KEY, BEARER, EMAIL, OPAQUE_ID, STRING, NUMBER, PAIR2, STRING_TOKEN, QUERY_PAIR, HEADER_LINE, MASKED, CONFIG_CONTAINER, utf8;
152933
152973
  var init_output_redaction = __esm({
152934
152974
  "cli/output-redaction.ts"() {
152935
152975
  "use strict";
152936
152976
  import_node_crypto107 = require("node:crypto");
152937
- import_node_util23 = require("node:util");
152977
+ import_node_util24 = require("node:util");
152938
152978
  init_config();
152939
152979
  SECRET_NAME = /^(?:[\w-]*(?:api[-_]?key|token|secret|password|passwd|authorization|cookie|signature|credential)s?|auth|sig|email|uid|[\w-]*(?:user|account|local|device|installation|client|app|project|sender|measurement|tenant)[-_]?id)$/i;
152940
152980
  JWT = /\beyJ[\w-]{6,}\.[\w-]{6,}\.[\w-]{6,}/g;
@@ -174599,7 +174639,7 @@ function zipSources(bytes, where) {
174599
174639
  }
174600
174640
  data = Buffer.from(payload);
174601
174641
  } else if (method === 8) {
174602
- data = (0, import_node_zlib11.inflateRawSync)(payload, { maxOutputLength: remainingBudget });
174642
+ data = (0, import_node_zlib12.inflateRawSync)(payload, { maxOutputLength: remainingBudget });
174603
174643
  }
174604
174644
  if (!data) throw new Error(`${where}: ${name3} uses zip method ${method}`);
174605
174645
  totalExtractedBytes += data.byteLength;
@@ -174722,7 +174762,7 @@ async function kotlinSources2(bytes, where) {
174722
174762
  if (kotlin.length === 0) throw new Error(`${where}: sources jar has no Kotlin`);
174723
174763
  return kotlin;
174724
174764
  }
174725
- var import_node_crypto116, import_node_fs197, import_node_os36, import_node_path198, import_node_zlib11, pending, MAX_SOURCES_JAR_BYTES, MAX_SOURCE_ENTRY_BYTES, MAX_TOTAL_EXTRACTED_BYTES;
174765
+ var import_node_crypto116, import_node_fs197, import_node_os36, import_node_path198, import_node_zlib12, pending, MAX_SOURCES_JAR_BYTES, MAX_SOURCE_ENTRY_BYTES, MAX_TOTAL_EXTRACTED_BYTES;
174726
174766
  var init_kotlin_maven_sources = __esm({
174727
174767
  "src/kotlin-maven-sources.ts"() {
174728
174768
  "use strict";
@@ -174730,7 +174770,7 @@ var init_kotlin_maven_sources = __esm({
174730
174770
  import_node_fs197 = __toESM(require("node:fs"), 1);
174731
174771
  import_node_os36 = __toESM(require("node:os"), 1);
174732
174772
  import_node_path198 = __toESM(require("node:path"), 1);
174733
- import_node_zlib11 = require("node:zlib");
174773
+ import_node_zlib12 = require("node:zlib");
174734
174774
  pending = /* @__PURE__ */ new Map();
174735
174775
  MAX_SOURCES_JAR_BYTES = 64 * 1024 * 1024;
174736
174776
  MAX_SOURCE_ENTRY_BYTES = 16 * 1024 * 1024;
@@ -176137,10 +176177,10 @@ async function runSwift(args, opts = {}) {
176137
176177
  res.end(JSON.stringify(metadata));
176138
176178
  return;
176139
176179
  }
176140
- compressedMetadata ??= compressMetadata(JSON.stringify(metadata), {
176180
+ compressedMetadata ??= compressMetadata2(JSON.stringify(metadata), {
176141
176181
  params: {
176142
- [import_node_zlib12.constants.BROTLI_PARAM_QUALITY]: 4,
176143
- [import_node_zlib12.constants.BROTLI_PARAM_LGWIN]: 24
176182
+ [import_node_zlib13.constants.BROTLI_PARAM_QUALITY]: 4,
176183
+ [import_node_zlib13.constants.BROTLI_PARAM_LGWIN]: 24
176144
176184
  }
176145
176185
  });
176146
176186
  void compressedMetadata.then(
@@ -176273,15 +176313,15 @@ async function runSwift(args, opts = {}) {
176273
176313
  }
176274
176314
  return code;
176275
176315
  }
176276
- var import_node_fs202, import_node_http6, import_node_path203, import_node_util24, import_node_zlib12, import_ws7, compressMetadata;
176316
+ var import_node_fs202, import_node_http6, import_node_path203, import_node_util25, import_node_zlib13, import_ws7, compressMetadata2;
176277
176317
  var init_swift2 = __esm({
176278
176318
  "cli/commands/swift.ts"() {
176279
176319
  "use strict";
176280
176320
  import_node_fs202 = __toESM(require("node:fs"), 1);
176281
176321
  import_node_http6 = __toESM(require("node:http"), 1);
176282
176322
  import_node_path203 = __toESM(require("node:path"), 1);
176283
- import_node_util24 = require("node:util");
176284
- import_node_zlib12 = require("node:zlib");
176323
+ import_node_util25 = require("node:util");
176324
+ import_node_zlib13 = require("node:zlib");
176285
176325
  init_swiftDiscoveryContract();
176286
176326
  import_ws7 = require("peachsim/vendor/ws");
176287
176327
  init_backend_origin();
@@ -176293,7 +176333,7 @@ var init_swift2 = __esm({
176293
176333
  init_settings_flags();
176294
176334
  init_control();
176295
176335
  init_guest_host();
176296
- compressMetadata = (0, import_node_util24.promisify)(import_node_zlib12.brotliCompress);
176336
+ compressMetadata2 = (0, import_node_util25.promisify)(import_node_zlib13.brotliCompress);
176297
176337
  }
176298
176338
  });
176299
176339