peachsim 0.1.2209 → 0.1.2210

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 (102) 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 +1 -1
  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 +1 -1
  11. package/dist-lib/bridge-contract.cjs +1 -1
  12. package/dist-lib/bridge-contract.mjs +1 -1
  13. package/dist-lib/bundle-channel.cjs +271 -51
  14. package/dist-lib/capture-contract.cjs +1 -1
  15. package/dist-lib/capture-contract.mjs +1 -1
  16. package/dist-lib/cloud-contract.cjs +1 -1
  17. package/dist-lib/cloud-contract.mjs +1 -1
  18. package/dist-lib/cloud-test-args.cjs +1 -1
  19. package/dist-lib/cloud-test-args.mjs +1 -1
  20. package/dist-lib/cloud.cjs +1 -1
  21. package/dist-lib/cloud.mjs +1 -1
  22. package/dist-lib/config.cjs +1 -1
  23. package/dist-lib/config.mjs +1 -1
  24. package/dist-lib/detox/index.cjs +1 -1
  25. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  26. package/dist-lib/expo-swift-bundle.cjs +270 -50
  27. package/dist-lib/expo-swift-metadata.cjs +1 -1
  28. package/dist-lib/expo-swift-metadata.mjs +1 -1
  29. package/dist-lib/home-paths.cjs +1 -1
  30. package/dist-lib/host/bridge-host.cjs +271 -51
  31. package/dist-lib/host/fetch-proxy-handler.cjs +16 -3
  32. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  33. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  34. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  35. package/dist-lib/host/websocket-proxy.cjs +1 -1
  36. package/dist-lib/index.cjs +16 -3
  37. package/dist-lib/jump-to-source-babel.cjs +1 -1
  38. package/dist-lib/jump-to-source-native.cjs +1 -1
  39. package/dist-lib/kotlin-host.cjs +1 -1
  40. package/dist-lib/menu.cjs +1 -1
  41. package/dist-lib/menu.mjs +1 -1
  42. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  43. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  44. package/dist-lib/metro-production-bundle.cjs +1 -1
  45. package/dist-lib/metro-production-bundle.mjs +1 -1
  46. package/dist-lib/metro.cjs +16 -3
  47. package/dist-lib/native-app-identity-project.cjs +15 -2
  48. package/dist-lib/native-app-identity-project.mjs +15 -2
  49. package/dist-lib/native-app-identity.cjs +1 -1
  50. package/dist-lib/native-app-identity.mjs +1 -1
  51. package/dist-lib/native-firebase-metadata.cjs +1 -1
  52. package/dist-lib/native-firebase-metadata.mjs +1 -1
  53. package/dist-lib/pdfium-raster.cjs +1 -1
  54. package/dist-lib/pdfium-raster.mjs +1 -1
  55. package/dist-lib/plist.cjs +1 -1
  56. package/dist-lib/plist.mjs +1 -1
  57. package/dist-lib/profiles.cjs +1 -1
  58. package/dist-lib/public-brand.cjs +1 -1
  59. package/dist-lib/public-origins-lib-esm.json +24 -24
  60. package/dist-lib/public-origins-lib.json +63 -53
  61. package/dist-lib/react-native-host-modules.cjs +1 -1
  62. package/dist-lib/react-native-host-modules.mjs +1 -1
  63. package/dist-lib/reap-browser.cjs +1 -1
  64. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  65. package/dist-lib/sdk.cjs +1 -1
  66. package/dist-lib/sdk.mjs +1 -1
  67. package/dist-lib/skills.cjs +271 -51
  68. package/dist-lib/swift-compile.cjs +58 -12
  69. package/dist-lib/swift-compile.mjs +57 -12
  70. package/dist-lib/swift-package.cjs +1 -1
  71. package/dist-lib/swift-package.mjs +1 -1
  72. package/dist-lib/swift-submit.cjs +1 -1
  73. package/dist-lib/swift-submit.mjs +1 -1
  74. package/dist-lib/swift-toolchain.cjs +1 -1
  75. package/dist-lib/swift.cjs +1 -1
  76. package/dist-lib/vite-swift.cjs +253 -46
  77. package/dist-lib/vite.cjs +16 -3
  78. package/dist-lib/worklet-executable.cjs +1 -1
  79. package/dist-lib/worklet-executable.mjs +1 -1
  80. package/package.json +1 -1
  81. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CoreAnimation.h +2 -0
  82. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes +21 -0
  83. package/sdk/ios/usr/lib/swift/Combine.swiftmodule/arm64-apple-ios-simulator.swiftinterface +18 -0
  84. package/sdk/ios/usr/lib/swift/Foundation.swiftmodule/arm64-apple-ios-simulator.swiftinterface +1 -0
  85. package/sdk/ios/usr/lib/swift/SwiftUI.swiftmodule/arm64-apple-ios-simulator.swiftinterface +19 -0
  86. package/sdk/ios/usr/lib/swift/SwiftUICore.swiftmodule/arm64-apple-ios-simulator.swiftinterface +4 -0
  87. package/sdk/ios/usr/lib/swift/UIKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +4 -0
  88. package/sdk/ios/wasm/include/pthread.h +1 -0
  89. package/sdk/ios/wasm/include/signal.h +2 -2
  90. package/sdk/native-hashes.json +3 -3
  91. package/src/native-static-libraries.ts +7 -0
  92. package/src/swift-compile.ts +48 -10
  93. package/src/swift-host.ts +22 -3
  94. package/src/swift-objc-compile.ts +1 -1
  95. package/src/swift-objc-import.ts +32 -2
  96. package/src/swift-objc-standin.ts +1 -1
  97. package/src/swift-packages.ts +53 -28
  98. package/src/swift-pdf-raster.ts +60 -4
  99. package/src/swift-shipped-archives.json +44 -0
  100. package/src/swift-shipped-binaries.ts +12 -0
  101. package/src/swift-standin-emit.ts +9 -3
  102. package/src/swift-standins.ts +75 -8
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2209 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2210 | (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;
@@ -18804,7 +18804,7 @@ function emitSwiftStandin(sourceGraphs, options) {
18804
18804
  const coder = members2.some((member) => leaf(member) === "init(coder:)");
18805
18805
  if (designated2 && !coder && externalRoot(id) !== "NSObject" && externalRoot(id) !== null)
18806
18806
  emit(
18807
- `${inner}public required init?(coder: NSCoder) { ${options.inert ? "return nil" : trap(`${path111}.init(coder:)`)} }`
18807
+ `${inner}public required init${options.coderNonfailable?.has(path111) ? "" : "?"}(coder: NSCoder) { ${options.inert && !options.coderNonfailable?.has(path111) ? "return nil" : trap(`${path111}.init(coder:)`)} }`
18808
18808
  );
18809
18809
  if (designated2 && !members2.some((member) => leaf(member) === "init()") && [...superChain(id)].some(
18810
18810
  (at) => options.requiredInits?.has(`${pathOf(byId.get(at))}.init()`)
@@ -18985,15 +18985,18 @@ function emitSwiftStandin(sourceGraphs, options) {
18985
18985
  const { 2: rest } = LEADING_ATTRS.exec(text(member));
18986
18986
  const decl = rest.replace(/^(?:weak |unowned )/, "").replace(/^((?:static )?)let /, "$1var ");
18987
18987
  const witness = `${owner2}.${leaf(member)}`;
18988
+ if (options.forcedOverride?.has(witness)) return;
18988
18989
  const body = options.inert ? inertBody(member) : trap(witness);
18989
18990
  if (member.kind.identifier === "swift.property" || member.kind.identifier === "swift.type.property") {
18990
18991
  const parsed = splitAccessors(decl);
18991
18992
  const setter = parsed.settable ? ` ${parsed.nonmutating ? "nonmutating " : ""}set { ${body} }` : "";
18992
- emit(
18993
+ emitAt(
18994
+ witness,
18993
18995
  `${indent2}${visibility} ${parsed.decl} { get${parsed.effects} { ${body} }${setter} }`
18994
18996
  );
18995
18997
  } else
18996
- emit(
18998
+ emitAt(
18999
+ witness,
18997
19000
  `${indent2}${member.kind.identifier === "swift.init" ? "public required " : visibility + " "}${stripDefaults(decl)} { ${body} }`
18998
19001
  );
18999
19002
  };
@@ -20555,7 +20558,7 @@ var init_swift_objc_standin = __esm({
20555
20558
  };
20556
20559
  NATIVE_GRAPH_ID = (0, import_node_crypto14.createHash)("sha256").update(JSON.stringify(NATIVE_GRAPH_INPUTS)).digest("hex");
20557
20560
  ROUNDS = 12;
20558
- headerFiles = (dir) => import_node_fs35.default.readdirSync(dir, { recursive: true, encoding: "utf8" }).filter((file) => file.endsWith(".h")).sort();
20561
+ headerFiles = (dir) => import_node_fs35.default.readdirSync(dir, { recursive: true, encoding: "utf8" }).filter((file) => file.endsWith(".h") || file.endsWith(".hh")).sort();
20559
20562
  MISSING_IMPORT = "#import <PeachMissing/PeachMissing.h>\n";
20560
20563
  FRAMEWORK_HEADER = /^System\/Library\/Frameworks\/([^/]+)\.framework\/Headers\/(.+)$/;
20561
20564
  FRAMEWORK_MODULEMAP = /^System\/Library\/Frameworks\/([^/]+)\.framework\/Modules\/module\.modulemap$/;
@@ -27719,16 +27722,30 @@ function swiftClangImporterFlags(flags) {
27719
27722
  (flag) => flag !== "-fobjc-arc" && flag !== "-fno-objc-arc" && !/^-std=(?:c(?!\+\+)|gnu(?!\+\+)|iso9899:)/.test(flag)
27720
27723
  );
27721
27724
  }
27722
- function swiftObjCModuleMap(module2, headers) {
27725
+ function swiftSubmoduleImports(sources) {
27726
+ const imports2 = /* @__PURE__ */ new Map();
27727
+ for (const source of sources)
27728
+ for (const [, module2, submodule] of source.matchAll(SWIFT_SUBMODULE_IMPORT)) {
27729
+ const names = imports2.get(module2) ?? /* @__PURE__ */ new Set();
27730
+ names.add(submodule);
27731
+ imports2.set(module2, names);
27732
+ }
27733
+ return imports2;
27734
+ }
27735
+ function swiftObjCModuleMap(module2, headers, submodules = /* @__PURE__ */ new Set()) {
27736
+ const header = (file) => `header ${JSON.stringify(file)}`;
27737
+ const stem = (file) => file.slice(file.lastIndexOf("/") + 1).replace(/\.[^.]*$/, "");
27723
27738
  return [
27724
27739
  `module ${module2} {`,
27725
- ...headers.map((header) => ` header ${JSON.stringify(header)}`),
27740
+ ...headers.map(
27741
+ (file) => submodules.has(stem(file)) ? ` module ${stem(file)} { ${header(file)} export * }` : ` ${header(file)}`
27742
+ ),
27726
27743
  " export *",
27727
27744
  "}",
27728
27745
  ""
27729
27746
  ].join("\n");
27730
27747
  }
27731
- var SWIFT_OBJC_INTEROP_FLAGS;
27748
+ var SWIFT_OBJC_INTEROP_FLAGS, SWIFT_SUBMODULE_IMPORT;
27732
27749
  var init_swift_objc_import = __esm({
27733
27750
  "src/swift-objc-import.ts"() {
27734
27751
  "use strict";
@@ -27743,6 +27760,7 @@ var init_swift_objc_import = __esm({
27743
27760
  "-Xcc",
27744
27761
  "-fblocks"
27745
27762
  ];
27763
+ SWIFT_SUBMODULE_IMPORT = /^[ \t]*(?:@\w+(?:\([^)]*\))?[ \t]+)*import[ \t]+([A-Za-z_]\w*)\.([A-Za-z_]\w*)[ \t]*(?:\/\/.*)?$/gm;
27746
27764
  }
27747
27765
  });
27748
27766
 
@@ -30097,6 +30115,12 @@ function stripCCode(source) {
30097
30115
  }
30098
30116
  return code;
30099
30117
  }
30118
+ function swiftCTakesReturnAddress(source) {
30119
+ if (!source.includes("__builtin_return_address")) return false;
30120
+ return /\b__builtin_return_address\s*\(/.test(
30121
+ cActiveCode(stripCCode(source), wasmMacroEnvironment)
30122
+ );
30123
+ }
30100
30124
  function swiftCMainEntry(file, source, env = emptyMacroEnvironment) {
30101
30125
  if (!isSwiftNativeTranslationUnit(file)) return false;
30102
30126
  const code = cActiveCode(stripCCode(source), env);
@@ -30371,6 +30395,11 @@ ${swiftProjectFilesProblems(input.projectFiles).join("\n")}`
30371
30395
  clangImportedModules.add(name3);
30372
30396
  }
30373
30397
  }
30398
+ const submoduleImports = swiftSubmoduleImports(
30399
+ Object.entries(input.files).flatMap(
30400
+ ([file, contents]) => file.endsWith(".swift") ? [contents] : []
30401
+ )
30402
+ );
30374
30403
  const headerDirectory = import_node_path51.default.join(layout2.root, ".build", "peach-cxx-headers");
30375
30404
  const flattenedHeaders = /* @__PURE__ */ new Set();
30376
30405
  if ((0, import_node_fs53.existsSync)(headerDirectory)) {
@@ -30756,7 +30785,8 @@ ${swiftProjectFilesProblems(input.projectFiles).join("\n")}`
30756
30785
  );
30757
30786
  const moduleContents = originalModuleMap ? input.files[originalModuleMap[1]] : swiftpmModuleMap?.contents ?? packageModuleMap?.[1] ?? swiftObjCModuleMap(
30758
30787
  swiftTargetModuleName(target.name),
30759
- roots2.map((file) => import_node_path51.default.join(layout2.root, file))
30788
+ roots2.map((file) => import_node_path51.default.join(layout2.root, file)),
30789
+ submoduleImports.get(swiftTargetModuleName(target.name))
30760
30790
  );
30761
30791
  if (moduleContents === void 0)
30762
30792
  throw new Error("missing original module map " + modulemap);
@@ -31081,10 +31111,14 @@ module ${moduleName2}.Swift {
31081
31111
  header ${JSON.stringify(import_node_path51.default.join(headerDirectory, name3 + "-Swift.h"))}
31082
31112
  requires objc
31083
31113
  }
31084
- ` : swiftObjCModuleMap(moduleName2, [
31085
- ...(input.nativeTargets?.find((target) => target.name === name3)?.publicHeaders ?? []).map((header) => import_node_path51.default.join(layout2.root, header)),
31086
- import_node_path51.default.join(headerDirectory, name3 + "-Swift.h")
31087
- ])
31114
+ ` : swiftObjCModuleMap(
31115
+ moduleName2,
31116
+ [
31117
+ ...(input.nativeTargets?.find((target) => target.name === name3)?.publicHeaders ?? []).map((header) => import_node_path51.default.join(layout2.root, header)),
31118
+ import_node_path51.default.join(headerDirectory, name3 + "-Swift.h")
31119
+ ],
31120
+ submoduleImports.get(moduleName2)
31121
+ )
31088
31122
  );
31089
31123
  nativeHeaderFlags.push("-fmodule-map-file=" + modulemap);
31090
31124
  }
@@ -32067,8 +32101,12 @@ async function buildFrameworkProducts(scratch2, args) {
32067
32101
  const linked = frameworkLinkClosure(scratch2, linkedTargets.targets);
32068
32102
  const objects = linked.objects;
32069
32103
  if (linked.modules.has("UniformTypeIdentifiers")) {
32070
- const object6 = import_node_path51.default.join(scratch2, "UniformTypeIdentifiers-NativeConstants.o");
32071
- if (!(0, import_node_fs53.existsSync)(object6)) {
32104
+ const constantsDir = import_node_path51.default.join(scratch2, "uniform-type-constants");
32105
+ const constantsStamp = import_node_path51.default.join(constantsDir, ".complete");
32106
+ const object6 = import_node_path51.default.join(constantsDir, "UniformTypeIdentifiers-NativeConstants.o");
32107
+ if (!(0, import_node_fs53.existsSync)(constantsStamp) || (0, import_node_fs53.readFileSync)(constantsStamp, "utf8") !== args.frameworkKey) {
32108
+ (0, import_node_fs53.rmSync)(constantsDir, { recursive: true, force: true });
32109
+ (0, import_node_fs53.mkdirSync)(constantsDir);
32072
32110
  const sdkPaths2 = swiftSdkPaths(args.moduleRoot, args.toolchainBin);
32073
32111
  compileUniformTypeConstants({
32074
32112
  bin: args.toolchainBin,
@@ -32076,8 +32114,9 @@ async function buildFrameworkProducts(scratch2, args) {
32076
32114
  darwin: sdkPaths2.darwin,
32077
32115
  packageRoot: args.moduleRoot,
32078
32116
  minimum: darwinRecordsMinimum(),
32079
- out: scratch2
32117
+ out: constantsDir
32080
32118
  });
32119
+ (0, import_node_fs53.writeFileSync)(constantsStamp, args.frameworkKey);
32081
32120
  }
32082
32121
  objects.push(object6);
32083
32122
  linked.owners.set(object6, "UniformTypeIdentifiers");
@@ -32762,7 +32801,7 @@ function compileSwiftProjectOnce(input, options) {
32762
32801
  options.signal
32763
32802
  );
32764
32803
  }
32765
- var import_node_child_process28, import_node_crypto23, import_node_fs53, import_node_os11, import_node_path51, v5, WASM_TRIPLE, SWIFTPM_PROGRESS, SWIFTPM_NOISE, SWIFT_BUILDER_TRANSPORT_MARGIN_MS, SWIFT_BUILDER_DEFAULT_COMPILE_MS, clangInterfaceHeader, swiftInterfaceDeclarations, linkedModuleDigests, SYSTEM_MODULE_LIBRARIES, SYSTEM_MODULE_IMPORT, OPTIONAL_FRAMEWORK_DEPENDENCIES, OPTIONAL_FRAMEWORKS, SWIFT_IMPORT, kleeneNot, kleeneAnd, kleeneOr, sdkPaths, availableModules, sdkOverlayFrameworks, DISTRIBUTION_CLANG_MODULES, ONE_PRODUCT, SPRITEKIT_PRODUCT, importsSpriteKit, FOUNDATION_IMPLICIT_MODULES, FOUNDATION_IMPLICIT_FLAGS, ONE_IMPLICIT_FLAGS, executableLinkFlags, darwinRecordsRegion, REACTOR_FLAG, MULTI_MANIFEST_VERSION, SWIFT_HEADER_PRODUCTS_TARGET, compilerSourceDigest, nativeCxxCompilerFlags, cFlagArray, cxxFlagArray, DIRECTIVE, OS_IOS, DELEGATE_CLASS, FOUNDATION_NETWORKING_TYPES, FOUNDATION_OVERLAY_TYPES, FOUNDATION_OVERLAY_GLOBALS, CORE_FOUNDATION_OVERLAY_GLOBALS, CORE_FOUNDATION_GEOMETRY_TYPES, CORE_FOUNDATION_GRAPHICS_TYPES, CORE_FOUNDATION_HANDLE_IMPORTS, emptyMacroEnvironment, HIDDEN_UNITS, LIBXML_REFERENCE, LIBXML_SOURCE, ROOT_LOCKS, host, rootLocks, SHARED_ARTIFACT_BUDGET_BYTES, SHARED_ARTIFACT_GRACE_MS, RETIRED_PREFIX, retainedArtifacts, FRAMEWORK_LINK_TARGET, SWIFT_LINK_STAMP, SWIFT_FRAMEWORK_SLOTS, SWIFT_FRAMEWORK_SLOT_KEY, SWIFT_FRAMEWORK_SLOT_ORIGIN;
32804
+ var import_node_child_process28, import_node_crypto23, import_node_fs53, import_node_os11, import_node_path51, v5, WASM_TRIPLE, SWIFTPM_PROGRESS, SWIFTPM_NOISE, SWIFT_BUILDER_TRANSPORT_MARGIN_MS, SWIFT_BUILDER_DEFAULT_COMPILE_MS, clangInterfaceHeader, swiftInterfaceDeclarations, linkedModuleDigests, SYSTEM_MODULE_LIBRARIES, SYSTEM_MODULE_IMPORT, OPTIONAL_FRAMEWORK_DEPENDENCIES, OPTIONAL_FRAMEWORKS, SWIFT_IMPORT, kleeneNot, kleeneAnd, kleeneOr, sdkPaths, availableModules, sdkOverlayFrameworks, DISTRIBUTION_CLANG_MODULES, ONE_PRODUCT, SPRITEKIT_PRODUCT, importsSpriteKit, FOUNDATION_IMPLICIT_MODULES, FOUNDATION_IMPLICIT_FLAGS, ONE_IMPLICIT_FLAGS, executableLinkFlags, darwinRecordsRegion, REACTOR_FLAG, MULTI_MANIFEST_VERSION, SWIFT_HEADER_PRODUCTS_TARGET, compilerSourceDigest, nativeCxxCompilerFlags, cFlagArray, cxxFlagArray, DIRECTIVE, OS_IOS, DELEGATE_CLASS, FOUNDATION_NETWORKING_TYPES, FOUNDATION_OVERLAY_TYPES, FOUNDATION_OVERLAY_GLOBALS, CORE_FOUNDATION_OVERLAY_GLOBALS, CORE_FOUNDATION_GEOMETRY_TYPES, CORE_FOUNDATION_GRAPHICS_TYPES, CORE_FOUNDATION_HANDLE_IMPORTS, emptyMacroEnvironment, wasmMacroEnvironment, HIDDEN_UNITS, LIBXML_REFERENCE, LIBXML_SOURCE, ROOT_LOCKS, host, rootLocks, SHARED_ARTIFACT_BUDGET_BYTES, SHARED_ARTIFACT_GRACE_MS, RETIRED_PREFIX, retainedArtifacts, FRAMEWORK_LINK_TARGET, SWIFT_LINK_STAMP, SWIFT_FRAMEWORK_SLOTS, SWIFT_FRAMEWORK_SLOT_KEY, SWIFT_FRAMEWORK_SLOT_ORIGIN;
32766
32805
  var init_swift_compile = __esm({
32767
32806
  "src/swift-compile.ts"() {
32768
32807
  "use strict";
@@ -32975,7 +33014,7 @@ int EXUpdatesApplyBSDiffPatch(const char * _Nonnull oldFilePath,
32975
33014
  REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
32976
33015
  MULTI_MANIFEST_VERSION = 68;
32977
33016
  SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
32978
- compilerSourceDigest = true ? "f113c3b74986e3d582dde643cb5771f750e5c836703fb20a79a1d67a53884748" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
33017
+ compilerSourceDigest = true ? "4fa3e84f8c3b585bc8e864c92f0682e6f02757d455de1ce784f0d40ba9df875a" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
32979
33018
  nativeCxxCompilerFlags = ["-fno-cxx-modules"];
32980
33019
  cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
32981
33020
  cxxFlagArray = (flags) => JSON.stringify([...nativeCxxCompilerFlags, ...withoutGlogModuleMap(flags)]);
@@ -33500,6 +33539,14 @@ int EXUpdatesApplyBSDiffPatch(const char * _Nonnull oldFilePath,
33500
33539
  predefines: /* @__PURE__ */ new Map(),
33501
33540
  targetDefined: /* @__PURE__ */ new Set()
33502
33541
  };
33542
+ wasmMacroEnvironment = {
33543
+ ...emptyMacroEnvironment,
33544
+ defines: /* @__PURE__ */ new Map([
33545
+ ["__wasm__", "1"],
33546
+ ["__wasm32__", "1"],
33547
+ ["__wasi__", "1"]
33548
+ ])
33549
+ };
33503
33550
  HIDDEN_UNITS = "PeachHiddenUnits";
33504
33551
  LIBXML_REFERENCE = /(?:^|\n)[ \t]*#[ \t]*(?:include|import)[ \t]*["<][ \t]*libxml\/|@import[ \t]+libxml2[ \t]*;|(?:^|\n)[ \t]*import[ \t]+libxml2(?![\w.])/;
33505
33552
  LIBXML_SOURCE = /\.(?:c|m|mm|cc|cpp|cxx|h|hh|hpp|hxx|swift)$/;
@@ -37428,7 +37475,7 @@ var init_swift_standin_digest = __esm({
37428
37475
  STANDIN_DIGEST_ENTRYPOINTS = ["swift-standins.ts", "swift-objc-compile.ts"];
37429
37476
  SPECIFIER = /from\s*['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
37430
37477
  standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
37431
- STANDIN_SOURCE_DIGEST = true ? "30ee25efff915489853ffb5c34661d03b2ca480fc48fe80201fced1d4821577a" : standinSourceDigest();
37478
+ STANDIN_SOURCE_DIGEST = true ? "9adf53d6f1cfece1b7a3e23bad712630278818d71b5b718384cf640144349600" : standinSourceDigest();
37432
37479
  }
37433
37480
  });
37434
37481
 
@@ -38039,6 +38086,13 @@ var init_native_static_libraries = __esm({
38039
38086
  upstream: "b94213a11b3a2edadfae89f0c57a7f4ab72772c9",
38040
38087
  recipe: "a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205",
38041
38088
  archive: "libsksg.a"
38089
+ },
38090
+ {
38091
+ name: "webgpu_dawn",
38092
+ nativeSha256: "95078993275bccc969b1dfa1ad0934cbacc05ae59e8aa2a6cc46ce93e97d4f69",
38093
+ upstream: "3d786993a7ded64c4ebb4884b9b079db9ad0e580",
38094
+ recipe: "c55468cc976e837ad894133f2231beb7d1ed64633af7b457b8a2610d7df45994",
38095
+ archive: "libwebgpu_dawn.a"
38042
38096
  }
38043
38097
  ];
38044
38098
  }
@@ -38133,6 +38187,72 @@ var init_numbered_lock = __esm({
38133
38187
  }
38134
38188
  });
38135
38189
 
38190
+ // src/swift-shipped-archives.json
38191
+ var swift_shipped_archives_default;
38192
+ var init_swift_shipped_archives = __esm({
38193
+ "src/swift-shipped-archives.json"() {
38194
+ swift_shipped_archives_default = {
38195
+ AppCheckCore: "a18d4e5aff27ff4b9bce8d6e73e55ccf1d11515311e219aa4473319cdff3187b",
38196
+ AppLovinSDK: "c00f052c4b15766a6a2734e2b3685234e6bd28dbc47fbe7cbc3edbf56f701d5c",
38197
+ AppsFlyerLib: "13bae495e63e22579dd9525a1c9e88d8eedc78b4586979b7e2d492cfd3efbe1f",
38198
+ FBAEMKit: "ceaf685683c6a23ae4893150d0d770aeeaec34811ac8c146b3aa351beade5fa0",
38199
+ FBAudienceNetwork: "4d84bf1e404a83852a93af2ae73e22e45bb2b11e0a9a445c3b461173a5d6aec3",
38200
+ FBLPromises: "3544fb457e7f60c69740cdd26617a75bdd613943e948becca643022c7edd76c0",
38201
+ FBSDKCoreKit: "1577edd62ec0c172928befed3b309dc59ae8915d2aaad091460d9d1be5ddc13d",
38202
+ FBSDKCoreKit_Basics: "c780833f204f9ec6eab70a3758a45c5c78bfb6f4e590289ccf395497f204cac1",
38203
+ FirebaseAnalytics: "e3253a494375c5174d20cb81925e20afa1ff6b1419125cb608d39b092b53ff2a",
38204
+ FirebaseAppCheck: "af82d72727d55d14f65eee96845d4d9495e4e603b4673709d6f3448b9595cc63",
38205
+ FirebaseAppCheckInterop: "7ffd54e6fe187bf8cd714e3d863e0095f7cbbb0fb802adb87a40c552de7cffcc",
38206
+ FirebaseAuth: "fcde09db8d45ffba67802e81c17b8046db6b56568226ace3fca898983b08c968",
38207
+ FirebaseAuthInterop: "e8e6f4fb42b3fa76c2bade7a522ab0f224558d27d2321175c791d307541787a8",
38208
+ FirebaseCore: "30e3505c715e17682c1dc20bb26ba475e99e6981a9a0dba3cf9352eea632fc1d",
38209
+ FirebaseCoreExtension: "e37ce2abcd4c218ab5426da78cbe7ab41f79ee7eba1d02dd4b0cde952ed2c4a0",
38210
+ FirebaseCoreInternal: "72a15c0c63585faf93e9ffa91e8a8c1c50b24749405804ffae19a29ec05b07ab",
38211
+ FirebaseCrashlytics: "e03c71913efd97678b895abb1e968c83e58b3fbd7955a81ec6e6581b95db16e3",
38212
+ FirebaseFirestore: "f7a1bb7fc4a2fb09298b514114d6aaca9a4f00fd8868667524a05bc4563bf1fd",
38213
+ FirebaseFirestoreInternal: "d9595a1784beaf5cd4a8e0dda0f4364ddfa6b536ad60f82746d81d14dce037a3",
38214
+ FirebaseInstallations: "141e313325bab001f2dbb79dc8a433f884f4c4a12a5feb665e6958098d637f7b",
38215
+ FirebaseRemoteConfig: "e0ae6d626a423d535bc67216f9f0cd66f98f1c0fb4b5bf88074d4496733e2db1",
38216
+ FirebaseRemoteConfigInterop: "794f599eb4232058715b606fa671639c8cc5d821655a0f739651d17c5ef65c37",
38217
+ FirebaseSessions: "1781d72e47dac0fc7a532412641021730bd5b659135633cd9ef7b97ccd31b0ce",
38218
+ FirebaseSharedSwift: "8d63b09a517733ef3a58390bf1e8cf054f058bdd618bb4f19a1f4b5a0b4f09e5",
38219
+ FirebaseStorage: "636b33180dd5ad60b4878357691fe6472cf3bd57ec691e9d661c5444f523df66",
38220
+ GTMSessionFetcher: "f58dc2bd9db39defd73f0f67e7a11893a0c6e6f0ba45cd83cf420b2b3c15f1bd",
38221
+ GoogleAdsOnDeviceConversion: "31a5a1f5204f4844a480d3889b6ebe2e69473ef32b868935c51812c0483cb08b",
38222
+ GoogleAppMeasurement: "5741e6334392e0345f1b5896111ffef4d5a78859970f5e197fa0b7d881165305",
38223
+ GoogleAppMeasurementIdentitySupport: "b70cb033eeb002ed1c5a8140953ccb3be0221ca754c05fe450ed9c9c6547f274",
38224
+ GoogleDataTransport: "7d08050419e0906f13039cc4d2dd69be075234c0bf5bbb34df9dd4891e48831d",
38225
+ GoogleMobileAds: "f2c09c60ee331ce029f563304ad73a481d57ace0d4bc11ce33a2bf59497c59bf",
38226
+ GoogleUtilities: "37a9d3d3810dad763a8a79bd4c7cc4c37b386240725aca07f45dba1826676c8c",
38227
+ Intercom: "fc8251f24b305b91f83304d4dffaf1a90c424a7bc37be8b595dd1fc5cff566ea",
38228
+ Promises: "6d8f1a4b3d561d67adfc2026834779b05685d1cdacea6e83c70d0641c39f24de",
38229
+ RecaptchaInterop: "cf5cc62ebc237b34d5267c1190d18f33b424dbc7f81713f127108d0ad8a592cf",
38230
+ RiveRuntime: "72b6ff5c5a1d153c9cdbea9a917c09be557cfcb1fafa02853fa06b0268551710",
38231
+ absl: "fff0388cf074c69a2da4bc197a005da0b8e5c23ebdcfa383600c540a342f9df1",
38232
+ grpc: "918737c9f8f93e14127b3894e31c7a0522475f2247b74f87d8166dff3a6bafb0",
38233
+ grpcpp: "b83f85e0256cf06df00cf0ed728b5c0d68373ca401742877935771447450b90a",
38234
+ leveldb: "5521a6e6e4cd01b2e31b099d4341f1bccae7e8ba43de648b028928573daf8bb4",
38235
+ nanopb: "a7fafe2e4e16d99de4c58f72e22dcc53221885aa6d678d1270123e4b01badfa3",
38236
+ openssl_grpc: "b2aaede82457cdd15915762a4f57b38e28ba0f47b9b48556a7e0c46881973096"
38237
+ };
38238
+ }
38239
+ });
38240
+
38241
+ // src/swift-shipped-binaries.ts
38242
+ function shippedBinaryDiffers(target, checksum) {
38243
+ const shipped = SHIPPED_ARCHIVES.get(target);
38244
+ return shipped !== void 0 && checksum !== null && checksum !== shipped;
38245
+ }
38246
+ var SHIPPED_ARCHIVES;
38247
+ var init_swift_shipped_binaries = __esm({
38248
+ "src/swift-shipped-binaries.ts"() {
38249
+ "use strict";
38250
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
38251
+ init_swift_shipped_archives();
38252
+ SHIPPED_ARCHIVES = new Map(Object.entries(swift_shipped_archives_default));
38253
+ }
38254
+ });
38255
+
38136
38256
  // src/swift-packages.ts
38137
38257
  function remoteSwiftCheckouts(root) {
38138
38258
  const prepared = preparedSwiftCheckouts(root);
@@ -38141,16 +38261,22 @@ function remoteSwiftCheckouts(root) {
38141
38261
  import_node_fs72.default.mkdirSync(cacheDir(), { recursive: true });
38142
38262
  return import_node_path71.default.join(import_node_fs72.default.realpathSync(cacheDir()), "swift-packages", key2, "checkouts");
38143
38263
  }
38144
- function assemblySources(files2, target) {
38264
+ function unlowerableSources(files2, target) {
38265
+ if (target.declaresWasiNativeSettings) return [];
38266
+ return [
38267
+ ...files2.filter((file) => UNSUPPORTED_NATIVE.test(file)),
38268
+ ...files2.filter(isSwiftNativeTranslationUnit).filter((file) => swiftCTakesReturnAddress(import_node_fs72.default.readFileSync(file, "utf8")))
38269
+ ];
38270
+ }
38271
+ function unloweredSources(files2, target) {
38145
38272
  if (target.type !== "regular") return null;
38146
- if (target.declaresWasiNativeSettings) return null;
38147
- const assembly = files2.filter((file) => UNSUPPORTED_NATIVE.test(file));
38148
- if (assembly.length === 0) return null;
38149
38273
  if (!files2.some(isSwiftNativeTranslationUnit)) return null;
38274
+ const unlowered = unlowerableSources(files2, target);
38275
+ if (unlowered.length === 0) return null;
38150
38276
  const headers = import_node_path71.default.resolve(target.dir, target.publicHeadersPath);
38151
38277
  if (!files2.some((file) => file.startsWith(`${headers}${import_node_path71.default.sep}`) && file.endsWith(".h")))
38152
38278
  return null;
38153
- return assembly;
38279
+ return unlowered;
38154
38280
  }
38155
38281
  function resolvedPins(data) {
38156
38282
  if (!data || typeof data !== "object") return null;
@@ -38446,9 +38572,9 @@ function resolveSwiftPackages(options) {
38446
38572
  if (target.type === "macro") return preservePackage(pkg, [name3], "host");
38447
38573
  const files2 = target.type === "regular" || target.type === "system" ? swiftTargetFiles(pkg.manifest, target) : [];
38448
38574
  const gap = options.binaryGaps?.get(name3);
38449
- const assembly = target.declaresWasiNativeSettings ? [] : files2.filter((file) => UNSUPPORTED_NATIVE.test(file));
38575
+ const unlowerable = unlowerableSources(files2, target);
38450
38576
  const placeholder = placeholderPackage(pkg);
38451
- const ownReason = target.type === "binary" ? `${name3} ${BINARY}${gap ? `; ${gap}` : ""}` : placeholder && gap ? `${name3} stands in as a placeholder (${placeholder}), and ${gap}` : target.type !== "regular" && target.type !== "system" ? `${name3} is a ${target.type} target` : assembly.length > 0 ? `${name3} is an assembly target with no wasm32 lowering: ${assembly.map((file) => import_node_path71.default.relative(pkg.manifest.dir, file)).join(", ")}${gap ? `; ${gap}` : ""}` : null;
38577
+ const ownReason = target.type === "binary" ? `${name3} ${BINARY}${gap ? `; ${gap}` : ""}` : placeholder && gap ? `${name3} stands in as a placeholder (${placeholder}), and ${gap}` : target.type !== "regular" && target.type !== "system" ? `${name3} is a ${target.type} target` : unlowerable.length > 0 ? `${name3} has native sources with no wasm32 lowering: ${unlowerable.map((file) => import_node_path71.default.relative(pkg.manifest.dir, file)).join(", ")}${gap ? `; ${gap}` : ""}` : null;
38452
38578
  const reasons = target.dependencies.map((dependency) => {
38453
38579
  if (dependency.kind === "target") return resolveTarget(pkg, dependency.name);
38454
38580
  const nested = resolveDependencyProduct(pkg, dependency);
@@ -38527,7 +38653,7 @@ function resolveSwiftPackages(options) {
38527
38653
  (file) => file.endsWith(".swift") && import_node_fs72.default.readFileSync(file, "utf8").trim() === ""
38528
38654
  ))
38529
38655
  return false;
38530
- if (providedTargets.has(name3) && assemblySources(files2, target)) return false;
38656
+ if (unloweredSources(files2, target)) return false;
38531
38657
  claimed.add(key2);
38532
38658
  providedTargets.delete(name3);
38533
38659
  for (const dependency of target.dependencies) {
@@ -38541,6 +38667,13 @@ function resolveSwiftPackages(options) {
38541
38667
  };
38542
38668
  const claimProduct = (pkg, product) => {
38543
38669
  const roots = pkg.manifest.products.get(product)?.targets ?? [];
38670
+ for (const root of roots) {
38671
+ const target = pkg.manifest.targets.get(root);
38672
+ if (target?.type === "binary" && !options.standinTargets?.has(root) && shippedBinaryDiffers(root, target.checksum)) {
38673
+ providedTargets.delete(root);
38674
+ providedProducts.delete(product);
38675
+ }
38676
+ }
38544
38677
  if (roots.map((name3) => claimTarget(pkg, name3)).some(Boolean))
38545
38678
  providedProducts.delete(product);
38546
38679
  };
@@ -38568,7 +38701,7 @@ function resolveSwiftPackages(options) {
38568
38701
  if (target.type === "executable") continue;
38569
38702
  const files2 = target.type === "regular" || target.type === "system" ? swiftTargetFiles(pkg.manifest, target) : [];
38570
38703
  const objc = target.type === "regular" && files2.some((file) => /\.(m|mm)$/.test(file));
38571
- const assembly = assemblySources(files2, target);
38704
+ const unlowered = unloweredSources(files2, target);
38572
38705
  const gap = placeholderPackage(pkg);
38573
38706
  const sources = files2.filter((file) => file.endsWith(".swift"));
38574
38707
  const release = (setting) => setting.configuration !== "debug";
@@ -38595,7 +38728,7 @@ function resolveSwiftPackages(options) {
38595
38728
  ]
38596
38729
  }
38597
38730
  });
38598
- else if (target.type === "binary" || objc || assembly)
38731
+ else if (target.type === "binary" || objc || unlowered)
38599
38732
  result.binaries.push({
38600
38733
  target: name3,
38601
38734
  source: pkg.source,
@@ -38609,8 +38742,8 @@ function resolveSwiftPackages(options) {
38609
38742
  import_node_path71.default.join(target.dir, target.publicHeadersPath)
38610
38743
  )
38611
38744
  },
38612
- ...assembly ? {
38613
- assemblySources: assembly.map(
38745
+ ...unlowered ? {
38746
+ unloweredSources: unlowered.map(
38614
38747
  (file) => import_node_path71.default.relative(pkg.manifest.dir, file)
38615
38748
  )
38616
38749
  } : {}
@@ -38831,8 +38964,10 @@ var init_swift_packages = __esm({
38831
38964
  init_native_git();
38832
38965
  init_numbered_lock();
38833
38966
  init_prepared_xcode_phases();
38967
+ init_swift_compile();
38834
38968
  init_swift_package();
38835
38969
  init_swift_package_manifest();
38970
+ init_swift_shipped_binaries();
38836
38971
  swiftBinaryOnDisk = (binary2) => binary2.url !== null || import_node_fs72.default.existsSync(binary2.dir);
38837
38972
  SWIFT_PLACEHOLDER_PACKAGES = /* @__PURE__ */ new Map();
38838
38973
  placeholderPackage = (pkg) => SWIFT_PLACEHOLDER_PACKAGES.get(swiftPackageIdentity(pkg.manifest.dir));
@@ -40431,7 +40566,7 @@ function interfaceEnumValues(graphs, interfaceText) {
40431
40566
  const declarations = [
40432
40567
  ...interfaceText.matchAll(
40433
40568
  new RegExp(
40434
- `^([ \\t]*)(?:@[\\w.]+(?:\\([^)]*\\))?\\s+)*(?:nonisolated\\s+)?(?:public|open)\\s+enum\\s+${name3}\\s*:\\s*(?:Swift\\.)?U?Int(?:8|16|32|64)?\\b[^{]*\\{[ \\t]*$`,
40569
+ `^([ \\t]*)(?:@[\\w.]+(?:\\([^)]*\\))?\\s+)*(?:nonisolated\\s+)?(?:public|open)\\s+enum\\s+${name3}\\s*:\\s*(?:Swift\\.)?(?:U?Int(?:8|16|32|64)?|IntegerLiteralType)\\b[^{]*\\{[ \\t]*$`,
40435
40570
  "gm"
40436
40571
  )
40437
40572
  )
@@ -40530,9 +40665,26 @@ function mixedStandin(surface, binary2, toolchain, work, behavior, frameworkDirs
40530
40665
  view.protocolProperties ?? /* @__PURE__ */ new Map(),
40531
40666
  null,
40532
40667
  view.inheritedConformances,
40533
- interfaceProjections(view.graphs, interfaceText)
40668
+ interfaceProjections(view.graphs, interfaceText),
40669
+ [],
40670
+ externalConformances(surface.module, interfaceText)
40534
40671
  );
40535
40672
  }
40673
+ function externalConformances(module2, interfaceText) {
40674
+ const lines = /* @__PURE__ */ new Set();
40675
+ for (const match of interfaceText.matchAll(
40676
+ /^(?:@\w+\s+)*extension\s+([\w.]+)\s*:\s*([^{\n]+?)\s*\{/gm
40677
+ )) {
40678
+ const [, extended, conformances] = match;
40679
+ if (extended.startsWith(`${module2}.`) || /\bwhere\b/.test(conformances)) continue;
40680
+ const own = conformances.split(",").map((name3) => name3.trim()).filter((name3) => name3.startsWith(`${module2}.`));
40681
+ const type = extended.startsWith("Swift.") ? extended : extended.split(".").slice(1).join(".");
40682
+ if (own.length > 0 && type) lines.add(`extension ${type} : ${own.join(", ")} {}
40683
+ `);
40684
+ }
40685
+ return lines.size > 0 ? `
40686
+ ${[...lines].join("")}` : "";
40687
+ }
40536
40688
  function wasmFlags(toolchain, imports2) {
40537
40689
  const { sysroot, darwin, resources, cFlags } = swiftSdkPaths(
40538
40690
  toolchain.moduleRoot,
@@ -40625,7 +40777,7 @@ function objcStandin(surface, binary2, toolchain, work, behavior, frameworks, si
40625
40777
  dependencyGraphs
40626
40778
  );
40627
40779
  }
40628
- function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, requiredInits2, declared, imports2 = [], requireSwift = false, objcProperties = /* @__PURE__ */ new Map(), placeholder = null, inheritedConformances = /* @__PURE__ */ new Map(), projections = /* @__PURE__ */ new Map(), dependencyGraphs = []) {
40780
+ function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, requiredInits2, declared, imports2 = [], requireSwift = false, objcProperties = /* @__PURE__ */ new Map(), placeholder = null, inheritedConformances = /* @__PURE__ */ new Map(), projections = /* @__PURE__ */ new Map(), dependencyGraphs = [], trailer = "") {
40629
40781
  const paths = new Set(
40630
40782
  graphs.flatMap(
40631
40783
  (graph) => graph.symbols.map((symbol2) => symbol2.pathComponents.join("."))
@@ -40666,6 +40818,8 @@ function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, r
40666
40818
  const plain = /* @__PURE__ */ new Set();
40667
40819
  const unobjc = /* @__PURE__ */ new Set();
40668
40820
  const trapped = /* @__PURE__ */ new Set();
40821
+ const forced = /* @__PURE__ */ new Set();
40822
+ const nonfailable = /* @__PURE__ */ new Set();
40669
40823
  const unconformed = /* @__PURE__ */ new Map();
40670
40824
  const objcProtocols = new Set(
40671
40825
  graphs.flatMap(
@@ -40675,7 +40829,7 @@ function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, r
40675
40829
  )
40676
40830
  );
40677
40831
  const file = import_node_path75.default.join(work, `${module2}.swift`);
40678
- const inert = binary2.placeholder !== void 0 || binary2.publicHeaders !== void 0 && binary2.assemblySources === void 0;
40832
+ const inert = binary2.placeholder !== void 0 || binary2.publicHeaders !== void 0 && binary2.unloweredSources === void 0;
40679
40833
  for (; ; ) {
40680
40834
  const { source, owners, skipped } = emitSwiftStandin(graphs, {
40681
40835
  module: module2,
@@ -40688,6 +40842,8 @@ function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, r
40688
40842
  unobjc,
40689
40843
  unconformed,
40690
40844
  trapped,
40845
+ forcedOverride: forced,
40846
+ coderNonfailable: nonfailable,
40691
40847
  inert,
40692
40848
  imports: [...placeholder?.peachImports ?? [], ...imports2],
40693
40849
  family: [...imports2, ...placeholder?.peachImports ?? []],
@@ -40707,7 +40863,7 @@ function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, r
40707
40863
  `Configured Swift behavior ${module2}.${entry.path} was not emitted: ${entry.reason}`
40708
40864
  );
40709
40865
  }
40710
- import_node_fs77.default.writeFileSync(file, source);
40866
+ import_node_fs77.default.writeFileSync(file, source + trailer);
40711
40867
  const check2 = (0, import_node_child_process38.spawnSync)(
40712
40868
  import_node_path75.default.join(toolchain.toolchainBin, "swiftc"),
40713
40869
  // emitting the module runs the diagnostics a typecheck skips, such as
@@ -40731,10 +40887,10 @@ function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, r
40731
40887
  return {
40732
40888
  module: module2,
40733
40889
  target: binary2.target,
40734
- files: { [`${module2}.swift`]: source },
40890
+ files: { [`${module2}.swift`]: source + trailer },
40735
40891
  ...imports2.length ? { dependencies: imports2 } : {}
40736
40892
  };
40737
- const before = omit.size + plain.size + unobjc.size + trapped.size + unconformed.size;
40893
+ const before = omit.size + plain.size + unobjc.size + trapped.size + unconformed.size + forced.size + nonfailable.size;
40738
40894
  const elsewhere = [];
40739
40895
  for (const match of check2.stderr.matchAll(/^(\S+?):(\d+):\d+: error: (.*)$/gm)) {
40740
40896
  const owner = match[1] === file ? owners[Number(match[2]) - 1] : void 0;
@@ -40757,14 +40913,22 @@ function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, r
40757
40913
  throw new Error(
40758
40914
  `Configured Swift behavior ${module2}.${owner} does not typecheck: ${match[3]}`
40759
40915
  );
40760
- if (owner && /does not override any|overrides nothing/.test(match[3]))
40916
+ if (owner && /does not override any|overrides nothing|does not override a designated initializer/.test(
40917
+ match[3]
40918
+ ))
40761
40919
  plain.add(owner);
40920
+ else if (owner && /failable initializer 'init\(coder:\)' cannot override a non-failable/.test(
40921
+ match[3]
40922
+ ) && !nonfailable.has(owner))
40923
+ nonfailable.add(owner);
40924
+ else if (owner && /requires an 'override' keyword/.test(match[3]) && !forced.has(owner))
40925
+ forced.add(owner);
40762
40926
  else if (owner && inert && INERT_VALUE.test(match[3]) && !trapped.has(owner))
40763
40927
  trapped.add(owner);
40764
40928
  else if (owner) omit.set(owner, `rejected by swiftc: ${match[3]}`);
40765
40929
  else elsewhere.push(match[3]);
40766
40930
  }
40767
- if (omit.size + plain.size + unobjc.size + trapped.size + unconformed.size === before)
40931
+ if (omit.size + plain.size + unobjc.size + trapped.size + unconformed.size + forced.size + nonfailable.size === before)
40768
40932
  throw new Error(
40769
40933
  `its generated source does not typecheck: ${elsewhere.slice(0, 3).join("; ") || check2.stderr.trim().slice(0, 400)}`
40770
40934
  );
@@ -41566,7 +41730,7 @@ function standinGenerationInputs(binaries, toolchain, configuredBehavior = {}, s
41566
41730
  ...(binary2.headerDependencies ?? []).map(
41567
41731
  (dependency) => `${swiftTargetModuleName(dependency.module)}\0${treeDigest2(import_node_path75.default.join(binary2.dir, dependency.path))}`
41568
41732
  ),
41569
- ...binary2.assemblySources ?? []
41733
+ ...binary2.unloweredSources ?? []
41570
41734
  ].join("\0") : swiftBinaryFramework(binary2).digest
41571
41735
  );
41572
41736
  } catch {
@@ -42249,7 +42413,7 @@ function* xcodeObjCInputSteps(app, binaries, moduleRoot, products, sourceRoot =
42249
42413
  const binaryHeaders = binarySearch.flatMap((search) => search.headers);
42250
42414
  const configuration = app.configuration === "Debug" ? "debug" : "release";
42251
42415
  for (const binary2 of binaries) {
42252
- if (!binary2.reached || binary2.publicHeaders === void 0 || binary2.assemblySources !== void 0)
42416
+ if (!binary2.reached || binary2.publicHeaders === void 0 || binary2.unloweredSources !== void 0)
42253
42417
  continue;
42254
42418
  const manifest = swiftPackageManifest(binary2.dir);
42255
42419
  const target = manifest.targets.get(binary2.target);
@@ -45787,9 +45951,9 @@ var init_self_invocation = __esm({
45787
45951
  });
45788
45952
 
45789
45953
  // src/swift-pdf-raster.ts
45790
- function rasterBinary() {
45791
- const tag = (0, import_node_crypto42.createHash)("sha256").update(RASTER_SWIFT).digest("hex").slice(0, 16);
45792
- const binary2 = import_node_path82.default.join(cacheDir(), `swift-pdf-raster-${tag}`);
45954
+ function rasterBinary(swift = RASTER_SWIFT, name3 = "swift-pdf-raster") {
45955
+ const tag = (0, import_node_crypto42.createHash)("sha256").update(swift).digest("hex").slice(0, 16);
45956
+ const binary2 = import_node_path82.default.join(cacheDir(), `${name3}-${tag}`);
45793
45957
  try {
45794
45958
  import_node_fs84.default.accessSync(binary2, import_node_fs84.default.constants.X_OK);
45795
45959
  return binary2;
@@ -45801,7 +45965,7 @@ function rasterBinary() {
45801
45965
  import_node_fs84.default.mkdtempSync(import_node_path82.default.join(import_node_os16.default.tmpdir(), "swift-pdf-raster-")),
45802
45966
  "raster.swift"
45803
45967
  );
45804
- import_node_fs84.default.writeFileSync(source, RASTER_SWIFT);
45968
+ import_node_fs84.default.writeFileSync(source, swift);
45805
45969
  try {
45806
45970
  (0, import_node_child_process42.execFileSync)("xcrun", ["swiftc", "-o", binary2, source], { stdio: "pipe" });
45807
45971
  } finally {
@@ -45859,7 +46023,31 @@ function rasterizePdfFile(diskPath, pdfSha256) {
45859
46023
  import_node_fs84.default.rmSync(import_node_path82.default.dirname(out), { recursive: true, force: true });
45860
46024
  }
45861
46025
  }
45862
- var import_node_child_process42, import_node_crypto42, import_node_fs84, import_node_os16, import_node_path82, RASTER_SWIFT;
46026
+ function rasterizeSvgFile(diskPath, svgSha256) {
46027
+ if (process.platform !== "darwin") return null;
46028
+ const binary2 = rasterBinary(RASTER_SVG_SWIFT, "swift-svg-raster");
46029
+ const tag = (0, import_node_crypto42.createHash)("sha256").update(RASTER_SVG_SWIFT).digest("hex").slice(0, 16);
46030
+ const cached3 = import_node_path82.default.join(cacheDir(), `swift-svg-png-${tag}-${svgSha256}.png`);
46031
+ if (import_node_fs84.default.existsSync(cached3)) return { bytes: import_node_fs84.default.readFileSync(cached3) };
46032
+ const out = import_node_path82.default.join(
46033
+ import_node_fs84.default.mkdtempSync(import_node_path82.default.join(import_node_os16.default.tmpdir(), "swift-svg-png-")),
46034
+ "out.png"
46035
+ );
46036
+ try {
46037
+ (0, import_node_child_process42.execFileSync)(binary2, [diskPath, "3", out], { stdio: "pipe" });
46038
+ const bytes = import_node_fs84.default.readFileSync(out);
46039
+ import_node_fs84.default.mkdirSync(cacheDir(), { recursive: true });
46040
+ import_node_fs84.default.copyFileSync(out, cached3);
46041
+ return { bytes: Buffer.from(bytes) };
46042
+ } catch (error) {
46043
+ throw new Error(
46044
+ `swift svg asset ${diskPath} did not rasterize: ${error instanceof Error ? error.message : String(error)}`
46045
+ );
46046
+ } finally {
46047
+ import_node_fs84.default.rmSync(import_node_path82.default.dirname(out), { recursive: true, force: true });
46048
+ }
46049
+ }
46050
+ var import_node_child_process42, import_node_crypto42, import_node_fs84, import_node_os16, import_node_path82, RASTER_SWIFT, RASTER_SVG_SWIFT;
45863
46051
  var init_swift_pdf_raster = __esm({
45864
46052
  "src/swift-pdf-raster.ts"() {
45865
46053
  "use strict";
@@ -45895,6 +46083,25 @@ guard let image = ctx.makeImage() else { exit(5) }
45895
46083
  guard let dest = CGImageDestinationCreateWithURL(output as CFURL, UTType.png.identifier as CFString, 1, nil) else { exit(6) }
45896
46084
  CGImageDestinationAddImage(dest, image, nil)
45897
46085
  guard CGImageDestinationFinalize(dest) else { exit(7) }
46086
+ `;
46087
+ RASTER_SVG_SWIFT = `import AppKit
46088
+ guard CommandLine.arguments.count == 4 else { exit(1) }
46089
+ let input = URL(fileURLWithPath: CommandLine.arguments[1])
46090
+ let scale = CGFloat(Double(CommandLine.arguments[2]) ?? 3.0)
46091
+ let output = URL(fileURLWithPath: CommandLine.arguments[3])
46092
+ guard let image = NSImage(contentsOf: input), image.size.width > 0, image.size.height > 0 else { exit(2) }
46093
+ let width = Int(ceil(image.size.width * scale))
46094
+ let height = Int(ceil(image.size.height * scale))
46095
+ if width > 12000 || height > 12000 { exit(3) }
46096
+ guard let rep = NSBitmapImageRep(bitmapDataPlanes: nil, pixelsWide: width, pixelsHigh: height, bitsPerSample: 8, samplesPerPixel: 4, hasAlpha: true, isPlanar: false, colorSpaceName: .deviceRGB, bytesPerRow: 0, bitsPerPixel: 0) else { exit(4) }
46097
+ guard let context = NSGraphicsContext(bitmapImageRep: rep) else { exit(5) }
46098
+ NSGraphicsContext.saveGraphicsState()
46099
+ NSGraphicsContext.current = context
46100
+ context.imageInterpolation = .high
46101
+ image.draw(in: NSRect(x: 0, y: 0, width: width, height: height), from: .zero, operation: .copy, fraction: 1)
46102
+ NSGraphicsContext.restoreGraphicsState()
46103
+ guard let data = rep.representation(using: .png, properties: [:]) else { exit(6) }
46104
+ do { try data.write(to: output) } catch { exit(7) }
45898
46105
  `;
45899
46106
  }
45900
46107
  });
@@ -46092,7 +46299,7 @@ async function swiftPackages(entry, app) {
46092
46299
  ] : []
46093
46300
  );
46094
46301
  let reached = [...cached3.binaries.filter((binary2) => binary2.reached), ...vendored];
46095
- const standinArtifact = (binary2) => binary2.publicHeaders === void 0 || binary2.assemblySources !== void 0;
46302
+ const standinArtifact = (binary2) => binary2.publicHeaders === void 0 || binary2.unloweredSources !== void 0;
46096
46303
  const artifacts = reached.filter(standinArtifact);
46097
46304
  if (entry.moduleRoot && entry.provided && artifacts.length > 0) {
46098
46305
  const resolved = swiftModuleToolchain(entry.moduleRoot);
@@ -46111,10 +46318,13 @@ async function swiftPackages(entry, app) {
46111
46318
  const cxxArtifacts = reached.filter(standinArtifact);
46112
46319
  const generation = standinGenerationInputs(cxxArtifacts, toolchain, entry.behavior);
46113
46320
  if (cached3.standinKey !== generation) {
46321
+ const replaced = new Set(
46322
+ cxxArtifacts.filter((binary2) => shippedBinaryDiffers(binary2.target, binary2.checksum)).map((binary2) => binary2.target)
46323
+ );
46114
46324
  const built2 = await swiftStandins(
46115
46325
  cxxArtifacts,
46116
46326
  toolchain,
46117
- entry.provided,
46327
+ new Set([...entry.provided].filter((name3) => !replaced.has(name3))),
46118
46328
  entry.behavior
46119
46329
  );
46120
46330
  cached3.packages = await resolveSwiftPackagesAsync({
@@ -46128,6 +46338,9 @@ async function swiftPackages(entry, app) {
46128
46338
  ...entry.provided,
46129
46339
  ...cxxArtifacts.map((binary2) => binary2.target).filter((target) => !built2.gaps.has(target))
46130
46340
  ]),
46341
+ standinTargets: new Set(
46342
+ [...replaced].filter((target) => !built2.gaps.has(target))
46343
+ ),
46131
46344
  binaryGaps: built2.gaps,
46132
46345
  owners
46133
46346
  });
@@ -47037,6 +47250,12 @@ function buildSwiftResourceTable(project2, baseUrl, inputs) {
47037
47250
  throw new Error("swift image pack exceeds the compile service caps");
47038
47251
  }
47039
47252
  bytes = readPackageFile2(project2.packagePath, disk, limits.imageBytes);
47253
+ const svg = ext === ".svg" ? rasterizeSvgFile(disk, (0, import_node_crypto43.createHash)("sha256").update(bytes).digest("hex")) : null;
47254
+ if (svg) {
47255
+ bytes = svg.bytes;
47256
+ ext = ".png";
47257
+ uploadName = `${import_node_path83.default.posix.basename(file, import_node_path83.default.posix.extname(file))}.png`;
47258
+ }
47040
47259
  }
47041
47260
  if (imageBytes + bytes.length > limits.imageTotalBytes) {
47042
47261
  throw new Error("swift image pack exceeds the compile service caps");
@@ -48010,6 +48229,7 @@ var init_swift_host = __esm({
48010
48229
  init_swift_package_manifest();
48011
48230
  init_swift_packages();
48012
48231
  init_swift_pdf_raster();
48232
+ init_swift_shipped_binaries();
48013
48233
  init_swift_source_file();
48014
48234
  init_swift_standin_config();
48015
48235
  init_swift_standins();
@@ -53678,7 +53898,7 @@ var init_nitro_superset = __esm({
53678
53898
  init_nitroContract();
53679
53899
  init_swift_standin_digest();
53680
53900
  NITRO_SUPERSET_ENTRY_NAME = "superset";
53681
- NITRO_COMPILER_DIGEST = true ? "234b7b78708dccda850fa0eb608aa86741138db8012d1281d22ea66230b6d7e7" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
53901
+ NITRO_COMPILER_DIGEST = true ? "7afc96bcaad18f442be5bd478487a44ee748ffe868f559accac85cf7e93d6a81" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
53682
53902
  nitroSupersetLock = parseLock(nitro_superset_lock_default);
53683
53903
  nitroSupersetKey = (inputs) => nativeEntryKey({ ...inputs, compiler: NITRO_COMPILER_DIGEST });
53684
53904
  published2 = /* @__PURE__ */ new Map();
@@ -63105,7 +63325,7 @@ init_swift_native_pin();
63105
63325
  init_xcode_project();
63106
63326
  var EXPO_NATIVE_ENTRY_NAME = "ios";
63107
63327
  function expoNativeCompilerDigestValue() {
63108
- return true ? "1b43265acf063948351fe9b1eff823e0f58d23536689055bd673253a28cf568b" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
63328
+ return true ? "5922e9285a81f56dda7ebf9adbf34c7d630c8a729a2ce226405b975c38ab854b" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
63109
63329
  }
63110
63330
  var IDENTITY_SOURCE_SKIPS = 1 | 4 | 8 | 16 | 32 | 64 | 128 | 4096;
63111
63331
  function readSources(value) {