peachsim 0.1.687 → 0.1.688

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 (116) hide show
  1. package/cli/cloud-client.ts +3 -3
  2. package/cli/command-registry.ts +2 -0
  3. package/cli/commands/control.ts +1 -0
  4. package/cli/commands/debug.ts +10 -33
  5. package/cli/commands/do-chain.ts +56 -6
  6. package/cli/commands/inspect/core.ts +2 -0
  7. package/cli/commands/inspect/list.ts +2 -1
  8. package/cli/commands/inspect/settling.ts +17 -3
  9. package/cli/commands/inspect/shared.ts +2 -0
  10. package/cli/commands/inspect/wait-idle.ts +2 -2
  11. package/cli/commands/inspect/wait-ready.ts +3 -3
  12. package/cli/commands/inspect.ts +33 -7
  13. package/cli/commands/location.ts +164 -0
  14. package/cli/commands/platform.ts +1 -1
  15. package/cli/drivers/playwright-sim-host.ts +46 -25
  16. package/cli/main.ts +6 -0
  17. package/detox/index.ts +13 -8
  18. package/dist-lib/agent-daemon-client.cjs +1 -1
  19. package/dist-lib/agent-events.cjs +1 -1
  20. package/dist-lib/agent-identity.cjs +1 -1
  21. package/dist-lib/agent-sessions.cjs +1 -1
  22. package/dist-lib/attached-projects.cjs +1 -1
  23. package/dist-lib/auth/shared-session.cjs +1 -1
  24. package/dist-lib/backend-origin.cjs +1 -1
  25. package/dist-lib/beta.cjs +1 -1
  26. package/dist-lib/beta.mjs +1 -1
  27. package/dist-lib/bridge-constants.cjs +4 -3
  28. package/dist-lib/bridge-contract-input.cjs +12 -1
  29. package/dist-lib/bridge-contract-input.mjs +12 -1
  30. package/dist-lib/bridge-contract.cjs +4 -3
  31. package/dist-lib/bridge-contract.mjs +4 -3
  32. package/dist-lib/capture-contract.cjs +1 -1
  33. package/dist-lib/capture-contract.mjs +1 -1
  34. package/dist-lib/cli-constants.cjs +1 -1
  35. package/dist-lib/cloud-contract.cjs +2 -1
  36. package/dist-lib/cloud-contract.mjs +2 -1
  37. package/dist-lib/cloud-test-args.cjs +1 -1
  38. package/dist-lib/cloud-test-args.mjs +1 -1
  39. package/dist-lib/cloud.cjs +2 -1
  40. package/dist-lib/cloud.mjs +2 -1
  41. package/dist-lib/config.cjs +1 -1
  42. package/dist-lib/detox/index.cjs +1197 -65
  43. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  44. package/dist-lib/home-paths.cjs +1 -1
  45. package/dist-lib/host/bridge-host.cjs +362 -108
  46. package/dist-lib/host/fetch-proxy-handler.cjs +50 -40
  47. package/dist-lib/host/fetch-proxy-overrides.cjs +50 -6
  48. package/dist-lib/host/fetch-proxy-overrides.mjs +48 -5
  49. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  50. package/dist-lib/host/websocket-proxy.cjs +1 -1
  51. package/dist-lib/index.cjs +29 -11
  52. package/dist-lib/jump-to-source-babel.cjs +1 -1
  53. package/dist-lib/jump-to-source-native.cjs +1 -1
  54. package/dist-lib/kotlin-host.cjs +89 -13
  55. package/dist-lib/menu.cjs +1 -1
  56. package/dist-lib/menu.mjs +1 -1
  57. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  58. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  59. package/dist-lib/metro-production-bundle.cjs +1 -1
  60. package/dist-lib/metro-production-bundle.mjs +1 -1
  61. package/dist-lib/metro.cjs +5 -3
  62. package/dist-lib/native-app-identity.cjs +8 -3
  63. package/dist-lib/native-app-identity.mjs +8 -3
  64. package/dist-lib/native-firebase-metadata.cjs +1 -1
  65. package/dist-lib/native-firebase-metadata.mjs +1 -1
  66. package/dist-lib/plist.cjs +1 -1
  67. package/dist-lib/plist.mjs +1 -1
  68. package/dist-lib/profiles.cjs +1 -1
  69. package/dist-lib/public-brand.cjs +1 -1
  70. package/dist-lib/react-native-host-modules.cjs +1 -1
  71. package/dist-lib/react-native-host-modules.mjs +1 -1
  72. package/dist-lib/render-mode.cjs +1 -1
  73. package/dist-lib/scripts/dev-server-scanner.cjs +2 -2
  74. package/dist-lib/sdk.cjs +21 -6
  75. package/dist-lib/sdk.mjs +21 -6
  76. package/dist-lib/skills.cjs +401 -130
  77. package/dist-lib/swift-compile.cjs +277 -22
  78. package/dist-lib/swift-compile.mjs +275 -22
  79. package/dist-lib/swift-package.cjs +1 -1
  80. package/dist-lib/swift-package.mjs +1 -1
  81. package/dist-lib/swift-submit.cjs +2 -2
  82. package/dist-lib/swift-submit.mjs +2 -2
  83. package/dist-lib/swift-toolchain.cjs +10 -10
  84. package/dist-lib/swift.cjs +1 -1
  85. package/dist-lib/vite-swift.cjs +280 -44
  86. package/dist-lib/vite.cjs +1 -1
  87. package/kotlin/AppSources/android/content/res/Configuration.kt +2 -0
  88. package/kotlin/AppSources/android/content/res/Resources.kt +6 -3
  89. package/kotlin/AppSources/android/util/DisplayMetrics.kt +12 -0
  90. package/kotlin/AppSources/androidx/compose/ui/res/PainterResources.kt +70 -0
  91. package/kotlin/AppSources/dev/peach/app/PeachApp.kt +12 -10
  92. package/kotlin/AppSources/dev/peach/app/PeachDrawable.kt +95 -0
  93. package/kotlin/fixtures/kotlin-app-variants/Bitmaps.kt +50 -0
  94. package/kotlin/fixtures/kotlin-app-variants/Drawables.kt +53 -0
  95. package/package.json +2 -2
  96. package/scripts/dev-server-scanner.ts +3 -1
  97. package/skills/contrast/SKILL.md +1 -0
  98. package/src/android-drawables.ts +315 -0
  99. package/src/android-theme.ts +9 -0
  100. package/src/bridge-constants.ts +3 -2
  101. package/src/bridge-contract-input.ts +11 -0
  102. package/src/bridge-contract.ts +45 -3
  103. package/src/cloud-contract.ts +1 -0
  104. package/src/host/fetch-proxy-handler.ts +13 -49
  105. package/src/host/fetch-proxy-overrides.ts +69 -12
  106. package/src/kotlin-app.ts +6 -0
  107. package/src/kotlin-host.ts +103 -15
  108. package/src/native-app-identity.ts +16 -3
  109. package/src/swift-compile.ts +366 -24
  110. package/src/swift-distribution-contract.ts +11 -4
  111. package/src/swift-distribution.lock.json +11 -9
  112. package/src/swift-distribution.ts +4 -4
  113. package/src/swift-icu.ts +8 -11
  114. package/src/swift-submit.ts +13 -1
  115. package/src/swift-toolchain.ts +17 -9
  116. package/src/vite-plugin.ts +86 -34
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.687 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.688 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -559,7 +559,7 @@ var init_reap_browser = __esm({
559
559
  "msEdgeUpdateLaunchServicesPreferredVersion"
560
560
  ];
561
561
  PLAYWRIGHT_ENABLED_FEATURES = ["CDPScreenshotNewSurface"];
562
- DISABLED_FEATURES = ["NetworkTimeServiceQuerying"];
562
+ DISABLED_FEATURES = ["NetworkTimeServiceQuerying", "LocalNetworkAccessChecks"];
563
563
  }
564
564
  });
565
565
 
@@ -3630,9 +3630,9 @@ var init_capability_outcomes2 = __esm({
3630
3630
  }
3631
3631
  }
3632
3632
  },
3633
- capturedAt: "2026-10-01T07:50:49.727Z",
3634
- receipts: ["core-paired-capture.2026-10-01T07:50:49.727Z.json"],
3635
- sourceCommit: "7b3f26ea6413895ef474cf7adcbb130c5eb298c7"
3633
+ capturedAt: "2026-10-04T14:45:43.524Z",
3634
+ receipts: ["core-paired-capture.2026-10-04T14:45:43.524Z.json"],
3635
+ sourceCommit: "a0153483ee758b7fe88b6dbf91930fa65f2a9ff0"
3636
3636
  },
3637
3637
  unmatchedReferenceCount: 7368,
3638
3638
  byPlatform: {
@@ -18985,13 +18985,14 @@ function resolveSootsimBridgePortForRuntimeLocation(input = {}) {
18985
18985
  const hrefUrl = parseHrefUrl(input.href);
18986
18986
  const httpPort = parsePort(input.httpPort) ?? parsePort(hrefUrl?.port);
18987
18987
  if (httpPort === null) return DEFAULT_SOOTSIM_BRIDGE_PORT;
18988
- if (hrefUrl?.pathname.startsWith("/sootsim") && (hrefUrl.searchParams.has("embed") || hrefUrl.searchParams.has("nativePreview"))) {
18988
+ const hostedShell = hrefUrl && /^\/(?:simulator|sootsim)(?:\/|$)/.test(hrefUrl.pathname);
18989
+ if (hostedShell && (hrefUrl.searchParams.has("embed") || hrefUrl.searchParams.has("nativePreview"))) {
18989
18990
  return resolveSootsimBridgePortForHttpPort({
18990
18991
  httpPort,
18991
18992
  baseHttpPort: CONTRAST_DEV_HTTP_BASE_PORT
18992
18993
  });
18993
18994
  }
18994
- if (hrefUrl?.pathname.startsWith("/sootsim") && httpPort >= SOOTSIM_SITE_DEV_HTTP_BASE_PORT && httpPort <= SOOTSIM_SITE_DEV_HTTP_BASE_PORT + MAX_LOCAL_DEV_PORT_OFFSET) {
18995
+ if (hostedShell && httpPort >= SOOTSIM_SITE_DEV_HTTP_BASE_PORT && httpPort <= SOOTSIM_SITE_DEV_HTTP_BASE_PORT + MAX_LOCAL_DEV_PORT_OFFSET) {
18995
18996
  return resolveSootsimBridgePortForHttpPort({
18996
18997
  httpPort,
18997
18998
  baseHttpPort: SOOTSIM_SITE_DEV_HTTP_BASE_PORT
@@ -20461,7 +20462,7 @@ async function scanDevServers(opts = {}) {
20461
20462
  for (const pid of [...cwdByPid.keys()]) {
20462
20463
  if (!livePids.has(pid)) cwdByPid.delete(pid);
20463
20464
  }
20464
- return results.filter((r) => !isSootSimSelfServer(r));
20465
+ return results.filter((r) => !isSootSimSelfServer(r)).sort((a, b) => a.port - b.port);
20465
20466
  }
20466
20467
  var import_child_process, import_promises2, import_http, import_net, import_node_fs2, import_node_path3, TIMEOUT_MS, MANIFEST_TIMEOUT_MS, TCP_GATE_MS, BODY_TIMEOUT_MS, FALLBACK_PORTS, SELF_PORT_RANGE_START, SELF_PORT_RANGE_END, DevServerScanUnavailableError, LISTING_TIMEOUT_MS, inflightListing, cwdByPid, localIconPathCache, localIconProbeInFlight, ENRICH_TIMEOUT_MS, enrichmentCache, enrichmentInFlight, knownNonPatched, knownNonExpo, knownOne, portCache, portCacheInvalidatedAt, NEGATIVE_CACHE_TTL_MS, WEAK_RESULT_CACHE_TTL_MS;
20467
20468
  var init_dev_server_scanner = __esm({
@@ -21615,7 +21616,7 @@ function swiftDistributionHost(platform, arch) {
21615
21616
  return SWIFT_DISTRIBUTION_HOSTS.find((candidate) => candidate === host2) ?? null;
21616
21617
  }
21617
21618
  function parseSwiftDistributionManifest(value) {
21618
- if (!isRecord(value) || typeof value.id !== "string" || typeof value.release !== "string" || typeof value.wasmSdkChecksum !== "string" || !isStrings(value.modules) || !isStrings(value.objects) || !isStrings(value.link) || !isRecord(value.files) || !Object.values(value.files).every((sha) => typeof sha === "string") || typeof value.host !== "string" || !isStrings(value.plugins)) {
21619
+ if (!isRecord(value) || typeof value.id !== "string" || typeof value.release !== "string" || typeof value.wasmSdkId !== "string" || typeof value.wasmSdkUrl !== "string" || typeof value.wasmSdkChecksum !== "string" || !isStrings(value.modules) || !isStrings(value.objects) || !isStrings(value.link) || !isRecord(value.files) || !Object.values(value.files).every((sha) => typeof sha === "string") || typeof value.host !== "string" || !isStrings(value.plugins)) {
21619
21620
  throw new Error(`invalid Swift distribution ${SWIFT_DISTRIBUTION_MANIFEST}`);
21620
21621
  }
21621
21622
  const host2 = SWIFT_DISTRIBUTION_HOSTS.find((candidate) => candidate === value.host);
@@ -21623,6 +21624,8 @@ function parseSwiftDistributionManifest(value) {
21623
21624
  return {
21624
21625
  id: value.id,
21625
21626
  release: value.release,
21627
+ wasmSdkId: value.wasmSdkId,
21628
+ wasmSdkUrl: value.wasmSdkUrl,
21626
21629
  wasmSdkChecksum: value.wasmSdkChecksum,
21627
21630
  modules: value.modules,
21628
21631
  objects: value.objects,
@@ -21635,7 +21638,7 @@ function parseSwiftDistributionManifest(value) {
21635
21638
  };
21636
21639
  }
21637
21640
  function parseSwiftDistributionLock(value) {
21638
- if (!isRecord(value) || typeof value.id !== "string" || !/^[a-f0-9]{16}$/.test(value.id) || typeof value.release !== "string" || typeof value.wasmSdkChecksum !== "string" || typeof value.source !== "string" || !isRecord(value.hosts)) {
21641
+ if (!isRecord(value) || typeof value.id !== "string" || !/^[a-f0-9]{16}$/.test(value.id) || typeof value.release !== "string" || typeof value.wasmSdkId !== "string" || typeof value.wasmSdkUrl !== "string" || typeof value.wasmSdkChecksum !== "string" || typeof value.source !== "string" || !isRecord(value.hosts)) {
21639
21642
  throw new Error("invalid Swift distribution lock");
21640
21643
  }
21641
21644
  const hosts = value.hosts;
@@ -21649,6 +21652,8 @@ function parseSwiftDistributionLock(value) {
21649
21652
  return {
21650
21653
  id: value.id,
21651
21654
  release: value.release,
21655
+ wasmSdkId: value.wasmSdkId,
21656
+ wasmSdkUrl: value.wasmSdkUrl,
21652
21657
  wasmSdkChecksum: value.wasmSdkChecksum,
21653
21658
  source: value.source,
21654
21659
  hosts: {
@@ -21686,25 +21691,25 @@ function memo(cache, key, load2) {
21686
21691
  }
21687
21692
  return pending;
21688
21693
  }
21689
- function swiftIcuData(toolchainBin, release) {
21690
- return memo(raw, `${toolchainBin}\0${release}`, () => load(toolchainBin, release));
21694
+ function swiftIcuData(toolchainBin, sdk) {
21695
+ return memo(raw, `${toolchainBin}\0${sdk}`, () => load(toolchainBin, sdk));
21691
21696
  }
21692
- function swiftIcuAsset(toolchainBin, release) {
21693
- return memo(assets, `${toolchainBin}\0${release}`, async () => {
21694
- const zipped = await deflate(await swiftIcuData(toolchainBin, release));
21697
+ function swiftIcuAsset(toolchainBin, sdk) {
21698
+ return memo(assets, `${toolchainBin}\0${sdk}`, async () => {
21699
+ const zipped = await deflate(await swiftIcuData(toolchainBin, sdk));
21695
21700
  return { sha256: (0, import_node_crypto3.createHash)("sha256").update(zipped).digest("hex"), gzip: zipped };
21696
21701
  });
21697
21702
  }
21698
- async function load(toolchainBin, release) {
21703
+ async function load(toolchainBin, sdk) {
21699
21704
  const { stdout } = await run(import_node_path8.default.join(toolchainBin, "swift"), [
21700
21705
  "sdk",
21701
21706
  "configure",
21702
21707
  "--show-configuration",
21703
- `${release}_wasm`,
21708
+ sdk,
21704
21709
  "wasm32-unknown-wasip1"
21705
21710
  ]);
21706
21711
  const resources = /^swiftStaticResourcesPath: (.+)$/m.exec(stdout)?.[1]?.trim();
21707
- if (!resources) throw new Error(`swift-icu: ${release}_wasm names no static resources`);
21712
+ if (!resources) throw new Error(`swift-icu: ${sdk} names no static resources`);
21708
21713
  return Buffer.from(
21709
21714
  icuSegment(archiveMember((0, import_node_fs8.readFileSync)(import_node_path8.default.join(resources, ARCHIVE)), MEMBER))
21710
21715
  );
@@ -21851,6 +21856,16 @@ function swiftDistributionAt(root) {
21851
21856
  if (!(0, import_node_fs9.existsSync)(file)) return null;
21852
21857
  return parseSwiftDistributionManifest(JSON.parse((0, import_node_fs9.readFileSync)(file, "utf8")));
21853
21858
  }
21859
+ function swiftModuleSdk(root) {
21860
+ const pin = swiftDistributionAt(root) ?? JSON.parse((0, import_node_fs9.readFileSync)(import_node_path9.default.join(root, "toolchain.json"), "utf8"));
21861
+ if (!pin || typeof pin !== "object" || typeof Reflect.get(pin, "wasmSdkId") !== "string" || typeof Reflect.get(pin, "wasmSdkUrl") !== "string" || typeof Reflect.get(pin, "wasmSdkChecksum") !== "string")
21862
+ throw new Error(`${root} pins no wasm SDK id, url and checksum`);
21863
+ return {
21864
+ wasmSdkId: String(Reflect.get(pin, "wasmSdkId")),
21865
+ wasmSdkUrl: String(Reflect.get(pin, "wasmSdkUrl")),
21866
+ wasmSdkChecksum: String(Reflect.get(pin, "wasmSdkChecksum"))
21867
+ };
21868
+ }
21854
21869
  function swiftModuleInputFiles(root) {
21855
21870
  if (swiftDistributionAt(root)) return [SWIFT_DISTRIBUTION_MANIFEST];
21856
21871
  const files = [
@@ -21862,7 +21877,7 @@ function swiftModuleInputFiles(root) {
21862
21877
  for (const entry of (0, import_node_fs9.readdirSync)(import_node_path9.default.join(root, dir), { withFileTypes: true })) {
21863
21878
  const relative2 = `${dir}/${entry.name}`;
21864
21879
  if (entry.isDirectory()) walk(relative2);
21865
- else if (/\.(swift|c|h)$/.test(entry.name)) files.push(relative2);
21880
+ else if (/\.(swift|c|cpp|h)$/.test(entry.name)) files.push(relative2);
21866
21881
  }
21867
21882
  };
21868
21883
  walk("Sources");
@@ -21964,7 +21979,7 @@ function swiftTargetDependencies(files, targets) {
21964
21979
  }
21965
21980
  function swiftArtifactHash(input, release, moduleRoot) {
21966
21981
  const hash = (0, import_node_crypto4.createHash)("sha256");
21967
- hash.update(`swift-compile/v8
21982
+ hash.update(`swift-compile/v12
21968
21983
  ${release}
21969
21984
  `);
21970
21985
  if (input.oneModule) hash.update("one-module\n");
@@ -22006,7 +22021,7 @@ function emitSwiftPackageManifest(args) {
22006
22021
  const reachedFrameworks = new Set(
22007
22022
  [...siblings.values()].flat().filter(
22008
22023
  (name2) => OPTIONAL_FRAMEWORKS.has(name2) && !targets.some((target) => target.name === name2)
22009
- )
22024
+ ).flatMap((name2) => [name2, ...OPTIONAL_FRAMEWORK_DEPENDENCIES[name2] ?? []])
22010
22025
  );
22011
22026
  const distributionObjects = distribution?.objects.filter(
22012
22027
  (object) => [...OPTIONAL_FRAMEWORKS].every(
@@ -22018,7 +22033,7 @@ function emitSwiftPackageManifest(args) {
22018
22033
  const stanza = (target) => {
22019
22034
  const isolation = target.mainActorIsolation ? " .defaultIsolation(MainActor.self)," : "";
22020
22035
  const imports = distribution ? `, "-I", ${JSON.stringify(import_node_path9.default.join(moduleRoot, "modules"))}` : "";
22021
- const swiftSettings = `swiftSettings: [.swiftLanguageMode(.v${target.languageMode}),${isolation} .unsafeFlags(["-Osize"${OBJC_IMPLICIT_FLAGS}${oneModule ? ONE_IMPLICIT_FLAGS : ""}${imports}])]`;
22036
+ const swiftSettings = `swiftSettings: [.swiftLanguageMode(.v${target.languageMode}),${isolation} .unsafeFlags(["-Osize"${FOUNDATION_IMPLICIT_FLAGS}${oneModule ? ONE_IMPLICIT_FLAGS : ""}${imports}])]`;
22022
22037
  const deps = [
22023
22038
  ...distribution ? [] : [
22024
22039
  '.product(name: "SwiftUI", package: "sootsim-swift")',
@@ -22084,7 +22099,169 @@ function syncSwiftTree(base, files) {
22084
22099
  (0, import_node_fs9.writeFileSync)(full, contents, "utf8");
22085
22100
  }
22086
22101
  }
22087
- function swiftSourceAsIOS(source) {
22102
+ function splitTopLevel(text) {
22103
+ const parts = [];
22104
+ let depth = 0;
22105
+ let start = 0;
22106
+ for (let i = 0; i < text.length; i++) {
22107
+ const char = text[i];
22108
+ if (char === "(" || char === "[" || char === "<") depth++;
22109
+ else if (char === ")" || char === "]" || char === ">" && text[i - 1] !== "-")
22110
+ depth--;
22111
+ else if (char === "," && depth === 0) {
22112
+ parts.push(text.slice(start, i));
22113
+ start = i + 1;
22114
+ }
22115
+ }
22116
+ parts.push(text.slice(start));
22117
+ return parts.map((part) => part.trim()).filter((part) => part !== "");
22118
+ }
22119
+ function forwardedArguments(parameters) {
22120
+ const args = [];
22121
+ for (const parameter of splitTopLevel(parameters)) {
22122
+ const match = /^(?:([A-Za-z_]\w*)\s+)?([A-Za-z_]\w*)\s*:\s*([\s\S]*)$/.exec(parameter);
22123
+ if (!match || match[3].includes("...")) return null;
22124
+ const label = match[1] ?? match[2];
22125
+ const value = (/^(?:@\w+\s+)*inout\b/.test(match[3]) ? "&" : "") + match[2];
22126
+ args.push(label === "_" ? value : `${label}: ${value}`);
22127
+ }
22128
+ return args.join(", ");
22129
+ }
22130
+ function liftExtensionOverrides(source) {
22131
+ const { tokens } = swiftCodeScan(source);
22132
+ const stack = [];
22133
+ let pending = null;
22134
+ const classes = /* @__PURE__ */ new Map();
22135
+ let declaredBase = null;
22136
+ let declaredObjCMembers = false;
22137
+ const lifted = [];
22138
+ const closing = (open) => {
22139
+ let depth = 0;
22140
+ for (const at of tokens) {
22141
+ if (at < open) continue;
22142
+ if (source[at] === "{") depth++;
22143
+ else if (source[at] === "}" && --depth === 0) return at + 1;
22144
+ }
22145
+ return source.length;
22146
+ };
22147
+ for (const at of tokens) {
22148
+ const rest = source.slice(at, at + 600);
22149
+ if (rest.startsWith("{")) {
22150
+ const frame = pending ?? { kind: "other", name: "" };
22151
+ if (frame.kind === "class" && !classes.has(frame.name))
22152
+ classes.set(frame.name, {
22153
+ brace: at,
22154
+ base: declaredBase,
22155
+ objcMembers: declaredObjCMembers
22156
+ });
22157
+ stack.push(frame);
22158
+ pending = null;
22159
+ continue;
22160
+ }
22161
+ if (rest.startsWith("}")) {
22162
+ stack.pop();
22163
+ continue;
22164
+ }
22165
+ const declared = CLASS_DECL.exec(rest);
22166
+ if (declared) {
22167
+ pending = { kind: "class", name: declared[1] };
22168
+ declaredBase = CLASS_BASE.exec(rest)?.[2]?.split(".").pop() ?? null;
22169
+ const lines = source.lastIndexOf("\n", source.lastIndexOf("\n", at - 1) - 1) + 1;
22170
+ declaredObjCMembers = /@objcMembers\b/.test(source.slice(lines, at));
22171
+ continue;
22172
+ }
22173
+ const extended = EXTENSION_DECL.exec(rest);
22174
+ if (extended) {
22175
+ pending = { kind: "extension", name: extended[1].split(".").pop() };
22176
+ continue;
22177
+ }
22178
+ const top = stack.at(-1);
22179
+ if (!rest.startsWith("override") || top?.kind !== "extension" || pending) continue;
22180
+ const line = source.slice(source.lastIndexOf("\n", at - 1) + 1, at);
22181
+ const modifiers = (` ${line} `.match(MODIFIERS) ?? []).map((word) => word.trim());
22182
+ const func = OVERRIDE_FUNC.exec(rest);
22183
+ if (func) {
22184
+ const name2 = func[2];
22185
+ const open = at + func[0].length - 1;
22186
+ let depth = 0;
22187
+ let close = open;
22188
+ for (; close < source.length; close++) {
22189
+ if (source[close] === "(") depth++;
22190
+ else if (source[close] === ")" && --depth === 0) break;
22191
+ }
22192
+ const body = tokens.find((token) => token > close && source[token] === "{");
22193
+ if (body === void 0) continue;
22194
+ const clause = source.slice(close + 1, body).trim();
22195
+ const args = forwardedArguments(source.slice(open + 1, close));
22196
+ if (args === null) continue;
22197
+ const call = (clause.includes("->") ? "return " : "") + (/\b(?:throws|rethrows)\b/.test(clause) ? "try " : "") + (/\basync\b/.test(clause) ? "await " : "") + `__peach_ext_${name2}(${args})`;
22198
+ const signature = `func ${name2}${func[3] ?? ""}${source.slice(open, close + 1)}${clause ? ` ${clause}` : ""}`;
22199
+ lifted.push({
22200
+ type: top.name,
22201
+ member: name2,
22202
+ stub: `${[...modifiers, "override"].join(" ")} ${signature} { ${call} };`,
22203
+ edits: [
22204
+ [at, "override".length, " ".repeat("override".length)],
22205
+ [
22206
+ at + rest.indexOf(
22207
+ name2,
22208
+ rest.indexOf("func", "override".length + func[1].length) + 4
22209
+ ),
22210
+ 0,
22211
+ "__peach_ext_"
22212
+ ]
22213
+ ]
22214
+ });
22215
+ continue;
22216
+ }
22217
+ const property = OVERRIDE_VAR.exec(rest);
22218
+ if (property) {
22219
+ const open = at + property[0].length - 1;
22220
+ if (/\b(?:set|willSet|didSet)\b/.test(source.slice(open, closing(open)))) continue;
22221
+ const name2 = property[2];
22222
+ lifted.push({
22223
+ type: top.name,
22224
+ member: name2,
22225
+ stub: `${[...modifiers, "override"].join(" ")} var ${name2}: ${property[3].trim()} { __peach_ext_${name2} };`,
22226
+ edits: [
22227
+ [at, "override".length, " ".repeat("override".length)],
22228
+ [at + rest.indexOf(name2, rest.indexOf("var")), 0, "__peach_ext_"]
22229
+ ]
22230
+ });
22231
+ }
22232
+ }
22233
+ const overridesObjC = (type, member) => {
22234
+ let base = classes.get(type)?.base ?? null;
22235
+ while (base !== null) {
22236
+ if (APPLE_CLASS.test(base)) return true;
22237
+ const declaredClass = classes.get(base);
22238
+ if (!declaredClass) return false;
22239
+ const body = source.slice(declaredClass.brace, closing(declaredClass.brace));
22240
+ const found = new RegExp(`\\b(?:func|var)\\s+${member}\\b`).exec(body);
22241
+ if (found) {
22242
+ const line = body.slice(body.lastIndexOf("\n", found.index) + 1, found.index);
22243
+ return declaredClass.objcMembers || /@objc\b/.test(line);
22244
+ }
22245
+ base = declaredClass.base;
22246
+ }
22247
+ return false;
22248
+ };
22249
+ const edits = [];
22250
+ const stubs = /* @__PURE__ */ new Map();
22251
+ for (const entry of lifted) {
22252
+ const brace = classes.get(entry.type)?.brace;
22253
+ if (brace === void 0 || !overridesObjC(entry.type, entry.member)) continue;
22254
+ edits.push(...entry.edits);
22255
+ stubs.set(brace, [...stubs.get(brace) ?? [], entry.stub]);
22256
+ }
22257
+ for (const [brace, list] of stubs) edits.push([brace + 1, 0, ` ${list.join(" ")}`]);
22258
+ let out = source;
22259
+ for (const [at, remove, insert] of edits.sort((a, b) => b[0] - a[0]))
22260
+ out = out.slice(0, at) + insert + out.slice(at + remove);
22261
+ return out;
22262
+ }
22263
+ function swiftSourceAsIOS(original) {
22264
+ const source = liftExtensionOverrides(original);
22088
22265
  const { lineStarts, tokens } = swiftCodeScan(source);
22089
22266
  let offset = 0;
22090
22267
  const conditioned = source.split("\n").map((line) => {
@@ -22095,8 +22272,30 @@ function swiftSourceAsIOS(source) {
22095
22272
  }).join("\n");
22096
22273
  let out = "";
22097
22274
  let copied = 0;
22275
+ const reusableViews = new Set(REUSABLE_VIEW_BASES);
22276
+ const reusableBodies = [];
22277
+ let depth = 0;
22278
+ let opensReusableBody = false;
22098
22279
  for (const at of tokens) {
22099
22280
  const rest = conditioned.slice(at, at + 400);
22281
+ if (rest.startsWith("{")) {
22282
+ depth++;
22283
+ if (opensReusableBody) reusableBodies.push(depth);
22284
+ opensReusableBody = false;
22285
+ continue;
22286
+ }
22287
+ if (rest.startsWith("}")) {
22288
+ if (reusableBodies.at(-1) === depth) reusableBodies.pop();
22289
+ depth--;
22290
+ continue;
22291
+ }
22292
+ if (rest.startsWith("override")) {
22293
+ if (REUSABLE_INIT.test(rest) || reusableBodies.at(-1) === depth && FRAME_INIT.test(rest)) {
22294
+ out += `${conditioned.slice(copied, at)}required`;
22295
+ copied = at + "override".length;
22296
+ }
22297
+ continue;
22298
+ }
22100
22299
  const imported = /^import\s+CoreImage\.CIFilterBuiltins\b/.exec(rest);
22101
22300
  if (imported) {
22102
22301
  out += conditioned.slice(copied, at) + "import CoreImage".padEnd(imported[0].length);
@@ -22109,6 +22308,11 @@ function swiftSourceAsIOS(source) {
22109
22308
  continue;
22110
22309
  }
22111
22310
  if (rest.startsWith("class")) {
22311
+ const declared = CLASS_BASE.exec(rest);
22312
+ if (declared && reusableViews.has(declared[2].split(".").pop())) {
22313
+ reusableViews.add(declared[1]);
22314
+ opensReusableBody = true;
22315
+ }
22112
22316
  const modifiers = conditioned.slice(conditioned.lastIndexOf("\n", at - 1) + 1, at);
22113
22317
  if (DELEGATE_CLASS.test(rest) && !/\b(?:final|open)\b/.test(modifiers)) {
22114
22318
  out += `${conditioned.slice(copied, at)}final `;
@@ -22123,6 +22327,8 @@ function swiftSourceAsIOS(source) {
22123
22327
  if (selector) replacement = "#Selector";
22124
22328
  else if (match[0] === "@objcMembers") replacement = "@ObjCMembers";
22125
22329
  else if (match[0] === "@IBAction") replacement = "@ObjC".padEnd(match[0].length);
22330
+ else if (TYPE_AFTER_ATTRIBUTE.test(rest.slice(match[0].length)))
22331
+ replacement = " ".repeat(match[0].length);
22126
22332
  else if (match[2] !== void 0)
22127
22333
  replacement = `@ObjC${match[1]}("${match[2].trim()}")`;
22128
22334
  out += conditioned.slice(copied, at) + replacement;
@@ -22201,6 +22407,9 @@ function swiftCodeScan(source) {
22201
22407
  if (hashes > 0) tokens.push(at - 1);
22202
22408
  i = Math.max(at, i + 1);
22203
22409
  }
22410
+ } else if (char === "{" || char === "}") {
22411
+ tokens.push(i);
22412
+ i++;
22204
22413
  } else if (char === "(") {
22205
22414
  top.parens++;
22206
22415
  i++;
@@ -22209,7 +22418,7 @@ function swiftCodeScan(source) {
22209
22418
  else top.parens--;
22210
22419
  i++;
22211
22420
  } else {
22212
- const keyword = source.startsWith("class", i) ? "class" : source.startsWith("import", i) ? "import" : source.startsWith("NSClassFromString", i) ? "NSClassFromString" : null;
22421
+ const keyword = source.startsWith("class", i) ? "class" : source.startsWith("extension", i) ? "extension" : source.startsWith("override", i) ? "override" : source.startsWith("import", i) ? "import" : source.startsWith("NSClassFromString", i) ? "NSClassFromString" : null;
22213
22422
  if (keyword && !/[\w$]/.test(source[i - 1] ?? "") && !/[\w$]/.test(source[i + keyword.length] ?? "")) {
22214
22423
  tokens.push(i);
22215
22424
  i += keyword.length;
@@ -22263,7 +22472,7 @@ function writeSwiftProject(layout, input, moduleRoot) {
22263
22472
  }
22264
22473
  if (input.oneModule) {
22265
22474
  const product = '.product(name: "CoreLocation", package: "sootsim-swift"),';
22266
- const flags = `"-Osize"${OBJC_IMPLICIT_FLAGS}`;
22475
+ const flags = `"-Osize"${FOUNDATION_IMPLICIT_FLAGS}`;
22267
22476
  if (!manifest.includes(product) || !manifest.includes(flags)) {
22268
22477
  throw new Error(
22269
22478
  "scripts/contrast-app-Package.swift lost the lines the One module links at"
@@ -22384,7 +22593,8 @@ function compileSwiftProjectUnit(input, options) {
22384
22593
  );
22385
22594
  }
22386
22595
  const macroPlugins = await ensureMacroPlugins(moduleRoot, options.toolchainBin);
22387
- const icu = swiftIcuAsset(options.toolchainBin, options.release);
22596
+ const sdk = swiftModuleSdk(moduleRoot).wasmSdkId;
22597
+ const icu = swiftIcuAsset(options.toolchainBin, sdk);
22388
22598
  try {
22389
22599
  await run2(
22390
22600
  swift,
@@ -22395,7 +22605,7 @@ function compileSwiftProjectUnit(input, options) {
22395
22605
  "--package-path",
22396
22606
  root,
22397
22607
  "--swift-sdk",
22398
- `${options.release}_wasm`,
22608
+ sdk,
22399
22609
  "-c",
22400
22610
  "release",
22401
22611
  "-Xswiftc",
@@ -22419,7 +22629,7 @@ function compileSwiftProjectUnit(input, options) {
22419
22629
  };
22420
22630
  });
22421
22631
  }
22422
- var import_node_child_process5, import_node_crypto4, import_node_fs9, import_node_os3, import_node_path9, import_node_util2, run2, WASM_TRIPLE, cores, BUILD_ENV, BUILD_JOBS, linkedModuleDigests, OPTIONAL_FRAMEWORKS, ONE_PRODUCT, SPRITEKIT_PRODUCT, importsSpriteKit, OBJC_IMPLICIT_FLAGS, ONE_IMPLICIT_FLAGS, MULTI_MANIFEST_VERSION, DIRECTIVE, OS_IOS, OBJC_ATTRIBUTE, SELECTOR, DELEGATE_CLASS, compiledSource, ROOT_LOCKS, host, rootLocks;
22632
+ var import_node_child_process5, import_node_crypto4, import_node_fs9, import_node_os3, import_node_path9, import_node_util2, run2, WASM_TRIPLE, cores, BUILD_ENV, BUILD_JOBS, linkedModuleDigests, OPTIONAL_FRAMEWORK_DEPENDENCIES, OPTIONAL_FRAMEWORKS, ONE_PRODUCT, SPRITEKIT_PRODUCT, importsSpriteKit, FOUNDATION_IMPLICIT_FLAGS, ONE_IMPLICIT_FLAGS, MULTI_MANIFEST_VERSION, DIRECTIVE, OS_IOS, OBJC_ATTRIBUTE, SELECTOR, TYPE_AFTER_ATTRIBUTE, DELEGATE_CLASS, REUSABLE_INIT, REUSABLE_VIEW_BASES, CLASS_BASE, FRAME_INIT, APPLE_CLASS, EXTENSION_DECL, CLASS_DECL, MODIFIERS, OVERRIDE_FUNC, OVERRIDE_VAR, compiledSource, ROOT_LOCKS, host, rootLocks;
22423
22633
  var init_swift_compile = __esm({
22424
22634
  "src/swift-compile.ts"() {
22425
22635
  "use strict";
@@ -22438,7 +22648,17 @@ var init_swift_compile = __esm({
22438
22648
  BUILD_ENV = { ...process.env, BINARYEN_CORES: String(Math.min(4, cores)) };
22439
22649
  BUILD_JOBS = String(Math.max(1, Math.floor(cores / 2)));
22440
22650
  linkedModuleDigests = /* @__PURE__ */ new Map();
22441
- OPTIONAL_FRAMEWORKS = /* @__PURE__ */ new Set(["CryptoKit", "Security"]);
22651
+ OPTIONAL_FRAMEWORK_DEPENDENCIES = {
22652
+ Accelerate: [],
22653
+ CryptoKit: [],
22654
+ Security: [],
22655
+ Statsig: [],
22656
+ DatadogCore: [],
22657
+ DatadogLogs: ["DatadogCore"],
22658
+ DatadogRUM: ["DatadogCore"],
22659
+ DatadogTrace: ["DatadogCore"]
22660
+ };
22661
+ OPTIONAL_FRAMEWORKS = new Set(Object.keys(OPTIONAL_FRAMEWORK_DEPENDENCIES));
22442
22662
  ONE_PRODUCT = '.product(name: "One", package: "sootsim-swift")';
22443
22663
  SPRITEKIT_PRODUCT = '.product(name: "SpriteKit", package: "sootsim-swift")';
22444
22664
  importsSpriteKit = (files) => Object.entries(files).some(
@@ -22446,14 +22666,29 @@ var init_swift_compile = __esm({
22446
22666
  contents
22447
22667
  )
22448
22668
  );
22449
- OBJC_IMPLICIT_FLAGS = ', "-Xfrontend", "-import-module", "-Xfrontend", "PeachObjC"';
22669
+ FOUNDATION_IMPLICIT_FLAGS = ', "-Xfrontend", "-import-module", "-Xfrontend", "PeachObjC", "-Xfrontend", "-import-module", "-Xfrontend", "Dispatch", "-Xfrontend", "-import-module", "-Xfrontend", "FoundationNetworking"';
22450
22670
  ONE_IMPLICIT_FLAGS = ', "-Xfrontend", "-import-module", "-Xfrontend", "One"';
22451
- MULTI_MANIFEST_VERSION = 8;
22671
+ MULTI_MANIFEST_VERSION = 10;
22452
22672
  DIRECTIVE = /^[ \t]*#(?:if|elseif)\b/;
22453
22673
  OS_IOS = /\bos\(\s*iOS\s*\)/g;
22454
22674
  OBJC_ATTRIBUTE = /^@(?:objcMembers\b|objc\b(?:(\s*)\(([^()]*)\))?|IBAction\b)/;
22455
22675
  SELECTOR = /^#selector\b/;
22676
+ TYPE_AFTER_ATTRIBUTE = /^(?:\s+|\/\/[^\n]*|\/\*[\s\S]*?\*\/|@\w+(?:\([^()]*\))?|\b(?:public|open|final|internal|fileprivate|private|package|nonisolated|indirect)\b)*\b(?:class(?!\s+(?:func|var|let|subscript)\b)|struct|enum|protocol|extension|actor)\b/;
22456
22677
  DELEGATE_CLASS = /^class\s+[A-Za-z_]\w*\s*(?:<[^>{]*>)?\s*:[^{]*\b(?:UIApplicationDelegate|UISceneDelegate|UIWindowSceneDelegate)\b[^{]*\{/;
22678
+ REUSABLE_INIT = /^override(?=\s+init\s*\(\s*(?:style\s*:[^,)]*,\s*reuseIdentifier|reuseIdentifier)\s*:)/;
22679
+ REUSABLE_VIEW_BASES = [
22680
+ "UICollectionReusableView",
22681
+ "UICollectionViewCell",
22682
+ "UICollectionViewListCell"
22683
+ ];
22684
+ CLASS_BASE = /^class\s+([A-Za-z_]\w*)\s*(?:<[^>{]*>)?\s*:\s*([A-Za-z_][\w.]*)[^{]*\{/;
22685
+ FRAME_INIT = /^override(?=\s+(?:(?:public|open|internal)\s+)?init\s*\(\s*frame\s*:)/;
22686
+ APPLE_CLASS = /^(?:UI|NS|CA|SK|WK|MK|AV|PK|CL|GK|PH|SF|AS|QL)[A-Z]/;
22687
+ EXTENSION_DECL = /^extension\s+([A-Za-z_][\w.]*)/;
22688
+ CLASS_DECL = /^class\s+(?!(?:func|var|let|subscript)\b)([A-Za-z_]\w*)/;
22689
+ MODIFIERS = /(?:^|\s)(public|open|internal|fileprivate|private|final|nonisolated|@MainActor)(?=\s)/g;
22690
+ OVERRIDE_FUNC = /^override((?:\s+(?:public|open|internal|fileprivate|private|final|nonisolated|dynamic|@\w+))*)\s+func\s+([A-Za-z_]\w*)\s*(<[^>{}]*>)?\s*\(/;
22691
+ OVERRIDE_VAR = /^override((?:\s+(?:public|open|internal|fileprivate|private|final|nonisolated|dynamic|@\w+))*)\s+var\s+([A-Za-z_]\w*)\s*:\s*([^{=]+?)\s*\{/;
22457
22692
  compiledSource = (file, contents) => file.endsWith(".swift") ? swiftSourceAsIOS(contents) : contents;
22458
22693
  ROOT_LOCKS = Symbol.for("peachsim.swiftCompile.rootLocks");
22459
22694
  host = globalThis;
@@ -22466,22 +22701,24 @@ var swift_distribution_lock_default;
22466
22701
  var init_swift_distribution_lock = __esm({
22467
22702
  "src/swift-distribution.lock.json"() {
22468
22703
  swift_distribution_lock_default = {
22469
- id: "6f2d91274094c8af",
22704
+ id: "37329dbb7d21fea3",
22470
22705
  release: "swift-6.3-RELEASE",
22471
- wasmSdkChecksum: "9fa4016ee632c7e9e906608ec3b55cf13dfc4dff44e47574c5af58064dc33fd9",
22472
- source: "27df8ca4ecdc5369d51f08fe54ac32a1f21c5949",
22706
+ wasmSdkId: "swift-6.3-RELEASE_wasm-peach-503c2533",
22707
+ wasmSdkUrl: "https://r2.sootsim.com/swift-wasm-sdk/swift-6.3-RELEASE_wasm-peach-503c2533.artifactbundle.tar.gz",
22708
+ wasmSdkChecksum: "00fd9cc559652638552cc19c27624ea350f30bb866d87c41bbfe97d2ae1810eb",
22709
+ source: "dd8c803162eb6e23ce3fca4ab40d5eedf8717d9f",
22473
22710
  hosts: {
22474
22711
  "darwin-arm64": {
22475
- sha256: "606751627cfeafedfeb6a0abefc7f9a734935b7fd222d93ead096a6d89695a98",
22476
- size: 4551053
22712
+ sha256: "b00c5daa751bd315c8157bddb2dc5037b475c3587e4040d12ccb624bfe3f1bb2",
22713
+ size: 6796662
22477
22714
  },
22478
22715
  "linux-x64": {
22479
- sha256: "7d7cb0adc43af4b83576979693a9a4994abca5d773e5550f4f154939fe08b091",
22480
- size: 4556463
22716
+ sha256: "d3f00367c7d3858e922574a49f5c80281fecaa0b2fc595f43c6bbdfc1aed9ac6",
22717
+ size: 6802137
22481
22718
  },
22482
22719
  "linux-arm64": {
22483
- sha256: "78c7c76b8a29a3ec797cd410fd882a6f1dfb349f1785e0cf5cf0d8aebb2d96a9",
22484
- size: 4555726
22720
+ sha256: "2b58ae90a2c2c9709a6487ada493e2f556e74db42d16ebb93bc819e60139b363",
22721
+ size: 6801173
22485
22722
  }
22486
22723
  }
22487
22724
  };
@@ -22503,8 +22740,8 @@ function swiftToolchainBin(release) {
22503
22740
  if (import_node_fs10.default.existsSync(import_node_path10.default.join(image, "swift"))) return image;
22504
22741
  return (process.env.PATH ?? "").split(import_node_path10.default.delimiter).find((dir) => dir && import_node_fs10.default.existsSync(import_node_path10.default.join(dir, "swift"))) ?? image;
22505
22742
  }
22506
- function swiftToolchain(release, wasmSdkChecksum) {
22507
- const cached4 = verified.get(release);
22743
+ function swiftToolchain(release, sdk) {
22744
+ const cached4 = verified.get(`${release}\0${sdk.wasmSdkId}`);
22508
22745
  if (cached4) return cached4;
22509
22746
  const bin = swiftToolchainBin(release);
22510
22747
  const swift = import_node_path10.default.join(bin, "swift");
@@ -22516,26 +22753,26 @@ function swiftToolchain(release, wasmSdkChecksum) {
22516
22753
  const found = version ? `found ${version.split("\n")[0]?.trim()} at ${swift}` : process.platform === "darwin" ? `found no ${release}.xctoolchain in ~/Library/Developer/Toolchains or /Library/Developer/Toolchains` : "found no swift on PATH";
22517
22754
  throw new Error(
22518
22755
  `peach compiles Swift with the swift.org toolchain ${release} and its wasm SDK; ${found}.
22519
- ${swiftInstallSteps(release, wasmSdkChecksum)}`
22756
+ ${swiftInstallSteps(release, sdk)}`
22520
22757
  );
22521
22758
  }
22522
22759
  const sdks = (0, import_node_child_process6.execFileSync)(swift, ["sdk", "list"], {
22523
22760
  encoding: "utf8",
22524
22761
  stdio: ["ignore", "pipe", "pipe"]
22525
22762
  });
22526
- if (!sdks.split("\n").some((line) => line.trim() === `${release}_wasm`)) {
22763
+ if (!sdks.split("\n").some((line) => line.trim() === sdk.wasmSdkId)) {
22527
22764
  throw new Error(
22528
- `peach compiles Swift with the ${release}_wasm SDK, which ${swift} does not have.
22529
- ${swiftInstallSteps(release, wasmSdkChecksum)}`
22765
+ `peach compiles Swift with the ${sdk.wasmSdkId} SDK, which ${swift} does not have.
22766
+ ${swiftInstallSteps(release, sdk)}`
22530
22767
  );
22531
22768
  }
22532
- verified.set(release, bin);
22769
+ verified.set(`${release}\0${sdk.wasmSdkId}`, bin);
22533
22770
  return bin;
22534
22771
  }
22535
- function swiftInstallSteps(release, wasmSdkChecksum) {
22772
+ function swiftInstallSteps(release, wasmSdk) {
22536
22773
  const version = release.replace(/^swift-/, "").toLowerCase();
22537
22774
  const downloads = `https://download.swift.org/swift-${version}`;
22538
- const sdk = `swift sdk install ${downloads}/wasm-sdk/${release}/${release}_wasm.artifactbundle.tar.gz --checksum ${wasmSdkChecksum}`;
22775
+ const sdk = `swift sdk install ${wasmSdk.wasmSdkUrl} --checksum ${wasmSdk.wasmSdkChecksum}`;
22539
22776
  if (process.platform === "darwin") {
22540
22777
  const swift = `~/Library/Developer/Toolchains/${release}.xctoolchain/usr/bin/swift`;
22541
22778
  return [
@@ -22577,7 +22814,7 @@ function swiftDistributionRoot() {
22577
22814
  `peach has no Swift distribution for ${process.platform}-${process.arch}; it ships for macOS arm64 and Linux x64 and arm64`
22578
22815
  );
22579
22816
  }
22580
- swiftToolchain(lock.release, lock.wasmSdkChecksum);
22817
+ swiftToolchain(lock.release, lock);
22581
22818
  const dir = import_node_path11.default.join(rnxHomeDir(), "swift", `${lock.id}-${host2}`);
22582
22819
  let pending = installs.get(dir);
22583
22820
  if (!pending) {
@@ -22626,7 +22863,7 @@ function swiftModuleToolchain(root) {
22626
22863
  const pin = swiftDistributionAt(root) ?? JSON.parse(import_node_fs11.default.readFileSync(import_node_path11.default.join(root, "toolchain.json"), "utf8"));
22627
22864
  return {
22628
22865
  release: pin.release,
22629
- toolchainBin: swiftToolchain(pin.release, pin.wasmSdkChecksum)
22866
+ toolchainBin: swiftToolchain(pin.release, swiftModuleSdk(root))
22630
22867
  };
22631
22868
  }
22632
22869
  var import_node_fs11, import_node_path11, import_meta2, SWIFT_ENDPOINT_ENV, installs;
@@ -23289,7 +23526,7 @@ var init_swift_submit = __esm({
23289
23526
  MAX_SWIFT_COMPILE_IMAGES = 128;
23290
23527
  MAX_SWIFT_COMPILE_IMAGE_BYTES = 4 * 1024 * 1024;
23291
23528
  MAX_SWIFT_COMPILE_IMAGE_TOTAL_BYTES = 16 * 1024 * 1024;
23292
- SWIFT_HOST_ABI = 5;
23529
+ SWIFT_HOST_ABI = 15;
23293
23530
  POLL_INTERVAL_MS = 1500;
23294
23531
  }
23295
23532
  });
@@ -25628,15 +25865,34 @@ function resolveFetchProxyTargetUrl(requested) {
25628
25865
  const replacement = PUBLIC_RPC_BY_QUICKNODE_CHAIN[chain];
25629
25866
  return replacement ? new URL(replacement) : requested;
25630
25867
  }
25631
- function getFetchProxyTargetHeaders(targetUrl, nativeUserAgent) {
25632
- const hostOverrides = headerOverridesFor(targetUrl.hostname);
25868
+ function buildFetchProxyUpstreamHeaders(requestHeaders, targetUrl) {
25869
+ const headers = {};
25870
+ let nativeUserAgent;
25871
+ for (const [rawKey, value] of requestHeaders) {
25872
+ const key = rawKey.toLowerCase();
25873
+ if (key === FETCH_PROXY_NATIVE_USER_AGENT_HEADER) nativeUserAgent = value;
25874
+ if (STRIP_FETCH_PROXY_REQUEST_HEADERS.has(key) || key.startsWith("x-forwarded-")) {
25875
+ continue;
25876
+ }
25877
+ headers[key] = value;
25878
+ }
25879
+ if (!targetUrl) return headers;
25633
25880
  return {
25881
+ ...headers,
25634
25882
  "accept-encoding": "identity",
25635
25883
  ...nativeUserAgent ? { "user-agent": nativeUserAgent } : {},
25636
- ...hostOverrides?.headers
25884
+ ...headerOverridesFor(targetUrl.hostname)?.headers
25637
25885
  };
25638
25886
  }
25639
- var FETCH_PROXY_NATIVE_USER_AGENT_HEADER, HOST_HEADER_OVERRIDES, PUBLIC_RPC_TENANT, QUICKNODE_HOST_SUFFIX, PUBLIC_RPC_BY_QUICKNODE_CHAIN;
25887
+ function nodeRequestHeaderEntries(headers) {
25888
+ const entries = [];
25889
+ for (const [key, value] of Object.entries(headers)) {
25890
+ if (!value) continue;
25891
+ entries.push([key, Array.isArray(value) ? value.join(", ") : value]);
25892
+ }
25893
+ return entries;
25894
+ }
25895
+ var FETCH_PROXY_NATIVE_USER_AGENT_HEADER, HOST_HEADER_OVERRIDES, PUBLIC_RPC_TENANT, QUICKNODE_HOST_SUFFIX, PUBLIC_RPC_BY_QUICKNODE_CHAIN, STRIP_FETCH_PROXY_REQUEST_HEADERS;
25640
25896
  var init_fetch_proxy_overrides = __esm({
25641
25897
  "src/host/fetch-proxy-overrides.ts"() {
25642
25898
  "use strict";
@@ -25665,6 +25921,29 @@ var init_fetch_proxy_overrides = __esm({
25665
25921
  "soneium-mainnet": "https://soneium-rpc.publicnode.com",
25666
25922
  "unichain-mainnet": "https://unichain-rpc.publicnode.com"
25667
25923
  };
25924
+ STRIP_FETCH_PROXY_REQUEST_HEADERS = /* @__PURE__ */ new Set([
25925
+ "host",
25926
+ "x-forwarded",
25927
+ "x-real-ip",
25928
+ "forwarded",
25929
+ "origin",
25930
+ "referer",
25931
+ "user-agent",
25932
+ "accept-encoding",
25933
+ "cookie",
25934
+ "connection",
25935
+ "keep-alive",
25936
+ "transfer-encoding",
25937
+ "upgrade",
25938
+ "content-length",
25939
+ "sec-fetch-site",
25940
+ "sec-fetch-mode",
25941
+ "sec-fetch-dest",
25942
+ "sec-ch-ua",
25943
+ "sec-ch-ua-mobile",
25944
+ "sec-ch-ua-platform",
25945
+ FETCH_PROXY_NATIVE_USER_AGENT_HEADER
25946
+ ]);
25668
25947
  }
25669
25948
  });
25670
25949
 
@@ -25682,19 +25961,7 @@ function applyFetchProxyCors(res) {
25682
25961
  }
25683
25962
  }
25684
25963
  function buildFetchProxyHeaders(reqHeaders, targetUrl) {
25685
- const headers = {};
25686
- for (const [key, value] of Object.entries(reqHeaders)) {
25687
- if (!value) continue;
25688
- if (STRIP_FETCH_PROXY_HEADERS.has(key.toLowerCase())) continue;
25689
- headers[key] = Array.isArray(value) ? value.join(", ") : value;
25690
- }
25691
- const rawNativeUserAgent = reqHeaders[FETCH_PROXY_NATIVE_USER_AGENT_HEADER];
25692
- const nativeUserAgent = Array.isArray(rawNativeUserAgent) ? rawNativeUserAgent[0] : rawNativeUserAgent;
25693
- Object.assign(
25694
- headers,
25695
- targetUrl ? getFetchProxyTargetHeaders(targetUrl, nativeUserAgent) : {}
25696
- );
25697
- return headers;
25964
+ return buildFetchProxyUpstreamHeaders(nodeRequestHeaderEntries(reqHeaders), targetUrl);
25698
25965
  }
25699
25966
  function buildAppApiProxyHeaders(reqHeaders, targetUrl) {
25700
25967
  const headers = {};
@@ -25743,16 +26010,6 @@ async function handleFetchProxyRequest(req, res) {
25743
26010
  res.end("invalid url param");
25744
26011
  return;
25745
26012
  }
25746
- let body;
25747
- if (req.method !== "GET" && req.method !== "HEAD") {
25748
- const chunks = [];
25749
- for await (const chunk of req) {
25750
- chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
25751
- }
25752
- if (chunks.length > 0) {
25753
- body = Buffer.concat(chunks);
25754
- }
25755
- }
25756
26013
  const originalMethod = req.method || "GET";
25757
26014
  const proxy = async (targetUrl2, method, nextBody, redirects) => {
25758
26015
  const transport = targetUrl2.protocol === "https:" ? import_https.default : import_http2.default;
@@ -25824,7 +26081,17 @@ async function handleFetchProxyRequest(req, res) {
25824
26081
  res.statusCode = status;
25825
26082
  await (0, import_promises4.pipeline)(proxyRes, res);
25826
26083
  };
26084
+ let body;
25827
26085
  try {
26086
+ if (req.method !== "GET" && req.method !== "HEAD") {
26087
+ const chunks = [];
26088
+ for await (const chunk of req) {
26089
+ chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
26090
+ }
26091
+ if (chunks.length > 0) {
26092
+ body = Buffer.concat(chunks);
26093
+ }
26094
+ }
25828
26095
  await proxy(upstreamUrl, originalMethod, body, 0);
25829
26096
  } catch (err) {
25830
26097
  const norm = normalizeHostname(upstreamUrl.hostname);
@@ -25936,7 +26203,7 @@ function handleAppApiRequest(req, res) {
25936
26203
  req.pipe(proxyReq);
25937
26204
  return true;
25938
26205
  }
25939
- var import_http2, import_https, import_promises4, fetchProxyHttpAgent, fetchProxyHttpsAgent, STRIP_FETCH_PROXY_HEADERS, FETCH_PROXY_CORS_HEADERS, APP_API_HEADER_REWRITES;
26206
+ var import_http2, import_https, import_promises4, fetchProxyHttpAgent, fetchProxyHttpsAgent, FETCH_PROXY_CORS_HEADERS, APP_API_HEADER_REWRITES;
25940
26207
  var init_fetch_proxy_handler = __esm({
25941
26208
  "src/host/fetch-proxy-handler.ts"() {
25942
26209
  "use strict";
@@ -25947,26 +26214,6 @@ var init_fetch_proxy_handler = __esm({
25947
26214
  init_fetch_proxy_overrides();
25948
26215
  fetchProxyHttpAgent = new import_http2.default.Agent({ keepAlive: true, maxSockets: 256 });
25949
26216
  fetchProxyHttpsAgent = new import_https.default.Agent({ keepAlive: true, maxSockets: 256 });
25950
- STRIP_FETCH_PROXY_HEADERS = /* @__PURE__ */ new Set([
25951
- "host",
25952
- "origin",
25953
- "referer",
25954
- "user-agent",
25955
- "accept-encoding",
25956
- "cookie",
25957
- "connection",
25958
- "keep-alive",
25959
- "transfer-encoding",
25960
- "upgrade",
25961
- "content-length",
25962
- "sec-fetch-site",
25963
- "sec-fetch-mode",
25964
- "sec-fetch-dest",
25965
- "sec-ch-ua",
25966
- "sec-ch-ua-mobile",
25967
- "sec-ch-ua-platform",
25968
- FETCH_PROXY_NATIVE_USER_AGENT_HEADER
25969
- ]);
25970
26217
  FETCH_PROXY_CORS_HEADERS = {
25971
26218
  "access-control-allow-origin": "*",
25972
26219
  "access-control-allow-methods": "GET,POST,PUT,DELETE,PATCH,OPTIONS",
@@ -27507,6 +27754,10 @@ function getDevice(model, posture, orientation, landscapeSide) {
27507
27754
  housing: { rail: uniformFrameInsets(4.3333), hingeBarrel: null },
27508
27755
  cameraCutout: null,
27509
27756
  physicalPPI: 430,
27757
+ // focused keyboard frames on the ios 27.1 duo simulator's inner display:
27758
+ // qwerty (0,442,951,227), number pad 220, emoji (0,349,951,320)pt
27759
+ // (plans/contrast/duo-platform.md)
27760
+ keyboardPanelHeights: { qwerty: 227, pad: 220, emoji: 320 },
27510
27761
  posture: "open",
27511
27762
  // the fold band exists on the open profile even though the os region
27512
27763
  // reads inactive while flat; two-group compositions anchor to its centre.
@@ -27581,7 +27832,7 @@ var init_devices = __esm({
27581
27832
  iosVersion: "27.0",
27582
27833
  // no native device has this geometry; carries the iphone 16 keyboard
27583
27834
  // height so the experimental profile still shows a keyboard.
27584
- keyboardHeight: 308,
27835
+ keyboardPanelHeights: { qwerty: 301, pad: 301, emoji: 395 },
27585
27836
  physicalPPI: 110,
27586
27837
  hardwareButtons: modernButtons(
27587
27838
  [185.8, 41.7],
@@ -27609,7 +27860,7 @@ var init_devices = __esm({
27609
27860
  dynamicIsland: null,
27610
27861
  safeAreaInsets: { top: 20, bottom: 0, left: 0, right: 0 },
27611
27862
  iosVersion: "27.0",
27612
- keyboardHeight: 233,
27863
+ keyboardPanelHeights: { qwerty: 226, pad: 226, emoji: 320 },
27613
27864
  physicalPPI: 326,
27614
27865
  hardwareButtons: LEGACY_HARDWARE_BUTTONS
27615
27866
  }),
@@ -27628,7 +27879,7 @@ var init_devices = __esm({
27628
27879
  dynamicIsland: null,
27629
27880
  safeAreaInsets: { top: 47, bottom: 34, left: 0, right: 0 },
27630
27881
  iosVersion: "27.0",
27631
- keyboardHeight: 308,
27882
+ keyboardPanelHeights: { qwerty: 301, pad: 301, emoji: 395 },
27632
27883
  physicalPPI: 460,
27633
27884
  hardwareButtons: modernButtons(
27634
27885
  [141.7, 29.7],
@@ -27653,7 +27904,7 @@ var init_devices = __esm({
27653
27904
  statusRowCenter: 32.75,
27654
27905
  safeAreaInsets: { top: 59, bottom: 34, left: 0, right: 0 },
27655
27906
  iosVersion: "27.0",
27656
- keyboardHeight: 308,
27907
+ keyboardPanelHeights: { qwerty: 301, pad: 301, emoji: 395 },
27657
27908
  physicalPPI: 460,
27658
27909
  hardwareButtons: modernButtons(
27659
27910
  [171.7, 32],
@@ -27678,7 +27929,7 @@ var init_devices = __esm({
27678
27929
  statusRowCenter: 30.05,
27679
27930
  safeAreaInsets: { top: 59, bottom: 34, left: 0, right: 0 },
27680
27931
  iosVersion: "27.0",
27681
- keyboardHeight: 318,
27932
+ keyboardPanelHeights: { qwerty: 311, pad: 311, emoji: 405 },
27682
27933
  physicalPPI: 460,
27683
27934
  hardwareButtons: modernButtons(
27684
27935
  [172.1, 33],
@@ -27703,7 +27954,7 @@ var init_devices = __esm({
27703
27954
  statusRowCenter: 32.4,
27704
27955
  safeAreaInsets: { top: 59, bottom: 34, left: 0, right: 0 },
27705
27956
  iosVersion: "27.0",
27706
- keyboardHeight: 308,
27957
+ keyboardPanelHeights: { qwerty: 301, pad: 301, emoji: 395 },
27707
27958
  physicalPPI: 460,
27708
27959
  hardwareButtons: modernButtons(
27709
27960
  [159.1, 31.5],
@@ -27728,7 +27979,7 @@ var init_devices = __esm({
27728
27979
  statusRowCenter: 32.3,
27729
27980
  safeAreaInsets: { top: 59, bottom: 34, left: 0, right: 0 },
27730
27981
  iosVersion: "27.0",
27731
- keyboardHeight: 318,
27982
+ keyboardPanelHeights: { qwerty: 311, pad: 311, emoji: 405 },
27732
27983
  physicalPPI: 460,
27733
27984
  hardwareButtons: modernButtons(
27734
27985
  [173.3, 32.2],
@@ -27757,7 +28008,7 @@ var init_devices = __esm({
27757
28008
  statusRowCenter: 29.65,
27758
28009
  safeAreaInsets: { top: 59, bottom: 34, left: 0, right: 0 },
27759
28010
  iosVersion: "27.0",
27760
- keyboardHeight: 308,
28011
+ keyboardPanelHeights: { qwerty: 301, pad: 301, emoji: 395 },
27761
28012
  physicalPPI: 460,
27762
28013
  hardwareButtons: modernButtons(
27763
28014
  [159.1, 31.5],
@@ -27782,7 +28033,7 @@ var init_devices = __esm({
27782
28033
  statusRowCenter: 30.05,
27783
28034
  safeAreaInsets: { top: 59, bottom: 34, left: 0, right: 0 },
27784
28035
  iosVersion: "27.0",
27785
- keyboardHeight: 318,
28036
+ keyboardPanelHeights: { qwerty: 311, pad: 311, emoji: 405 },
27786
28037
  physicalPPI: 460,
27787
28038
  hardwareButtons: modernButtons(
27788
28039
  [173.3, 32.2],
@@ -27809,7 +28060,7 @@ var init_devices = __esm({
27809
28060
  statusRowCenter: 32.5,
27810
28061
  safeAreaInsets: { top: 62, bottom: 34, left: 0, right: 0 },
27811
28062
  iosVersion: "27.0",
27812
- keyboardHeight: 308,
28063
+ keyboardPanelHeights: { qwerty: 301, pad: 301, emoji: 395 },
27813
28064
  physicalPPI: 460,
27814
28065
  hardwareButtons: modernButtons(
27815
28066
  [159.1, 31.5],
@@ -27837,7 +28088,7 @@ var init_devices = __esm({
27837
28088
  statusRowCenter: 33,
27838
28089
  safeAreaInsets: { top: 62, bottom: 34, left: 0, right: 0 },
27839
28090
  iosVersion: "27.0",
27840
- keyboardHeight: 318,
28091
+ keyboardPanelHeights: { qwerty: 311, pad: 311, emoji: 405 },
27841
28092
  physicalPPI: 460,
27842
28093
  hardwareButtons: modernButtons(
27843
28094
  [178.8, 32.2],
@@ -27863,7 +28114,7 @@ var init_devices = __esm({
27863
28114
  statusRowCenter: 32.65,
27864
28115
  safeAreaInsets: { top: 59, bottom: 34, left: 0, right: 0 },
27865
28116
  iosVersion: "27.0",
27866
- keyboardHeight: 308,
28117
+ keyboardPanelHeights: { qwerty: 301, pad: 301, emoji: 395 },
27867
28118
  physicalPPI: 460,
27868
28119
  hardwareButtons: modernButtons(
27869
28120
  [159.1, 31.5],
@@ -27906,7 +28157,7 @@ var init_devices = __esm({
27906
28157
  statusRowCenter: 39,
27907
28158
  safeAreaInsets: { top: 59, bottom: 34, left: 0, right: 0 },
27908
28159
  iosVersion: "27.0",
27909
- keyboardHeight: 318,
28160
+ keyboardPanelHeights: { qwerty: 311, pad: 311, emoji: 405 },
27910
28161
  physicalPPI: 460,
27911
28162
  hardwareButtons: modernButtons(
27912
28163
  [178.8, 32.2],
@@ -27939,7 +28190,7 @@ var init_devices = __esm({
27939
28190
  statusRowCenter: 33,
27940
28191
  safeAreaInsets: { top: 62, bottom: 34, left: 0, right: 0 },
27941
28192
  iosVersion: "27.0",
27942
- keyboardHeight: 308,
28193
+ keyboardPanelHeights: { qwerty: 301, pad: 301, emoji: 395 },
27943
28194
  physicalPPI: 460,
27944
28195
  hardwareButtons: modernButtons(
27945
28196
  [159.1, 31.5],
@@ -27967,7 +28218,7 @@ var init_devices = __esm({
27967
28218
  statusRowCenter: 33,
27968
28219
  safeAreaInsets: { top: 62, bottom: 34, left: 0, right: 0 },
27969
28220
  iosVersion: "27.0",
27970
- keyboardHeight: 318,
28221
+ keyboardPanelHeights: { qwerty: 311, pad: 311, emoji: 405 },
27971
28222
  physicalPPI: 460,
27972
28223
  hardwareButtons: modernButtons(
27973
28224
  [178.8, 32.2],
@@ -28024,7 +28275,10 @@ var init_devices = __esm({
28024
28275
  // 84pt trailing Vertical Bar on the outer display (Apple iOS 27 UI kit).
28025
28276
  safeAreaInsets: { top: 0, bottom: 34, left: 0, right: 84 },
28026
28277
  iosVersion: "27.1",
28027
- keyboardHeight: 0,
28278
+ // focused keyboard frames on the ios 27.1 duo simulator's cover: qwerty
28279
+ // (0,426,466,252), number pad 256, emoji (0,340,466,338)pt
28280
+ // (plans/contrast/duo-platform.md)
28281
+ keyboardPanelHeights: { qwerty: 252, pad: 256, emoji: 338 },
28028
28282
  physicalPPI: 460,
28029
28283
  // official model extraction for button positions is outside this slice.
28030
28284
  hardwareButtons: modernButtons([0, 0], [0, 0], [0, 0], [0, 0]),
@@ -28072,7 +28326,7 @@ var init_devices = __esm({
28072
28326
  iosVersion: "27.0",
28073
28327
  // portrait docked keyboard, UIKeyboardFrameEndUserInfoKey
28074
28328
  // {0, 870, 834, 340}. landscape posted a zero-height frame.
28075
- keyboardHeight: 340,
28329
+ keyboardPanelHeights: { qwerty: 333, pad: 333, emoji: 427 },
28076
28330
  // hypot(1668, 2420) / 11, measured native pixels over the device type's
28077
28331
  // 11-inch name. not a separate density read.
28078
28332
  physicalPPI: 267.19578360606573,
@@ -28092,7 +28346,7 @@ var init_devices = __esm({
28092
28346
  navigationBarHeight: ANDROID_GESTURE_NAV_BAR_HEIGHT,
28093
28347
  // not measured on an android emulator yet: this is the iphone 16 figure
28094
28348
  // the engine used for every device before per-device heights landed.
28095
- keyboardHeight: 308,
28349
+ keyboardPanelHeights: { qwerty: 308, pad: 308, emoji: 395 },
28096
28350
  navigationBarMode: "gesture",
28097
28351
  displayCutout: {
28098
28352
  top: PIXEL_8_STATUS_BAR_HEIGHT,
@@ -28142,7 +28396,7 @@ var init_devices = __esm({
28142
28396
  navigationBarHeight: 48,
28143
28397
  // not measured on an android emulator yet: this is the iphone 16 figure
28144
28398
  // the engine used for every device before per-device heights landed.
28145
- keyboardHeight: 308,
28399
+ keyboardPanelHeights: { qwerty: 308, pad: 308, emoji: 395 },
28146
28400
  navigationBarMode: "three-button",
28147
28401
  displayCutout: {
28148
28402
  top: PIXEL_8_STATUS_BAR_HEIGHT,
@@ -28189,7 +28443,7 @@ var init_devices = __esm({
28189
28443
  navigationBarHeight: ANDROID_GESTURE_NAV_BAR_HEIGHT,
28190
28444
  // not measured on an android emulator yet: this is the iphone 16 figure
28191
28445
  // the engine used for every device before per-device heights landed.
28192
- keyboardHeight: 308,
28446
+ keyboardPanelHeights: { qwerty: 308, pad: 308, emoji: 395 },
28193
28447
  navigationBarMode: "gesture",
28194
28448
  displayCutout: { top: 40, bottom: 0, left: 0, right: 0 },
28195
28449
  cornerRadius: cornerRadii(41),
@@ -28227,7 +28481,7 @@ var init_devices = __esm({
28227
28481
  navigationBarHeight: ANDROID_GESTURE_NAV_BAR_HEIGHT,
28228
28482
  // not measured on an android emulator yet: this is the iphone 16 figure
28229
28483
  // the engine used for every device before per-device heights landed.
28230
- keyboardHeight: 308,
28484
+ keyboardPanelHeights: { qwerty: 308, pad: 308, emoji: 395 },
28231
28485
  navigationBarMode: "gesture",
28232
28486
  displayCutout: { top: 40, bottom: 0, left: 0, right: 0 },
28233
28487
  cornerRadius: cornerRadii(40),
@@ -28266,7 +28520,7 @@ var init_devices = __esm({
28266
28520
  navigationBarHeight: ANDROID_GESTURE_NAV_BAR_HEIGHT,
28267
28521
  // not measured on an android emulator yet: this is the iphone 16 figure
28268
28522
  // the engine used for every device before per-device heights landed.
28269
- keyboardHeight: 308,
28523
+ keyboardPanelHeights: { qwerty: 308, pad: 308, emoji: 395 },
28270
28524
  navigationBarMode: "gesture",
28271
28525
  displayCutout: { top: 36, bottom: 0, left: 0, right: 0 },
28272
28526
  cornerRadius: cornerRadii(36),
@@ -28306,7 +28560,7 @@ var init_devices = __esm({
28306
28560
  navigationBarHeight: ANDROID_GESTURE_NAV_BAR_HEIGHT,
28307
28561
  // not measured on an android emulator yet: this is the iphone 16 figure
28308
28562
  // the engine used for every device before per-device heights landed.
28309
- keyboardHeight: 308,
28563
+ keyboardPanelHeights: { qwerty: 308, pad: 308, emoji: 395 },
28310
28564
  navigationBarMode: "gesture",
28311
28565
  displayCutout: { top: 36, bottom: 0, left: 0, right: 0 },
28312
28566
  cornerRadius: cornerRadii(24),
@@ -30398,6 +30652,7 @@ var init_cloud_contract = __esm({
30398
30652
  flowStatus: "drive",
30399
30653
  reset: "reset",
30400
30654
  camera: "media",
30655
+ location: "media",
30401
30656
  // string evaluation and arbitrary bridge calls are maestro's boundary: the
30402
30657
  // customer sdk never carries this scope, and the service grants it only to
30403
30658
  // the account api key caller. close rides along, since ending the page ends
@@ -31238,12 +31493,12 @@ var init_cloud_client = __esm({
31238
31493
  init_metro_fingerprint();
31239
31494
  init_backend_origin();
31240
31495
  init_cloud_contract();
31496
+ init_is_record();
31241
31497
  init_metro_production_bundle();
31242
31498
  init_public_brand();
31243
31499
  init_auth();
31244
31500
  init_cloud_session();
31245
31501
  init_detect();
31246
- init_is_record();
31247
31502
  DEFAULT_RNX_CLOUD_ORIGIN = rnxPublicBrand.origin;
31248
31503
  MAX_RNX_CLOUD_BUNDLE_BYTES = RNX_CLOUD_MAX_ARTIFACT_BYTES;
31249
31504
  REMOTE_COMMAND = "peach remote";
@@ -35619,10 +35874,10 @@ var init_app_splash = __esm({
35619
35874
 
35620
35875
  // src/bridge-contract.ts
35621
35876
  function readyProbeHasContent(probe3) {
35622
- return probe3.liveFrameActive || probe3.targets > 0 || probe3.nodes >= SEMANTIC_READY_CONTENT_NODE_FLOOR;
35877
+ return (probe3.browserSurfaceCount ?? 0) > 0 || probe3.liveFrameActive || probe3.targets > 0 || probe3.nodes >= SEMANTIC_READY_CONTENT_NODE_FLOOR;
35623
35878
  }
35624
35879
  function readyProbeHasTargetContent(probe3) {
35625
- return probe3.liveFrameActive || probe3.targets > 0;
35880
+ return (probe3.browserSurfaceCount ?? 0) > 0 || probe3.liveFrameActive || probe3.targets > 0;
35626
35881
  }
35627
35882
  function readyProbeIsReady(probe3) {
35628
35883
  return (probe3.flag === true ? readyProbeHasContent(probe3) : readyProbeHasTargetContent(probe3)) && probe3.externalReady !== false && !probe3.externalError && !probe3.loadingText;
@@ -36160,6 +36415,7 @@ function waitReadyStatus(result, ready) {
36160
36415
  nodes: probe3?.nodes ?? 0,
36161
36416
  targets: probe3?.targets ?? 0,
36162
36417
  liveFrameActive: probe3?.liveFrameActive ?? false,
36418
+ browserSurfaceCount: probe3?.browserSurfaceCount ?? 0,
36163
36419
  liveFrameChannels: probe3?.liveFrameChannels ?? 0,
36164
36420
  liveFramePublishes: probe3?.liveFramePublishes ?? 0,
36165
36421
  flag: probe3?.flag,
@@ -38414,6 +38670,7 @@ var init_command_registry = __esm({
38414
38670
  "state",
38415
38671
  "reset",
38416
38672
  "camera",
38673
+ "location",
38417
38674
  "mode",
38418
38675
  "debug",
38419
38676
  "timeline",
@@ -39244,7 +39501,7 @@ function looksLikeSootsimUrl(target) {
39244
39501
  try {
39245
39502
  const url = new URL(target);
39246
39503
  const pathname = url.pathname.replace(/\/+$/, "") || "/";
39247
- return url.searchParams.has("open") || url.searchParams.has("port") || url.searchParams.has("bundle") || url.searchParams.has("demo") || url.pathname.includes("/sootsim/index.html") || pathname === "/sootsim" || url.pathname === "/__soot" || url.pathname === "/__soot/" || pathname === "/rn" || /^\/rn\/[^/]+$/i.test(pathname) || /^\/app\/[^/]+$/i.test(pathname) || pathname === "/__soot/rn" || /^\/__soot\/rn\/[^/]+$/i.test(pathname) || /^\/__soot\/app\/[^/]+$/i.test(pathname);
39504
+ return url.searchParams.has("open") || url.searchParams.has("port") || url.searchParams.has("bundle") || url.searchParams.has("demo") || url.pathname.includes("/sootsim/index.html") || /^\/simulator(?:\/(?:rn(?:\/[^/]+)?|app\/[^/]+|dock\/[^/]+))?$/.test(pathname) || pathname === "/sootsim" || url.pathname === "/__soot" || url.pathname === "/__soot/" || pathname === "/rn" || /^\/rn\/[^/]+$/i.test(pathname) || /^\/app\/[^/]+$/i.test(pathname) || pathname === "/__soot/rn" || /^\/__soot\/rn\/[^/]+$/i.test(pathname) || /^\/__soot\/app\/[^/]+$/i.test(pathname);
39248
39505
  } catch {
39249
39506
  return false;
39250
39507
  }
@@ -41306,6 +41563,16 @@ async function waitForSootsimIdle({
41306
41563
  let requestInFlight = 0
41307
41564
  let renderStatsAvailable = false
41308
41565
  let frameCount = -1
41566
+ let shellAnimating = false
41567
+ // strict also waits out shell motion: a system alert, sheet or menu
41568
+ // animates in the shell worker while the app's own stats read still,
41569
+ // so its presentation is complete only once the shell's list empties.
41570
+ if (strict) {
41571
+ try {
41572
+ const motion = await window.__sootsimTest?.listAnimations?.()
41573
+ shellAnimating = Array.isArray(motion) && motion.some((anim) => anim.realm === 'shell')
41574
+ } catch {}
41575
+ }
41309
41576
  try {
41310
41577
  const stats = await window.__sootsimRenderHost?.queryStats?.()
41311
41578
  if (stats) {
@@ -41343,7 +41610,7 @@ async function waitForSootsimIdle({
41343
41610
  }
41344
41611
  walk(root)
41345
41612
  }
41346
- return { layout: nodes.join(';'), frameCount, animating, layoutDirty, pendingFetches, renderStatsAvailable, requestTotal, requestInFlight }
41613
+ return { layout: nodes.join(';'), frameCount, animating, shellAnimating, layoutDirty, pendingFetches, renderStatsAvailable, requestTotal, requestInFlight }
41347
41614
  }
41348
41615
 
41349
41616
  // how long generic background network is allowed to keep us waiting AFTER
@@ -41374,13 +41641,16 @@ async function waitForSootsimIdle({
41374
41641
  const snapshot = await readSnapshot()
41375
41642
  polls++
41376
41643
  if (snapshot.layoutDirty) dirtyPolls++
41377
- if (snapshot.animating) animatingPolls++
41644
+ if (snapshot.animating || snapshot.shellAnimating) animatingPolls++
41378
41645
  if (polls > 1 && snapshot.layout !== lastLayout) layoutChangedPolls++
41379
41646
  const painted = paintStill && snapshot.frameCount !== lastFrameCount
41380
41647
  if (polls > 1 && painted) paintedPolls++
41381
41648
  const strictOk =
41382
41649
  !strict ||
41383
- (snapshot.renderStatsAvailable && !snapshot.animating && !snapshot.layoutDirty)
41650
+ (snapshot.renderStatsAvailable &&
41651
+ !snapshot.animating &&
41652
+ !snapshot.shellAnimating &&
41653
+ !snapshot.layoutDirty)
41384
41654
  // visually settled: no animations, no image content loading, layout
41385
41655
  // unchanged since the last poll.
41386
41656
  const visuallyStill =
@@ -41416,6 +41686,7 @@ async function waitForSootsimIdle({
41416
41686
  const blockers = []
41417
41687
  if (strict && !last.renderStatsAvailable) blockers.push('render stats unavailable')
41418
41688
  if (last.animating) blockers.push('animations still running')
41689
+ if (last.shellAnimating) blockers.push('shell animations still running')
41419
41690
  if (last.layoutDirty) blockers.push('layout still dirty')
41420
41691
  if (last.pendingFetches > 0) blockers.push(last.pendingFetches + ' image fetches pending')
41421
41692
  if (last.layout !== lastLayout) blockers.push('layout still changing')