peachsim 0.1.2180 → 0.1.2185

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 (106) hide show
  1. package/cli/commands/shell-url.ts +28 -22
  2. package/cli/outbound-endpoints.ts +11 -1
  3. package/dist-lib/agent-daemon-client.cjs +1 -1
  4. package/dist-lib/agent-events.cjs +1 -1
  5. package/dist-lib/attached-projects.cjs +1 -1
  6. package/dist-lib/auth/shared-session.cjs +1 -1
  7. package/dist-lib/backend-origin.cjs +1 -1
  8. package/dist-lib/beta.cjs +1 -1
  9. package/dist-lib/beta.mjs +1 -1
  10. package/dist-lib/bridge-constants.cjs +1 -1
  11. package/dist-lib/bridge-contract-input.cjs +1 -1
  12. package/dist-lib/bridge-contract-input.mjs +1 -1
  13. package/dist-lib/bridge-contract.cjs +1 -1
  14. package/dist-lib/bridge-contract.mjs +1 -1
  15. package/dist-lib/bundle-channel.cjs +457 -96
  16. package/dist-lib/capture-contract.cjs +1 -1
  17. package/dist-lib/capture-contract.mjs +1 -1
  18. package/dist-lib/cloud-contract.cjs +1 -1
  19. package/dist-lib/cloud-contract.mjs +1 -1
  20. package/dist-lib/cloud-test-args.cjs +1 -1
  21. package/dist-lib/cloud-test-args.mjs +1 -1
  22. package/dist-lib/cloud.cjs +1 -1
  23. package/dist-lib/cloud.mjs +1 -1
  24. package/dist-lib/config.cjs +1 -1
  25. package/dist-lib/config.mjs +1 -1
  26. package/dist-lib/detox/index.cjs +1 -1
  27. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  28. package/dist-lib/expo-swift-bundle.cjs +352 -58
  29. package/dist-lib/expo-swift-metadata.cjs +1 -1
  30. package/dist-lib/expo-swift-metadata.mjs +1 -1
  31. package/dist-lib/home-paths.cjs +1 -1
  32. package/dist-lib/host/bridge-host.cjs +415 -85
  33. package/dist-lib/host/fetch-proxy-handler.cjs +7 -4
  34. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  35. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  36. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  37. package/dist-lib/host/websocket-proxy.cjs +1 -1
  38. package/dist-lib/index.cjs +7 -4
  39. package/dist-lib/jump-to-source-babel.cjs +1 -1
  40. package/dist-lib/jump-to-source-native.cjs +1 -1
  41. package/dist-lib/kotlin-host.cjs +1 -1
  42. package/dist-lib/menu.cjs +1 -1
  43. package/dist-lib/menu.mjs +1 -1
  44. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  45. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  46. package/dist-lib/metro-production-bundle.cjs +1 -1
  47. package/dist-lib/metro-production-bundle.mjs +1 -1
  48. package/dist-lib/metro.cjs +7 -4
  49. package/dist-lib/native-app-identity-project.cjs +6 -3
  50. package/dist-lib/native-app-identity-project.mjs +6 -3
  51. package/dist-lib/native-app-identity.cjs +1 -1
  52. package/dist-lib/native-app-identity.mjs +1 -1
  53. package/dist-lib/native-firebase-metadata.cjs +1 -1
  54. package/dist-lib/native-firebase-metadata.mjs +1 -1
  55. package/dist-lib/pdfium-raster.cjs +1 -1
  56. package/dist-lib/pdfium-raster.mjs +1 -1
  57. package/dist-lib/plist.cjs +1 -1
  58. package/dist-lib/plist.mjs +1 -1
  59. package/dist-lib/profiles.cjs +1 -1
  60. package/dist-lib/public-brand.cjs +1 -1
  61. package/dist-lib/public-origins-lib-esm.json +25 -24
  62. package/dist-lib/public-origins-lib.json +63 -53
  63. package/dist-lib/react-native-host-modules.cjs +1 -1
  64. package/dist-lib/react-native-host-modules.mjs +1 -1
  65. package/dist-lib/reap-browser.cjs +1 -1
  66. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  67. package/dist-lib/sdk.cjs +1 -1
  68. package/dist-lib/sdk.mjs +1 -1
  69. package/dist-lib/skills.cjs +447 -93
  70. package/dist-lib/swift-compile.cjs +13 -4
  71. package/dist-lib/swift-compile.mjs +13 -4
  72. package/dist-lib/swift-package.cjs +26 -1
  73. package/dist-lib/swift-package.mjs +25 -1
  74. package/dist-lib/swift-submit.cjs +2 -2
  75. package/dist-lib/swift-submit.mjs +2 -2
  76. package/dist-lib/swift-toolchain.cjs +1 -1
  77. package/dist-lib/swift.cjs +1 -1
  78. package/dist-lib/vite-swift.cjs +298 -27
  79. package/dist-lib/vite.cjs +7 -4
  80. package/dist-lib/worklet-executable.cjs +1 -1
  81. package/dist-lib/worklet-executable.mjs +1 -1
  82. package/dist-types/packages/peach-engine/src/render-worker/map-command-channel.d.ts +14 -0
  83. package/package.json +1 -1
  84. package/sdk/ios/System/Library/Frameworks/ActivityKit.framework/Headers/ActivityKit.h +1 -0
  85. package/sdk/ios/System/Library/Frameworks/ActivityKit.framework/Modules/module.modulemap +4 -0
  86. package/sdk/ios/usr/lib/swift/ActivityKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +14 -0
  87. package/sdk/ios/usr/lib/swift/CoreGraphics.swiftmodule/arm64-apple-ios-simulator.swiftinterface +14 -0
  88. package/sdk/ios/usr/lib/swift/Dispatch.swiftmodule/arm64-apple-ios-simulator.swiftinterface +3 -0
  89. package/sdk/ios/usr/lib/swift/Foundation.swiftmodule/arm64-apple-ios-simulator.swiftinterface +147 -16
  90. package/sdk/ios/usr/lib/swift/UIKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +5 -0
  91. package/src/expo-native-workspace.ts +19 -21
  92. package/src/expo-swift-bundle.ts +6 -1
  93. package/src/expo-swift-host.ts +35 -6
  94. package/src/expoSwiftContract.ts +3 -0
  95. package/src/native-bundles.ts +30 -10
  96. package/src/one-sdk/source.ts +10 -4
  97. package/src/one-sdk-bundle.ts +56 -24
  98. package/src/swift-compile.ts +3 -1
  99. package/src/swift-interface-bodies.ts +165 -0
  100. package/src/swift-objc-standin.ts +73 -13
  101. package/src/swift-package.ts +26 -0
  102. package/src/swift-source-pods.ts +27 -4
  103. package/src/swift-standin-emit.ts +30 -3
  104. package/src/swift-standins.ts +75 -12
  105. package/src/swift-submit.ts +2 -1
  106. package/src/wasm-optimize.ts +11 -1
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2180 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2185 | (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;
@@ -39,7 +39,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
39
39
  var define_SWIFT_COVERAGE_SOURCE_DIGESTS_default;
40
40
  var init_define_SWIFT_COVERAGE_SOURCE_DIGESTS = __esm({
41
41
  "<define:__SWIFT_COVERAGE_SOURCE_DIGESTS__>"() {
42
- define_SWIFT_COVERAGE_SOURCE_DIGESTS_default = { "swift-coverage/indexdump.ts": "0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412", "swift-coverage/indexing.ts": "633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272", "swift-coverage/types.ts": "bd8fae54ea6c53e110cd8a5d7b57c1d532dd0166e09fdaea63c4f270c3780dd1", "swift-coverage/source.ts": "c151758a9f67631bc61473c375df0dc017da6902a34533b2cf4fc4fd7d19b6ee", "swift-coverage/package.ts": "1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b", "swift-coverage/xcode.ts": "65a500b806ce1c3a496de27f2e0ad77287c0f6795c618342c08af647f92af1fa", "swift-coverage/xcode-assets.ts": "99e03b74c961d2449afd58c2cbc415ba91d1d469a4f89e461c137fd6c305b27c", "swift-coverage/xcode-asset-symbols.ts": "1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671", "swift-coverage/xcode-bridging.ts": "33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11", "swift-coverage/xcode-packages.ts": "8e6020d17d24474150a5a50d042aca6261819ef75c79680a287a66f395909915", "swift-coverage/xcode-strings.ts": "f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c", "swift-coverage/reader.ts": "da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c", "swift-coverage/provenance.ts": "eb3b41ae8b58b48f6758f084800f188dfb1edb227e483abdd6b80cde66e849b9", "swift-package-manifest.ts": "4b7d4a715cdaf57468ead23f2ff9dce76d02c6a888d73d144d4baa2ae571ba3c", "swift-package.ts": "0b82b3773f9c0b27636f277d9c123b3e631b9c9980995d67d67efa6b3176df4a", "swift-source-file.ts": "93fd659ed63a27b67f54a7c229a7ceb636dc9c59e68414920ba36cff1eda1f94", "swift-toolchain.ts": "65a0698bf022ace2f4254f3f891828dedf403d61c102238e242084a2279e04eb", "home-paths.ts": "f5583b61f8bdd81823b3b29ff519a48daf9993719f194ddb7de22218472e90f9", "xcode-header-search.ts": "f8c3d557b4eca5ddad32907545353eb7ad53b2ebd0969d9ed8f7275e109a13b1", "xcode-project.ts": "5f41cd0bd86cb0cffbfb0047348b963f81d5e51cb0e8dd574c739b1a27aa56de", "xcode-target-members.ts": "ad7589132bffab265e8a10b64e24484fe88b4a2b1cc0ee19a97f151a002eca77", "xcode-json-project.ts": "41990ebbe4b488eef34e74c4608b4b48e5a5b299ba98ca7fbcfdfa0e77be63b6", "openstep-plist.ts": "74e6ce1dac80c9c318e0e9f5e3e8cd19a898a8820c36fc160609695bcb59dcd3" };
42
+ define_SWIFT_COVERAGE_SOURCE_DIGESTS_default = { "swift-coverage/indexdump.ts": "0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412", "swift-coverage/indexing.ts": "633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272", "swift-coverage/types.ts": "bd8fae54ea6c53e110cd8a5d7b57c1d532dd0166e09fdaea63c4f270c3780dd1", "swift-coverage/source.ts": "c151758a9f67631bc61473c375df0dc017da6902a34533b2cf4fc4fd7d19b6ee", "swift-coverage/package.ts": "1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b", "swift-coverage/xcode.ts": "65a500b806ce1c3a496de27f2e0ad77287c0f6795c618342c08af647f92af1fa", "swift-coverage/xcode-assets.ts": "99e03b74c961d2449afd58c2cbc415ba91d1d469a4f89e461c137fd6c305b27c", "swift-coverage/xcode-asset-symbols.ts": "1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671", "swift-coverage/xcode-bridging.ts": "33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11", "swift-coverage/xcode-packages.ts": "8e6020d17d24474150a5a50d042aca6261819ef75c79680a287a66f395909915", "swift-coverage/xcode-strings.ts": "f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c", "swift-coverage/reader.ts": "da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c", "swift-coverage/provenance.ts": "eb3b41ae8b58b48f6758f084800f188dfb1edb227e483abdd6b80cde66e849b9", "swift-package-manifest.ts": "4b7d4a715cdaf57468ead23f2ff9dce76d02c6a888d73d144d4baa2ae571ba3c", "swift-package.ts": "338cfef9a34a930206ac2e1a8a90b85c8d61f776d9a41e6445dc18e0c5385cdb", "swift-source-file.ts": "93fd659ed63a27b67f54a7c229a7ceb636dc9c59e68414920ba36cff1eda1f94", "swift-toolchain.ts": "65a0698bf022ace2f4254f3f891828dedf403d61c102238e242084a2279e04eb", "home-paths.ts": "f5583b61f8bdd81823b3b29ff519a48daf9993719f194ddb7de22218472e90f9", "xcode-header-search.ts": "f8c3d557b4eca5ddad32907545353eb7ad53b2ebd0969d9ed8f7275e109a13b1", "xcode-project.ts": "5f41cd0bd86cb0cffbfb0047348b963f81d5e51cb0e8dd574c739b1a27aa56de", "xcode-target-members.ts": "ad7589132bffab265e8a10b64e24484fe88b4a2b1cc0ee19a97f151a002eca77", "xcode-json-project.ts": "41990ebbe4b488eef34e74c4608b4b48e5a5b299ba98ca7fbcfdfa0e77be63b6", "openstep-plist.ts": "74e6ce1dac80c9c318e0e9f5e3e8cd19a898a8820c36fc160609695bcb59dcd3" };
43
43
  }
44
44
  });
45
45
 
@@ -2036,7 +2036,7 @@ var MAX_SWIFT_COMPILE_METAL_TOTAL_BYTES = 8 * 1024 * 1024;
2036
2036
  var MAX_SWIFT_COMPILE_IMAGES = 256;
2037
2037
  var MAX_SWIFT_COMPILE_IMAGE_BYTES = 4 * 1024 * 1024;
2038
2038
  var MAX_SWIFT_COMPILE_IMAGE_TOTAL_BYTES = 16 * 1024 * 1024;
2039
- var SWIFT_HOST_ABI = 69;
2039
+ var SWIFT_HOST_ABI = 70;
2040
2040
  var POLL_INTERVAL_MS = 1500;
2041
2041
  function httpSwiftCompileSubmit(context) {
2042
2042
  const { assetReadToken, authorization, endpoint } = context;
@@ -7604,6 +7604,29 @@ function moduleMapName(text5) {
7604
7604
  );
7605
7605
  return index < 0 ? void 0 : tokens2[index + 1];
7606
7606
  }
7607
+ function moduleMapModules(text5) {
7608
+ const modules = [];
7609
+ const token = /\/\*[\s\S]*?\*\/|\/\/[^\n]*|"[^"]*"|\{|\}|\bmodule\s+([\w.]+)/g;
7610
+ let depth = 0;
7611
+ let start = -1;
7612
+ let name3 = "";
7613
+ for (const match of text5.matchAll(token)) {
7614
+ if (match[0] === "{") depth++;
7615
+ else if (match[0] === "}") {
7616
+ depth--;
7617
+ if (depth === 0 && start >= 0) {
7618
+ modules.push({ name: name3, text: text5.slice(start, match.index + 1) });
7619
+ start = -1;
7620
+ }
7621
+ } else if (match[1] !== void 0 && depth === 0) {
7622
+ const before = text5.slice(0, match.index).trimEnd();
7623
+ if (/\bextern$/.test(before)) continue;
7624
+ start = match.index;
7625
+ name3 = match[1];
7626
+ }
7627
+ }
7628
+ return modules;
7629
+ }
7607
7630
  function swiftTargetModuleName(name3) {
7608
7631
  return name3.replace(/[^A-Za-z0-9_]/g, "_").replace(/^[0-9]/, "_");
7609
7632
  }
@@ -11840,6 +11863,137 @@ var import_node_crypto10 = require("node:crypto");
11840
11863
  var import_node_fs29 = __toESM(require("node:fs"), 1);
11841
11864
  var import_node_path26 = __toESM(require("node:path"), 1);
11842
11865
 
11866
+ // src/swift-interface-bodies.ts
11867
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
11868
+ var INLINE_ATTRIBUTE = /@(?:inlinable|_alwaysEmitIntoClient|_transparent|inline\(__always\)|_effects\([^()]*\)|_specialize\((?:[^()]|\([^()]*\))*\))\s*/g;
11869
+ var ACCESSOR = /^(?:mutating|nonmutating|async|throws|rethrows|get|set|_modify|_read)$/;
11870
+ function declarationKind(head) {
11871
+ const words2 = head.replace(/@\w+(?:\((?:[^()]|\([^()]*\))*\))?/g, " ").match(/[A-Za-z_]\w*/g);
11872
+ for (const word of words2 ?? []) {
11873
+ if (word === "func" || word === "init" || word === "deinit") return "function";
11874
+ if (word === "var" || word === "let" || word === "subscript") return "property";
11875
+ if (word === "struct" || word === "class" || word === "enum" || word === "protocol" || word === "extension" || word === "actor" || word === "precedencegroup")
11876
+ return "container";
11877
+ }
11878
+ return "container";
11879
+ }
11880
+ function skipLiteral(text5, i) {
11881
+ if (text5.startsWith("//", i)) {
11882
+ const end = text5.indexOf("\n", i);
11883
+ return end < 0 ? text5.length : end;
11884
+ }
11885
+ if (text5.startsWith("/*", i)) {
11886
+ const end = text5.indexOf("*/", i + 2);
11887
+ return end < 0 ? text5.length : end + 2;
11888
+ }
11889
+ if (text5[i] !== '"' && text5[i] !== "#") return i;
11890
+ let hashes = 0;
11891
+ let j = i;
11892
+ while (text5[j] === "#") {
11893
+ hashes++;
11894
+ j++;
11895
+ }
11896
+ if (text5[j] !== '"') return i;
11897
+ const multiline = text5.startsWith('"""', j);
11898
+ const open = multiline ? '"""' : '"';
11899
+ j += open.length;
11900
+ const close = `${open}${"#".repeat(hashes)}`;
11901
+ const escape2 = `\\${"#".repeat(hashes)}`;
11902
+ while (j < text5.length) {
11903
+ if (text5.startsWith(escape2, j)) j += escape2.length + 1;
11904
+ else if (text5.startsWith(close, j)) return j + close.length;
11905
+ else j++;
11906
+ }
11907
+ return text5.length;
11908
+ }
11909
+ function skipBlock(text5, open) {
11910
+ let depth = 0;
11911
+ for (let i = open; i < text5.length; ) {
11912
+ const after = skipLiteral(text5, i);
11913
+ if (after !== i) {
11914
+ i = after;
11915
+ continue;
11916
+ }
11917
+ if (text5[i] === "{") depth++;
11918
+ else if (text5[i] === "}" && --depth === 0) return i + 1;
11919
+ i++;
11920
+ }
11921
+ return text5.length;
11922
+ }
11923
+ function skipExpression(text5, start) {
11924
+ let depth = 0;
11925
+ for (let i = start; i < text5.length; ) {
11926
+ const after = skipLiteral(text5, i);
11927
+ if (after !== i) {
11928
+ i = after;
11929
+ continue;
11930
+ }
11931
+ const char = text5[i];
11932
+ if (char === "(" || char === "[" || char === "{" || char === "<") depth++;
11933
+ else if (char === ">" && text5[i - 1] !== "-") depth--;
11934
+ else if (char === ")" || char === "]" || char === "}") {
11935
+ if (depth === 0) return i;
11936
+ depth--;
11937
+ } else if (char === "," && depth === 0) return i;
11938
+ i++;
11939
+ }
11940
+ return text5.length;
11941
+ }
11942
+ function swiftInterfaceWithoutBodies(text5, keepDefaults = false) {
11943
+ let out = "";
11944
+ const frames = [];
11945
+ let parens = 0;
11946
+ let lineStart = 0;
11947
+ for (let i = 0; i < text5.length; ) {
11948
+ const after = skipLiteral(text5, i);
11949
+ if (after !== i) {
11950
+ out += text5.slice(i, after);
11951
+ i = after;
11952
+ continue;
11953
+ }
11954
+ const char = text5[i];
11955
+ if (char === "=" && parens > 0 && text5[i - 1] === " " && text5[i + 1] === " ") {
11956
+ out = out.trimEnd();
11957
+ i = skipExpression(text5, i + 1);
11958
+ continue;
11959
+ }
11960
+ if (char === "\n") lineStart = out.length + 1;
11961
+ else if (char === "(") parens++;
11962
+ else if (char === ")") parens--;
11963
+ else if (char === "}") {
11964
+ frames.pop();
11965
+ } else if (char === "{") {
11966
+ const parent = frames.at(-1);
11967
+ const head = out.slice(lineStart);
11968
+ if (parens > 0 || parent === "expression") frames.push("expression");
11969
+ else if (parent === "accessors") {
11970
+ out = `${out.slice(0, lineStart)}${head.replace(INLINE_ATTRIBUTE, "")}`.trimEnd();
11971
+ i = skipBlock(text5, i);
11972
+ continue;
11973
+ } else {
11974
+ const kind = declarationKind(head);
11975
+ const body = text5.slice(i + 1, skipBlock(text5, i) - 1);
11976
+ if (kind === "function") {
11977
+ out = `${out.slice(0, lineStart)}${head.replace(INLINE_ATTRIBUTE, "")}`.trimEnd();
11978
+ i = skipBlock(text5, i);
11979
+ continue;
11980
+ }
11981
+ const bare = body.split(/\s+/).every((word) => word === "" || ACCESSOR.test(word));
11982
+ frames.push(kind === "property" && !bare ? "accessors" : "container");
11983
+ if (kind === "property" && bare) {
11984
+ out += `{${body}}`;
11985
+ i = skipBlock(text5, i);
11986
+ frames.pop();
11987
+ continue;
11988
+ }
11989
+ }
11990
+ }
11991
+ out += char;
11992
+ i++;
11993
+ }
11994
+ return out.replace(INLINE_ATTRIBUTE, "");
11995
+ }
11996
+
11843
11997
  // src/swift-objc-sdk.ts
11844
11998
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
11845
11999
  var import_node_path25 = __toESM(require("node:path"), 1);
@@ -11878,7 +12032,7 @@ function restoreSwiftInterfaceSPI(interfaceText, module2, graphs) {
11878
12032
  let depth = 0;
11879
12033
  for (const line of interfaceText.split("\n")) {
11880
12034
  const enclosing = scopes.at(-1)?.path ?? [];
11881
- const declaration = /^\s*(?:@[\w.]+(?:\([^)]*\))?\s+|\w+\s+)*?(class(?!\s+(?:func|var|subscript)\b)|struct|enum|protocol|actor|extension|func|var|let|init|subscript|typealias|case)\b\s*([\w.`]*)/.exec(
12035
+ const declaration = /^\s*(?:@[\w.]+(?:\([^)]*\))?\s+|\w+\s+)*?(class(?!\s+(?:func|var|subscript)\b)|struct|enum|protocol|actor|extension|func|var|let|init|subscript|typealias|case)\b\s*([/=\-+!*%<>&|^~?]+|[\w.`]*)/.exec(
11882
12036
  line.replace(/::/g, ".")
11883
12037
  );
11884
12038
  if (declaration) {
@@ -11976,7 +12130,26 @@ var KEEP_EXTERNAL = /* @__PURE__ */ new Map([
11976
12130
  ["s:SE", "Encodable"],
11977
12131
  ["s:Se", "Decodable"],
11978
12132
  ["s:s23CustomStringConvertibleP", "CustomStringConvertible"],
11979
- ["s:s9CodingKeyP", "CodingKey"]
12133
+ ["s:s9CodingKeyP", "CodingKey"],
12134
+ ["s:SL", "Comparable"],
12135
+ ["s:ST", "Sequence"],
12136
+ ["s:St", "IteratorProtocol"],
12137
+ ["s:Sl", "Collection"],
12138
+ ["s:SK", "BidirectionalCollection"],
12139
+ ["s:Sk", "RandomAccessCollection"],
12140
+ ["s:SM", "MutableCollection"],
12141
+ ["s:Sm", "RangeReplaceableCollection"],
12142
+ ["s:s28CustomDebugStringConvertibleP", "CustomDebugStringConvertible"],
12143
+ ["s:s25LosslessStringConvertibleP", "LosslessStringConvertible"],
12144
+ ["s:s20TextOutputStreamableP", "TextOutputStreamable"],
12145
+ ["s:Sx", "Strideable"],
12146
+ ["s:s18AdditiveArithmeticP", "AdditiveArithmetic"],
12147
+ ["s:s25ExpressibleByArrayLiteralP", "ExpressibleByArrayLiteral"],
12148
+ ["s:s30ExpressibleByDictionaryLiteralP", "ExpressibleByDictionaryLiteral"],
12149
+ ["s:s26ExpressibleByStringLiteralP", "ExpressibleByStringLiteral"],
12150
+ ["s:s27ExpressibleByIntegerLiteralP", "ExpressibleByIntegerLiteral"],
12151
+ ["s:s25ExpressibleByFloatLiteralP", "ExpressibleByFloatLiteral"],
12152
+ ["s:s27ExpressibleByBooleanLiteralP", "ExpressibleByBooleanLiteral"]
11980
12153
  ]);
11981
12154
  var LEADING_ATTRS = /^((?:@\w+(?:\([^)]*\))?\s*|nonisolated\s+)*)(.*)$/s;
11982
12155
  var OBJC_ONLY = /@(?:objcMembers|objc|IBOutlet|IBInspectable|IBAction|IBSegueAction|GKInspectable|nonobjc|NSCopying|NSManaged)(?:\([^)]*\))?\s*|\bdynamic\s+/g;
@@ -12857,7 +13030,12 @@ function emitSwiftStandin(sourceGraphs, options) {
12857
13030
  const list2 = [
12858
13031
  ...parent ? [parent] : [],
12859
13032
  ...(conforms.get(id) ?? []).filter(
12860
- (name3) => !ancestors.has(name3) && !inherited.has(conformanceTargets.get(id).get(name3)) && !(parent && objectConformers.has(id) && ["Hashable", "Equatable", "CustomStringConvertible"].includes(name3)) && !(name3 === nsObjectProtocol && externalRoot(id) === nsObject)
13033
+ (name3) => !ancestors.has(name3) && !inherited.has(conformanceTargets.get(id).get(name3)) && !(parent && objectConformers.has(id) && [
13034
+ "Hashable",
13035
+ "Equatable",
13036
+ "CustomStringConvertible",
13037
+ "CustomDebugStringConvertible"
13038
+ ].includes(name3)) && !(name3 === nsObjectProtocol && externalRoot(id) === nsObject) && !options.unconformed?.get(path66)?.has(name3)
12861
13039
  )
12862
13040
  ].filter((name3, at, all2) => all2.indexOf(name3) === at);
12863
13041
  const parentSymbol = superId.has(id) ? byId.get(superId.get(id)) : void 0;
@@ -13646,6 +13824,43 @@ function sdkDeclaration(name3) {
13646
13824
  }
13647
13825
  return sdkDeclarations.get(name3) ?? null;
13648
13826
  }
13827
+ function intakeInterface(text5, keepDefaults = false) {
13828
+ return swiftInterfaceWithoutBodies(text5, keepDefaults).replace(/^((?:@_exported[ \t]+)?import[ \t]+)(\w+)\.[\w.]+[ \t]*$/gm, "$1$2").replace(/\bCoreFoundation\.(?=CG)/g, "CoreGraphics.").replace(/\bCoreFoundation\.(?=\w)/g, "Foundation.").replace(/\bDarwin\.OSStatus\b/g, "Swift.Int32").replace(
13829
+ /\bFoundation\.Data\.(?=Base64(?:En|De)codingOptions\b)/g,
13830
+ "Foundation.NSData."
13831
+ );
13832
+ }
13833
+ function stageVendorFrameworks(dir, stage) {
13834
+ import_node_fs29.default.mkdirSync(stage, { recursive: true });
13835
+ for (const entry of import_node_fs29.default.readdirSync(dir)) {
13836
+ if (!entry.endsWith(".framework")) continue;
13837
+ const source = import_node_path26.default.join(dir, entry);
13838
+ const target = import_node_path26.default.join(stage, entry);
13839
+ import_node_fs29.default.mkdirSync(target, { recursive: true });
13840
+ for (const child of import_node_fs29.default.readdirSync(source)) {
13841
+ if (child !== "Modules") {
13842
+ import_node_fs29.default.symlinkSync(import_node_path26.default.join(source, child), import_node_path26.default.join(target, child));
13843
+ continue;
13844
+ }
13845
+ for (const file of import_node_fs29.default.readdirSync(import_node_path26.default.join(source, child), {
13846
+ recursive: true,
13847
+ encoding: "utf8"
13848
+ })) {
13849
+ const from = import_node_path26.default.join(source, child, file);
13850
+ const to = import_node_path26.default.join(target, child, file);
13851
+ if (import_node_fs29.default.statSync(from).isDirectory()) {
13852
+ import_node_fs29.default.mkdirSync(to, { recursive: true });
13853
+ continue;
13854
+ }
13855
+ import_node_fs29.default.mkdirSync(import_node_path26.default.dirname(to), { recursive: true });
13856
+ if (file.endsWith(".swiftinterface"))
13857
+ import_node_fs29.default.writeFileSync(to, intakeInterface(import_node_fs29.default.readFileSync(from, "utf8")));
13858
+ else import_node_fs29.default.copyFileSync(from, to);
13859
+ }
13860
+ }
13861
+ }
13862
+ return stage;
13863
+ }
13649
13864
  function objcView(surface, toolchainBin, stdlib, cacheDir5, work, original, vendorFrameworks = []) {
13650
13865
  if (!import_node_fs29.default.existsSync(stdlib))
13651
13866
  throw new Error(
@@ -13673,6 +13888,7 @@ function objcView(surface, toolchainBin, stdlib, cacheDir5, work, original, vend
13673
13888
  import_node_fs29.default.writeFileSync(file, text5);
13674
13889
  }
13675
13890
  const interfaceCopies = [];
13891
+ let keepDefaults = true;
13676
13892
  if (framework) {
13677
13893
  import_node_fs29.default.mkdirSync(import_node_path26.default.join(frameworks, `${surface.module}.framework`, "Modules"), {
13678
13894
  recursive: true
@@ -13699,10 +13915,7 @@ function objcView(surface, toolchainBin, stdlib, cacheDir5, work, original, vend
13699
13915
  interfaceCopies.push(import_node_path26.default.join(to, name3));
13700
13916
  import_node_fs29.default.writeFileSync(
13701
13917
  import_node_path26.default.join(to, name3),
13702
- import_node_fs29.default.readFileSync(import_node_path26.default.join(from, name3), "utf8").replace(/\bCoreFoundation\.(?=CG)/g, "CoreGraphics.").replace(/\bCoreFoundation\.(?=\w)/g, "Foundation.").replace(/\bDarwin\.OSStatus\b/g, "Swift.Int32").replace(
13703
- /\bFoundation\.Data\.(?=Base64(?:En|De)codingOptions\b)/g,
13704
- "Foundation.NSData."
13705
- )
13918
+ intakeInterface(import_node_fs29.default.readFileSync(import_node_path26.default.join(from, name3), "utf8"), true)
13706
13919
  );
13707
13920
  }
13708
13921
  }
@@ -13764,7 +13977,10 @@ function objcView(surface, toolchainBin, stdlib, cacheDir5, work, original, vend
13764
13977
  stubs,
13765
13978
  "-I",
13766
13979
  stubIncludes,
13767
- ...vendorFrameworks.flatMap((dir) => ["-F", dir])
13980
+ ...vendorFrameworks.flatMap((dir, index) => [
13981
+ "-F",
13982
+ stageVendorFrameworks(dir, import_node_path26.default.join(work, "vendor-frameworks", String(index)))
13983
+ ])
13768
13984
  ];
13769
13985
  const missing = /* @__PURE__ */ new Map();
13770
13986
  const stubbed = /* @__PURE__ */ new Set();
@@ -13970,6 +14186,13 @@ function objcView(surface, toolchainBin, stdlib, cacheDir5, work, original, vend
13970
14186
  );
13971
14187
  }
13972
14188
  }
14189
+ if ((!progress || round === ROUNDS) && keepDefaults && interfaceCopies.length > 0) {
14190
+ keepDefaults = false;
14191
+ for (const file of interfaceCopies)
14192
+ import_node_fs29.default.writeFileSync(file, swiftInterfaceWithoutBodies(import_node_fs29.default.readFileSync(file, "utf8")));
14193
+ writeHeaders();
14194
+ continue;
14195
+ }
13973
14196
  if (!progress || round === ROUNDS)
13974
14197
  throw new Error(
13975
14198
  `its headers do not import as Swift: ${errors.length > 0 ? [...new Set(errors.map((match) => match[4]))].slice(0, 10).join("; ") : `swift-symbolgraph-extract ${run8.signal ?? `exit ${run8.status}`}: ${(run8.stderr.trim() || run8.stdout.trim() || "no diagnostic").slice(0, 4e3)}`}`
@@ -20701,6 +20924,13 @@ var BINARYEN_RELEASES = /* @__PURE__ */ new Map([
20701
20924
  ]
20702
20925
  ]);
20703
20926
  async function runWasmOpt(file, output2, skipPasses, binary2) {
20927
+ const admittedCores = windowAdmission()?.cores ?? Number(process.env.TM_EXEC_CPU_CORES);
20928
+ const requestedCores = Number(process.env.BINARYEN_CORES);
20929
+ const environment = { ...process.env, WASM_OPT_PATH: binary2 };
20930
+ if (Number.isInteger(admittedCores) && admittedCores > 0)
20931
+ environment.BINARYEN_CORES = String(
20932
+ Number.isInteger(requestedCores) && requestedCores > 0 ? Math.min(admittedCores, requestedCores) : admittedCores
20933
+ );
20704
20934
  const result = await (0, import_wasm_opt.wasmOpt)(
20705
20935
  [
20706
20936
  "-Oz",
@@ -20710,7 +20940,7 @@ async function runWasmOpt(file, output2, skipPasses, binary2) {
20710
20940
  "-o",
20711
20941
  output2
20712
20942
  ],
20713
- { env: { ...process.env, WASM_OPT_PATH: binary2 } }
20943
+ { env: environment }
20714
20944
  );
20715
20945
  if (result.status !== 0)
20716
20946
  throw new Error(`wasm-opt exited ${result.status}: ${result.stderr}`);
@@ -22744,7 +22974,7 @@ var darwinRecordsRegion = (quoted) => quoted.length ? ["-Wl,--start-lib", ...quo
22744
22974
  var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
22745
22975
  var MULTI_MANIFEST_VERSION = 68;
22746
22976
  var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
22747
- var compilerSourceDigest = true ? "f4c68ce2ea46dd5a9205990046616e5dcc4a3b3b527378ee285d9e25865e5851" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
22977
+ var compilerSourceDigest = true ? "e48d05f659c020e9d4ddc0f6a17da7924aae807faacd6bef7cbed911c43d08cc" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
22748
22978
  function swiftArtifactHash(input, release, moduleRoot) {
22749
22979
  const hash = (0, import_node_crypto19.createHash)("sha256");
22750
22980
  hash.update(`swift-compile
@@ -26071,7 +26301,7 @@ function readCompiledArtifact(directory, hash) {
26071
26301
  return null;
26072
26302
  const bytes = (0, import_node_fs47.readFileSync)(import_node_path44.default.join(directory, "app.wasm"));
26073
26303
  const gzip2 = (0, import_node_fs47.readFileSync)(import_node_path44.default.join(directory, "icu.gz"));
26074
- if ((0, import_node_crypto19.createHash)("sha256").update(bytes).digest("hex") !== receipt.wasm || (0, import_node_crypto19.createHash)("sha256").update(gzip2).digest("hex") !== receipt.icu || bytes.length < 8 || bytes.readUInt32LE(0) !== 1836278016 || bytes.readUInt32LE(4) !== 1)
26304
+ if ((0, import_node_crypto19.createHash)("sha256").update(bytes).digest("hex") !== receipt.wasm || (0, import_node_crypto19.createHash)("sha256").update(gzip2).digest("hex") !== receipt.icu || bytes.length <= 8 || bytes.readUInt32LE(0) !== 1836278016 || bytes.readUInt32LE(4) !== 1)
26075
26305
  return null;
26076
26306
  return { hash, bytes, icu: { sha256: receipt.icu, gzip: gzip2 } };
26077
26307
  } catch (error) {
@@ -27133,6 +27363,8 @@ function compileSwiftProjectOnce(input, options) {
27133
27363
  bytes: (0, import_node_fs47.readFileSync)(executable),
27134
27364
  icu: await icu
27135
27365
  };
27366
+ if (artifact.bytes.length <= 8)
27367
+ throw new Error("swift-compile: deferred linker produced no executable");
27136
27368
  if (!options.project) saveCompiledArtifact(root, artifact);
27137
27369
  saveSharedArtifact(sharedRoot, artifact);
27138
27370
  report("compiled artifact verified");
@@ -31241,7 +31473,7 @@ function initializeWorkspaceGit(root, work) {
31241
31473
  });
31242
31474
  const tracked = trackedSourceFiles(root, work);
31243
31475
  if (tracked.length > 0)
31244
- (0, import_node_child_process32.execFileSync)("git", ["add", "-f", "--pathspec-from-file=-", "--pathspec-file-nul"], {
31476
+ (0, import_node_child_process32.execFileSync)("git", ["update-index", "--add", "-z", "--stdin"], {
31245
31477
  cwd: work,
31246
31478
  env: { ...process.env, ...isolatedGitEnv },
31247
31479
  input: tracked.join("\0"),
@@ -31341,6 +31573,7 @@ async function prepareWorkspace(app, stage, key2, podsEnvironment) {
31341
31573
  const nodeVersion = typeof manifest.engines?.node === "string" && /^\d+(\.\d+){0,2}$/.test(manifest.engines.node) ? manifest.engines.node : null;
31342
31574
  const prefix = nodeVersion ? ["mise", "exec", `node@${nodeVersion}`, "--"] : [];
31343
31575
  const bunPrefix = import_node_path54.default.join(cacheDir(), "package-managers", manager);
31576
+ const bunExecutable = import_node_path54.default.join(bunPrefix, "node_modules/.bin/bun");
31344
31577
  const install = manager === "pnpm" || manager.startsWith("pnpm@") ? [
31345
31578
  "npx",
31346
31579
  "--yes",
@@ -31349,11 +31582,7 @@ async function prepareWorkspace(app, stage, key2, podsEnvironment) {
31349
31582
  "--frozen-lockfile",
31350
31583
  // the copied node_modules link into the store pnpm chose on the app's volume
31351
31584
  ...pnpmStoreArgs(root)
31352
- ] : manager === "yarn" || manager.startsWith("yarn@") ? ["corepack", "yarn", "install", "--immutable"] : manager === "bun" || manager.startsWith("bun@") ? manager === "bun" ? ["bun", "install", "--frozen-lockfile"] : [
31353
- import_node_path54.default.join(bunPrefix, "node_modules/.bin/bun"),
31354
- "install",
31355
- "--frozen-lockfile"
31356
- ] : (
31585
+ ] : manager === "yarn" || manager.startsWith("yarn@") ? ["corepack", "yarn", "install", "--immutable"] : manager === "bun" || manager.startsWith("bun@") ? manager === "bun" ? ["bun", "install", "--frozen-lockfile"] : [bunExecutable, "install", "--frozen-lockfile"] : (
31357
31586
  // npm ci would delete the cloned tree before installing it again
31358
31587
  ["npm", "install", "--no-audit", "--no-fund"]
31359
31588
  );
@@ -31362,22 +31591,22 @@ async function prepareWorkspace(app, stage, key2, podsEnvironment) {
31362
31591
  const command = [...prefix, ...args];
31363
31592
  await run8(command[0], command.slice(1), cwd, env);
31364
31593
  };
31594
+ if (manager.startsWith("bun@") && (!projectReady || !import_node_fs56.default.existsSync(bunExecutable)))
31595
+ await execute(
31596
+ [
31597
+ "npm",
31598
+ "install",
31599
+ "--prefix",
31600
+ bunPrefix,
31601
+ // the bun package ships a placeholder binary its postinstall replaces
31602
+ "--ignore-scripts=false",
31603
+ "--no-audit",
31604
+ "--no-fund",
31605
+ manager
31606
+ ],
31607
+ work
31608
+ );
31365
31609
  if (!projectReady) {
31366
- if (manager.startsWith("bun@"))
31367
- await execute(
31368
- [
31369
- "npm",
31370
- "install",
31371
- "--prefix",
31372
- bunPrefix,
31373
- // the bun package ships a placeholder binary its postinstall replaces
31374
- "--ignore-scripts=false",
31375
- "--no-audit",
31376
- "--no-fund",
31377
- manager
31378
- ],
31379
- work
31380
- );
31381
31610
  if (install[0] === "npm" && import_node_fs56.default.existsSync(import_node_path54.default.join(work, "package-lock.json"))) {
31382
31611
  await execute(
31383
31612
  ["npm", "ci", "--dry-run", "--ignore-scripts", "--no-audit", "--no-fund"],
@@ -32003,7 +32232,7 @@ function sourceClosureDigest(srcDir, entrypoints) {
32003
32232
  return hash.digest("hex");
32004
32233
  }
32005
32234
  var standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
32006
- var STANDIN_SOURCE_DIGEST = true ? "f2fd734797f09885af5cbd2e5fd5b69c0958bd1f06e2a2e9454cbae6de386412" : standinSourceDigest();
32235
+ var STANDIN_SOURCE_DIGEST = true ? "0981767eef4ad46fe5cb602ee15f1de9ea06dac3a2edb4dab0f6d5279b018a3b" : standinSourceDigest();
32007
32236
 
32008
32237
  // src/expoSwiftContract.ts
32009
32238
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
@@ -32269,7 +32498,7 @@ async function packageTreeDigest(root) {
32269
32498
  // src/expo-native-prebuilt.ts
32270
32499
  var EXPO_NATIVE_ENTRY_NAME = "ios";
32271
32500
  function expoNativeCompilerDigestValue() {
32272
- return true ? "6e72a2a7110799c942eb67d757031bc037f2300be88e5ce35d02796324beadb3" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
32501
+ return true ? "5096ba1e78a0087b6e56f15c4b37fcbd9bcabb2acde17a257d8add357efd462c" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
32273
32502
  }
32274
32503
  var IDENTITY_SOURCE_SKIPS = 1 | 4 | 8 | 16 | 32 | 64 | 128 | 4096;
32275
32504
  function readSources(value) {
@@ -34462,6 +34691,19 @@ function cxxOnly(surface) {
34462
34691
  return false;
34463
34692
  });
34464
34693
  }
34694
+ function mapSurfaces(modulemap) {
34695
+ const text5 = import_node_fs70.default.readFileSync(modulemap, "utf8");
34696
+ const headers = import_node_path67.default.dirname(modulemap);
34697
+ const modules = moduleMapModules(text5);
34698
+ if (modules.length <= 1) {
34699
+ const module2 = moduleMapName(text5);
34700
+ return module2 ? [headerSurface(module2, modulemap, headers)] : [];
34701
+ }
34702
+ return modules.map(
34703
+ (module2) => headerSurface(module2.name, generatedModuleMap(`${module2.text}
34704
+ `, false), headers)
34705
+ );
34706
+ }
34465
34707
  function simulatorSlice(xcframeworkDir) {
34466
34708
  const slice = import_node_fs70.default.readdirSync(xcframeworkDir).filter((name3) => /^ios-.+-simulator$/.test(name3)).sort()[0];
34467
34709
  return slice ? import_node_path67.default.join(xcframeworkDir, slice) : null;
@@ -34525,8 +34767,7 @@ function surfaces(xcframeworkDir, target, slice = simulatorSlice(xcframeworkDir)
34525
34767
  const headers = import_node_path67.default.join(root, "Headers");
34526
34768
  for (const map2 of files(headers, (name3) => name3 === "module.modulemap")) {
34527
34769
  const modulemap = import_node_path67.default.join(headers, map2);
34528
- const module2 = moduleMapName(import_node_fs70.default.readFileSync(modulemap, "utf8"));
34529
- if (module2) found.push(headerSurface(module2, modulemap, import_node_path67.default.dirname(modulemap)));
34770
+ found.push(...mapSurfaces(modulemap));
34530
34771
  }
34531
34772
  if (found.length === 0 && files(headers, (name3) => name3.endsWith(".h")).length) {
34532
34773
  const module2 = swiftTargetModuleName(target);
@@ -34663,9 +34904,13 @@ function swiftInterfaceForWasm(text5, cFlags) {
34663
34904
  ]);
34664
34905
  return `${interop} ${xcc.join(" ")}`;
34665
34906
  });
34666
- return retargeted.split("\n").map((line) => {
34667
- if (/\benum\s/.test(line) && TYPE_DECLARATION.test(line))
34668
- return line.replace(/@objc(?:\s*\([^()]*\))?\s+/g, "");
34907
+ const lines = retargeted.split("\n");
34908
+ const required = lines.filter((line) => OPTIONAL_REQUIREMENT.test(line)).join("\n");
34909
+ return lines.map((line) => {
34910
+ if (/\benum\s/.test(line) && TYPE_DECLARATION.test(line)) {
34911
+ const name3 = /\benum\s+(\w+)/.exec(line)?.[1];
34912
+ return name3 && new RegExp(`\\b${name3}\\b`).test(required) && !/\bSwift\.Error\b/.test(line) ? line : line.replace(/@objc(?:\s*\([^()]*\))?\s+/g, "");
34913
+ }
34669
34914
  if (TYPE_DECLARATION.test(line)) return line.replace(/@objcMembers\b/g, "");
34670
34915
  if (OPTIONAL_REQUIREMENT.test(line)) return line;
34671
34916
  return line.replace(OBJC_ATTRIBUTE, "");
@@ -35086,6 +35331,14 @@ function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, r
35086
35331
  const plain = /* @__PURE__ */ new Set();
35087
35332
  const unobjc = /* @__PURE__ */ new Set();
35088
35333
  const trapped = /* @__PURE__ */ new Set();
35334
+ const unconformed = /* @__PURE__ */ new Map();
35335
+ const objcProtocols = new Set(
35336
+ graphs.flatMap(
35337
+ (graph) => graph.symbols.filter(
35338
+ (symbol2) => symbol2.kind.identifier === "swift.protocol" && symbol2.identifier.precise.startsWith("c:")
35339
+ ).map((symbol2) => symbol2.pathComponents.join("."))
35340
+ )
35341
+ );
35089
35342
  const file = import_node_path67.default.join(work, `${module2}.swift`);
35090
35343
  const inert = binary2.placeholder !== void 0 || binary2.publicHeaders !== void 0 && binary2.assemblySources === void 0;
35091
35344
  for (; ; ) {
@@ -35098,6 +35351,7 @@ function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, r
35098
35351
  omit,
35099
35352
  plain,
35100
35353
  unobjc,
35354
+ unconformed,
35101
35355
  trapped,
35102
35356
  inert,
35103
35357
  imports: [...placeholder?.peachImports ?? [], ...imports2],
@@ -35145,7 +35399,7 @@ function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, r
35145
35399
  files: { [`${module2}.swift`]: source },
35146
35400
  ...imports2.length ? { dependencies: imports2 } : {}
35147
35401
  };
35148
- const before = omit.size + plain.size + unobjc.size + trapped.size;
35402
+ const before = omit.size + plain.size + unobjc.size + trapped.size + unconformed.size;
35149
35403
  const elsewhere = [];
35150
35404
  for (const match of check2.stderr.matchAll(/^(\S+?):(\d+):\d+: error: (.*)$/gm)) {
35151
35405
  const owner = match[1] === file ? owners[Number(match[2]) - 1] : void 0;
@@ -35153,6 +35407,13 @@ function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, r
35153
35407
  unobjc.add(owner);
35154
35408
  continue;
35155
35409
  }
35410
+ const conformance = /^type '\w+' does not conform to protocol '(\w+)'$/.exec(
35411
+ match[3]
35412
+ )?.[1];
35413
+ if (owner && conformance && objcProtocols.has(conformance)) {
35414
+ unconformed.set(owner, /* @__PURE__ */ new Set([...unconformed.get(owner) ?? [], conformance]));
35415
+ continue;
35416
+ }
35156
35417
  if (owner && swiftPaths.has(owner))
35157
35418
  throw new Error(
35158
35419
  `Swift declaration ${module2}.${owner} does not typecheck: ${match[3]}`
@@ -35168,7 +35429,7 @@ function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, r
35168
35429
  else if (owner) omit.set(owner, `rejected by swiftc: ${match[3]}`);
35169
35430
  else elsewhere.push(match[3]);
35170
35431
  }
35171
- if (omit.size + plain.size + unobjc.size + trapped.size === before)
35432
+ if (omit.size + plain.size + unobjc.size + trapped.size + unconformed.size === before)
35172
35433
  throw new Error(
35173
35434
  `its generated source does not typecheck: ${elsewhere.slice(0, 3).join("; ") || check2.stderr.trim().slice(0, 400)}`
35174
35435
  );
@@ -35294,7 +35555,16 @@ function splitDeclarators(statement, names) {
35294
35555
  );
35295
35556
  }
35296
35557
  function cStandin(surface, binary2, toolchain, work) {
35297
- const headers = files(surface.headers, (name3) => name3.endsWith(".h"));
35558
+ const everyHeader = files(surface.headers, (name3) => name3.endsWith(".h"));
35559
+ const moduleRoots = moduleMapHeaders(surface.modulemap, everyHeader);
35560
+ const headers = [...moduleRoots];
35561
+ for (let at = 0; at < headers.length; at++)
35562
+ for (const [, local] of import_node_fs70.default.readFileSync(import_node_path67.default.join(surface.headers, headers[at]), "utf8").matchAll(/^\s*#\s*(?:include|import)\s*["<]([^">]+)[">]/gm)) {
35563
+ const file = import_node_path67.default.posix.normalize(
35564
+ import_node_path67.default.posix.join(import_node_path67.default.posix.dirname(headers[at]), local)
35565
+ );
35566
+ if (everyHeader.includes(file) && !headers.includes(file)) headers.push(file);
35567
+ }
35298
35568
  const framework = import_node_path67.default.basename(import_node_path67.default.dirname(surface.modulemap)) === "Modules";
35299
35569
  const headerDirectory = framework ? `${surface.module}.framework/Headers` : ".";
35300
35570
  const texts = new Map(
@@ -35309,9 +35579,7 @@ function cStandin(surface, binary2, toolchain, work) {
35309
35579
  import_node_fs70.default.mkdirSync(import_node_path67.default.dirname(import_node_path67.default.join(include, file)), { recursive: true });
35310
35580
  import_node_fs70.default.writeFileSync(import_node_path67.default.join(include, file), text5);
35311
35581
  }
35312
- const roots = moduleMapHeaders(surface.modulemap, headers).map(
35313
- (file) => import_node_path67.default.posix.join(headerDirectory, file)
35314
- );
35582
+ const roots = moduleRoots.map((file) => import_node_path67.default.posix.join(headerDirectory, file));
35315
35583
  const frameworkMap = `${surface.module}.framework/Modules/module.modulemap`;
35316
35584
  const modulemap = `module ${surface.module} {
35317
35585
  ${roots.map((file) => ` header "${file}"
@@ -36056,7 +36324,7 @@ ${roots.map((file) => ` header "${file}"`).join("\n")}
36056
36324
  return error instanceof Error ? error.message : String(error);
36057
36325
  }
36058
36326
  const found = all.filter(
36059
- (surface) => !provided.has(surface.module) && !(binary2.cxxHeaders === void 0 && cxxOnly(surface))
36327
+ (surface) => !provided.has(surface.module) && (surface.kind === "swift" || surface.kind === "mixed" || surface.kind === "source" || files(surface.headers, (name3) => name3.endsWith(".h")).length > 0) && !(binary2.cxxHeaders === void 0 && cxxOnly(surface))
36060
36328
  );
36061
36329
  if (found.length === 0) {
36062
36330
  import_node_fs70.default.rmSync(work, { recursive: true, force: true });
@@ -44232,7 +44500,15 @@ function targetSettings2(units) {
44232
44500
  }
44233
44501
  return settings;
44234
44502
  }
44235
- function expoEntry(units) {
44503
+ function oneSDKStamp(oneSDK) {
44504
+ if (!oneSDK) return "";
44505
+ const hash = (0, import_node_crypto40.createHash)("sha256");
44506
+ for (const files2 of [oneSDK.targets, oneSDK.entry])
44507
+ for (const [name3, source] of [...files2].sort(([a], [b]) => a.localeCompare(b)))
44508
+ hash.update(`${name3}\0${source}\0`);
44509
+ return hash.digest("hex");
44510
+ }
44511
+ function expoEntry(units, oneSDK = false) {
44236
44512
  const namespaces = [...new Set(units.map((unit2) => unit2.namespace))].filter((namespace) => namespace !== "PeachExpoApp").filter(
44237
44513
  (namespace) => units.some(
44238
44514
  (unit2) => Object.keys(unit2.files).some((file) => file.startsWith(`Sources/${namespace}/`))
@@ -44242,13 +44518,14 @@ function expoEntry(units) {
44242
44518
  const subscribers = units.flatMap((unit2) => unit2.appDelegateSubscribers);
44243
44519
  const handlers = units.flatMap((unit2) => unit2.reactDelegateHandlers);
44244
44520
  const delegates = subscribers.length + handlers.length > 0 ? `; PeachExpoRuntime.registerDelegates(subscribers: [${subscribers.join(", ")}], handlers: [${handlers.join(", ")}])` : "";
44521
+ const view = oneSDK ? '@ViewBuilder func view(props: JSON) -> some View {\n if props["oneSDKHost"] != nil { OneSDKUIKitHost(props: props) } else { PeachExpoNativeView(props: props) }\n }' : "func view(props: JSON) -> PeachExpoNativeView { PeachExpoNativeView(props: props) }";
44245
44522
  return `import SwiftUI
44246
44523
  internal import ExpoModulesCore
44247
- ${bridgeModules.length ? "import React\n" : ""}${namespaces.map((namespace) => `import ${namespace}`).join("\n")}
44524
+ ${bridgeModules.length ? "import React\n" : ""}${oneSDK ? "import One\nimport OneSDKBindings\n" : ""}${namespaces.map((namespace) => `import ${namespace}`).join("\n")}
44248
44525
 
44249
44526
  @main struct PeachExpoApp: PeachPackage {
44250
44527
  init() { MainActor.assumeIsolated { PeachExpoRuntime.register([${units.flatMap((unit2) => unit2.classes).join(", ")}])${delegates}${bridgeModules.length ? `; RCTModuleHost.register([${bridgeModules.join(", ")}])` : ""} } }
44251
- func view(props: JSON) -> PeachExpoNativeView { PeachExpoNativeView(props: props) }
44528
+ ${view}
44252
44529
  }
44253
44530
 
44254
44531
  @_expose(wasm, "peach_expo_call")
@@ -44344,7 +44621,7 @@ async function compileExpoSwiftModules(root, base, publishArtifact, options = {}
44344
44621
  installSwiftInputTrace();
44345
44622
  let key2;
44346
44623
  try {
44347
- key2 = `${await discoveryKey(root, options.installedWorkspace, true, options.iosTarget, options.moduleRoot)}\0${options.only?.join(",") ?? ""}`;
44624
+ key2 = `${await discoveryKey(root, options.installedWorkspace, true, options.iosTarget, options.moduleRoot)}\0${options.only?.join(",") ?? ""}\0${oneSDKStamp(options.oneSDK)}`;
44348
44625
  } catch {
44349
44626
  return compileExpoSwiftModulesTraced(root, base, publishArtifact, options);
44350
44627
  }
@@ -44381,11 +44658,23 @@ async function compileExpoSwiftModulesTraced(root, base, publishArtifact, option
44381
44658
  throw new Error(`conflicting Expo Swift binary source ${name3}`);
44382
44659
  files2[name3] = source;
44383
44660
  }
44384
- files2[EXPO_SWIFT_ENTRY] = expoEntry(linked2);
44661
+ const settings = targetSettings2(linked2);
44662
+ if (options.oneSDK) {
44663
+ for (const [name3, source] of options.oneSDK.targets) files2[name3] = source;
44664
+ for (const [name3, source] of options.oneSDK.entry)
44665
+ files2[`Sources/PeachExpoApp/${name3}`] = source;
44666
+ settings.set("OneSDKBindings", {
44667
+ languageMode: 5,
44668
+ mainActorIsolation: false,
44669
+ swiftFlags: ["-suppress-warnings"],
44670
+ dependencies: [{ kind: "target", name: "One" }]
44671
+ });
44672
+ }
44673
+ files2[EXPO_SWIFT_ENTRY] = expoEntry(linked2, options.oneSDK !== void 0);
44385
44674
  files2["Package.swift"] = expoManifest(
44386
44675
  files2,
44387
44676
  linked2.map((unit2) => generations.get(unit2) ?? "").join(","),
44388
- targetSettings2(linked2)
44677
+ settings
44389
44678
  );
44390
44679
  const provider = linked2.some((unit2) => unit2.reactNativeProvider) ? reactProvider : void 0;
44391
44680
  if (provider) {
@@ -44746,7 +45035,11 @@ async function compileExpoSwiftModulesTraced(root, base, publishArtifact, option
44746
45035
  stamps.set(unit2, stamp);
44747
45036
  candidates.push(unit2);
44748
45037
  }
44749
- const preparedKey = expoSwiftPreparedKey(base, units, reactProviderStamp);
45038
+ const preparedKey = expoSwiftPreparedKey(
45039
+ base,
45040
+ units,
45041
+ reactProviderStamp + oneSDKStamp(options.oneSDK)
45042
+ );
44750
45043
  if (!publishArtifact) {
44751
45044
  const prepared = preparedExpoSwift.get(preparedKey);
44752
45045
  if (prepared) {
@@ -44938,7 +45231,7 @@ async function compileExpoSwiftModulesTraced(root, base, publishArtifact, option
44938
45231
  }
44939
45232
 
44940
45233
  // src/expo-swift-bundle.ts
44941
- async function buildExpoSwiftBundle(appRoot) {
45234
+ async function buildExpoSwiftBundle(appRoot, oneSDK) {
44942
45235
  const assets2 = [];
44943
45236
  const metadata = await compileExpoSwiftModules(
44944
45237
  appRoot,
@@ -44951,7 +45244,8 @@ async function buildExpoSwiftBundle(appRoot) {
44951
45244
  contentType: "application/wasm"
44952
45245
  });
44953
45246
  if ("gzip" in artifact.icu) assets2.push(await swiftIcuBundleAsset(artifact.icu));
44954
- }
45247
+ },
45248
+ { oneSDK }
44955
45249
  );
44956
45250
  if (!metadata) return null;
44957
45251
  return { metadata, assets: assets2 };