peachsim 0.1.2433 → 0.1.2435

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 (97) hide show
  1. package/cli/app-project.ts +5 -0
  2. package/cli/commands/box.ts +3 -0
  3. package/cli/commands/control.ts +14 -6
  4. package/cli/commands/platform.ts +3 -3
  5. package/cli/commands/stream.ts +8 -1
  6. package/dist-lib/agent-daemon-client.cjs +1 -1
  7. package/dist-lib/agent-events.cjs +1 -1
  8. package/dist-lib/attached-projects.cjs +1 -1
  9. package/dist-lib/auth/shared-session.cjs +1 -1
  10. package/dist-lib/backend-origin.cjs +1 -1
  11. package/dist-lib/beta.cjs +1 -1
  12. package/dist-lib/beta.mjs +1 -1
  13. package/dist-lib/bridge-constants.cjs +1 -1
  14. package/dist-lib/bridge-contract-input.cjs +1 -1
  15. package/dist-lib/bridge-contract-input.mjs +1 -1
  16. package/dist-lib/bridge-contract.cjs +1 -1
  17. package/dist-lib/bridge-contract.mjs +1 -1
  18. package/dist-lib/bundle-channel.cjs +109 -38
  19. package/dist-lib/capture-contract.cjs +1 -1
  20. package/dist-lib/capture-contract.mjs +1 -1
  21. package/dist-lib/cloud-contract.cjs +1 -1
  22. package/dist-lib/cloud-contract.mjs +1 -1
  23. package/dist-lib/cloud-test-args.cjs +1 -1
  24. package/dist-lib/cloud-test-args.mjs +1 -1
  25. package/dist-lib/cloud.cjs +1 -1
  26. package/dist-lib/cloud.mjs +1 -1
  27. package/dist-lib/config.cjs +1 -1
  28. package/dist-lib/config.mjs +1 -1
  29. package/dist-lib/detox/index.cjs +1 -1
  30. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  31. package/dist-lib/expo-swift-bundle.cjs +99 -28
  32. package/dist-lib/expo-swift-metadata.cjs +1 -1
  33. package/dist-lib/expo-swift-metadata.mjs +1 -1
  34. package/dist-lib/home-paths.cjs +1 -1
  35. package/dist-lib/host/bridge-host.cjs +100 -29
  36. package/dist-lib/host/fetch-proxy-handler.cjs +4 -3
  37. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  38. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  39. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  40. package/dist-lib/host/websocket-proxy.cjs +1 -1
  41. package/dist-lib/index.cjs +15 -6
  42. package/dist-lib/jump-to-source-babel.cjs +1 -1
  43. package/dist-lib/jump-to-source-native.cjs +1 -1
  44. package/dist-lib/kotlin-host.cjs +1 -1
  45. package/dist-lib/menu.cjs +1 -1
  46. package/dist-lib/menu.mjs +1 -1
  47. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  48. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  49. package/dist-lib/metro-production-bundle.cjs +1 -1
  50. package/dist-lib/metro-production-bundle.mjs +1 -1
  51. package/dist-lib/metro.cjs +15 -6
  52. package/dist-lib/native-app-identity-project.cjs +13 -5
  53. package/dist-lib/native-app-identity-project.mjs +13 -5
  54. package/dist-lib/native-app-identity.cjs +1 -1
  55. package/dist-lib/native-app-identity.mjs +1 -1
  56. package/dist-lib/native-firebase-metadata.cjs +1 -1
  57. package/dist-lib/native-firebase-metadata.mjs +1 -1
  58. package/dist-lib/pdfium-raster.cjs +1 -1
  59. package/dist-lib/pdfium-raster.mjs +1 -1
  60. package/dist-lib/plist.cjs +1 -1
  61. package/dist-lib/plist.mjs +1 -1
  62. package/dist-lib/profiles.cjs +1 -1
  63. package/dist-lib/public-brand.cjs +1 -1
  64. package/dist-lib/public-origins-lib-esm.json +25 -25
  65. package/dist-lib/public-origins-lib.json +56 -56
  66. package/dist-lib/react-native-host-modules.cjs +1 -1
  67. package/dist-lib/react-native-host-modules.mjs +1 -1
  68. package/dist-lib/reap-browser.cjs +1 -1
  69. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  70. package/dist-lib/sdk.cjs +1 -1
  71. package/dist-lib/sdk.mjs +1 -1
  72. package/dist-lib/skills.cjs +122 -39
  73. package/dist-lib/swift-compile.cjs +78 -25
  74. package/dist-lib/swift-compile.mjs +78 -25
  75. package/dist-lib/swift-package.cjs +1 -1
  76. package/dist-lib/swift-package.mjs +1 -1
  77. package/dist-lib/swift-submit.cjs +1 -1
  78. package/dist-lib/swift-submit.mjs +1 -1
  79. package/dist-lib/swift-toolchain.cjs +1 -1
  80. package/dist-lib/swift.cjs +1 -1
  81. package/dist-lib/vite-swift.cjs +101 -31
  82. package/dist-lib/vite.cjs +4 -3
  83. package/dist-lib/worklet-executable.cjs +1 -1
  84. package/dist-lib/worklet-executable.mjs +1 -1
  85. package/dist-types/packages/peach-engine/src/engine/node.d.ts +1 -0
  86. package/dist-types/packages/peach-engine/src/ios/apps/canvas-map-data.d.ts +2 -2
  87. package/kotlin/sdk.tar.gz +0 -0
  88. package/package.json +1 -1
  89. package/src/bazel-project.ts +11 -3
  90. package/src/react-native-coverage/native-typescript-parser.ts +29 -1
  91. package/src/swift-compile.ts +49 -5
  92. package/src/swift-guest-image-ledger.ts +15 -12
  93. package/src/swift-guest-link.ts +13 -2
  94. package/src/swift-guest-source-inputs.ts +5 -1
  95. package/src/swift-host.ts +12 -0
  96. package/src/swift-submit.ts +2 -0
  97. package/src/swift-wasm-prune.ts +8 -3
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2433 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2435 | (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;
@@ -10038,9 +10038,9 @@ var init_registry = __esm({
10038
10038
  {
10039
10039
  range: ">=7.0.0",
10040
10040
  coverage: 0.82,
10041
- note: "native-seam only \u2014 the real upstream index.ts (an async wrapper around `NativeModules.Contacts ?? TurboModuleRegistry.get('RCTContacts')`) runs from the bundle. sootsim provides a deterministic in-memory address book against the Contacts TurboModule (every consumer method delegates here): add/update/delete operate on an in-process Map keyed by recordID; getContactsByPhoneNumber/Email/MatchingString filter that store; checkPermission/requestPermission use the shared app-scoped system permission registry; the groups subsurface (addGroup/getGroup/contactsInGroup/etc.) is wired against an in-process group store so consumers can exercise the full membership round-trip.",
10042
- working: "real upstream JS wrapper running from the bundle, getAll/getAllWithoutPhotos, getContactById, getContactsByPhoneNumber/Email/MatchingString, getCount, getPhotoForId, addContact/openContactForm/openExistingContact/viewExistingContact/editExistingContact/updateContact/deleteContact, writePhotoToPath, iosEnableNotesUsage, checkPermission/requestPermission, getGroups/getGroup/addGroup/updateGroup/deleteGroup/contactsInGroup/addContactsToGroup/removeContactsFromGroup",
10043
- missing: "real OS contacts database access (no browser AddressBook API), native iOS/Android contacts UI for openContactForm presentation, thumbnail photo writing to disk, container/source routing"
10041
+ note: "The published JavaScript uses the Contacts native module, backed by a local address book and the shared permission registry.",
10042
+ working: "list, find, count, add, update and delete local contacts, read thumbnail paths, check and request permission, manage groups and membership",
10043
+ missing: "OS contacts database access, contact forms and cards, thumbnail file writes, iOS Notes entitlement and container routing"
10044
10044
  }
10045
10045
  ]
10046
10046
  },
@@ -13434,10 +13434,9 @@ var init_registry = __esm({
13434
13434
  versions: [
13435
13435
  {
13436
13436
  range: ">=0.6.0",
13437
- coverage: 0.3,
13438
- note: "native-seam only: RNWhisper.install() mounts all fourteen JSI bindings so the package's own JS runs, but transcripts come from the host speech recognizer instead of a whisper model",
13439
- working: "package load and JSI binding handshake, getConstants, context and VAD context init/release lifecycle, transcribeFile/transcribeData resolving TranscribeResult shapes, onProgress and onNewSegments callbacks, abortTranscribe, bench, toggleNativeLog, and RealtimeTranscriber delivering real text through the browser SpeechRecognition API",
13440
- missing: "no whisper.cpp/ggml runtime, so the declared model file is never loaded \u2014 no CoreML or GPU acceleration, model-derived segment timings, token timestamps, tinydiarize, beam/temperature decoding options, language auto-detect, or real VAD speech probabilities"
13437
+ coverage: 0,
13438
+ note: "RNWhisper.install() resolves false and the published wrapper reports that JSI bindings are unavailable",
13439
+ missing: "whisper.cpp and ggml model loading, transcription, Parakeet, voice activity detection, and benchmarks"
13441
13440
  }
13442
13441
  ]
13443
13442
  },
@@ -30251,6 +30250,10 @@ var init_expo_eager_seam_contract = __esm({
30251
30250
  });
30252
30251
 
30253
30252
  // cli/app-project.ts
30253
+ function appNameFromPath(pathOrUrl) {
30254
+ const segment2 = pathOrUrl.split(/[?#]/)[0]?.split(/[/\\]/).filter(Boolean).at(-1) ?? "";
30255
+ return segment2.replace(/\.[^.]+$/, "");
30256
+ }
30254
30257
  function firstNamedFile(dir, names) {
30255
30258
  for (const name3 of names) {
30256
30259
  const candidate = import_node_path7.default.join(dir, name3);
@@ -59972,8 +59975,10 @@ function bazelGraph(root, label, configuration) {
59972
59975
  );
59973
59976
  const deps = app2.attrs.get("deps")?.list ?? [];
59974
59977
  if (deps.length === 0) throw new Error(`${label} links no libraries`);
59978
+ const strings7 = app2.attrs.get("strings")?.list ?? [];
59975
59979
  const infoplists = app2.attrs.get("infoplists")?.list ?? [];
59976
- const query = `kind("${QUERIED_RULES.join("|")}", deps(set(${deps.join(" ")})))${infoplists.length > 0 ? ` + set(${infoplists.join(" ")})` : ""}`;
59980
+ const roots = [...deps, ...strings7];
59981
+ const query = `kind("${QUERIED_RULES.join("|")}", deps(set(${roots.join(" ")})))${infoplists.length > 0 ? ` + set(${infoplists.join(" ")})` : ""}`;
59977
59982
  const output2 = run12(["cquery", query, ...flags, "--output=jsonproto"]);
59978
59983
  const defaults = run12([
59979
59984
  "cquery",
@@ -60350,8 +60355,14 @@ ${published3.map(
60350
60355
  graph.app.attrs.get("infoplists")?.list ?? [],
60351
60356
  graph.app.label
60352
60357
  );
60358
+ const strings7 = files2.expand(
60359
+ graph.app.attrs.get("strings")?.list ?? [],
60360
+ graph.app.label
60361
+ );
60362
+ resources.push(...strings7);
60353
60363
  const absent = () => [
60354
60364
  ...infoPlistFiles,
60365
+ ...strings7,
60355
60366
  ...[...frameworks, appModule].flatMap((module2) => [
60356
60367
  ...module2.allSources,
60357
60368
  ...module2.objc?.headers ?? []
@@ -60395,7 +60406,7 @@ ${published3.map(
60395
60406
  const missing2 = options.requireSources === false ? [] : absent();
60396
60407
  if (missing2.length > 0)
60397
60408
  throw new Error(
60398
- `bazel generates ${missing2.length} sources this app compiles that are not built: ${missing2.slice(0, 5).map((file) => import_node_path45.default.relative(root, file)).join(", ")}`
60409
+ `bazel application has ${missing2.length} unbuilt inputs: ${missing2.slice(0, 5).map((file) => import_node_path45.default.relative(root, file)).join(", ")}`
60399
60410
  );
60400
60411
  const archives = /* @__PURE__ */ new Map();
60401
60412
  for (const rule of order) {
@@ -60703,7 +60714,7 @@ var init_bazel_project = __esm({
60703
60714
  HEADER3 = /\.(?:h|hh|hpp|hxx|inc|inl|ipp)$/;
60704
60715
  PRODUCTS = import_node_path45.default.join(".build", "peach-bazel", "Products");
60705
60716
  graphs = /* @__PURE__ */ new Map();
60706
- GRAPH_FORMAT = 4;
60717
+ GRAPH_FORMAT = 6;
60707
60718
  BazelFiles = class {
60708
60719
  constructor(graph, root) {
60709
60720
  this.graph = graph;
@@ -69941,7 +69952,11 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
69941
69952
  const def = definedGlobalSyms.get(symName);
69942
69953
  if (def) activateSymbolInObj(def.obj, def.symIdx);
69943
69954
  }
69944
- for (const symName of ["__peach_dlsym_from_image", "__peach_dlerror"]) {
69955
+ for (const symName of [
69956
+ "__peach_dlsym_from_image",
69957
+ "__peach_dlerror",
69958
+ ...link ? ["_dyld_register_func_for_add_image"] : []
69959
+ ]) {
69945
69960
  const provider = lazyProviders.get(symName)?.[0];
69946
69961
  if (provider) extractObject(provider);
69947
69962
  const def = definedGlobalSyms.get(symName);
@@ -70591,7 +70606,7 @@ function readString(bytes, position) {
70591
70606
  const [length, start] = readNumber(bytes, position);
70592
70607
  if (start + length > bytes.length) throw new Error("invalid wasm string");
70593
70608
  return [
70594
- Buffer.from(bytes.subarray(start, start + length)).toString("utf8"),
70609
+ Buffer.from(bytes.buffer, bytes.byteOffset + start, length).toString("utf8"),
70595
70610
  start + length
70596
70611
  ];
70597
70612
  }
@@ -70616,7 +70631,7 @@ function llvmType(value) {
70616
70631
  function rewriteObject(bytes, names, callerAlias, binding, instrumentDynamicLookups, preserveCanonical) {
70617
70632
  if (Buffer.from(bytes.subarray(0, 8)).toString("hex") !== "0061736d01000000")
70618
70633
  throw new Error("expected wasm object");
70619
- const sections2 = [Buffer.from(bytes.subarray(0, 8))];
70634
+ const sections2 = binding ? [Buffer.from(bytes.subarray(0, 8))] : void 0;
70620
70635
  const types = [];
70621
70636
  const functionTypes = [];
70622
70637
  const definitions = [];
@@ -70630,8 +70645,9 @@ function rewriteObject(bytes, names, callerAlias, binding, instrumentDynamicLook
70630
70645
  const [size2, start] = readNumber(bytes, position);
70631
70646
  const end = start + size2;
70632
70647
  if (end > bytes.length) throw new Error("invalid wasm section");
70633
- let section = Buffer.from(bytes.subarray(start, end));
70634
70648
  position = end;
70649
+ if (!sections2 && id > 3) continue;
70650
+ let section = Buffer.from(bytes.buffer, bytes.byteOffset + start, size2);
70635
70651
  let offset = 0;
70636
70652
  const number4 = () => {
70637
70653
  const [value, next] = readNumber(section, offset);
@@ -70659,7 +70675,7 @@ function rewriteObject(bytes, names, callerAlias, binding, instrumentDynamicLook
70659
70675
  }
70660
70676
  } else if (id === 2) {
70661
70677
  const count = number4();
70662
- const imports2 = [encodeNumber(count)];
70678
+ const imports2 = sections2 ? [encodeNumber(count)] : void 0;
70663
70679
  for (let i = 0; i < count; i++) {
70664
70680
  const module2 = string7();
70665
70681
  const name3 = string7();
@@ -70703,17 +70719,17 @@ function rewriteObject(bytes, names, callerAlias, binding, instrumentDynamicLook
70703
70719
  }
70704
70720
  if (isDlsym) usesDlsym = true;
70705
70721
  if (isDlerror) usesDlerror = true;
70706
- imports2.push(
70722
+ imports2?.push(
70707
70723
  encodedString(module2),
70708
70724
  encodedString(
70709
- isDlsym ? callerAlias : isDlerror ? "__peach_dlerror" : module2 === "env" && name3 !== "dlsym" && name3 !== "dlerror" ? binding(name3) ?? name3 : name3
70725
+ isDlsym ? callerAlias : isDlerror ? "__peach_dlerror" : module2 === "env" && name3 !== "dlsym" && name3 !== "dlerror" ? binding?.(name3) ?? name3 : name3
70710
70726
  ),
70711
70727
  Buffer.from([kind]),
70712
70728
  section.subarray(typeStart, offset)
70713
70729
  );
70714
70730
  }
70715
70731
  if (offset !== section.length) throw new Error("invalid wasm import section");
70716
- section = Buffer.concat(imports2);
70732
+ if (imports2) section = Buffer.concat(imports2);
70717
70733
  } else if (id === 3) {
70718
70734
  const count = number4();
70719
70735
  for (let i = 0; i < count; i++) functionTypes.push(number4());
@@ -70797,7 +70813,7 @@ function rewriteObject(bytes, names, callerAlias, binding, instrumentDynamicLook
70797
70813
  encodedString(name3 === "dlsym" ? callerAlias : "__peach_dlerror"),
70798
70814
  section.subarray(nameEnd, offset)
70799
70815
  );
70800
- } else if (flags & 16 && name3 !== "dlsym" && name3 !== "dlerror" && binding(name3) !== void 0) {
70816
+ } else if (flags & 16 && name3 !== "dlsym" && name3 !== "dlerror" && binding?.(name3) !== void 0) {
70801
70817
  entries.push(
70802
70818
  section.subarray(begin, nameStart),
70803
70819
  encodedString(binding(name3)),
@@ -70872,10 +70888,10 @@ function rewriteObject(bytes, names, callerAlias, binding, instrumentDynamicLook
70872
70888
  section = Buffer.concat(parts);
70873
70889
  }
70874
70890
  }
70875
- sections2.push(Buffer.from([id]), encodeNumber(section.length), section);
70891
+ sections2?.push(Buffer.from([id]), encodeNumber(section.length), section);
70876
70892
  }
70877
70893
  return {
70878
- bytes: Buffer.concat(sections2),
70894
+ bytes: sections2 ? Buffer.concat(sections2) : bytes,
70879
70895
  definitions,
70880
70896
  functionImports,
70881
70897
  usesDlsym,
@@ -70931,7 +70947,7 @@ function createGuestImageLedger(input) {
70931
70947
  object8.bytes,
70932
70948
  aliases,
70933
70949
  `__peach_dlsym_caller_${image.id}`,
70934
- () => void 0,
70950
+ void 0,
70935
70951
  object8.instrumentDynamicLookups,
70936
70952
  /* @__PURE__ */ new Set()
70937
70953
  );
@@ -73599,13 +73615,21 @@ function verifyGuestSymbolScopes(options) {
73599
73615
  continue;
73600
73616
  if (!scope2.includes(provider)) {
73601
73617
  const candidates = options.definitionObjects.get(symbol2) ?? /* @__PURE__ */ new Set();
73602
- const providers = [...record5.providers.keys()];
73618
+ const traced = [...record5.providers.keys()];
73619
+ const strongTraced = traced.filter(
73620
+ (definer) => !options.weakDefinitions.get(definer)?.has(symbol2)
73621
+ );
73622
+ const providers = strongTraced.length === 1 ? strongTraced : traced;
73603
73623
  if (options.weakReferences.get(object8)?.has(symbol2) && !providers.some((provider2) => options.systemProviders.has(provider2)))
73604
73624
  continue;
73605
73625
  const equivalentCopies = providers.length === 1 && candidates.has(providers[0]) && [...candidates].every(
73606
73626
  (definer) => options.weakDefinitions.get(definer)?.has(symbol2)
73607
73627
  );
73608
- if (!equivalentCopies && (candidates.size !== 1 || providers.length !== 1 || !candidates.has(providers[0]) || !(options.systemProviders.has(providers[0]) || // a strong undefined reference binds through the process global
73628
+ const strongCandidates = [...candidates].filter(
73629
+ (definer) => !options.weakDefinitions.get(definer)?.has(symbol2)
73630
+ );
73631
+ const soleCandidate = candidates.size === 1 || strongCandidates.length === 1 && strongCandidates[0] === providers[0];
73632
+ if (!equivalentCopies && (!soleCandidate || providers.length !== 1 || !candidates.has(providers[0]) || !(options.systemProviders.has(providers[0]) || // a strong undefined reference binds through the process global
73609
73633
  // scope, the root image and its dependency closure, as in elf.
73610
73634
  provider === 0 || callers.get(0)?.includes(provider) || !options.weakReferences.get(object8)?.has(symbol2) && options.frameworkProviders.get(object8)?.has(providers[0]))))
73611
73635
  throw new Error(
@@ -73867,10 +73891,13 @@ function sourceGuestClangLinkOptions(options) {
73867
73891
  plan,
73868
73892
  JSON.stringify(replays.map(({ compiler, args }) => [compiler, ...args]))
73869
73893
  );
73870
- (0, import_node_child_process30.execFileSync)(process.execPath, ["-e", PARALLEL_REPLAY], {
73894
+ const script = import_node_path59.default.join(options.directory, "clang-link-replay.cjs");
73895
+ (0, import_node_fs62.writeFileSync)(script, PARALLEL_REPLAY);
73896
+ (0, import_node_child_process30.execFileSync)(process.execPath, [script], {
73871
73897
  stdio: "inherit",
73872
73898
  env: {
73873
73899
  ...process.env,
73900
+ [PEACH_FORKED_SCRIPT_ENV]: "1",
73874
73901
  PEACH_CLANG_REPLAYS: plan,
73875
73902
  PEACH_CLANG_JOBS: String(options.jobs)
73876
73903
  }
@@ -74115,6 +74142,7 @@ var init_swift_guest_source_inputs = __esm({
74115
74142
  import_node_crypto31 = require("node:crypto");
74116
74143
  import_node_fs62 = require("node:fs");
74117
74144
  import_node_path59 = __toESM(require("node:path"), 1);
74145
+ init_forked_script_contract();
74118
74146
  init_swift_guest_source_plan();
74119
74147
  init_swift_runtime_products();
74120
74148
  CLANG_TARGET_MODULE_WRAPPER = ".peach-clang";
@@ -77140,6 +77168,8 @@ ${WASM_LOWER_IDENTITY}
77140
77168
  hash.update(JSON.stringify(input.staticClangTargets ?? []));
77141
77169
  hash.update(JSON.stringify(input.headerAliases ?? {}));
77142
77170
  hash.update(JSON.stringify(input.packageGuestImports ?? []));
77171
+ if (input.packageHostMacros?.length)
77172
+ hash.update("package-host-macros\n" + JSON.stringify(input.packageHostMacros));
77143
77173
  if (input.defaultLocalization)
77144
77174
  hash.update(`default-localization
77145
77175
  ${input.defaultLocalization}
@@ -80781,6 +80811,8 @@ function swiftLinkStamp(args) {
80781
80811
  hash.update(`swift-link/v1
80782
80812
  ${args.frameworkKey}
80783
80813
  `);
80814
+ if (args.packageHostMacros?.length)
80815
+ hash.update("package-host-macros\n" + JSON.stringify(args.packageHostMacros));
80784
80816
  if (!args.prebuilt) return hash.digest("hex");
80785
80817
  const statOf = (file) => {
80786
80818
  const stat2 = (0, import_node_fs72.statSync)(file, { bigint: true });
@@ -81005,11 +81037,13 @@ function compileSwiftProjectOnce(input, options) {
81005
81037
  });
81006
81038
  }
81007
81039
  if (options.project) removeProjectLinks(root);
81040
+ const packageHostMacros = process.platform === "linux" ? input.packageHostMacros : void 0;
81008
81041
  if (retireStaleSwiftLink(
81009
81042
  root,
81010
81043
  swiftLinkStamp({
81011
81044
  frameworkKey,
81012
- prebuilt
81045
+ prebuilt,
81046
+ packageHostMacros
81013
81047
  })
81014
81048
  ))
81015
81049
  report("framework revision changed; rebuilding the app link");
@@ -81032,8 +81066,38 @@ function compileSwiftProjectOnce(input, options) {
81032
81066
  ).product.name
81033
81067
  ] : []
81034
81068
  );
81035
- const projectProcess = options.project ? prepareSwiftProjectProcess(root, options.project) : void 0;
81036
81069
  const compiler = preparation.targetToolset ? { CC: import_node_path70.default.join(root, CLANG_TARGET_MODULE_WRAPPER) } : {};
81070
+ if (packageHostMacros?.length) {
81071
+ const swiftc = import_node_path70.default.join(root, SWIFT_HOST_COMPILER_WRAPPER);
81072
+ writeBuildFile(
81073
+ swiftc,
81074
+ [
81075
+ "#!/bin/sh",
81076
+ "target=",
81077
+ "module=",
81078
+ "compile=",
81079
+ "previous=",
81080
+ "for argument do",
81081
+ ' case "$previous" in -target) target=$argument ;; -module-name) module=$argument ;; esac',
81082
+ ' case "$argument" in -c|-emit-module|-scan-dependencies|-typecheck) compile=1 ;; esac',
81083
+ " previous=$argument",
81084
+ "done",
81085
+ 'case "$target/$compile" in',
81086
+ " *-*-linux*/1)",
81087
+ ' case ",$PEACH_SWIFT_HOST_MACROS," in',
81088
+ ' *",$module,"*) set -- "$@" -Xfrontend -import-module -Xfrontend Foundation ;;',
81089
+ " esac ;;",
81090
+ "esac",
81091
+ 'exec "$PEACH_SWIFTC" "$@"',
81092
+ ""
81093
+ ].join("\n")
81094
+ );
81095
+ (0, import_node_fs72.chmodSync)(swiftc, 493);
81096
+ compiler.SWIFT_EXEC = swiftc;
81097
+ compiler.PEACH_SWIFT_HOST_MACROS = packageHostMacros.join(",");
81098
+ compiler.PEACH_SWIFTC = import_node_path70.default.join(options.toolchainBin, "swiftc");
81099
+ }
81100
+ const projectProcess = options.project ? prepareSwiftProjectProcess(root, options.project) : void 0;
81037
81101
  const appOptions = projectProcess ? {
81038
81102
  ...buildOptions,
81039
81103
  uid: projectProcess.uid,
@@ -81388,7 +81452,7 @@ function compileSwiftProjectOnce(input, options) {
81388
81452
  releaseDirectory: import_node_path70.default.dirname(linked),
81389
81453
  moduleRoot: frameworkRoot,
81390
81454
  toolchainBin: options.toolchainBin,
81391
- swiftCompiler: preparation.headerCompiler ? import_node_path70.default.join(root, SWIFT_HEADER_COMPILER_WRAPPER) : import_node_path70.default.join(options.toolchainBin, "swiftc"),
81455
+ swiftCompiler: preparation.headerCompiler ? import_node_path70.default.join(root, SWIFT_HEADER_COMPILER_WRAPPER) : compiler.SWIFT_EXEC ?? import_node_path70.default.join(options.toolchainBin, "swiftc"),
81392
81456
  sysroot: swiftSdkPaths(frameworkRoot, options.toolchainBin).sysroot,
81393
81457
  sdk: swiftModuleSdk(frameworkRoot),
81394
81458
  staticClangTargets: input.staticClangTargets ?? [],
@@ -81426,7 +81490,7 @@ function compileSwiftProjectOnce(input, options) {
81426
81490
  options.signal
81427
81491
  );
81428
81492
  }
81429
- var import_node_child_process37, import_node_crypto35, import_node_fs72, import_node_os15, import_node_path70, v5, WASM_TRIPLE, SWIFTPM_PROGRESS, SWIFTPM_NOISE, REACH_STAGED_FRAMEWORKS, clangInterfaceHeader, objcEnumerations, sdkDeclarationOwners, 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, GAME_FAMILY, gameProducts, gameProduct, GAME_REACH, FOUNDATION_IMPLICIT_MODULES, PRECONCURRENCY_FOUNDATION_IMPORT, FOUNDATION_IMPLICIT_FLAGS, ONE_IMPLICIT_FLAGS, executableLinkFlags, darwinRecordsRegion, REACTOR_FLAG, MULTI_MANIFEST_VERSION, SWIFT_HEADER_PRODUCTS_TARGET, compilerSourceDigest, nativeCxxCompilerFlags, cFlagArray, cxxFlagArray, SWIFTPM_DEFAULT_IOS_DEPLOYMENT_TARGET, DIRECTIVE, OS_IOS, ARCH_ARM64, NOT_ON_IOS, DELEGATE_CLASS, ARM64_MACRO, WASM_MACRO, ARCH_WASM32, C_WORDS, archEnvironments, 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, cPredefineTable, cPredefineCache, SWIFT_SCAN_KEYWORDS, 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;
81493
+ var import_node_child_process37, import_node_crypto35, import_node_fs72, import_node_os15, import_node_path70, v5, WASM_TRIPLE, SWIFTPM_PROGRESS, SWIFTPM_NOISE, REACH_STAGED_FRAMEWORKS, clangInterfaceHeader, objcEnumerations, sdkDeclarationOwners, 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, GAME_FAMILY, gameProducts, gameProduct, GAME_REACH, FOUNDATION_IMPLICIT_MODULES, PRECONCURRENCY_FOUNDATION_IMPORT, FOUNDATION_IMPLICIT_FLAGS, ONE_IMPLICIT_FLAGS, executableLinkFlags, darwinRecordsRegion, REACTOR_FLAG, MULTI_MANIFEST_VERSION, SWIFT_HEADER_PRODUCTS_TARGET, compilerSourceDigest, nativeCxxCompilerFlags, cFlagArray, cxxFlagArray, SWIFTPM_DEFAULT_IOS_DEPLOYMENT_TARGET, DIRECTIVE, OS_IOS, ARCH_ARM64, NOT_ON_IOS, DELEGATE_CLASS, ARM64_MACRO, WASM_MACRO, ARCH_WASM32, C_WORDS, archEnvironments, 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, cPredefineTable, cPredefineCache, SWIFT_SCAN_KEYWORDS, 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_HOST_COMPILER_WRAPPER, SWIFT_FRAMEWORK_SLOTS, SWIFT_FRAMEWORK_SLOT_KEY, SWIFT_FRAMEWORK_SLOT_ORIGIN;
81430
81494
  var init_swift_compile = __esm({
81431
81495
  "src/swift-compile.ts"() {
81432
81496
  "use strict";
@@ -81667,7 +81731,7 @@ int EXUpdatesApplyBSDiffPatch(const char * _Nonnull oldFilePath,
81667
81731
  REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
81668
81732
  MULTI_MANIFEST_VERSION = 72;
81669
81733
  SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
81670
- compilerSourceDigest = true ? "cdc5ec2138bb4a158f783cf86ed87144cd455551e18374805c743783ac04aa46" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
81734
+ compilerSourceDigest = true ? "4a6e02699924195639b15c5cdfd8852b5f17fb2ffacb8f9f964ef3daeee8b9dc" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
81671
81735
  nativeCxxCompilerFlags = ["-fno-cxx-modules"];
81672
81736
  cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
81673
81737
  cxxFlagArray = (flags) => JSON.stringify([...nativeCxxCompilerFlags, ...withoutGlogModuleMap(flags)]);
@@ -82163,6 +82227,7 @@ int EXUpdatesApplyBSDiffPatch(const char * _Nonnull oldFilePath,
82163
82227
  retainedArtifacts = /* @__PURE__ */ new Map();
82164
82228
  FRAMEWORK_LINK_TARGET = "PeachFrameworkLink";
82165
82229
  SWIFT_LINK_STAMP = ".peach-link-stamp";
82230
+ SWIFT_HOST_COMPILER_WRAPPER = ".peach-swiftc";
82166
82231
  SWIFT_FRAMEWORK_SLOTS = 8;
82167
82232
  SWIFT_FRAMEWORK_SLOT_KEY = ".peach-framework-key";
82168
82233
  SWIFT_FRAMEWORK_SLOT_ORIGIN = ".peach-framework-origin";
@@ -88409,7 +88474,7 @@ var init_swift_standin_digest = __esm({
88409
88474
  STANDIN_DIGEST_ENTRYPOINTS = ["swift-standins.ts", "swift-objc-compile.ts"];
88410
88475
  SPECIFIER = /from\s*['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
88411
88476
  standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
88412
- STANDIN_SOURCE_DIGEST = true ? "edbd6d6714a42d5d22c4d8b74e605e5c897358beb450af3e5605c81299e68531" : standinSourceDigest();
88477
+ STANDIN_SOURCE_DIGEST = true ? "2517dacc106de8d2cadefded667b8502b029a35f04f5453646eb48792e0fb55c" : standinSourceDigest();
88413
88478
  }
88414
88479
  });
88415
88480
 
@@ -88904,7 +88969,7 @@ __export(expo_native_prebuilt_exports, {
88904
88969
  servedExpoSwift: () => servedExpoSwift
88905
88970
  });
88906
88971
  function expoNativeCompilerDigestValue() {
88907
- return true ? "92f2e3795e852982bdccd3a73ae36de137f0eb97ab0ada5e0624f164f9c024b8" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
88972
+ return true ? "5f4ceb325a4bf4e4aa833707da1460384624555bbc7a3bed9d973bd2507d8db6" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
88908
88973
  }
88909
88974
  function readSources(value) {
88910
88975
  const sources = isRecord(value) ? value.sources : null;
@@ -101086,6 +101151,13 @@ function packageSnapshot(project2, entry, moduleRoot) {
101086
101151
  ...Object.keys(projectFiles).length > 0 ? { projectFiles } : {},
101087
101152
  ...Object.keys(packageFiles2).length > 0 ? {
101088
101153
  packageFiles: packageFiles2,
101154
+ packageHostMacros: [
101155
+ ...new Set(
101156
+ (layout2?.packages.nativePackages ?? []).flatMap(
101157
+ ({ manifest }) => [...manifest.targets.values()].filter((target) => target.type === "macro").map((target) => swiftTargetModuleName(target.name))
101158
+ )
101159
+ )
101160
+ ].sort(),
101089
101161
  packageGuestImports: [
101090
101162
  ...new Set(
101091
101163
  (layout2?.packages.nativePackages ?? []).flatMap(
@@ -101152,7 +101224,8 @@ function snapshotCompileInput(snapshot) {
101152
101224
  files: snapshot.files,
101153
101225
  ...snapshot.packageFiles ? {
101154
101226
  packageFiles: snapshot.packageFiles,
101155
- packageGuestImports: snapshot.packageGuestImports
101227
+ packageGuestImports: snapshot.packageGuestImports,
101228
+ packageHostMacros: snapshot.packageHostMacros
101156
101229
  } : {},
101157
101230
  ...snapshot.projectFiles ? { projectFiles: snapshot.projectFiles } : {},
101158
101231
  ...snapshot.nativeTargets ? { nativeTargets: snapshot.nativeTargets } : {},
@@ -101418,7 +101491,8 @@ async function compileRemote(packagePath, snapshot, hosted, ownerSignal) {
101418
101491
  files: snapshot.files,
101419
101492
  ...snapshot.packageFiles ? {
101420
101493
  packageFiles: snapshot.packageFiles,
101421
- packageGuestImports: snapshot.packageGuestImports
101494
+ packageGuestImports: snapshot.packageGuestImports,
101495
+ packageHostMacros: snapshot.packageHostMacros
101422
101496
  } : {},
101423
101497
  ...snapshot.nativeTargets ? { nativeTargets: snapshot.nativeTargets } : {},
101424
101498
  ...snapshot.sourceLinkGraph ? { sourceLinkGraph: snapshot.sourceLinkGraph } : {},
@@ -112107,7 +112181,7 @@ var init_nitro_superset = __esm({
112107
112181
  init_nitroContract();
112108
112182
  init_swift_standin_digest();
112109
112183
  NITRO_SUPERSET_ENTRY_NAME = "superset";
112110
- NITRO_COMPILER_DIGEST = true ? "98a615e818fd7ecd108090fffd262f6b9726b3f0350a386bea66b62b3395a63d" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
112184
+ NITRO_COMPILER_DIGEST = true ? "3856ca8527b7219f2b4be3736283df1fec84313b7dc56326d4d30f5e0e9b382a" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
112111
112185
  nitroSupersetLock = parseLock(nitro_superset_lock_default);
112112
112186
  nitroSupersetKey = (inputs) => nativeEntryKey({ ...inputs, compiler: NITRO_COMPILER_DIGEST });
112113
112187
  published2 = /* @__PURE__ */ new Map();
@@ -142430,12 +142504,17 @@ async function runStreamCommand(args, opts = {}) {
142430
142504
  bridge,
142431
142505
  "SootSim.bridges.settings.get"
142432
142506
  );
142507
+ const name3 = opts.appName ?? await bridge.send({
142508
+ type: "evaluate",
142509
+ code: "globalThis.SootSim?.state?.engineSnapshot?.activeApp?.appName ?? null"
142510
+ });
142433
142511
  const response = await fetch(new URL("/api/v1/rnx/streams", origin), {
142434
142512
  method: "POST",
142435
142513
  headers: { authorization: header, "content-type": "application/json" },
142436
142514
  body: JSON.stringify({
142437
142515
  accountId: cloudAccountIdOrExit(auth),
142438
142516
  device: typeof settings.deviceModel === "string" ? settings.deviceModel : void 0,
142517
+ name: typeof name3 === "string" ? name3 : void 0,
142439
142518
  repo: resolveCheckoutRepo() ?? void 0
142440
142519
  }),
142441
142520
  signal: AbortSignal.timeout(15e3)
@@ -157194,7 +157273,10 @@ async function runOpenCommand(args, opts = {}) {
157194
157273
  opts
157195
157274
  );
157196
157275
  if (opened)
157197
- await runStreamCommand2(["start", "--sim", opened.simId], { port: opts.port });
157276
+ await runStreamCommand2(["start", "--sim", opened.simId], {
157277
+ port: opts.port,
157278
+ appName: opened.appName
157279
+ });
157198
157280
  return opened;
157199
157281
  }
157200
157282
  if (!args.includes("--json")) return openSim(args, opts);
@@ -157448,6 +157530,7 @@ async function openSim(args, opts) {
157448
157530
  resolvedBundle?.manifestProjectRoot,
157449
157531
  opts.signal
157450
157532
  );
157533
+ const appName = resolvedBundle?.projectName ?? (appNameFromPath(project2?.appDir ?? prebuiltBundle ?? "") || void 0);
157451
157534
  startExpoConfigRead(project2);
157452
157535
  const requestedDriverId = args.find((_, i) => args[i - 1] === "--driver") || "";
157453
157536
  if (requestedDriverId && !isDriverId(requestedDriverId)) {
@@ -157836,7 +157919,7 @@ async function openSim(args, opts) {
157836
157919
  );
157837
157920
  await maybeDescribeAfterOpen(parsed2.wsPort, targetSim.id, args);
157838
157921
  printAgentHints(quiet);
157839
- return { simId: targetSim.id, launched: false };
157922
+ return { simId: targetSim.id, launched: false, appName };
157840
157923
  }
157841
157924
  } finally {
157842
157925
  bridge.close();
@@ -157989,7 +158072,7 @@ async function openSim(args, opts) {
157989
158072
  printOpenedSim(openUrl2, match, `${driver.name} driver`, quiet, json);
157990
158073
  await maybeDescribeAfterOpen(parsed2.wsPort, match.id, args);
157991
158074
  printAgentHints(quiet);
157992
- return { simId: match.id, launched: true };
158075
+ return { simId: match.id, launched: true, appName };
157993
158076
  }
157994
158077
  async function runUseLikeCommand(args, opts = {}) {
157995
158078
  const parsed2 = parseBridgeCliArgs(args, {