peachsim 0.1.2179 → 0.1.2182

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 (104) hide show
  1. package/cli/commands/package.ts +7 -2
  2. package/cli/commands/shell-url.ts +28 -22
  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 +225 -85
  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 +2 -2
  27. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  28. package/dist-lib/expo-swift-bundle.cjs +140 -48
  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 +201 -82
  33. package/dist-lib/host/fetch-proxy-handler.cjs +4 -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 +4 -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 +11 -3
  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 +4 -4
  49. package/dist-lib/native-app-identity-project.cjs +2 -2
  50. package/dist-lib/native-app-identity-project.mjs +2 -2
  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 +24 -24
  62. package/dist-lib/public-origins-lib.json +53 -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 +239 -176
  70. package/dist-lib/swift-compile.cjs +85 -16
  71. package/dist-lib/swift-compile.mjs +85 -16
  72. package/dist-lib/swift-package.cjs +1 -1
  73. package/dist-lib/swift-package.mjs +1 -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 +87 -18
  79. package/dist-lib/vite.cjs +4 -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/cli-companion.d.ts +1 -0
  83. package/dist-types/packages/peach-engine/src/ios/frame-art.d.ts +41 -0
  84. package/dist-types/packages/peach-engine/src/ios/frame-paint.d.ts +43 -0
  85. package/dist-types/packages/peach-engine/src/ios/frame-svg.d.ts +4 -0
  86. package/dist-types/packages/peach-engine/src/render-worker/map-command-channel.d.ts +14 -0
  87. package/kotlin/sdk.tar.gz +0 -0
  88. package/package.json +1 -1
  89. package/runtime-companion.json +1 -1
  90. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIScrollView.h +8 -25
  91. package/sdk/ios/System/Library/Frameworks/UIKitTypes.framework/Headers/UIKitTypes.h +26 -0
  92. package/src/expo-native-workspace.ts +17 -20
  93. package/src/expo-swift-bundle.ts +6 -1
  94. package/src/expo-swift-host.ts +35 -6
  95. package/src/expo-widgets-bundle.ts +12 -8
  96. package/src/expoSwiftContract.ts +3 -0
  97. package/src/kotlin-host.ts +10 -2
  98. package/src/native-bundles.ts +30 -10
  99. package/src/one-sdk/source.ts +10 -4
  100. package/src/one-sdk-bundle.ts +57 -24
  101. package/src/screenshots/frame-compose.ts +14 -109
  102. package/src/swift-compile.ts +105 -13
  103. package/src/swift-submit.ts +2 -1
  104. package/src/wasm-optimize.ts +13 -4
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2179 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2182 | (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;
@@ -30850,7 +30850,7 @@ var init_swift_submit = __esm({
30850
30850
  MAX_SWIFT_COMPILE_IMAGES = 256;
30851
30851
  MAX_SWIFT_COMPILE_IMAGE_BYTES = 4 * 1024 * 1024;
30852
30852
  MAX_SWIFT_COMPILE_IMAGE_TOTAL_BYTES = 16 * 1024 * 1024;
30853
- SWIFT_HOST_ABI = 69;
30853
+ SWIFT_HOST_ABI = 70;
30854
30854
  POLL_INTERVAL_MS = 1500;
30855
30855
  }
30856
30856
  });
@@ -51918,6 +51918,13 @@ var init_swift_guest_source_inputs = __esm({
51918
51918
 
51919
51919
  // src/wasm-optimize.ts
51920
51920
  async function runWasmOpt(file, output2, skipPasses, binary2) {
51921
+ const admittedCores = windowAdmission()?.cores ?? Number(process.env.TM_EXEC_CPU_CORES);
51922
+ const requestedCores = Number(process.env.BINARYEN_CORES);
51923
+ const environment = { ...process.env, WASM_OPT_PATH: binary2 };
51924
+ if (Number.isInteger(admittedCores) && admittedCores > 0)
51925
+ environment.BINARYEN_CORES = String(
51926
+ Number.isInteger(requestedCores) && requestedCores > 0 ? Math.min(admittedCores, requestedCores) : admittedCores
51927
+ );
51921
51928
  const result = await (0, import_wasm_opt.wasmOpt)(
51922
51929
  [
51923
51930
  "-Oz",
@@ -51927,7 +51934,7 @@ async function runWasmOpt(file, output2, skipPasses, binary2) {
51927
51934
  "-o",
51928
51935
  output2
51929
51936
  ],
51930
- { env: { ...process.env, WASM_OPT_PATH: binary2 } }
51937
+ { env: environment }
51931
51938
  );
51932
51939
  if (result.status !== 0)
51933
51940
  throw new Error(`wasm-opt exited ${result.status}: ${result.stderr}`);
@@ -51963,6 +51970,7 @@ var init_wasm_optimize = __esm({
51963
51970
  import_node_path41 = require("node:path");
51964
51971
  init_src();
51965
51972
  import_wasm_opt = require("wasm-opt");
51973
+ init_admitted_mac_build();
51966
51974
  init_home_paths();
51967
51975
  FEATURES = [
51968
51976
  "threads",
@@ -54124,6 +54132,20 @@ function emitSwiftPackageManifest(args) {
54124
54132
  const prebuilt = args.prebuilt;
54125
54133
  const linkedObjects = Boolean(distribution || prebuilt);
54126
54134
  const cxxFlagsFor = (flags) => args.deferDarwinOverlay ? withoutWasmOverlayIsystem(flags) : flags;
54135
+ const packageModules = new Set(
54136
+ targets.filter(({ name: name3 }) => !args.sourceSwiftTargets?.has(name3)).map(({ name: name3 }) => swiftTargetModuleName(name3))
54137
+ );
54138
+ const mapsPackageModule = (flag) => {
54139
+ if (!flag.startsWith("-fmodule-map-file=")) return false;
54140
+ const file = flag.slice("-fmodule-map-file=".length).replaceAll(SWIFT_NATIVE_INPUT_ROOT, args.root);
54141
+ if (!file.includes("/Pods/Headers/")) return false;
54142
+ const map2 = args.files.get(file) ?? ((0, import_node_fs53.existsSync)(file) ? (0, import_node_fs53.readFileSync)(file) : void 0);
54143
+ const name3 = map2 === void 0 ? void 0 : moduleMapName(map2.toString());
54144
+ return name3 !== void 0 && packageModules.has(name3);
54145
+ };
54146
+ const withoutPackageModuleMaps = (flags) => flags.filter((flag) => !mapsPackageModule(flag));
54147
+ const targetCFlags = (flags) => cFlagArray(withoutPackageModuleMaps(flags));
54148
+ const targetCxxFlags = (flags) => cxxFlagArray(withoutPackageModuleMaps(flags));
54127
54149
  const reachedFrameworks = /* @__PURE__ */ new Set();
54128
54150
  const reach = (name3) => {
54129
54151
  if (reachedFrameworks.has(name3) || targets.some((target) => swiftTargetModuleName(target.name) === name3))
@@ -54203,7 +54225,9 @@ function emitSwiftPackageManifest(args) {
54203
54225
  const macroSettings = (values) => (values ?? []).map((value) => ` ${clangMacroSetting(value)},`).join("");
54204
54226
  const flagArray = (literal5) => `peachCompilerArguments(${JSON.stringify(literal5.replace(/,\s*]$/, "]"))})`;
54205
54227
  const swiftFlagArray = (literal5) => {
54206
- const flags = JSON.parse(literal5.replace(/,\s*]$/, "]"));
54228
+ const flags = JSON.parse(literal5.replace(/,\s*]$/, "]")).filter(
54229
+ (flag, index, all) => !mapsPackageModule(flag) && !(flag === "-Xcc" && mapsPackageModule(all[index + 1] ?? ""))
54230
+ );
54207
54231
  const content = flags.map((flag) => JSON.stringify(flag)).join("\n") + "\n";
54208
54232
  const digest3 = (0, import_node_crypto25.createHash)("sha256").update(content).digest("hex");
54209
54233
  const file = import_node_path50.default.join(args.root, ".peach-swift-arguments", `${digest3}.rsp`);
@@ -54363,18 +54387,18 @@ function emitSwiftPackageManifest(args) {
54363
54387
  "c"
54364
54388
  ).map((entry) => ` ${entry},`).join(
54365
54389
  ""
54366
- )} .unsafeFlags(${flagArray(cFlagArray([...nativeFlags, ...native.clang.flags]))})]`,
54390
+ )} .unsafeFlags(${flagArray(targetCFlags([...nativeFlags, ...native.clang.flags]))})]`,
54367
54391
  ...nativeCxx ? [
54368
54392
  `cxxSettings: [${cxxDefines}${clangSettingEntries(
54369
54393
  frameworkSearchFlags(target, "cxx"),
54370
54394
  "cxx"
54371
54395
  ).map((entry) => ` ${entry},`).join(
54372
54396
  ""
54373
- )} .unsafeFlags(${flagArray(cxxFlagArray([...cxxFlagsFor(nativeFlags), ...native.clang.cxxFlags]))})]`
54397
+ )} .unsafeFlags(${flagArray(targetCxxFlags([...cxxFlagsFor(nativeFlags), ...native.clang.cxxFlags]))})]`
54374
54398
  ] : []
54375
54399
  ].join(", ") : [
54376
- `cSettings: [${cDefines}${declaredClangSettings(target, "c")} .unsafeFlags(${flagArray(cFlagArray([...nativeFlags, ...native?.flags ?? []]))})]`,
54377
- `cxxSettings: [${cxxDefines}${declaredClangSettings(target, "cxx")} .unsafeFlags(${flagArray(cxxFlagArray([...cxxFlagsFor(nativeFlags), ...native?.cxxFlags ?? []]))})]`
54400
+ `cSettings: [${cDefines}${declaredClangSettings(target, "c")} .unsafeFlags(${flagArray(targetCFlags([...nativeFlags, ...native?.flags ?? []]))})]`,
54401
+ `cxxSettings: [${cxxDefines}${declaredClangSettings(target, "cxx")} .unsafeFlags(${flagArray(targetCxxFlags([...cxxFlagsFor(nativeFlags), ...native?.cxxFlags ?? []]))})]`
54378
54402
  ].join(", ");
54379
54403
  const exclusions = native?.clang ? [] : [
54380
54404
  ...native ? native.exclude ?? native.lateSources : [],
@@ -54443,9 +54467,9 @@ function emitSwiftPackageManifest(args) {
54443
54467
  ` path: ${JSON.stringify(group.path)},`,
54444
54468
  ` sources: ${JSON.stringify(group.sources)},`,
54445
54469
  ` publicHeadersPath: ${JSON.stringify(native.groups ? "include" : "PeachSwiftImplementation")},`,
54446
- ` cSettings: [${macroSettings(owner?.cDefines)}${declaredClangSettings(owner, "c")} .unsafeFlags(${flagArray(cFlagArray([...nativeFlags, "-I", native.includeDirectory, ...args.headerDirectory ? ["-I", args.headerDirectory] : [], ...group.flags]))})],`,
54470
+ ` cSettings: [${macroSettings(owner?.cDefines)}${declaredClangSettings(owner, "c")} .unsafeFlags(${flagArray(targetCFlags([...nativeFlags, "-I", native.includeDirectory, ...args.headerDirectory ? ["-I", args.headerDirectory] : [], ...group.flags]))})],`,
54447
54471
  ...group.sources.some((source) => /\.(?:cc|cpp|cxx|mm)$/.test(source)) ? [
54448
- ` cxxSettings: [${macroSettings(owner?.cxxDefines)}${declaredClangSettings(owner, "cxx")} .unsafeFlags(${flagArray(cxxFlagArray([...cxxFlagsFor(nativeFlags), "-I", native.includeDirectory, ...group.cxxFlags]))})]),`
54472
+ ` cxxSettings: [${macroSettings(owner?.cxxDefines)}${declaredClangSettings(owner, "cxx")} .unsafeFlags(${flagArray(targetCxxFlags([...cxxFlagsFor(nativeFlags), "-I", native.includeDirectory, ...group.cxxFlags]))})]),`
54449
54473
  ] : [" ),"]
54450
54474
  ]) : [];
54451
54475
  }),
@@ -55355,7 +55379,10 @@ ${swiftProjectFilesProblems(input.projectFiles).join("\n")}`
55355
55379
  const target = bySourcePath.find(
55356
55380
  (candidate) => candidate.path === "." || file.startsWith(`${candidate.path}/`)
55357
55381
  );
55358
- if (target) swiftTargets.add(target.name);
55382
+ const excluded = target?.exclude?.some(
55383
+ (name3) => file === import_node_path50.default.posix.join(target.path, name3)
55384
+ );
55385
+ if (target && !excluded) swiftTargets.add(target.name);
55359
55386
  }
55360
55387
  const importedModules = /* @__PURE__ */ new Set();
55361
55388
  const swiftImportedModules = /* @__PURE__ */ new Set();
@@ -56401,6 +56428,9 @@ module ${moduleName2}.Swift {
56401
56428
  frameworkLink,
56402
56429
  [
56403
56430
  ...prebuilt.objects.map(quote),
56431
+ "-Wl,--start-lib",
56432
+ ...prebuilt.lazyObjects.map(quote),
56433
+ "-Wl,--end-lib",
56404
56434
  ...darwinRecordsRegion(prebuilt.providers.map(quote))
56405
56435
  ].join("\n") + "\n"
56406
56436
  );
@@ -56683,7 +56713,7 @@ function readCompiledArtifact(directory2, hash) {
56683
56713
  return null;
56684
56714
  const bytes = (0, import_node_fs53.readFileSync)(import_node_path50.default.join(directory2, "app.wasm"));
56685
56715
  const gzip2 = (0, import_node_fs53.readFileSync)(import_node_path50.default.join(directory2, "icu.gz"));
56686
- if ((0, import_node_crypto25.createHash)("sha256").update(bytes).digest("hex") !== receipt.wasm || (0, import_node_crypto25.createHash)("sha256").update(gzip2).digest("hex") !== receipt.icu || bytes.length < 8 || bytes.readUInt32LE(0) !== 1836278016 || bytes.readUInt32LE(4) !== 1)
56716
+ if ((0, import_node_crypto25.createHash)("sha256").update(bytes).digest("hex") !== receipt.wasm || (0, import_node_crypto25.createHash)("sha256").update(gzip2).digest("hex") !== receipt.icu || bytes.length <= 8 || bytes.readUInt32LE(0) !== 1836278016 || bytes.readUInt32LE(4) !== 1)
56687
56717
  return null;
56688
56718
  return { hash, bytes, icu: { sha256: receipt.icu, gzip: gzip2 } };
56689
56719
  } catch (error) {
@@ -56799,7 +56829,13 @@ function linkedFrameworkTargets(moduleRoot, input) {
56799
56829
  );
56800
56830
  const targets = compileTargets(input);
56801
56831
  const planning = targets.length > 0 ? targets : [{ name: "App", path: "." }];
56802
- const siblings = swiftTargetDependencies(input.files, planning, libraries.keys());
56832
+ const siblings = swiftTargetDependencies(
56833
+ input.files,
56834
+ planning.map(
56835
+ (target) => input.libraries?.[target.name] ? { ...target, exclude: [] } : target
56836
+ ),
56837
+ libraries.keys()
56838
+ );
56803
56839
  const reached = /* @__PURE__ */ new Set();
56804
56840
  const reach = (name3) => {
56805
56841
  if (name3 === "SwiftUI") return;
@@ -57101,9 +57137,31 @@ async function buildFrameworkProducts(scratch2, args) {
57101
57137
  }
57102
57138
  const providers = (0, import_node_fs53.readdirSync)(providerDir).filter((file) => file.endsWith(".o")).sort().map((file) => import_node_path50.default.join(providerDir, file));
57103
57139
  for (const provider of providers) linked.owners.set(provider, "DarwinRecords");
57140
+ const archive = import_node_path50.default.join(scratch2, "lib");
57141
+ (0, import_node_fs53.rmSync)(archive, { recursive: true, force: true });
57142
+ (0, import_node_fs53.mkdirSync)(archive);
57143
+ const archived = /* @__PURE__ */ new Map();
57144
+ for (const object6 of objects) {
57145
+ const target = linked.owners.get(object6);
57146
+ const dir = import_node_path50.default.join(release, `${target}.build`);
57147
+ if (!target || target === "Darwin" || !object6.startsWith(dir + import_node_path50.default.sep)) continue;
57148
+ const name3 = `${target}-${import_node_path50.default.relative(dir, object6).replaceAll(import_node_path50.default.sep, "-").replace(/\.swift\.o$/, ".o")}`;
57149
+ (0, import_node_fs53.symlinkSync)(object6, import_node_path50.default.join(archive, name3));
57150
+ archived.set(object6, `lib/${name3}`);
57151
+ }
57152
+ const roots = swiftObjcRootObjects(`${scratch2}
57153
+ ${args.frameworkKey}`, scratch2, [
57154
+ ...archived.values()
57155
+ ]);
57156
+ const linkedObjects = objects.map((object6) => {
57157
+ const name3 = archived.get(object6);
57158
+ return name3 ? { path: import_node_path50.default.join(scratch2, name3), lazy: !roots.has(name3) } : { path: object6, lazy: false };
57159
+ });
57104
57160
  return {
57161
+ root: scratch2,
57105
57162
  modules: import_node_path50.default.join(release, "Modules"),
57106
- objects,
57163
+ objects: linkedObjects.filter((object6) => !object6.lazy).map((object6) => object6.path),
57164
+ lazyObjects: linkedObjects.filter((object6) => object6.lazy).map((object6) => object6.path),
57107
57165
  owners: linked.owners,
57108
57166
  providers,
57109
57167
  link,
@@ -57253,6 +57311,10 @@ ${args.frameworkKey}
57253
57311
  for (const object6 of args.prebuilt.objects)
57254
57312
  hash.update(`object
57255
57313
  ${object6}
57314
+ ${statOf(object6)}`);
57315
+ for (const object6 of args.prebuilt.lazyObjects)
57316
+ hash.update(`lazy-object
57317
+ ${object6}
57256
57318
  ${statOf(object6)}`);
57257
57319
  for (const object6 of args.prebuilt.providers)
57258
57320
  hash.update(`provider
@@ -57669,7 +57731,7 @@ function compileSwiftProjectOnce(input, options) {
57669
57731
  pruneSwiftWasmLink(
57670
57732
  root,
57671
57733
  options.toolchainBin,
57672
- frameworkRoot,
57734
+ prebuilt?.root ?? frameworkRoot,
57673
57735
  input.staticClangTargets,
57674
57736
  options.project,
57675
57737
  void 0,
@@ -57693,11 +57755,19 @@ function compileSwiftProjectOnce(input, options) {
57693
57755
  optimized
57694
57756
  });
57695
57757
  else if (input.optimize) await optimizeWasm(output2, optimized);
57758
+ const executable = input.optimize ? optimized : output2;
57759
+ await runCompiler(
57760
+ import_node_path50.default.join(options.toolchainBin, "llvm-objcopy"),
57761
+ ["--remove-section=.swift1_autolink_entries", executable],
57762
+ buildOptions
57763
+ );
57696
57764
  const artifact = {
57697
57765
  hash,
57698
- bytes: (0, import_node_fs53.readFileSync)(input.optimize ? optimized : output2),
57766
+ bytes: (0, import_node_fs53.readFileSync)(executable),
57699
57767
  icu: await icu
57700
57768
  };
57769
+ if (artifact.bytes.length <= 8)
57770
+ throw new Error("swift-compile: deferred linker produced no executable");
57701
57771
  if (!options.project) saveCompiledArtifact(root, artifact);
57702
57772
  saveSharedArtifact(sharedRoot, artifact);
57703
57773
  report("compiled artifact verified");
@@ -57877,7 +57947,7 @@ var init_swift_compile = __esm({
57877
57947
  REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
57878
57948
  MULTI_MANIFEST_VERSION = 68;
57879
57949
  SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
57880
- compilerSourceDigest = true ? "49b49a3b4f72b519cda4a1310d169f7d233d4f0249b0bcff228d2c316fafd9e1" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
57950
+ compilerSourceDigest = true ? "73960368f0b83cf042511655d857d5f64204fa539e2c984423a12c08657b068e" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
57881
57951
  nativeCxxCompilerFlags = ["-fno-cxx-modules"];
57882
57952
  cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
57883
57953
  cxxFlagArray = (flags) => JSON.stringify([...nativeCxxCompilerFlags, ...withoutGlogModuleMap(flags)]);
@@ -63726,6 +63796,7 @@ async function prepareWorkspace(app, stage, key2, podsEnvironment) {
63726
63796
  const nodeVersion = typeof manifest.engines?.node === "string" && /^\d+(\.\d+){0,2}$/.test(manifest.engines.node) ? manifest.engines.node : null;
63727
63797
  const prefix = nodeVersion ? ["mise", "exec", `node@${nodeVersion}`, "--"] : [];
63728
63798
  const bunPrefix = import_node_path61.default.join(cacheDir(), "package-managers", manager);
63799
+ const bunExecutable = import_node_path61.default.join(bunPrefix, "node_modules/.bin/bun");
63729
63800
  const install = manager === "pnpm" || manager.startsWith("pnpm@") ? [
63730
63801
  "npx",
63731
63802
  "--yes",
@@ -63734,11 +63805,7 @@ async function prepareWorkspace(app, stage, key2, podsEnvironment) {
63734
63805
  "--frozen-lockfile",
63735
63806
  // the copied node_modules link into the store pnpm chose on the app's volume
63736
63807
  ...pnpmStoreArgs(root)
63737
- ] : manager === "yarn" || manager.startsWith("yarn@") ? ["corepack", "yarn", "install", "--immutable"] : manager === "bun" || manager.startsWith("bun@") ? manager === "bun" ? ["bun", "install", "--frozen-lockfile"] : [
63738
- import_node_path61.default.join(bunPrefix, "node_modules/.bin/bun"),
63739
- "install",
63740
- "--frozen-lockfile"
63741
- ] : (
63808
+ ] : manager === "yarn" || manager.startsWith("yarn@") ? ["corepack", "yarn", "install", "--immutable"] : manager === "bun" || manager.startsWith("bun@") ? manager === "bun" ? ["bun", "install", "--frozen-lockfile"] : [bunExecutable, "install", "--frozen-lockfile"] : (
63742
63809
  // npm ci would delete the cloned tree before installing it again
63743
63810
  ["npm", "install", "--no-audit", "--no-fund"]
63744
63811
  );
@@ -63747,22 +63814,22 @@ async function prepareWorkspace(app, stage, key2, podsEnvironment) {
63747
63814
  const command = [...prefix, ...args];
63748
63815
  await run12(command[0], command.slice(1), cwd, env);
63749
63816
  };
63817
+ if (manager.startsWith("bun@") && (!projectReady || !import_node_fs63.default.existsSync(bunExecutable)))
63818
+ await execute(
63819
+ [
63820
+ "npm",
63821
+ "install",
63822
+ "--prefix",
63823
+ bunPrefix,
63824
+ // the bun package ships a placeholder binary its postinstall replaces
63825
+ "--ignore-scripts=false",
63826
+ "--no-audit",
63827
+ "--no-fund",
63828
+ manager
63829
+ ],
63830
+ work
63831
+ );
63750
63832
  if (!projectReady) {
63751
- if (manager.startsWith("bun@"))
63752
- await execute(
63753
- [
63754
- "npm",
63755
- "install",
63756
- "--prefix",
63757
- bunPrefix,
63758
- // the bun package ships a placeholder binary its postinstall replaces
63759
- "--ignore-scripts=false",
63760
- "--no-audit",
63761
- "--no-fund",
63762
- manager
63763
- ],
63764
- work
63765
- );
63766
63833
  if (install[0] === "npm" && import_node_fs63.default.existsSync(import_node_path61.default.join(work, "package-lock.json"))) {
63767
63834
  await execute(
63768
63835
  ["npm", "ci", "--dry-run", "--ignore-scripts", "--no-audit", "--no-fund"],
@@ -64446,7 +64513,7 @@ var init_swift_standin_digest = __esm({
64446
64513
  STANDIN_DIGEST_ENTRYPOINTS = ["swift-standins.ts", "swift-objc-compile.ts"];
64447
64514
  SPECIFIER = /from\s*['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
64448
64515
  standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
64449
- STANDIN_SOURCE_DIGEST = true ? "a3c0ce4a9bde10ffdfdde4f65019a9ffc1f75b1779312f1d5ed2a686a3f6e0c7" : standinSourceDigest();
64516
+ STANDIN_SOURCE_DIGEST = true ? "cc396d180b261e922288f645807b4a704fa92410ffc902bfbaac72b81af6413a" : standinSourceDigest();
64450
64517
  }
64451
64518
  });
64452
64519
 
@@ -64902,7 +64969,7 @@ var init_package_tree_digest = __esm({
64902
64969
 
64903
64970
  // src/expo-native-prebuilt.ts
64904
64971
  function expoNativeCompilerDigestValue() {
64905
- return true ? "ac42571af765c2d0124171549a0a6350da01f038cf184c0f638923a4932a5e8b" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
64972
+ return true ? "2799fbdcc514ac59227047679bf5780658834c45f46965b7b41455f6453d53e2" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
64906
64973
  }
64907
64974
  function readSources(value) {
64908
64975
  const sources = isRecord(value) ? value.sources : null;
@@ -81978,7 +82045,15 @@ function targetSettings2(units) {
81978
82045
  }
81979
82046
  return settings;
81980
82047
  }
81981
- function expoEntry(units) {
82048
+ function oneSDKStamp(oneSDK) {
82049
+ if (!oneSDK) return "";
82050
+ const hash = (0, import_node_crypto49.createHash)("sha256");
82051
+ for (const files2 of [oneSDK.targets, oneSDK.entry])
82052
+ for (const [name3, source] of [...files2].sort(([a], [b]) => a.localeCompare(b)))
82053
+ hash.update(`${name3}\0${source}\0`);
82054
+ return hash.digest("hex");
82055
+ }
82056
+ function expoEntry(units, oneSDK = false) {
81982
82057
  const namespaces = [...new Set(units.map((unit2) => unit2.namespace))].filter((namespace) => namespace !== "PeachExpoApp").filter(
81983
82058
  (namespace) => units.some(
81984
82059
  (unit2) => Object.keys(unit2.files).some((file) => file.startsWith(`Sources/${namespace}/`))
@@ -81988,13 +82063,14 @@ function expoEntry(units) {
81988
82063
  const subscribers = units.flatMap((unit2) => unit2.appDelegateSubscribers);
81989
82064
  const handlers = units.flatMap((unit2) => unit2.reactDelegateHandlers);
81990
82065
  const delegates = subscribers.length + handlers.length > 0 ? `; PeachExpoRuntime.registerDelegates(subscribers: [${subscribers.join(", ")}], handlers: [${handlers.join(", ")}])` : "";
82066
+ 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) }";
81991
82067
  return `import SwiftUI
81992
82068
  internal import ExpoModulesCore
81993
- ${bridgeModules.length ? "import React\n" : ""}${namespaces.map((namespace) => `import ${namespace}`).join("\n")}
82069
+ ${bridgeModules.length ? "import React\n" : ""}${oneSDK ? "import One\nimport OneSDKBindings\n" : ""}${namespaces.map((namespace) => `import ${namespace}`).join("\n")}
81994
82070
 
81995
82071
  @main struct PeachExpoApp: PeachPackage {
81996
82072
  init() { MainActor.assumeIsolated { PeachExpoRuntime.register([${units.flatMap((unit2) => unit2.classes).join(", ")}])${delegates}${bridgeModules.length ? `; RCTModuleHost.register([${bridgeModules.join(", ")}])` : ""} } }
81997
- func view(props: JSON) -> PeachExpoNativeView { PeachExpoNativeView(props: props) }
82073
+ ${view}
81998
82074
  }
81999
82075
 
82000
82076
  @_expose(wasm, "peach_expo_call")
@@ -82086,7 +82162,7 @@ async function compileExpoSwiftModules(root, base, publishArtifact, options = {}
82086
82162
  installSwiftInputTrace();
82087
82163
  let key2;
82088
82164
  try {
82089
- key2 = `${await discoveryKey(root, options.installedWorkspace, true, options.iosTarget, options.moduleRoot)}\0${options.only?.join(",") ?? ""}`;
82165
+ key2 = `${await discoveryKey(root, options.installedWorkspace, true, options.iosTarget, options.moduleRoot)}\0${options.only?.join(",") ?? ""}\0${oneSDKStamp(options.oneSDK)}`;
82090
82166
  } catch {
82091
82167
  return compileExpoSwiftModulesTraced(root, base, publishArtifact, options);
82092
82168
  }
@@ -82123,11 +82199,23 @@ async function compileExpoSwiftModulesTraced(root, base, publishArtifact, option
82123
82199
  throw new Error(`conflicting Expo Swift binary source ${name3}`);
82124
82200
  files2[name3] = source;
82125
82201
  }
82126
- files2[EXPO_SWIFT_ENTRY] = expoEntry(linked2);
82202
+ const settings = targetSettings2(linked2);
82203
+ if (options.oneSDK) {
82204
+ for (const [name3, source] of options.oneSDK.targets) files2[name3] = source;
82205
+ for (const [name3, source] of options.oneSDK.entry)
82206
+ files2[`Sources/PeachExpoApp/${name3}`] = source;
82207
+ settings.set("OneSDKBindings", {
82208
+ languageMode: 5,
82209
+ mainActorIsolation: false,
82210
+ swiftFlags: ["-suppress-warnings"],
82211
+ dependencies: [{ kind: "target", name: "One" }]
82212
+ });
82213
+ }
82214
+ files2[EXPO_SWIFT_ENTRY] = expoEntry(linked2, options.oneSDK !== void 0);
82127
82215
  files2["Package.swift"] = expoManifest(
82128
82216
  files2,
82129
82217
  linked2.map((unit2) => generations.get(unit2) ?? "").join(","),
82130
- targetSettings2(linked2)
82218
+ settings
82131
82219
  );
82132
82220
  const provider = linked2.some((unit2) => unit2.reactNativeProvider) ? reactProvider : void 0;
82133
82221
  if (provider) {
@@ -82488,7 +82576,11 @@ async function compileExpoSwiftModulesTraced(root, base, publishArtifact, option
82488
82576
  stamps.set(unit2, stamp);
82489
82577
  candidates.push(unit2);
82490
82578
  }
82491
- const preparedKey = expoSwiftPreparedKey(base, units, reactProviderStamp);
82579
+ const preparedKey = expoSwiftPreparedKey(
82580
+ base,
82581
+ units,
82582
+ reactProviderStamp + oneSDKStamp(options.oneSDK)
82583
+ );
82492
82584
  if (!publishArtifact) {
82493
82585
  const prepared = preparedExpoSwift.get(preparedKey);
82494
82586
  if (prepared) {
@@ -84587,7 +84679,7 @@ var init_nitro_superset = __esm({
84587
84679
  init_nitroContract();
84588
84680
  init_swift_standin_digest();
84589
84681
  NITRO_SUPERSET_ENTRY_NAME = "superset";
84590
- NITRO_COMPILER_DIGEST = true ? "0c558d82081eee0b4f4782c87d6575c3ffe493604ad9c4efe3b68378321ccbc2" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
84682
+ NITRO_COMPILER_DIGEST = true ? "4b0c1069391aa3533d7f86ec0218e3db332433aaaa017425707f0273d51d8ce5" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
84591
84683
  nitroSupersetLock = parseLock(nitro_superset_lock_default);
84592
84684
  nitroSupersetKey = (inputs) => nativeEntryKey({ ...inputs, compiler: NITRO_COMPILER_DIGEST });
84593
84685
  published2 = /* @__PURE__ */ new Map();
@@ -84787,18 +84879,21 @@ async function buildExpoWidgetsBundle(appRoot, origin = "") {
84787
84879
  throw error;
84788
84880
  }
84789
84881
  const packageDir = import_node_path98.default.dirname(manifest);
84790
- await (0, import_node_util17.promisify)(import_node_child_process49.execFile)(
84791
- process.env.NODE_BINARY || "node",
84792
- [import_node_path98.default.join(packageDir, "scripts/build-bundle.mjs"), appRoot],
84793
- { cwd: appRoot, maxBuffer: 16 * 1024 * 1024 }
84882
+ const runtimeBundle = await withSwiftRootLock(
84883
+ import_node_path98.default.join(await import_promises9.default.realpath(packageDir), "bundle"),
84884
+ async () => {
84885
+ await (0, import_node_util17.promisify)(import_node_child_process49.execFile)(
84886
+ process.env.NODE_BINARY || "node",
84887
+ [import_node_path98.default.join(packageDir, "scripts/build-bundle.mjs"), appRoot],
84888
+ { cwd: appRoot, maxBuffer: 16 * 1024 * 1024 }
84889
+ );
84890
+ return import_promises9.default.readFile(import_node_path98.default.join(packageDir, "bundle/build/ExpoWidgets.bundle"), "utf8");
84891
+ }
84794
84892
  );
84795
84893
  const catalog = await stageExpoWidgetAssets(appRoot, origin);
84796
84894
  return {
84797
84895
  metadata: {
84798
- runtimeBundle: await import_promises9.default.readFile(
84799
- import_node_path98.default.join(packageDir, "bundle/build/ExpoWidgets.bundle"),
84800
- "utf8"
84801
- ),
84896
+ runtimeBundle,
84802
84897
  images: catalog?.images ?? {}
84803
84898
  }
84804
84899
  };
@@ -84815,6 +84910,7 @@ var init_expo_widgets_bundle = __esm({
84815
84910
  import_node_util17 = require("node:util");
84816
84911
  init_expo_widget_assets();
84817
84912
  init_nitro_bundle();
84913
+ init_swift_root_lock();
84818
84914
  EXPO_WIDGETS_ROUTE = "/__peach/expo-widgets";
84819
84915
  handleExpoWidgetsRequest = compiledModuleRequestHandler(
84820
84916
  "Expo widget extension",
@@ -84824,7 +84920,7 @@ var init_expo_widgets_bundle = __esm({
84824
84920
  });
84825
84921
 
84826
84922
  // src/one-sdk/source.ts
84827
- var oneSDKModule, oneSDKApp, oneSDKTransport;
84923
+ var oneSDKModule, oneSDKHost, oneSDKApp, oneSDKTransport;
84828
84924
  var init_source = __esm({
84829
84925
  "src/one-sdk/source.ts"() {
84830
84926
  "use strict";
@@ -84860,12 +84956,11 @@ extension OneNativeComposable {
84860
84956
  public func propagateActive(_ active: Bool) {}
84861
84957
  }
84862
84958
  `;
84863
- oneSDKApp = String.raw`import SwiftUI
84959
+ oneSDKHost = String.raw`import SwiftUI
84864
84960
  @_spi(Peach) import UIKit
84865
84961
  import One
84866
- import OneSDKBindings
84867
84962
 
84868
- private struct UIKitHost: UIViewRepresentable {
84963
+ struct OneSDKUIKitHost: UIViewRepresentable {
84869
84964
  let props: JSON
84870
84965
  func makeUIView(context: Context) -> OneNativeUIKitHostView { OneNativeUIKitHostView() }
84871
84966
  func updateUIView(_ view: OneNativeUIKitHostView, context: Context) {
@@ -84877,10 +84972,14 @@ private struct UIKitHost: UIViewRepresentable {
84877
84972
  }
84878
84973
  static func dismantleUIView(_ view: OneNativeUIKitHostView, coordinator: Coordinator) { view.reset() }
84879
84974
  }
84975
+ `;
84976
+ oneSDKApp = String.raw`import SwiftUI
84977
+ import One
84978
+ import OneSDKBindings
84880
84979
 
84881
84980
  @main
84882
84981
  struct SDKGuest: PeachPackage {
84883
- func view(props: JSON) -> some View { UIKitHost(props: props) }
84982
+ func view(props: JSON) -> some View { OneSDKUIKitHost(props: props) }
84884
84983
  }
84885
84984
  `;
84886
84985
  oneSDKTransport = String.raw`import Foundation
@@ -85178,7 +85277,7 @@ async function compileOneSDKApp(appRoot, origin, moduleRootOverride) {
85178
85277
  const prepared = await prepareExpoNativeProject(appRoot);
85179
85278
  return compilePreparedOneSDKApp(appRoot, prepared.app, origin, moduleRootOverride);
85180
85279
  }
85181
- async function compilePreparedOneSDKApp(appRoot, preparedRoot, origin, moduleRootOverride) {
85280
+ async function oneSDKLinkSources(appRoot, preparedRoot) {
85182
85281
  const selected = await selectOneSDK(appRoot);
85183
85282
  if (!selected) throw new Error("prepared app has no One SDK imports");
85184
85283
  const { one, frameworks } = selected;
@@ -85193,6 +85292,35 @@ async function compilePreparedOneSDKApp(appRoot, preparedRoot, origin, moduleRoo
85193
85292
  throw new Error(
85194
85293
  "prepared One SDK sources differ from the installed facades or app imports"
85195
85294
  );
85295
+ const targets = /* @__PURE__ */ new Map();
85296
+ targets.set("Sources/One/One.swift", oneSDKModule);
85297
+ for (const source of [
85298
+ "SDK/OneSDKRuntime.swift",
85299
+ "OneNativeUIKitHostView.swift",
85300
+ "OneNativeContent.swift",
85301
+ "OneNativeAccessibility.swift",
85302
+ "SDKViews/OneNativeViewsTable.swift"
85303
+ ])
85304
+ targets.set(
85305
+ `Sources/One/${import_node_path99.default.basename(source)}`,
85306
+ import_node_fs100.default.readFileSync(import_node_path99.default.join(one, "ios", source), "utf8")
85307
+ );
85308
+ for (const name3 of generated.files)
85309
+ targets.set(
85310
+ `Sources/OneSDKBindings/${name3}`,
85311
+ import_node_fs100.default.readFileSync(import_node_path99.default.join(sourceRoot, name3), "utf8")
85312
+ );
85313
+ return {
85314
+ targets,
85315
+ entry: /* @__PURE__ */ new Map([
85316
+ ["OneSDKHost.swift", oneSDKHost],
85317
+ ["OneSDKTransport.swift", oneSDKTransport]
85318
+ ]),
85319
+ modules: frameworks.map((name3) => `${name3}_${generated.generation}`)
85320
+ };
85321
+ }
85322
+ async function compilePreparedOneSDKApp(appRoot, preparedRoot, origin, moduleRootOverride) {
85323
+ const sources = await oneSDKLinkSources(appRoot, preparedRoot);
85196
85324
  const moduleRoot = moduleRootOverride ?? (await resolveSwiftModule()).root;
85197
85325
  const packagePath = import_node_path99.default.join(
85198
85326
  swiftCacheDir(),
@@ -85212,25 +85340,9 @@ let package = Package(name: "OneSDKGuest", targets: [
85212
85340
  ])
85213
85341
  `
85214
85342
  );
85215
- files2.set("Sources/One/One.swift", oneSDKModule);
85216
- for (const source of [
85217
- "SDK/OneSDKRuntime.swift",
85218
- "OneNativeUIKitHostView.swift",
85219
- "OneNativeContent.swift",
85220
- "OneNativeAccessibility.swift",
85221
- "SDKViews/OneNativeViewsTable.swift"
85222
- ])
85223
- files2.set(
85224
- `Sources/One/${import_node_path99.default.basename(source)}`,
85225
- import_node_fs100.default.readFileSync(import_node_path99.default.join(one, "ios", source), "utf8")
85226
- );
85227
- for (const name3 of generated.files)
85228
- files2.set(
85229
- `Sources/OneSDKBindings/${name3}`,
85230
- import_node_fs100.default.readFileSync(import_node_path99.default.join(sourceRoot, name3), "utf8")
85231
- );
85343
+ for (const [name3, source] of sources.targets) files2.set(name3, source);
85344
+ for (const [name3, source] of sources.entry) files2.set(`Sources/App/${name3}`, source);
85232
85345
  files2.set("Sources/App/App.swift", oneSDKApp);
85233
- files2.set("Sources/App/Transport.swift", oneSDKTransport);
85234
85346
  import_node_fs100.default.mkdirSync(packagePath, { recursive: true });
85235
85347
  syncSwiftTree(
85236
85348
  packagePath,
@@ -85238,6 +85350,7 @@ let package = Package(name: "OneSDKGuest", targets: [
85238
85350
  );
85239
85351
  const project2 = projectFor(packagePath);
85240
85352
  project2.oneModule = false;
85353
+ project2.optimize = true;
85241
85354
  const artifact = await artifactFor(project2, "Sources/App/App.swift", moduleRoot);
85242
85355
  const metadata = {
85243
85356
  url: `${origin}/__peach/swift/${artifact.hash}.wasm`,
@@ -85245,7 +85358,7 @@ let package = Package(name: "OneSDKGuest", targets: [
85245
85358
  icuUrl: icuUrl(origin, artifact),
85246
85359
  rootId: `one-sdk-${artifact.hash.slice(0, 16)}`,
85247
85360
  bundleFiles: artifact.package.bundleFiles.files,
85248
- modules: frameworks.map((name3) => `${name3}_${generated.generation}`)
85361
+ modules: sources.modules
85249
85362
  };
85250
85363
  return { metadata, artifact };
85251
85364
  }
@@ -85278,7 +85391,7 @@ var init_one_sdk_bundle = __esm({
85278
85391
  var runtime_companion_default;
85279
85392
  var init_runtime_companion = __esm({
85280
85393
  "runtime-companion.json"() {
85281
- runtime_companion_default = { abi: 1, sha256: "c5311b24d34f15e1e93e1e7fc426600404705562e03ce05c7c359e341afc75cd", file: "node/cli-c5311b24d34f15e1e93e1e7fc426600404705562e03ce05c7c359e341afc75cd.cjs" };
85394
+ runtime_companion_default = { abi: 1, sha256: "d1826a4d4d05c87a157d5b160177de9cd6f1fd10a3d142804a92a0d57ff3060f", file: "node/cli-d1826a4d4d05c87a157d5b160177de9cd6f1fd10a3d142804a92a0d57ff3060f.cjs" };
85282
85395
  }
85283
85396
  });
85284
85397
 
@@ -95257,7 +95370,11 @@ function entrySource(ids) {
95257
95370
  "",
95258
95371
  "@OptIn(kotlin.js.ExperimentalJsExport::class)",
95259
95372
  "@JsExport",
95260
- "fun peachSetAndroidBuildInfo(model: String, release: String, apiLevel: Int) = Build.setDevice(model, release, apiLevel)",
95373
+ "fun peachSetAndroidDeviceInfo(model: String, release: String, apiLevel: Int, locale: String, timeZone: String) {",
95374
+ " Build.setDevice(model, release, apiLevel)",
95375
+ " java.util.Locale.setDefault(java.util.Locale.forLanguageTag(locale))",
95376
+ " java.util.TimeZone.setDevice(timeZone)",
95377
+ "}",
95261
95378
  "",
95262
95379
  "@OptIn(kotlin.js.ExperimentalJsExport::class, kotlinx.coroutines.DelicateCoroutinesApi::class)",
95263
95380
  "@JsExport",
@@ -95624,8 +95741,12 @@ async function expoKotlinArtifact(root, moduleRoot, origin, modules) {
95624
95741
  " ))",
95625
95742
  "}",
95626
95743
  "",
95627
- "@JsExport fun peachSetAndroidBuildInfo(model: String, release: String, apiLevel: Int) =",
95744
+ "@JsExport fun peachSetAndroidDeviceInfo(model: String, release: String, apiLevel: Int, locale: String, timeZone: String) {",
95628
95745
  " android.os.Build.setDevice(model, release, apiLevel)",
95746
+ " java.util.Locale.setDefault(java.util.Locale.forLanguageTag(locale))",
95747
+ " java.util.TimeZone.setDevice(timeZone)",
95748
+ " PeachExpoRuntime.configureProcessLocale(locale)",
95749
+ "}",
95629
95750
  "",
95630
95751
  "@JsExport fun peachExpoListen(notify: () -> Unit) {",
95631
95752
  " registered",
@@ -113198,6 +113319,17 @@ function bundleUrlOf(urlStr) {
113198
113319
  }
113199
113320
  async function buildShellUrl(target, baseUrl = resolveDefaultShellBaseUrl(), opts = {}) {
113200
113321
  const resolved = await resolveShellUrl(target, baseUrl, opts);
113322
+ const supplied = new URL(resolved);
113323
+ if (!opts.project && looksLikeSootsimUrl(target) && [
113324
+ LAUNCH_METADATA_QUERY_PARAM,
113325
+ "oneSDK",
113326
+ "expoSwift",
113327
+ "expoWidgets",
113328
+ "nitro",
113329
+ "turbo",
113330
+ "expoKotlin"
113331
+ ].some((key2) => supplied.searchParams.has(key2)))
113332
+ return applyShellLaunchOptions(supplied, opts).toString();
113201
113333
  const project2 = opts.offline ? opts.project : opts.project ?? await resolveAppProjectForBundleUrl(bundleUrlOf(resolved));
113202
113334
  const expoRoot = project2?.appDir ?? null;
113203
113335
  const world = resolveBridgeWorld();
@@ -113307,9 +113439,6 @@ async function buildShellUrl(target, baseUrl = resolveDefaultShellBaseUrl(), opt
113307
113439
  const manifest = "config" in expoConfigRead ? stageBuiltBundleManifest(stampedBundle, expoConfigRead.config) : null;
113308
113440
  if (manifest) expoStamped.searchParams.set("appManifest", manifest);
113309
113441
  }
113310
- if (opts.bundleOriginOverride)
113311
- expoStamped.searchParams.set("bundleOriginOverride", opts.bundleOriginOverride);
113312
- if (opts.hostDriver) expoStamped.searchParams.set("peachHostDriver", opts.hostDriver);
113313
113442
  if (expoRoot && !opts.offline) {
113314
113443
  if (packageVersions?.["expo-widgets"])
113315
113444
  expoStamped.searchParams.set(
@@ -113338,9 +113467,16 @@ async function buildShellUrl(target, baseUrl = resolveDefaultShellBaseUrl(), opt
113338
113467
  `${nativeAssetOrigin}/__peach/expo-kotlin?root=${encodeURIComponent(expoRoot)}`
113339
113468
  );
113340
113469
  }
113341
- if (!opts.device && !opts.proof && !opts.ephemeral && !opts.posture && !opts.renderResolution && opts.predictiveText === void 0 && !opts.orientation && !opts.osVersion && !opts.theme && !opts.env?.length && !opts.args?.length && !opts.dotEnv)
113342
- return opts.offline ? expoStamped.toString() : stageHostLaunchMetadata(expoStamped, nativeAssetOrigin);
113343
- const url = expoStamped;
113470
+ const url = applyShellLaunchOptions(expoStamped, opts);
113471
+ return opts.offline ? url.toString() : stageHostLaunchMetadata(url, nativeAssetOrigin);
113472
+ }
113473
+ function applyShellLaunchOptions(url, opts) {
113474
+ const bundle = url.searchParams.get("bundle");
113475
+ if (bundle && opts.hot !== void 0)
113476
+ url.searchParams.set("bundle", applyHotMode(bundle, opts.hot));
113477
+ if (opts.bundleOriginOverride)
113478
+ url.searchParams.set("bundleOriginOverride", opts.bundleOriginOverride);
113479
+ if (opts.hostDriver) url.searchParams.set("peachHostDriver", opts.hostDriver);
113344
113480
  if (opts.dotEnv) url.searchParams.set("dotEnv", JSON.stringify(opts.dotEnv));
113345
113481
  if (opts.device) url.searchParams.set("device", opts.device);
113346
113482
  if (opts.posture) url.searchParams.set("posture", opts.posture);
@@ -113360,7 +113496,7 @@ async function buildShellUrl(target, baseUrl = resolveDefaultShellBaseUrl(), opt
113360
113496
  if (opts.ephemeral) url.searchParams.set("ephemeral", "1");
113361
113497
  for (const entry of opts.env ?? []) url.searchParams.append("env", entry);
113362
113498
  for (const entry of opts.args ?? []) url.searchParams.append("arg", entry);
113363
- return opts.offline ? url.toString() : stageHostLaunchMetadata(url, nativeAssetOrigin);
113499
+ return url;
113364
113500
  }
113365
113501
  var import_node_fs134, import_node_os24, import_node_path136, SHELL_APPS, DEV_BUNDLE_RESOLVE_ATTEMPTS, DEV_BUNDLE_RESOLVE_INTERVAL_MS, startedExpoConfigReads;
113366
113502
  var init_shell_url = __esm({
@@ -113383,6 +113519,7 @@ var init_shell_url = __esm({
113383
113519
  init_loopback_ports();
113384
113520
  init_staged_host_files();
113385
113521
  init_installed_package_versions();
113522
+ init_launchMetadataContract();
113386
113523
  init_metro_project_root();
113387
113524
  init_native_app_identity();
113388
113525
  init_native_app_identity_project();
@@ -125013,9 +125150,7 @@ function getFramedScreenshotLayout(model) {
125013
125150
  housingLayers,
125014
125151
  // the housing paints its own body layer, shadow included: its frame box is
125015
125152
  // wider than the body, because the hinge barrel protrudes past the spine.
125016
- frameBackground: isLegacyHardware ? "linear-gradient(180deg, #1b1c20 0%, #0f1012 42%, #050608 100%)" : housingLayers ? "transparent" : "#000000",
125017
125153
  frameOutline: isLegacyHardware ? "0 0 0 1px #1f2125" : housingLayers ? "none" : "0 0 0 1px #333",
125018
- metallicRingShadow: isLegacyHardware || housingLayers ? null : METALLIC_RING_SHADOW,
125019
125154
  buttons,
125020
125155
  legacyHomeButton: isLegacyHardware ? {
125021
125156
  top: getCliRuntime().ios_chrome_metrics.LEGACY_TOP_BEZEL + spec.height + (getCliRuntime().ios_chrome_metrics.LEGACY_BOTTOM_BEZEL - getCliRuntime().ios_chrome_metrics.LEGACY_HOME_BUTTON_SIZE) / 2,
@@ -125027,86 +125162,18 @@ function getFramedScreenshotLayout(model) {
125027
125162
  logicalHomeIndicatorStripHeight: spec.homeIndicatorHeight
125028
125163
  };
125029
125164
  }
125030
- function renderSideButtonHtml(button) {
125031
- const isRight = button.side === "right";
125032
- const isBottom = button.side === "bottom";
125033
- const horizontal = button.side === "top" || isBottom;
125034
- const clip = horizontal ? isBottom ? "inset(0 -3px -3px -3px)" : "inset(-3px -3px 0 -3px)" : isRight ? "inset(-3px -3px -3px 0)" : "inset(-3px 0 -3px -3px)";
125035
- return `
125036
- <div
125037
- aria-hidden="true"
125038
- style="
125039
- position:absolute;
125040
- ${horizontal ? `left:${button.top}px;${isBottom ? `bottom:-${button.width}px;` : `top:-${button.width}px;`}` : `${isRight ? `right:-${button.width}px;` : `left:-${button.width}px;`}top:${button.top}px;`}
125041
- width:${horizontal ? button.height : button.width}px;
125042
- height:${horizontal ? button.width : button.height}px;
125043
- background-color:#212121;
125044
- border-top-left-radius:${isRight || isBottom ? 0 : 1.5}px;
125045
- border-bottom-left-radius:${isRight || button.side === "top" ? 0 : 1.5}px;
125046
- border-top-right-radius:${button.side === "left" || isBottom ? 0 : 1.5}px;
125047
- border-bottom-right-radius:${button.side === "left" || button.side === "top" ? 0 : 1.5}px;
125048
- box-shadow:
125049
- inset 0 0.5px 0 #616161,
125050
- inset 0 -0.5px 0 #3F3F3F,
125051
- ${isRight ? "inset -0.5px 0 0 #3F3F3F," : "inset 0.5px 0 0 #3F3F3F,"}
125052
- 0 0 0 0.5px #676767,
125053
- 0 0 0 1.5px #000;
125054
- clip-path:${clip};
125055
- pointer-events:none;
125056
- z-index:2;
125057
- "
125058
- ></div>
125059
- `;
125060
- }
125061
125165
  function renderFrameHtml(layout2, rawImageDataUrl) {
125062
- const buttonsHtml = layout2.buttons.map(renderSideButtonHtml).join("");
125063
- const ringHtml = layout2.metallicRingShadow ? `
125064
- <div
125065
- aria-hidden="true"
125066
- style="
125067
- position:absolute;
125068
- inset:0;
125069
- border-radius:${getCliRuntime().settings_devices.formatCornerRadii(layout2.logicalFrameRadius)};
125070
- box-shadow:${layout2.metallicRingShadow};
125071
- pointer-events:none;
125072
- z-index:10;
125073
- "
125074
- ></div>
125075
- ` : "";
125166
+ const painter = getCliRuntime().ios_frame_svg;
125167
+ const paintSpec = {
125168
+ width: layout2.logicalFrameWidth,
125169
+ height: layout2.logicalFrameHeight,
125170
+ radii: layout2.logicalFrameRadius,
125171
+ body: layout2.legacyHomeButton ? "legacy" : layout2.housingLayers ? null : "solid",
125172
+ ring: layout2.legacyHomeButton || layout2.housingLayers ? null : painter.METALLIC_RING,
125173
+ buttons: layout2.buttons.filter((button) => button.height > 0).map((button) => ({ ...button, hover: 0 })),
125174
+ home: layout2.legacyHomeButton
125175
+ };
125076
125176
  const housingHtml = (layout2.housingLayers ?? []).map(getCliRuntime().ios_duo_housing.housingLayerHtml).join("");
125077
- const legacyHomeButtonHtml = layout2.legacyHomeButton ? `
125078
- <div
125079
- aria-hidden="true"
125080
- style="
125081
- position:absolute;
125082
- top:${layout2.legacyHomeButton.top}px;
125083
- left:${layout2.legacyHomeButton.left}px;
125084
- width:${layout2.legacyHomeButton.size}px;
125085
- height:${layout2.legacyHomeButton.size}px;
125086
- border-radius:50%;
125087
- background:
125088
- radial-gradient(circle at 35% 32%, rgba(62,64,68,0.35) 0%, rgba(17,18,20,0.98) 72%, rgba(8,9,11,1) 100%);
125089
- box-shadow:
125090
- inset 0 0 0 1px rgba(255,255,255,0.06),
125091
- inset 0 0 0 ${layout2.legacyHomeButton.ring}px rgba(184,192,204,0.45),
125092
- 0 0 0 1px rgba(0,0,0,0.5);
125093
- z-index:3;
125094
- pointer-events:none;
125095
- display:flex;
125096
- align-items:center;
125097
- justify-content:center;
125098
- "
125099
- >
125100
- <div
125101
- style="
125102
- width:16px;
125103
- height:16px;
125104
- border-radius:4px;
125105
- box-shadow:inset 0 0 0 1.5px rgba(188,194,202,0.5);
125106
- "
125107
- ></div>
125108
- </div>
125109
- ` : "";
125110
125177
  const homeIndicatorHtml = layout2.showHomeIndicator ? `
125111
125178
  <div
125112
125179
  aria-hidden="true"
@@ -125190,14 +125257,11 @@ function renderFrameHtml(layout2, rawImageDataUrl) {
125190
125257
  border-radius:${layout2.housingLayers ? "0" : getCliRuntime().settings_devices.formatCornerRadii(layout2.logicalFrameRadius)};
125191
125258
  box-sizing:border-box;
125192
125259
  overflow:visible;
125193
- background:${layout2.frameBackground};
125194
125260
  box-shadow:${layout2.frameOutline};
125195
125261
  "
125196
125262
  >
125197
- ${buttonsHtml}
125198
- ${ringHtml}
125263
+ ${painter.frameSvg(paintSpec)}
125199
125264
  ${housingHtml}
125200
- ${legacyHomeButtonHtml}
125201
125265
  <div
125202
125266
  id="screen"
125203
125267
  style="
@@ -125275,7 +125339,7 @@ async function createFramedScreenshotComposer(browser) {
125275
125339
  }
125276
125340
  };
125277
125341
  }
125278
- var METALLIC_RING_SHADOW, FRAME_OUTLINE_BLEED;
125342
+ var FRAME_OUTLINE_BLEED;
125279
125343
  var init_frame_compose = __esm({
125280
125344
  "src/screenshots/frame-compose.ts"() {
125281
125345
  "use strict";
@@ -125283,7 +125347,6 @@ var init_frame_compose = __esm({
125283
125347
  init_playwright_provisioning();
125284
125348
  init_cli_runtime();
125285
125349
  init_device_catalog();
125286
- METALLIC_RING_SHADOW = "inset 0 0 0 0.5px #000, inset 0 0 0 2px #757575, inset 0 0 0 5px #212121";
125287
125350
  FRAME_OUTLINE_BLEED = 1;
125288
125351
  }
125289
125352
  });