peachsim 0.1.2248 → 0.1.2250

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/cli/bridge-flow-runner.ts +30 -3
  2. package/cli/commands/flow.ts +4 -1
  3. package/cli/commands/inspect/settling.ts +35 -4
  4. package/cli/drivers/playwright.ts +2 -0
  5. package/dist-lib/agent-daemon-client.cjs +1 -1
  6. package/dist-lib/agent-events.cjs +1 -1
  7. package/dist-lib/attached-projects.cjs +1 -1
  8. package/dist-lib/auth/shared-session.cjs +1 -1
  9. package/dist-lib/backend-origin.cjs +1 -1
  10. package/dist-lib/beta.cjs +1 -1
  11. package/dist-lib/beta.mjs +1 -1
  12. package/dist-lib/bridge-constants.cjs +1 -1
  13. package/dist-lib/bridge-contract-input.cjs +1 -1
  14. package/dist-lib/bridge-contract-input.mjs +1 -1
  15. package/dist-lib/bridge-contract.cjs +1 -1
  16. package/dist-lib/bridge-contract.mjs +1 -1
  17. package/dist-lib/bundle-channel.cjs +203 -53
  18. package/dist-lib/capture-contract.cjs +1 -1
  19. package/dist-lib/capture-contract.mjs +1 -1
  20. package/dist-lib/cloud-contract.cjs +1 -1
  21. package/dist-lib/cloud-contract.mjs +1 -1
  22. package/dist-lib/cloud-test-args.cjs +1 -1
  23. package/dist-lib/cloud-test-args.mjs +1 -1
  24. package/dist-lib/cloud.cjs +1 -1
  25. package/dist-lib/cloud.mjs +1 -1
  26. package/dist-lib/config.cjs +1 -1
  27. package/dist-lib/config.mjs +1 -1
  28. package/dist-lib/detox/index.cjs +33 -9
  29. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  30. package/dist-lib/expo-swift-bundle.cjs +177 -49
  31. package/dist-lib/expo-swift-metadata.cjs +1 -1
  32. package/dist-lib/expo-swift-metadata.mjs +1 -1
  33. package/dist-lib/home-paths.cjs +1 -1
  34. package/dist-lib/host/bridge-host.cjs +210 -54
  35. package/dist-lib/host/fetch-proxy-handler.cjs +4 -4
  36. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  37. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  38. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  39. package/dist-lib/host/websocket-proxy.cjs +1 -1
  40. package/dist-lib/index.cjs +45 -14
  41. package/dist-lib/jump-to-source-babel.cjs +1 -1
  42. package/dist-lib/jump-to-source-native.cjs +1 -1
  43. package/dist-lib/kotlin-host.cjs +1 -1
  44. package/dist-lib/menu.cjs +1 -1
  45. package/dist-lib/menu.mjs +1 -1
  46. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  47. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  48. package/dist-lib/metro-production-bundle.cjs +1 -1
  49. package/dist-lib/metro-production-bundle.mjs +1 -1
  50. package/dist-lib/metro.cjs +15 -8
  51. package/dist-lib/native-app-identity-project.cjs +2 -2
  52. package/dist-lib/native-app-identity-project.mjs +2 -2
  53. package/dist-lib/native-app-identity.cjs +1 -1
  54. package/dist-lib/native-app-identity.mjs +1 -1
  55. package/dist-lib/native-firebase-metadata.cjs +1 -1
  56. package/dist-lib/native-firebase-metadata.mjs +1 -1
  57. package/dist-lib/pdfium-raster.cjs +1 -1
  58. package/dist-lib/pdfium-raster.mjs +1 -1
  59. package/dist-lib/plist.cjs +1 -1
  60. package/dist-lib/plist.mjs +1 -1
  61. package/dist-lib/profiles.cjs +1 -1
  62. package/dist-lib/public-brand.cjs +1 -1
  63. package/dist-lib/public-origins-lib-esm.json +24 -24
  64. package/dist-lib/public-origins-lib.json +53 -53
  65. package/dist-lib/react-native-host-modules.cjs +1 -1
  66. package/dist-lib/react-native-host-modules.mjs +1 -1
  67. package/dist-lib/reap-browser.cjs +2 -2
  68. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  69. package/dist-lib/sdk.cjs +31 -7
  70. package/dist-lib/sdk.mjs +31 -7
  71. package/dist-lib/skills.cjs +289 -64
  72. package/dist-lib/swift-compile.cjs +165 -38
  73. package/dist-lib/swift-compile.mjs +165 -38
  74. package/dist-lib/swift-package.cjs +1 -1
  75. package/dist-lib/swift-package.mjs +1 -1
  76. package/dist-lib/swift-submit.cjs +1 -1
  77. package/dist-lib/swift-submit.mjs +1 -1
  78. package/dist-lib/swift-toolchain.cjs +1 -1
  79. package/dist-lib/swift.cjs +1 -1
  80. package/dist-lib/vite-swift.cjs +174 -46
  81. package/dist-lib/vite.cjs +15 -8
  82. package/dist-lib/worklet-executable.cjs +1 -1
  83. package/dist-lib/worklet-executable.mjs +1 -1
  84. package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +4 -0
  85. package/dist-types/packages/peach-engine/src/render-worker/image-pixel-contract.d.ts +0 -4
  86. package/dist-types/packages/peach-engine/src/render-worker/native-ui-protocol.d.ts +1 -0
  87. package/dist-types/packages/peach-engine/src/render-worker/shell-tree-wire.d.ts +8 -0
  88. package/dist-types/packages/peach-engine/src/render-worker/webview-capture-protocol.d.ts +1 -0
  89. package/dist-types/packages/peach-globals/src/globalsContract.d.ts +5 -0
  90. package/kotlin/sdk.tar.gz +0 -0
  91. package/package.json +1 -1
  92. package/runtime-companion.json +1 -1
  93. package/sdk/ios/wasm/include/math.h +1 -1
  94. package/sdk/ios/wasm/include/pthread.h +1 -1
  95. package/src/assetCatalogContract.ts +6 -0
  96. package/src/nitro-compile.ts +23 -1
  97. package/src/process-group.ts +5 -2
  98. package/src/runtime-packs.ts +8 -0
  99. package/src/sfSymbolMetricsContract.ts +73 -37
  100. package/src/swift-compile.ts +119 -13
  101. package/src/swift-guest-image-ledger.ts +10 -5
  102. package/src/swift-guest-link.ts +20 -14
  103. package/src/swift-guest-source-inputs.ts +5 -1
  104. package/src/swift-installed-targets.ts +4 -1
  105. package/src/swift-standins.ts +11 -8
  106. package/src/swift-wasm-prune.ts +33 -1
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2248 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2250 | (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;
@@ -329,7 +329,7 @@ var init_process_table = __esm({
329
329
  });
330
330
 
331
331
  // src/process-group.ts
332
- function listProcessChildren(parents, timeoutMs = 3e3) {
332
+ function listProcessChildren(parents, timeoutMs = 1e4) {
333
333
  if (parents.some((pid) => !Number.isInteger(pid) || pid <= 1))
334
334
  throw new Error("process inspection requires valid parent pids");
335
335
  if (parents.length === 0) return [];
@@ -539,7 +539,7 @@ async function terminateProcessGroup(child, signal = "SIGTERM", gracefulTimeoutM
539
539
  try {
540
540
  signalProcessGroup(child, "SIGSTOP");
541
541
  let parents = [child.pid];
542
- const inspectionDeadline = Date.now() + GRACEFUL_TIMEOUT_MS;
542
+ const inspectionDeadline = Date.now() + INSPECTION_TIMEOUT_MS;
543
543
  while (parents.length > 0) {
544
544
  const remaining = inspectionDeadline - Date.now();
545
545
  if (remaining <= 0) {
@@ -635,7 +635,7 @@ async function terminateProcessGroup(child, signal = "SIGTERM", gracefulTimeoutM
635
635
  }
636
636
  if (inspectionError) throw inspectionError;
637
637
  }
638
- var import_node_child_process3, import_node_fs3, import_node_os2, import_node_path, import_node_stream, import_promises, GRACEFUL_TIMEOUT_MS, FORCED_EXIT_TIMEOUT_MS, FREEZE_GUARD_NAME;
638
+ var import_node_child_process3, import_node_fs3, import_node_os2, import_node_path, import_node_stream, import_promises, GRACEFUL_TIMEOUT_MS, FORCED_EXIT_TIMEOUT_MS, INSPECTION_TIMEOUT_MS, FREEZE_GUARD_NAME;
639
639
  var init_process_group = __esm({
640
640
  "src/process-group.ts"() {
641
641
  "use strict";
@@ -648,6 +648,7 @@ var init_process_group = __esm({
648
648
  init_process_table();
649
649
  GRACEFUL_TIMEOUT_MS = 3e3;
650
650
  FORCED_EXIT_TIMEOUT_MS = 1e3;
651
+ INSPECTION_TIMEOUT_MS = 1e4;
651
652
  FREEZE_GUARD_NAME = "process-freeze-guard";
652
653
  }
653
654
  });
@@ -47853,7 +47854,11 @@ function parseWasmObjectBytes(file, buf, isDist, symbolFlagOffsets) {
47853
47854
  objcClassSymToTypePrefix,
47854
47855
  typePrefixesInObj,
47855
47856
  rootFuncs,
47856
- rootSegs
47857
+ rootSegs,
47858
+ segPayloadRanges: sEnds.map((end, i) => [
47859
+ dataStart + sPayloadStarts[i],
47860
+ dataStart + end
47861
+ ])
47857
47862
  };
47858
47863
  }
47859
47864
  function parseWasmObjectCached(file, isDist, useCache) {
@@ -48101,6 +48106,7 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
48101
48106
  const eagerFiles = [];
48102
48107
  const lazyBuildObjects = /* @__PURE__ */ new Map();
48103
48108
  const extraArchiveObjs = [];
48109
+ const objectBytes = /* @__PURE__ */ new Map();
48104
48110
  let inStartLib = false;
48105
48111
  let swiftrtOrigPath = "";
48106
48112
  for (const t of tokens2) {
@@ -48147,7 +48153,9 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
48147
48153
  } else if (!inStartLib && t.endsWith(".a") && !t.endsWith("libclang_rt.builtins-wasm64.a") && import_node_fs38.default.existsSync(t)) {
48148
48154
  const members2 = readArMembers(new Uint8Array(import_node_fs38.default.readFileSync(t)));
48149
48155
  for (const m of members2) {
48150
- extraArchiveObjs.push(parseWasmObjectBytes(`${t}(${m.name})`, m.bytes, false));
48156
+ const object6 = parseWasmObjectBytes(`${t}(${m.name})`, m.bytes, false);
48157
+ extraArchiveObjs.push(object6);
48158
+ objectBytes.set(object6, Buffer.from(m.bytes));
48151
48159
  }
48152
48160
  }
48153
48161
  }
@@ -48518,9 +48526,28 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
48518
48526
  "$s10Foundation16NSSortDescriptorC7keyPath9ascendingACs03KeyE0Cyxq_G_SbtcSLR_r0_lufC",
48519
48527
  "$s10Foundation16NSSortDescriptorC7keyPath9ascendingACs03KeyE0Cyxq_G_SbtcSLR_r0_lufc"
48520
48528
  ]);
48529
+ const keepObjCClassesNamedInSegment = (obj, segIdx) => {
48530
+ const range2 = obj.segPayloadRanges[segIdx];
48531
+ if (!range2) return;
48532
+ let bytes = objectBytes.get(obj);
48533
+ if (!bytes) objectBytes.set(obj, bytes = import_node_fs38.default.readFileSync(obj.file));
48534
+ const text6 = bytes.toString("latin1", range2[0], range2[1]);
48535
+ for (const match of text6.matchAll(/So(\d+)/g)) {
48536
+ const start = match.index + 2 + match[1].length;
48537
+ const length = Number(match[1]);
48538
+ if (text6[start + length] !== "C") continue;
48539
+ const symbol2 = `._OBJC_CLASS_${text6.slice(start, start + length)}`;
48540
+ for (const provider of lazyProviders.get(symbol2) ?? []) {
48541
+ eagerDynamicObjects.add(provider);
48542
+ extractObject(provider);
48543
+ activateSymbolInObj(provider, provider.symNames.indexOf(symbol2));
48544
+ }
48545
+ }
48546
+ };
48521
48547
  while (workQueue.length > 0) {
48522
48548
  const item = workQueue.pop();
48523
48549
  const obj = item.obj;
48550
+ if (item.kind === "seg") keepObjCClassesNamedInSegment(obj, item.idx);
48524
48551
  let relocs;
48525
48552
  if (item.kind === "func") {
48526
48553
  relocs = obj.funcRelocs[item.idx];
@@ -49466,8 +49493,12 @@ function createGuestImageLedger(input) {
49466
49493
  }
49467
49494
  }
49468
49495
  }
49496
+ const nameBytes = /* @__PURE__ */ new Map();
49497
+ for (const definition2 of definitions)
49498
+ if (!nameBytes.has(definition2.name))
49499
+ nameBytes.set(definition2.name, Buffer.from(definition2.name));
49469
49500
  definitions.sort(
49470
- (a, b) => Buffer.compare(Buffer.from(a.name), Buffer.from(b.name)) || a.image - b.image
49501
+ (a, b) => Buffer.compare(nameBytes.get(a.name), nameBytes.get(b.name)) || a.image - b.image
49471
49502
  );
49472
49503
  const preserveCanonical = /* @__PURE__ */ new Set();
49473
49504
  const definitionsByName = Map.groupBy(definitions, (definition2) => definition2.name);
@@ -49497,12 +49528,12 @@ function createGuestImageLedger(input) {
49497
49528
  preserveCanonical.add(name3);
49498
49529
  for (const name3 of input.commandLineSymbols ?? []) preserveCanonical.add(name3);
49499
49530
  const bindingsByImage = /* @__PURE__ */ new Map();
49531
+ const definitionsByImage = Map.groupBy(definitions, (definition2) => definition2.image);
49500
49532
  for (const caller of input.callers) {
49501
49533
  const bindings = /* @__PURE__ */ new Map();
49502
49534
  const seen = /* @__PURE__ */ new Map();
49503
49535
  for (const image of [caller.image, ...caller.next])
49504
- for (const definition2 of definitions) {
49505
- if (definition2.image !== image) continue;
49536
+ for (const definition2 of definitionsByImage.get(image) ?? []) {
49506
49537
  const previous = seen.get(definition2.name);
49507
49538
  if (previous?.image === definition2.image) {
49508
49539
  if (previous.weak && !definition2.weak) {
@@ -49542,8 +49573,9 @@ function createGuestImageLedger(input) {
49542
49573
  definitionsByAlias.set(definition2.alias, definition2);
49543
49574
  }
49544
49575
  const objects = units.map(({ image, object: object6, aliases, functionImports }) => {
49545
- const bindings = new Map(bindingsByImage.get(image));
49546
- for (const [name3, alias] of startup.get(object6.path) ?? []) bindings.set(name3, alias);
49576
+ const shared = bindingsByImage.get(image);
49577
+ const own = startup.get(object6.path);
49578
+ const bindings = own ? new Map([...shared, ...own]) : shared;
49547
49579
  for (const [name3, type] of functionImports) {
49548
49580
  const alias = bindings.get(name3);
49549
49581
  const provider = alias === void 0 ? void 0 : definitionsByAlias.get(alias);
@@ -51462,6 +51494,7 @@ function linkGuestImages(options) {
51462
51494
  );
51463
51495
  }
51464
51496
  const archives = /* @__PURE__ */ new Map();
51497
+ const memberBytes = /* @__PURE__ */ new Map();
51465
51498
  const prepare2 = (provider2) => {
51466
51499
  const trace = runLink("discovery", [
51467
51500
  ...withOutput(args, discovery, true),
@@ -51505,20 +51538,23 @@ function linkGuestImages(options) {
51505
51538
  }
51506
51539
  const objectsByImage = /* @__PURE__ */ new Map();
51507
51540
  for (const image of plan.images) objectsByImage.set(image.id, []);
51541
+ const artifacts = new Map(plan.artifacts.map((artifact) => [artifact.path, artifact]));
51508
51542
  for (const item of selected2) {
51509
- const artifact = plan.artifacts.find(
51510
- (candidate) => candidate.path === item.artifact
51511
- );
51543
+ const artifact = artifacts.get(item.artifact);
51512
51544
  const image = selectedGuestInputImage(artifact, item.member);
51513
51545
  let bytes;
51514
51546
  if (item.member === null) bytes = import_node_fs42.default.readFileSync(item.artifact);
51515
51547
  else {
51516
- let members2 = archives.get(item.artifact);
51517
- if (!members2) {
51518
- members2 = readArMembers(import_node_fs42.default.readFileSync(item.artifact));
51548
+ let byName = memberBytes.get(item.artifact);
51549
+ if (!byName) {
51550
+ const members2 = readArMembers(import_node_fs42.default.readFileSync(item.artifact));
51519
51551
  archives.set(item.artifact, members2);
51552
+ byName = /* @__PURE__ */ new Map();
51553
+ for (const member of members2)
51554
+ if (!byName.has(member.name)) byName.set(member.name, member.bytes);
51555
+ memberBytes.set(item.artifact, byName);
51520
51556
  }
51521
- bytes = members2.find((member) => member.name === item.member).bytes;
51557
+ bytes = byName.get(item.member);
51522
51558
  }
51523
51559
  const objects = objectsByImage.get(image);
51524
51560
  if (!objects) throw new Error(`unknown image ${image}`);
@@ -51551,10 +51587,11 @@ function linkGuestImages(options) {
51551
51587
  const { selected, ledger } = prepared;
51552
51588
  const replacements = /* @__PURE__ */ new Map();
51553
51589
  const linkedOwners = /* @__PURE__ */ new Map();
51590
+ const ledgerObjects = new Map(ledger.objects.map((item) => [item.path, item]));
51554
51591
  for (const [index, artifact] of plan.artifacts.entries()) {
51555
51592
  const prefix = `${artifact.path}(`;
51556
51593
  if (artifact.kind === "object") {
51557
- const object6 = ledger.objects.find((item) => item.path === artifact.path);
51594
+ const object6 = ledgerObjects.get(artifact.path);
51558
51595
  if (!object6) continue;
51559
51596
  const output3 = import_node_path39.default.join(directory2, `object-${index}.o`);
51560
51597
  import_node_fs42.default.writeFileSync(output3, object6.bytes);
@@ -51574,9 +51611,7 @@ function linkGuestImages(options) {
51574
51611
  const output2 = import_node_path39.default.join(directory2, `archive-${index}.a`);
51575
51612
  const inputs = members2.map((member) => {
51576
51613
  const memberOutput = import_node_path39.default.join(memberDir, member.name);
51577
- const rewritten = ledger.objects.find(
51578
- (item) => item.path === `${prefix}${member.name})`
51579
- );
51614
+ const rewritten = ledgerObjects.get(`${prefix}${member.name})`);
51580
51615
  import_node_fs42.default.writeFileSync(memberOutput, rewritten?.bytes ?? member.bytes);
51581
51616
  if (rewritten) {
51582
51617
  linkedOwners.set(
@@ -51915,10 +51950,13 @@ function selectedGuestSymbolInputs(plan, selected) {
51915
51950
  else {
51916
51951
  let members2 = archives.get(item.artifact);
51917
51952
  if (!members2) {
51918
- members2 = readArMembers(import_node_fs42.default.readFileSync(item.artifact));
51953
+ members2 = Map.groupBy(
51954
+ readArMembers(import_node_fs42.default.readFileSync(item.artifact)),
51955
+ (member) => member.name
51956
+ );
51919
51957
  archives.set(item.artifact, members2);
51920
51958
  }
51921
- const matching2 = members2.filter((member) => member.name === item.member);
51959
+ const matching2 = members2.get(item.member) ?? [];
51922
51960
  if (matching2.length !== 1)
51923
51961
  throw new Error(
51924
51962
  `ambiguous selected symbol input ${item.artifact}(${item.member})`
@@ -52330,9 +52368,10 @@ function sourceGuestClangLinkOptions(options) {
52330
52368
  if (command.tool !== "clang" || compiler !== (0, import_node_fs43.realpathSync)(import_node_path40.default.join(options.toolchainBin, "clang")) && compiler !== (0, import_node_fs43.realpathSync)(import_node_path40.default.join(options.buildDirectory, CLANG_TARGET_MODULE_WRAPPER)))
52331
52369
  throw new Error(`unsupported source object producer ${file}`);
52332
52370
  const args = command.args.slice(1).filter((arg) => arg !== "-c");
52371
+ const targetBuild = import_node_path40.default.relative(options.buildDirectory, file).split(import_node_path40.default.sep).findLast((part) => part !== ".build" && part.endsWith(".build"));
52333
52372
  const outputDirectory = import_node_path40.default.join(
52334
52373
  options.directory,
52335
- import_node_path40.default.basename(import_node_path40.default.dirname(file))
52374
+ targetBuild ?? import_node_path40.default.basename(import_node_path40.default.dirname(file))
52336
52375
  );
52337
52376
  (0, import_node_fs43.mkdirSync)(outputDirectory, { recursive: true });
52338
52377
  const output2 = import_node_path40.default.join(outputDirectory, `clang-link-${index}.ll`);
@@ -54351,6 +54390,46 @@ function swiftModuleInterface(moduleRoot, name3, interfaceRoot) {
54351
54390
  if (declared.size === 0) return null;
54352
54391
  return { declared, header: clangInterfaceHeader((0, import_node_fs53.readFileSync)(built2, "utf8")) };
54353
54392
  }
54393
+ function nativelyDeclaredFunctions(generated, headers) {
54394
+ const candidates = [
54395
+ ...new Set(
54396
+ [...generated.matchAll(/^\s*SWIFT_EXTERN\b[^(\n]*?\b(\w+)\s*\(/gm)].map(
54397
+ (match) => match[1]
54398
+ )
54399
+ )
54400
+ ];
54401
+ if (candidates.length === 0) return [];
54402
+ const declaration = new RegExp(`^[^\\n#/*]*?\\b(${candidates.join("|")})\\s*\\(`, "gm");
54403
+ const found = /* @__PURE__ */ new Set();
54404
+ for (const header of headers)
54405
+ for (const match of header.matchAll(declaration)) found.add(match[1]);
54406
+ return [...found];
54407
+ }
54408
+ function sdkObjCDeclarationOwners(frameworks) {
54409
+ const known = sdkDeclarationOwners.get(frameworks);
54410
+ if (known) return known;
54411
+ const owners = /* @__PURE__ */ new Map();
54412
+ for (const framework of (0, import_node_fs53.readdirSync)(frameworks))
54413
+ if (framework.endsWith(".framework")) {
54414
+ const headers = import_node_path50.default.join(frameworks, framework, "Headers");
54415
+ if ((0, import_node_fs53.existsSync)(headers)) {
54416
+ for (const file of (0, import_node_fs53.readdirSync)(headers, { recursive: true, encoding: "utf8" }))
54417
+ if (file.endsWith(".h")) {
54418
+ const header = (0, import_node_fs53.readFileSync)(import_node_path50.default.join(headers, file), "utf8");
54419
+ for (const name3 of [
54420
+ ...swiftInterfaceDeclarations(header),
54421
+ ...objcEnumerations(header),
54422
+ ...[
54423
+ ...header.matchAll(/^[A-Z_]*_(?:EXTERN|EXPORT)\b[^;(\n]*?\b(\w+)\s*\(/gm)
54424
+ ].map((match) => match[1])
54425
+ ])
54426
+ owners.set(name3, framework.slice(0, -".framework".length));
54427
+ }
54428
+ }
54429
+ }
54430
+ sdkDeclarationOwners.set(frameworks, owners);
54431
+ return owners;
54432
+ }
54354
54433
  function swiftHeaderWithSuperclassImports(header, interfaceFor) {
54355
54434
  const superclasses = new Set(
54356
54435
  [...header.matchAll(/@interface\s+\w+\s*:\s*(\w+)/g)].map((match) => match[1])
@@ -54383,6 +54462,10 @@ function withoutSwiftDeclarations(text6, declared, interfaceImport) {
54383
54462
  const name3 = /^\s*(?:[A-Z_]\w*(?:\([^()\n]*\))?\s+)*@(?:protocol|interface)\s+(\w+)\s*(?=[:<{]|$)/.exec(
54384
54463
  line
54385
54464
  )?.[1];
54465
+ const external = /^\s*SWIFT_EXTERN\b[^(\n]*?\b(\w+)\s*\(.*\)[^;\n]*;\s*$/.exec(
54466
+ line
54467
+ )?.[1];
54468
+ if (external && declared.has(external)) continue;
54386
54469
  const enumeration = /^\s*typedef\s+(?:NS_ENUM|NS_OPTIONS|SWIFT_ENUM(?:_NAMED)?)\s*\(\s*\w+\s*,\s*(\w+)\b/.exec(
54387
54470
  line
54388
54471
  )?.[1];
@@ -57630,15 +57713,29 @@ module ${moduleName2}.Swift {
57630
57713
  [
57631
57714
  "#!/bin/sh",
57632
57715
  "name=",
57716
+ "explicit=",
57633
57717
  "prev=",
57634
57718
  'for arg in "$@"; do',
57635
- ' if [ "$prev" = -o ]; then name=${arg%/*}; name=${name##*/}; fi',
57719
+ " case $arg in -fmodule-name=*) explicit=1 ;; esac",
57720
+ ' if [ "$prev" = -o ]; then',
57721
+ " case $arg in */*) dir=${arg%/*} ;; *) dir= ;; esac",
57722
+ ' while [ -n "$dir" ] && [ "$dir" != / ] && [ "$dir" != . ]; do',
57723
+ " base=${dir##*/}",
57724
+ " case $base in",
57725
+ " .build) break ;;",
57726
+ " *.build) name=${base%.build}; break ;;",
57727
+ " esac",
57728
+ " next=${dir%/*}",
57729
+ ' [ "$next" = "$dir" ] && break',
57730
+ " dir=$next",
57731
+ " done",
57732
+ " fi",
57636
57733
  " prev=$arg",
57637
57734
  "done",
57638
- "case $name in",
57639
- ` *.build) exec '${import_node_path50.default.join(nativeToolchain(), "clang")}' "-fmodule-name=\${name%.build}" "$@" ;;`,
57640
- ` *) exec '${import_node_path50.default.join(nativeToolchain(), "clang")}' "$@" ;;`,
57641
- "esac",
57735
+ 'if [ -n "$name" ] && [ -z "$explicit" ]; then',
57736
+ ` exec '${import_node_path50.default.join(nativeToolchain(), "clang")}' "-fmodule-name=$name" "$@"`,
57737
+ "fi",
57738
+ `exec '${import_node_path50.default.join(nativeToolchain(), "clang")}' "$@"`,
57642
57739
  ""
57643
57740
  ].join("\n")
57644
57741
  );
@@ -58097,7 +58194,7 @@ function frameworkLinkClosure(scratch2, roots) {
58097
58194
  const deps = /* @__PURE__ */ new Set();
58098
58195
  for (const file of paths) {
58099
58196
  const module2 = /\/Modules\/([^/]+)\.swiftmodule$/.exec(file);
58100
- const object6 = /\/([^/]+)\.build\/[^/]+\.o$/.exec(file);
58197
+ const object6 = /\/release\/([^/]+)\.build\/.+\.o$/.exec(file);
58101
58198
  if (module2) deps.add(module2[1]);
58102
58199
  else if (object6 && object6[1] !== pending2.name) deps.add(object6[1]);
58103
58200
  }
@@ -58773,11 +58870,28 @@ function compileSwiftProjectOnce(input, options) {
58773
58870
  ))
58774
58871
  declared.add(name4);
58775
58872
  }
58776
- const header = withoutSwiftDeclarations(
58873
+ const own = withoutSwiftDeclarations(
58777
58874
  clangInterfaceHeader((0, import_node_fs53.readFileSync)(source, "utf8")),
58778
58875
  declared,
58779
58876
  `#import <${name3}/${name3}.h>`
58780
58877
  );
58878
+ const owners = sdkObjCDeclarationOwners(import_node_path50.default.dirname(import_node_path50.default.dirname(headers)));
58879
+ const foreign = /* @__PURE__ */ new Map();
58880
+ for (const declaration of [
58881
+ ...swiftInterfaceDeclarations(own),
58882
+ ...objcEnumerations(own),
58883
+ ...[...own.matchAll(/^\s*SWIFT_EXTERN\b[^(\n]*?\b(\w+)\s*\(/gm)].map(
58884
+ (match) => match[1]
58885
+ )
58886
+ ]) {
58887
+ const owner = owners.get(declaration);
58888
+ if (owner && owner !== name3) foreign.set(declaration, owner);
58889
+ }
58890
+ const header = foreign.size ? withoutSwiftDeclarations(
58891
+ own,
58892
+ new Set(foreign.keys()),
58893
+ [...new Set(foreign.values())].map((owner) => `#import <${owner}/${owner}.h>`).join("\n")
58894
+ ) : own;
58781
58895
  const value = {
58782
58896
  file: import_node_path50.default.join(root, ".build/peach-framework-objc", `${name3}-Swift.h`),
58783
58897
  header,
@@ -58814,18 +58928,25 @@ function compileSwiftProjectOnce(input, options) {
58814
58928
  `${producer}-Swift.h`
58815
58929
  );
58816
58930
  const original = preparation.nativeHeaderDeclarations[producer] ? emitted.replace(/-Swift\.h$/, "-Swift.original.h") : emitted;
58817
- if ((0, import_node_fs53.existsSync)(original))
58931
+ if ((0, import_node_fs53.existsSync)(original)) {
58932
+ const generated = clangInterfaceHeader((0, import_node_fs53.readFileSync)(original, "utf8"));
58818
58933
  writeBuildFile(
58819
58934
  emitted,
58820
58935
  withoutSwiftDeclarations(
58821
- swiftHeaderWithSuperclassImports(
58822
- clangInterfaceHeader((0, import_node_fs53.readFileSync)(original, "utf8")),
58823
- frameworkInterface
58824
- ),
58825
- new Set(preparation.nativeHeaderDeclarations[producer]),
58936
+ swiftHeaderWithSuperclassImports(generated, frameworkInterface),
58937
+ /* @__PURE__ */ new Set([
58938
+ ...preparation.nativeHeaderDeclarations[producer] ?? [],
58939
+ ...nativelyDeclaredFunctions(
58940
+ generated,
58941
+ Object.entries(input.files).filter(
58942
+ ([name3]) => name3.endsWith(".h") && !name3.endsWith("-Swift.h")
58943
+ ).map(([, source]) => source)
58944
+ )
58945
+ ]),
58826
58946
  `#import <${producer}/${producer}.h>`
58827
58947
  )
58828
58948
  );
58949
+ }
58829
58950
  }
58830
58951
  }
58831
58952
  const checkpoints = import_node_path50.default.join(
@@ -58963,7 +59084,7 @@ function compileSwiftProjectOnce(input, options) {
58963
59084
  options.signal
58964
59085
  );
58965
59086
  }
58966
- var import_node_child_process32, import_node_crypto24, import_node_fs53, import_node_os11, import_node_path50, 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, 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, NOT_ON_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, cPredefineTable, cPredefineCache, 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;
59087
+ var import_node_child_process32, import_node_crypto24, import_node_fs53, import_node_os11, import_node_path50, v5, WASM_TRIPLE, SWIFTPM_PROGRESS, SWIFTPM_NOISE, SWIFT_BUILDER_TRANSPORT_MARGIN_MS, SWIFT_BUILDER_DEFAULT_COMPILE_MS, 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, NOT_ON_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, cPredefineTable, cPredefineCache, 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;
58967
59088
  var init_swift_compile = __esm({
58968
59089
  "src/swift-compile.ts"() {
58969
59090
  "use strict";
@@ -59011,6 +59132,12 @@ var init_swift_compile = __esm({
59011
59132
  /^@import (?:CoreFoundation|FoundationNetworking);$/gm,
59012
59133
  "@import Foundation;"
59013
59134
  ).replace(/\b_TtC10Foundation\d+(NS\w+)\b/g, "$1").replace(/\b__attribute__\(\(objc_subclassing_restricted\)\)\s*/g, "");
59135
+ objcEnumerations = (header) => [
59136
+ ...header.matchAll(
59137
+ /^\s*typedef\s+(?:NS|CF|SWIFT)_\w*(?:ENUM|OPTIONS)\w*\s*\(\s*\w+\s*,\s*(\w+)\b/gm
59138
+ )
59139
+ ].map((match) => match[1]);
59140
+ sdkDeclarationOwners = /* @__PURE__ */ new Map();
59014
59141
  swiftInterfaceDeclarations = (header) => /* @__PURE__ */ new Set([
59015
59142
  ...[
59016
59143
  ...header.matchAll(
@@ -59193,7 +59320,7 @@ int EXUpdatesApplyBSDiffPatch(const char * _Nonnull oldFilePath,
59193
59320
  REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
59194
59321
  MULTI_MANIFEST_VERSION = 68;
59195
59322
  SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
59196
- compilerSourceDigest = true ? "6b31bc2b6f1a60a8ff02569b886f5f3a6cca1ec484cdb3c17ac060942b93cb3e" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
59323
+ compilerSourceDigest = true ? "4a1be1d1296381c7090b5b2b704a7d2bebba03ceaa580613acd0f2c39c31ed4c" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
59197
59324
  nativeCxxCompilerFlags = ["-fno-cxx-modules"];
59198
59325
  cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
59199
59326
  cxxFlagArray = (flags) => JSON.stringify([...nativeCxxCompilerFlags, ...withoutGlogModuleMap(flags)]);
@@ -65659,7 +65786,7 @@ var init_swift_standin_digest = __esm({
65659
65786
  STANDIN_DIGEST_ENTRYPOINTS = ["swift-standins.ts", "swift-objc-compile.ts"];
65660
65787
  SPECIFIER = /from\s*['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
65661
65788
  standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
65662
- STANDIN_SOURCE_DIGEST = true ? "7b618908e76b704175d5c94e30ceb691f6a3f50052a1d5a7bc25f24a07375c9b" : standinSourceDigest();
65789
+ STANDIN_SOURCE_DIGEST = true ? "977c30e838b3cb068d200b9a9a12851b01d2192d0d04e2b5a6abe8189c168d42" : standinSourceDigest();
65663
65790
  }
65664
65791
  });
65665
65792
 
@@ -66115,7 +66242,7 @@ var init_package_tree_digest = __esm({
66115
66242
 
66116
66243
  // src/expo-native-prebuilt.ts
66117
66244
  function expoNativeCompilerDigestValue() {
66118
- return true ? "446bf6dc0f5ffa819ef1aa8b28a7e2ced01c01b9d003c548d978b6610dec6435" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
66245
+ return true ? "61015852e514afc4871689bd71712eb2a5ac95c8b04829519dc81f6855f86b30" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
66119
66246
  }
66120
66247
  function readSources(value) {
66121
66248
  const sources = isRecord(value) ? value.sources : null;
@@ -68441,9 +68568,9 @@ function exec(file, args, cwd) {
68441
68568
  }
68442
68569
  function failure(error) {
68443
68570
  const output2 = error && typeof error === "object" && "stderr" in error ? `${String(error.stderr)}
68444
- ${"stdout" in error ? String(error.stdout) : ""}` : String(error);
68445
- const errors = output2.split("\n").filter((line) => /^\S.*?:\d+:\d+: error:/.test(line)).map((line) => line.replace(/^.*?:\d+:\d+: error:\s*/, "").trim());
68446
- return [...new Set(errors)].slice(0, 3).join("; ") || output2.trim().slice(0, 400);
68571
+ ${"stdout" in error ? String(error.stdout) : ""}` : error instanceof Error ? error.message : String(error);
68572
+ const errors = output2.split("\n").filter((line) => /^(\S.*?:\d+:\d+: )?error:/.test(line)).map((line) => line.replace(/^(.*?:\d+:\d+: )?error:\s*/, "").trim());
68573
+ return [...new Set(errors)].slice(0, 3).join("; ") || output2.trim().slice(-600);
68447
68574
  }
68448
68575
  function treeDigest2(root) {
68449
68576
  const names = [];
@@ -68954,6 +69081,8 @@ function peachModuleDirs(toolchain, imports2, sdkIncludes) {
68954
69081
  target,
68955
69082
  "-Xswiftc",
68956
69083
  "-Osize",
69084
+ "-Xswiftc",
69085
+ "-gnone",
68957
69086
  ...plugins.libraries.flatMap((library) => [
68958
69087
  "-Xswiftc",
68959
69088
  "-load-plugin-library",
@@ -70589,10 +70718,9 @@ ${roots.map((file) => ` header "${file}"`).join("\n")}
70589
70718
  ) : binary2.cxxHeaders ? await cxxStandin(surface, binary2, toolchain, dir) : cStandin(surface, binary2, toolchain, dir)
70590
70719
  );
70591
70720
  } catch (error) {
70592
- throw new Error(
70593
- `no stand-in for ${surface.module}: ${error instanceof Error && !("stderr" in error) ? error.message : failure(error)}`,
70594
- { cause: error }
70595
- );
70721
+ throw new Error(`no stand-in for ${surface.module}: ${failure(error)}`, {
70722
+ cause: error
70723
+ });
70596
70724
  }
70597
70725
  }
70598
70726
  publish(result);
@@ -77680,10 +77808,11 @@ function applyInstalledSwiftTargets(collection, snapshot, generatedTargets, root
77680
77808
  ].map((bundle) => [bundle.target, bundle])
77681
77809
  ).values()
77682
77810
  ];
77683
- collection.headerAliases = {
77811
+ const headerAliases = {
77684
77812
  ...collection.headerAliases,
77685
77813
  ...snapshot.input.headerAliases
77686
77814
  };
77815
+ collection.headerAliases = headerAliases;
77687
77816
  const canonical = /* @__PURE__ */ new Map();
77688
77817
  for (const [key2, source] of Object.entries(snapshot.sourcePaths)) {
77689
77818
  const real = import_node_fs86.default.realpathSync(source);
@@ -77753,6 +77882,8 @@ function applyInstalledSwiftTargets(collection, snapshot, generatedTargets, root
77753
77882
  const match = supplied.get(file.slice(prefix.length))?.find((candidate) => candidate.content === content);
77754
77883
  if (!match) continue;
77755
77884
  roots2.add(match.root);
77885
+ aliases[file] = copy;
77886
+ headerAliases[file] = copy;
77756
77887
  delete collection.files[file];
77757
77888
  }
77758
77889
  return roots2;
@@ -86548,6 +86679,7 @@ async function compileNitroModule(options) {
86548
86679
  options.packageRoots,
86549
86680
  options.answers
86550
86681
  ).flatMap(({ config }) => config.swiftModule ? [config.swiftModule] : []);
86682
+ let installedTargets = [];
86551
86683
  if (swiftModules.length > 0 && workspace) {
86552
86684
  const available = new Set(
86553
86685
  swiftAvailableModules(
@@ -86571,12 +86703,13 @@ async function compileNitroModule(options) {
86571
86703
  },
86572
86704
  async (root) => {
86573
86705
  const snapshot = await installedWorkspaceInput(root, "main.swift");
86706
+ installedTargets = swiftManifestTargets(snapshot.input.files["Package.swift"]);
86574
86707
  const swiftFiles = Object.keys(snapshot.input.files).filter(
86575
86708
  (file) => file.endsWith(".swift")
86576
86709
  );
86577
86710
  const mixedTargets = /* @__PURE__ */ new Set([
86578
86711
  ...collection.targets.map(({ name: name3 }) => name3),
86579
- ...swiftManifestTargets(snapshot.input.files["Package.swift"]).filter(
86712
+ ...installedTargets.filter(
86580
86713
  (target) => swiftFiles.some((file) => file.startsWith(`${target.path}/`))
86581
86714
  ).map(({ name: name3 }) => name3)
86582
86715
  ]);
@@ -86617,6 +86750,23 @@ async function compileNitroModule(options) {
86617
86750
  options.moduleRoot,
86618
86751
  installedProviders ? [] : unresolvedFrameworkIncludes(collection.files)
86619
86752
  );
86753
+ if (dependencies) {
86754
+ const podTargets = new Set(
86755
+ swiftManifestTargets(dependencies.files["Package.swift"]).map(
86756
+ ({ name: name3 }) => name3
86757
+ )
86758
+ );
86759
+ for (const target of collection.targets) {
86760
+ const declared = installedTargets.find(({ name: name3 }) => name3 === target.name);
86761
+ const owned = new Set((target.dependencies ?? []).map(({ name: name3 }) => name3));
86762
+ target.dependencies = [
86763
+ ...target.dependencies ?? [],
86764
+ ...(declared?.dependencies ?? []).filter(
86765
+ (dependency) => dependency.kind === "target" && podTargets.has(dependency.name) && !owned.has(dependency.name)
86766
+ )
86767
+ ];
86768
+ }
86769
+ }
86620
86770
  }
86621
86771
  const iosDeploymentTarget = readIosAppTarget(
86622
86772
  options.projectRoot,
@@ -86866,7 +87016,7 @@ var init_nitro_superset = __esm({
86866
87016
  init_nitroContract();
86867
87017
  init_swift_standin_digest();
86868
87018
  NITRO_SUPERSET_ENTRY_NAME = "superset";
86869
- NITRO_COMPILER_DIGEST = true ? "d719141ae7515a0d6743db461f1634baaba243d994f8421790e5927a804d6fa4" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
87019
+ NITRO_COMPILER_DIGEST = true ? "0429b227e3c07f9b7eede2db1261fa41aed089c33099b22004c3776da007bf07" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
86870
87020
  nitroSupersetLock = parseLock(nitro_superset_lock_default);
86871
87021
  nitroSupersetKey = (inputs) => nativeEntryKey({ ...inputs, compiler: NITRO_COMPILER_DIGEST });
86872
87022
  published2 = /* @__PURE__ */ new Map();
@@ -87574,7 +87724,7 @@ var init_one_sdk_bundle = __esm({
87574
87724
  var runtime_companion_default;
87575
87725
  var init_runtime_companion = __esm({
87576
87726
  "runtime-companion.json"() {
87577
- runtime_companion_default = { abi: 1, sha256: "0a25deb1065a15100e9bbd938d998d015318b067a7ab5d6e666a7360a2ab446a", file: "node/cli-0a25deb1065a15100e9bbd938d998d015318b067a7ab5d6e666a7360a2ab446a.cjs" };
87727
+ runtime_companion_default = { abi: 1, sha256: "15053b90437ccef5f18e3e8cde5732e85d2dc9feb3a3e76076cb671a640c465e", file: "node/cli-15053b90437ccef5f18e3e8cde5732e85d2dc9feb3a3e76076cb671a640c465e.cjs" };
87578
87728
  }
87579
87729
  });
87580
87730
 
@@ -87657,7 +87807,8 @@ var init_cli_runtime = __esm({
87657
87807
  // src/runtime-packs.ts
87658
87808
  var runtime_packs_exports = {};
87659
87809
  __export(runtime_packs_exports, {
87660
- ensureRuntimePackFor: () => ensureRuntimePackFor
87810
+ ensureRuntimePackFor: () => ensureRuntimePackFor,
87811
+ installAllRuntimePacks: () => installAllRuntimePacks
87661
87812
  });
87662
87813
  function listedFiles(runtimeRoot) {
87663
87814
  let listed = listedByRoot.get(runtimeRoot);
@@ -87720,6 +87871,11 @@ async function ensureRuntimePackFor(runtimeRoot, pathname) {
87720
87871
  if (!/\.m?js$/.test(rel) || import_node_fs104.default.existsSync(import_node_path103.default.join(tenantDir, rel))) return;
87721
87872
  await installNamedPack(runtimeRoot, RUNTIME_MERGE_PACK_DIR);
87722
87873
  }
87874
+ async function installAllRuntimePacks(runtimeRoot) {
87875
+ for (const name3 of Object.keys(readPacks(runtimeRoot) ?? {}))
87876
+ if (!await installNamedPack(runtimeRoot, name3))
87877
+ throw new Error(`runtime pack ${name3} did not install under ${runtimeRoot}`);
87878
+ }
87723
87879
  function installNamedPack(runtimeRoot, name3) {
87724
87880
  if (name3 === RUNTIME_MERGE_PACK_DIR) {
87725
87881
  const tenantDir = import_node_path103.default.join(runtimeRoot, RUNTIME_MERGE_PACK_DIR);
@@ -110016,6 +110172,7 @@ async function launch(opts) {
110016
110172
  SOOTSIM_PW_USERDATADIR: resolveUserDataDir(opts),
110017
110173
  SOOTSIM_PW_CDP_PORT: cdpPort ? String(cdpPort) : "",
110018
110174
  PEACH_PW_HOST_COMMAND: hostCommand ? JSON.stringify(hostCommand) : "",
110175
+ PEACH_PW_CODE_CACHE: (0, import_path8.join)(cacheDir(), "code-cache"),
110019
110176
  // when the caller passed no viewport, leave the inherited
110020
110177
  // SOOTSIM_PW_VIEWPORT (from playwrightEnv) alone instead of
110021
110178
  // clobbering it with '' — the driver reads it as its own default.
@@ -110072,6 +110229,7 @@ var init_playwright = __esm({
110072
110229
  init_bridge_constants();
110073
110230
  init_cli_version();
110074
110231
  init_desktop_host_delivery();
110232
+ init_home_paths();
110075
110233
  init_playwright_host_log();
110076
110234
  init_profiles();
110077
110235
  init_internal_child_contract();
@@ -114991,6 +115149,17 @@ function readSource(source) {
114991
115149
  }
114992
115150
  result = { kind: "object", entries };
114993
115151
  at++;
115152
+ } else if (is(at, import_types3.TokenType.bracketL)) {
115153
+ at++;
115154
+ const items2 = [];
115155
+ while (at < tokens2.length && !is(at, import_types3.TokenType.bracketR)) {
115156
+ const [item, next] = value(at);
115157
+ items2.push(item);
115158
+ at = next;
115159
+ if (is(at, import_types3.TokenType.comma)) at++;
115160
+ }
115161
+ result = { kind: "array", items: items2 };
115162
+ at++;
114994
115163
  } else if (is(at, import_types3.TokenType._true) || is(at, import_types3.TokenType._false)) {
114995
115164
  result = { kind: "boolean", value: is(at, import_types3.TokenType._true) };
114996
115165
  at++;
@@ -115123,6 +115292,20 @@ function oneNativeAppIdentity(source, platform2 = "ios") {
115123
115292
  const purpose = text6(...path142);
115124
115293
  if (purpose !== void 0) infoPlistStrings[key2] = purpose;
115125
115294
  }
115295
+ const ios = property(app, "ios");
115296
+ const list2 = (input, read) => input?.kind === "array" ? input.items.flatMap((item) => read(item) ?? []) : [];
115297
+ const literal5 = (item) => item?.kind === "string" ? item.value : void 0;
115298
+ const enabled2 = (item) => item !== null && !(item.kind === "boolean" && !item.value);
115299
+ const tasks = property(ios, "backgroundTasks");
115300
+ const refreshTasks = list2(property(tasks, "refresh"), literal5);
115301
+ const processingTasks = list2(property(tasks, "processing"), literal5);
115302
+ const appIntents = property(ios, "appIntents");
115303
+ const backgroundModes = [
115304
+ ...enabled2(property(app, "pictureInPicture")) || enabled2(property(property(app, "audio"), "background")) ? ["audio"] : [],
115305
+ ...enabled2(property(property(app, "location"), "background")) ? ["location"] : [],
115306
+ ...refreshTasks.length ? ["fetch"] : [],
115307
+ ...processingTasks.length ? ["processing"] : []
115308
+ ];
115126
115309
  const permissionUsageDescriptions = Object.fromEntries(
115127
115310
  Object.entries(infoPlistStrings).filter(
115128
115311
  ([key2]) => /^NS.*UsageDescription$/.test(key2)
@@ -115148,7 +115331,15 @@ function oneNativeAppIdentity(source, platform2 = "ios") {
115148
115331
  infoPlistStrings,
115149
115332
  infoPlistBooleans,
115150
115333
  ...supportedInterfaceOrientations === void 0 ? {} : { supportedInterfaceOrientations },
115151
- ipadSupportedInterfaceOrientations: [...landscape, ...portrait]
115334
+ ipadSupportedInterfaceOrientations: [...landscape, ...portrait],
115335
+ ...appIntents ? {
115336
+ appIntentIdentifiers: list2(
115337
+ property(appIntents, "actions"),
115338
+ (action) => literal5(property(action, "id"))
115339
+ )
115340
+ } : {},
115341
+ ...refreshTasks.length || processingTasks.length ? { backgroundTaskIdentifiers: [...refreshTasks, ...processingTasks] } : {},
115342
+ ...backgroundModes.length ? { backgroundModes } : {}
115152
115343
  };
115153
115344
  }
115154
115345
  var import_parser5, import_types3, OPENERS2, CLOSERS, STATEMENT_STARTS, IOS_PURPOSE_STRINGS;
@@ -133489,7 +133680,8 @@ async function waitForSootsimIdle({
133489
133680
  skipIfInspectActive = false,
133490
133681
  readyPlayback = false,
133491
133682
  transitionStartWindowMs = 80,
133492
- transitionTimeoutMs = 4e3
133683
+ transitionTimeoutMs = 4e3,
133684
+ stillSince = null
133493
133685
  }) {
133494
133686
  let result;
133495
133687
  const observationStartedAt = Date.now();
@@ -133528,6 +133720,7 @@ async function waitForSootsimIdle({
133528
133720
  const accessibilityBounds = ${accessibilityBounds.toString()}
133529
133721
  const sameNativeAccessibilityShape = ${sameNativeAccessibilityShape.toString()}
133530
133722
  const readyPlayback = ${readyPlayback ? "true" : "false"}
133723
+ const stillSince = ${JSON.stringify(stillSince)}
133531
133724
  // full mounted-geometry observation needs at least two hierarchy reads
133532
133725
  // plus the stillness window, which a sub-second budget cannot afford:
133533
133726
  // tight budgets (auto-wait) settle on worker stillness plus root
@@ -133546,7 +133739,7 @@ async function waitForSootsimIdle({
133546
133739
  // those that began after it drained still can. a loaded host runs a
133547
133740
  // push past a tap's budget, so the transition gets its own timeout and
133548
133741
  // the budget restarts once it drains.
133549
- let transitionWait = (async () => {
133742
+ const watchTransition = async () => {
133550
133743
  try {
133551
133744
  const wfst = globalThis.__sootsimTest?.waitForScreenTransitions
133552
133745
  if (typeof wfst === 'function' && budgetMs > 120) {
@@ -133566,7 +133759,9 @@ async function waitForSootsimIdle({
133566
133759
  }
133567
133760
  } catch {}
133568
133761
  return false
133569
- })()
133762
+ }
133763
+ // a wait that may settle on its first poll watches only once that poll does not
133764
+ let transitionWait = stillSince === null ? watchTransition() : null
133570
133765
 
133571
133766
  // a worker that cannot answer within the remaining budget is busy, not
133572
133767
  // idle: its poll reads as unsettled. bounding each read by the budget
@@ -133918,6 +134113,9 @@ async function waitForSootsimIdle({
133918
134113
  if (clockNow() >= deadline) break
133919
134114
  }
133920
134115
  const pollStarted = clockNow()
134116
+ const readRevision = () =>
134117
+ answer(() => globalThis.__sootsimTest?.getGeometryRevision?.()).catch(() => null)
134118
+ const pollRevision = readRevision()
133921
134119
  const snapshot = await readSnapshot()
133922
134120
  if (snapshot.runtimeUnsupported) return snapshot.runtimeUnsupported
133923
134121
  // a read the deadline cut short observed nothing: the last full poll
@@ -133925,6 +134123,18 @@ async function waitForSootsimIdle({
133925
134123
  // the loop head drains a transition still in flight before it ends.
133926
134124
  if (snapshot.workerBusy && clockNow() >= deadline && report) continue
133927
134125
  polls++
134126
+ if (
134127
+ polls === 1 && stillSince !== null &&
134128
+ !snapshot.workerBusy && snapshot.pendingFetches === 0 && snapshot.requestInFlight === 0 &&
134129
+ !snapshot.webViewStarting && !snapshot.animating && !snapshot.shellAnimating &&
134130
+ !snapshot.layoutDirty && !snapshot.visibleMotion
134131
+ ) {
134132
+ const [proving, replying] = await Promise.all([pollRevision, readRevision()])
134133
+ if (proving === stillSince && replying === stillSince) {
134134
+ return { settled: true, elapsed: clockNow() - start, blockedBy: '', stillRevision: stillSince }
134135
+ }
134136
+ }
134137
+ if (polls === 1 && stillSince !== null) transitionWait = watchTransition()
133928
134138
  report = { snapshot, nativeHierarchy: lastNativeHierarchy, layout: lastLayout, requestTotal: lastRequestTotal, appCommits: lastAppCommits, nodeCount: lastNodeCount }
133929
134139
  if (snapshot.layoutDirty) dirtyPolls++
133930
134140
  if (snapshot.animating || snapshot.shellAnimating) animatingPolls++
@@ -134009,7 +134219,11 @@ async function waitForSootsimIdle({
134009
134219
  await transitionWait
134010
134220
  transitionWait = null
134011
134221
  }
134012
- if (stillProven()) return { settled: true, elapsed: clockNow() - start, blockedBy: '' }
134222
+ if (stillProven()) {
134223
+ const [proving, replying] = await Promise.all([pollRevision, readRevision()])
134224
+ const stillRevision = typeof proving === 'string' && proving === replying ? proving : undefined
134225
+ return { settled: true, elapsed: clockNow() - start, blockedBy: '', stillRevision }
134226
+ }
134013
134227
  }
134014
134228
  } else {
134015
134229
  stillPolls = []
@@ -134074,11 +134288,12 @@ async function waitForSootsimIdle({
134074
134288
  result.missingFields
134075
134289
  );
134076
134290
  }
134077
- const { elapsed, settled, blockedBy } = result ?? {};
134291
+ const { elapsed, settled, blockedBy, stillRevision } = result ?? {};
134078
134292
  return {
134079
134293
  elapsed: typeof elapsed === "number" ? elapsed : maxMs,
134080
134294
  settled: settled === true,
134081
- blockedBy: typeof blockedBy === "string" ? blockedBy : "unknown"
134295
+ blockedBy: typeof blockedBy === "string" ? blockedBy : "unknown",
134296
+ ...settled === true && typeof stillRevision === "string" ? { stillRevision } : {}
134082
134297
  };
134083
134298
  }
134084
134299
  var RuntimeReadinessUnsupportedError, IdleObservationError;
@@ -134555,6 +134770,7 @@ var bridge_flow_runner_exports = {};
134555
134770
  __export(bridge_flow_runner_exports, {
134556
134771
  SootSimBridgeFlowRunner: () => SootSimBridgeFlowRunner,
134557
134772
  firstPlainLaunchPermissions: () => firstPlainLaunchPermissions,
134773
+ normalizeBareStringStep: () => normalizeBareStringStep,
134558
134774
  normalizeFlowScreenshotSpec: () => normalizeFlowScreenshotSpec,
134559
134775
  parseFlowSteps: () => parseFlowSteps,
134560
134776
  resolveFlowScreenshotPathWithMode: () => resolveFlowScreenshotPathWithMode
@@ -135127,6 +135343,8 @@ var init_bridge_flow_runner = __esm({
135127
135343
  appStopped = false;
135128
135344
  animationClockLocked = false;
135129
135345
  flowDepth = 0;
135346
+ // the geometry revision the last settle proved still, until the next settle starts
135347
+ stillRevision = null;
135130
135348
  profilingEnabled = false;
135131
135349
  recordingEnabled = false;
135132
135350
  recordingAccessChecked = false;
@@ -135756,6 +135974,7 @@ var init_bridge_flow_runner = __esm({
135756
135974
  element = await this.findElement(opts, preferHittable);
135757
135975
  }
135758
135976
  if (!element) return element;
135977
+ if (revision !== null && revision === this.stillRevision) return element;
135759
135978
  const stabilityDeadline = Date.now() + 1200;
135760
135979
  let prev = element;
135761
135980
  do {
@@ -135812,7 +136031,7 @@ var init_bridge_flow_runner = __esm({
135812
136031
  }
135813
136032
  async tapOn(target) {
135814
136033
  const opts = typeof target === "string" ? { text: target } : target;
135815
- await this.waitForAppToSettle();
136034
+ await this.waitForAppToSettle({ beforeAction: true });
135816
136035
  const repeat = Math.max(1, Math.trunc(opts.repeat ?? 1));
135817
136036
  const repeatDelay = opts.delay !== void 0 && opts.delay >= 0 ? opts.delay : 100;
135818
136037
  const repeatTaps = async (tappedAtMs, tapAgain) => {
@@ -136698,7 +136917,9 @@ var init_bridge_flow_runner = __esm({
136698
136917
  // ios waits up to three seconds for a still screen, then compares native
136699
136918
  // hierarchies.
136700
136919
  // the observer overlaps those reads to keep this command's existing budget.
136701
- async waitForAppToSettle() {
136920
+ async waitForAppToSettle({ beforeAction = false } = {}) {
136921
+ const stillSince = beforeAction ? this.stillRevision : null;
136922
+ this.stillRevision = null;
136702
136923
  try {
136703
136924
  const result = await waitForSootsimIdle({
136704
136925
  bridge: this.bridge,
@@ -136706,8 +136927,10 @@ var init_bridge_flow_runner = __esm({
136706
136927
  maxMs: 3e3,
136707
136928
  pollMs: 32,
136708
136929
  maestro: true,
136709
- screenStill: true
136930
+ screenStill: true,
136931
+ stillSince
136710
136932
  });
136933
+ this.stillRevision = result.stillRevision ?? null;
136711
136934
  if (!result.settled) {
136712
136935
  console.warn(
136713
136936
  ` [flow] still moving after ${result.elapsed}ms: ${result.blockedBy}`
@@ -137150,6 +137373,8 @@ var init_bridge_flow_runner = __esm({
137150
137373
  }
137151
137374
  }
137152
137375
  async runStepInner(step) {
137376
+ if (!step.tapOn && !step.assertVisible && !step.assertNotVisible && step.assertTrue === void 0 && !step.assertTreeContains && !step.takeScreenshot && !step.dumpTree && step.copyTextFrom === void 0 && !step.waitFor && !step.extendedWaitUntil && !step.runFlow && !step.repeat && !step.retry)
137377
+ this.stillRevision = null;
137153
137378
  if (this.animationClockLocked && !step.advanceAnimationClock && !step.takeScreenshot && !step.assertVisible && !step.assertNotVisible && step.assertTrue === void 0 && !step.assertTreeContains && !step.dumpTree && step.copyTextFrom === void 0 && typeof step.evalScript !== "string" && !step.runScript && step.setClipboard === void 0 && !step.runFlow && !step.repeat && !step.retry) {
137154
137379
  await this.releaseAnimationClock();
137155
137380
  }