peachsim 0.1.2490 → 0.1.2492

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 (140) hide show
  1. package/cli/bridge-flow-runner.ts +190 -167
  2. package/cli/cloud-box-artifact.ts +49 -0
  3. package/cli/cloud-client.ts +7 -2
  4. package/cli/commands/inspect/settling.ts +7 -2
  5. package/cli/commands/platform.ts +7 -1
  6. package/cli/native-input.ts +18 -8
  7. package/dist-lib/agent-daemon-client.cjs +1 -1
  8. package/dist-lib/agent-events.cjs +1 -1
  9. package/dist-lib/attached-projects.cjs +1 -1
  10. package/dist-lib/auth/shared-session.cjs +1 -1
  11. package/dist-lib/backend-origin.cjs +1 -1
  12. package/dist-lib/beta.cjs +1 -1
  13. package/dist-lib/beta.mjs +2 -2
  14. package/dist-lib/bridge-constants.cjs +1 -1
  15. package/dist-lib/bridge-contract-input.cjs +1 -1
  16. package/dist-lib/bridge-contract-input.mjs +5 -5
  17. package/dist-lib/bridge-contract.cjs +1 -1
  18. package/dist-lib/bridge-contract.mjs +3 -3
  19. package/dist-lib/bundle-channel.cjs +2 -2
  20. package/dist-lib/capture-contract.cjs +1 -1
  21. package/dist-lib/capture-contract.mjs +3 -3
  22. package/dist-lib/cloud-contract.cjs +1 -1
  23. package/dist-lib/cloud-contract.mjs +3 -3
  24. package/dist-lib/cloud-test-args.cjs +1 -1
  25. package/dist-lib/cloud-test-args.mjs +2 -2
  26. package/dist-lib/cloud.cjs +1 -1
  27. package/dist-lib/cloud.mjs +7 -7
  28. package/dist-lib/config.cjs +1 -1
  29. package/dist-lib/config.mjs +5 -5
  30. package/dist-lib/detox/index.cjs +8 -3
  31. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  32. package/dist-lib/esm-chunks/{acorn-V3XDEDP6.mjs → acorn-FU2FRHH2.mjs} +3 -3
  33. package/dist-lib/esm-chunks/{chunk-ZMCFZNUO.mjs → chunk-2PXTYLHZ.mjs} +5 -5
  34. package/dist-lib/esm-chunks/{chunk-HEOMLBGO.mjs → chunk-5CBH6U4Z.mjs} +1 -1
  35. package/dist-lib/esm-chunks/{chunk-P6RAV46E.mjs → chunk-5D567O3G.mjs} +5 -5
  36. package/dist-lib/esm-chunks/{chunk-3JP3KRAD.mjs → chunk-66G5BBLZ.mjs} +1 -1
  37. package/dist-lib/esm-chunks/{chunk-633546VE.mjs → chunk-AYLLC3WV.mjs} +1 -1
  38. package/dist-lib/esm-chunks/{chunk-KGUUTG42.mjs → chunk-DDEXJ7N5.mjs} +1 -1
  39. package/dist-lib/esm-chunks/{chunk-ZR3V6DY4.mjs → chunk-DIKB4ZTF.mjs} +1 -1
  40. package/dist-lib/esm-chunks/{chunk-FLENJWNX.mjs → chunk-HHC6G7P2.mjs} +1 -1
  41. package/dist-lib/esm-chunks/{chunk-ISB7UYPO.mjs → chunk-HMFMZEYN.mjs} +1 -1
  42. package/dist-lib/esm-chunks/{chunk-MSVSZ66J.mjs → chunk-IOMFLWBI.mjs} +2 -2
  43. package/dist-lib/esm-chunks/{chunk-6J6FWZLQ.mjs → chunk-MA2ZJ77J.mjs} +1 -1
  44. package/dist-lib/esm-chunks/{chunk-DCO5CMNF.mjs → chunk-N27ZLCKM.mjs} +1 -1
  45. package/dist-lib/esm-chunks/{chunk-N7VZ7VEK.mjs → chunk-PZMRNAME.mjs} +1 -1
  46. package/dist-lib/esm-chunks/{chunk-KUFZD2CT.mjs → chunk-QI3ZYNIW.mjs} +1 -1
  47. package/dist-lib/esm-chunks/{chunk-E6Q66I6T.mjs → chunk-SUBUXVVR.mjs} +1 -1
  48. package/dist-lib/esm-chunks/{chunk-PBEN5WRU.mjs → chunk-WBME7FVJ.mjs} +1 -1
  49. package/dist-lib/esm-chunks/{chunk-LATLGHGM.mjs → chunk-WHCH5I3R.mjs} +12 -12
  50. package/dist-lib/esm-chunks/{chunk-HGXXVBJG.mjs → chunk-WXSE2Q5H.mjs} +3 -3
  51. package/dist-lib/esm-chunks/{chunk-6V2ECPE7.mjs → chunk-WZC67JCE.mjs} +1 -1
  52. package/dist-lib/esm-chunks/{chunk-O7GFR7YK.mjs → chunk-XMN5ZUL5.mjs} +4 -4
  53. package/dist-lib/esm-chunks/{chunk-AQ3PGPWE.mjs → chunk-YLQTCLSU.mjs} +1 -1
  54. package/dist-lib/esm-chunks/{metro-layout-parser-JHKSRYFH.mjs → metro-layout-parser-MCDRWEZS.mjs} +3 -3
  55. package/dist-lib/esm-chunks/{swift-package-prebuilt-JX5THTBC.mjs → swift-package-prebuilt-UFSFZOBX.mjs} +10 -10
  56. package/dist-lib/esm-chunks/{swift-sdk-app-module-W6JPOC7Q.mjs → swift-sdk-app-module-G4ILN2V5.mjs} +13 -13
  57. package/dist-lib/esm-chunks/{swift-sdk-image-7IQKWX4J.mjs → swift-sdk-image-VIXRBEVE.mjs} +13 -13
  58. package/dist-lib/esm-chunks/{swift-sdk-image-producer-IFBEHFC5.mjs → swift-sdk-image-producer-CDWJNY67.mjs} +4 -4
  59. package/dist-lib/expo-swift-bundle.cjs +2 -2
  60. package/dist-lib/expo-swift-metadata.cjs +1 -1
  61. package/dist-lib/expo-swift-metadata.mjs +7 -7
  62. package/dist-lib/home-paths.cjs +1 -1
  63. package/dist-lib/host/bridge-host.cjs +5 -4
  64. package/dist-lib/host/fetch-proxy-handler.cjs +2 -2
  65. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  66. package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
  67. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  68. package/dist-lib/host/websocket-proxy.cjs +1 -1
  69. package/dist-lib/index.cjs +11 -5
  70. package/dist-lib/kotlin-host.cjs +1 -1
  71. package/dist-lib/menu.cjs +1 -1
  72. package/dist-lib/menu.mjs +3 -3
  73. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  74. package/dist-lib/metro-fingerprint-registry.mjs +3 -3
  75. package/dist-lib/metro-production-bundle.cjs +1 -1
  76. package/dist-lib/metro-production-bundle.mjs +4 -4
  77. package/dist-lib/native-app-identity-project.cjs +1 -1
  78. package/dist-lib/native-app-identity-project.mjs +15 -15
  79. package/dist-lib/native-app-identity.cjs +1 -1
  80. package/dist-lib/native-app-identity.mjs +6 -6
  81. package/dist-lib/native-firebase-metadata.cjs +1 -1
  82. package/dist-lib/native-firebase-metadata.mjs +3 -3
  83. package/dist-lib/pdfium-raster.cjs +1 -1
  84. package/dist-lib/pdfium-raster.mjs +2 -2
  85. package/dist-lib/plist.cjs +1 -1
  86. package/dist-lib/plist.mjs +3 -3
  87. package/dist-lib/profiles.cjs +1 -1
  88. package/dist-lib/public-brand.cjs +1 -1
  89. package/dist-lib/public-origins-lib-esm.json +79 -79
  90. package/dist-lib/public-origins-lib.json +69 -69
  91. package/dist-lib/react-native-host-modules.cjs +1 -1
  92. package/dist-lib/react-native-host-modules.mjs +2 -2
  93. package/dist-lib/reap-browser.cjs +1 -1
  94. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  95. package/dist-lib/sdk.cjs +8 -3
  96. package/dist-lib/sdk.mjs +14 -9
  97. package/dist-lib/skills.cjs +168 -186
  98. package/dist-lib/swift-compile.cjs +1 -1
  99. package/dist-lib/swift-compile.mjs +10 -10
  100. package/dist-lib/swift-package.cjs +1 -1
  101. package/dist-lib/swift-package.mjs +3 -3
  102. package/dist-lib/swift-submit.cjs +1 -1
  103. package/dist-lib/swift-submit.mjs +5 -5
  104. package/dist-lib/swift-svg-raster.cjs +1 -1
  105. package/dist-lib/swift-svg-raster.mjs +2 -2
  106. package/dist-lib/swift-toolchain.cjs +1 -1
  107. package/dist-lib/swift.cjs +1 -1
  108. package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
  109. package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
  110. package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
  111. package/dist-lib/vendor/@xmldom/xmldom.cjs +1 -1
  112. package/dist-lib/vendor/acorn.cjs +1 -1
  113. package/dist-lib/vendor/bplist-parser.cjs +1 -1
  114. package/dist-lib/vendor/ignore.cjs +1 -1
  115. package/dist-lib/vendor/magic-string.cjs +1 -1
  116. package/dist-lib/vendor/plist.cjs +1 -1
  117. package/dist-lib/vendor/smol-toml.cjs +1 -1
  118. package/dist-lib/vendor/stream-json.cjs +1 -1
  119. package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
  120. package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
  121. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
  122. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
  123. package/dist-lib/vendor/sucrase.cjs +1 -1
  124. package/dist-lib/vendor/terser.cjs +1 -1
  125. package/dist-lib/vendor/valibot.cjs +1 -1
  126. package/dist-lib/vendor/ws.cjs +1 -1
  127. package/dist-lib/vendor/zod.cjs +1 -1
  128. package/dist-lib/worklet-executable.cjs +1 -1
  129. package/dist-lib/worklet-executable.mjs +3 -3
  130. package/dist-types/packages/peach-engine/src/engine/node.d.ts +1 -1
  131. package/dist-types/packages/peach-engine/src/engine/types.d.ts +1 -1
  132. package/dist-types/packages/peach-engine/src/render-worker/host.d.ts +2 -1
  133. package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +8 -9
  134. package/dist-types/packages/peach-globals/src/index.d.ts +2 -2
  135. package/dist-types/packages/peach-globals/src/nodeContract.d.ts +1 -0
  136. package/dist-types/packages/peach-globals/src/testBridgeContract.d.ts +13 -1
  137. package/package.json +1 -1
  138. package/src/bridge-contract.ts +2 -17
  139. package/src/connect.ts +1 -1
  140. package/src/guest-bundle.ts +3 -2
package/dist-lib/sdk.mjs CHANGED
@@ -1,25 +1,25 @@
1
- /*! peach v0.1.2490 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2492 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  import {
3
3
  SEMANTIC_WAIT_MAX_TIMEOUT_MS,
4
4
  parseDiagnosticsResult
5
- } from "./esm-chunks/chunk-HGXXVBJG.mjs";
5
+ } from "./esm-chunks/chunk-WXSE2Q5H.mjs";
6
6
  import {
7
7
  LAUNCH_METADATA_KEYS,
8
8
  LAUNCH_METADATA_QUERY_PARAM
9
- } from "./esm-chunks/chunk-N7VZ7VEK.mjs";
9
+ } from "./esm-chunks/chunk-PZMRNAME.mjs";
10
10
  import {
11
11
  HEADLESS_TENANT_FETCH_HUNG_MARKER,
12
12
  readyProbeContentBasis,
13
13
  readyProbeHasContent,
14
14
  readyProbeIsReady
15
- } from "./esm-chunks/chunk-KGUUTG42.mjs";
15
+ } from "./esm-chunks/chunk-DDEXJ7N5.mjs";
16
16
  import {
17
17
  sleep
18
- } from "./esm-chunks/chunk-KUFZD2CT.mjs";
19
- import "./esm-chunks/chunk-PBEN5WRU.mjs";
18
+ } from "./esm-chunks/chunk-QI3ZYNIW.mjs";
19
+ import "./esm-chunks/chunk-WBME7FVJ.mjs";
20
20
  import {
21
21
  __publicField
22
- } from "./esm-chunks/chunk-6V2ECPE7.mjs";
22
+ } from "./esm-chunks/chunk-WZC67JCE.mjs";
23
23
 
24
24
  // cli/commands/inspect/core.ts
25
25
  var MAX_MS_FLAG_ALIASES = ["--max-ms", "--maxMs", "--maxms", "--max_ms", "--timeout"];
@@ -1798,7 +1798,9 @@ function renderActivityIdleScript({
1798
1798
  }
1799
1799
  const blockers = []
1800
1800
  const stats = await Promise.race([
1801
- Promise.resolve().then(() => host?.queryStats(false)).catch(() => null),
1801
+ Promise.resolve()
1802
+ .then(() => host?.queryReadinessStats ? host.queryReadinessStats() : host?.queryStats(false))
1803
+ .catch(() => null),
1802
1804
  new Promise((resolve) => setTimeout(() => resolve(null), 500)),
1803
1805
  ])
1804
1806
  if (stats) {
@@ -1954,7 +1956,10 @@ async function waitForSootsimIdle({
1954
1956
  const motionRead = strict || screenStill
1955
1957
  ? answer(() => globalThis.__sootsimTest?.listAnimations?.()).catch(() => null)
1956
1958
  : null
1957
- const statsRead = answer(() => globalThis.__sootsimRenderHost?.queryStats?.(false)).catch(() => null)
1959
+ const host = globalThis.__sootsimRenderHost
1960
+ const statsRead = answer(() =>
1961
+ host?.queryReadinessStats ? host.queryReadinessStats() : host?.queryStats?.(false)
1962
+ ).catch(() => null)
1958
1963
  // image preparation ends in the tenant before the compositor decodes
1959
1964
  // and realizes its pixels. both owners must finish before settling.
1960
1965
  // the compositor rejects a stats request it is too busy to answer.
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2490 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2492 | (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;
@@ -35508,7 +35508,7 @@ var init_swift_standin_digest = __esm({
35508
35508
 
35509
35509
  // src/expo-native-compiler-digest.ts
35510
35510
  function expoNativeCompilerDigestValue() {
35511
- return true ? "5ecccf2b494fb8b3c2cf21811592de3c3ec410e9cae0e92acb330c9e1365b32d" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
35511
+ return true ? "1c0184f1321579a9b9b9c0308b04ff09e6300798e4e113cf490c8718edbeb72c" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
35512
35512
  }
35513
35513
  var import_node_crypto12;
35514
35514
  var init_expo_native_compiler_digest = __esm({
@@ -118790,10 +118790,11 @@ var init_metro_runtime_source = __esm({
118790
118790
  function productionNativeGuestSource(source) {
118791
118791
  return source.startsWith(productionPrelude) ? source : productionPrelude + source;
118792
118792
  }
118793
- function swiftGuestBundle(packageName2) {
118793
+ function swiftGuestBundle(packageName2, metadataUrl) {
118794
+ const args = metadataUrl ? [packageName2, metadataUrl] : [packageName2];
118794
118795
  return guestBundle(
118795
118796
  "peachsim/swift",
118796
- `AppRegistry.registerComponent('PeachSwift', () => host.createSwiftPreviewEntry(${JSON.stringify(packageName2)}))`
118797
+ `AppRegistry.registerComponent('PeachSwift', () => host.createSwiftPreviewEntry(${args.map((arg) => JSON.stringify(arg)).join(", ")}))`
118797
118798
  );
118798
118799
  }
118799
118800
  function kotlinGuestBundle() {
@@ -147239,6 +147240,7 @@ async function deleteRemoteSim(options2) {
147239
147240
  return { simId: parsed2.simId, status: parsed2.status };
147240
147241
  }
147241
147242
  function resolveCloudSessionForParsed(parsed2) {
147243
+ if (parsed2.explicitPort) return null;
147242
147244
  const session = readCloudSession();
147243
147245
  if (!session) return null;
147244
147246
  if (session.service === "box") {
@@ -175253,6 +175255,14 @@ async function prepareSwiftInput(input, opts = {}) {
175253
175255
  host2.disposeSwiftProject(packagePath);
175254
175256
  throw error;
175255
175257
  }
175258
+ const createGuestSource = async (config, metadataUrl) => {
175259
+ const source = await produceConfiguredBundle(
175260
+ swiftGuestBundle(name3, metadataUrl),
175261
+ config,
175262
+ /* @__PURE__ */ new Set()
175263
+ );
175264
+ return appInfo.identity ? insertNativeAppIdentityFooter(source, appInfo.identity) : source;
175265
+ };
175256
175266
  return {
175257
175267
  host: host2,
175258
175268
  module: module2,
@@ -175260,15 +175270,13 @@ async function prepareSwiftInput(input, opts = {}) {
175260
175270
  name: name3,
175261
175271
  appProject,
175262
175272
  appInfo,
175273
+ async guestSourceForMetadataUrl(metadataUrl) {
175274
+ return createGuestSource(await loadRNXAppConfig(appProject), metadataUrl);
175275
+ },
175263
175276
  async build(origin) {
175264
175277
  const config = await loadRNXAppConfig(appProject);
175265
175278
  host2.configureSwiftProject(packagePath, config);
175266
- const source = await produceConfiguredBundle(
175267
- swiftGuestBundle(name3),
175268
- config,
175269
- /* @__PURE__ */ new Set()
175270
- );
175271
- const guestSource = appInfo.identity ? insertNativeAppIdentityFooter(source, appInfo.identity) : source;
175279
+ const guestSource = await createGuestSource(config);
175272
175280
  const metadata = await host2.swiftPackageMetadata(
175273
175281
  packagePath,
175274
175282
  name3,
@@ -175330,6 +175338,7 @@ async function prepareNativeInput(input, opts) {
175330
175338
  metadataPath: SWIFT_PACKAGE_PATH + encodeURIComponent(prepared.name),
175331
175339
  icon: prepared.appInfo.icon,
175332
175340
  assets: assets2,
175341
+ guestSourceForMetadataUrl: prepared.guestSourceForMetadataUrl,
175333
175342
  dispose: prepared.dispose
175334
175343
  };
175335
175344
  } catch (error) {
@@ -178674,7 +178683,9 @@ function renderActivityIdleScript({
178674
178683
  }
178675
178684
  const blockers = []
178676
178685
  const stats = await Promise.race([
178677
- Promise.resolve().then(() => host?.queryStats(false)).catch(() => null),
178686
+ Promise.resolve()
178687
+ .then(() => host?.queryReadinessStats ? host.queryReadinessStats() : host?.queryStats(false))
178688
+ .catch(() => null),
178678
178689
  new Promise((resolve) => setTimeout(() => resolve(null), 500)),
178679
178690
  ])
178680
178691
  if (stats) {
@@ -178830,7 +178841,10 @@ async function waitForSootsimIdle({
178830
178841
  const motionRead = strict || screenStill
178831
178842
  ? answer(() => globalThis.__sootsimTest?.listAnimations?.()).catch(() => null)
178832
178843
  : null
178833
- const statsRead = answer(() => globalThis.__sootsimRenderHost?.queryStats?.(false)).catch(() => null)
178844
+ const host = globalThis.__sootsimRenderHost
178845
+ const statsRead = answer(() =>
178846
+ host?.queryReadinessStats ? host.queryReadinessStats() : host?.queryStats?.(false)
178847
+ ).catch(() => null)
178834
178848
  // image preparation ends in the tenant before the compositor decodes
178835
178849
  // and realizes its pixels. both owners must finish before settling.
178836
178850
  // the compositor rejects a stats request it is too busy to answer.
@@ -180573,178 +180587,145 @@ var init_bridge_flow_runner = __esm({
180573
180587
  // (match scoped to a container). a nested selector resolves the same way,
180574
180588
  // and a relative filter holds when ANY match of its anchor satisfies it.
180575
180589
  async findElementScoped(opts, preferHittable = false) {
180576
- const screen = await this.screenBounds();
180577
- const candidates = await this.evaluate(`(async () => {
180578
- const test = globalThis.__sootsimTest
180579
- if (!test || !test.queryAll) return null
180580
- const selector = ${JSON.stringify(opts)}
180581
- const compile = ${maestroSelectorMatcher.toString()}
180582
- // relative filters need their anchors too; other id selectors only
180583
- // project matching nodes, retaining every duplicate for ordering below.
180584
- // patterns accepting an absent id also need unidentified nodes.
180585
- const idMatcher = selector.id == null ? null : compile(selector.id, 'id')
180586
- const needsAnchors = ['childOf', 'below', 'above', 'leftOf', 'rightOf']
180587
- .some((key) => selector[key] != null)
180588
- const query = idMatcher && !idMatcher(null) && !needsAnchors
180589
- ? { idPattern: { source: idMatcher.source, flags: idMatcher.flags, matchLastSegment: true } }
180590
- : {}
180591
- const all = ((await test.queryAll(query)) || []).filter(
180592
- (n) => n && n.absolutePosition && n.layout,
180593
- )
180594
- // maestro reads ios frames as integer edges (AXElement.boundsString)
180595
- const bounds = (n) => {
180596
- const left = Math.trunc(n.absolutePosition.x)
180597
- const top = Math.trunc(n.absolutePosition.y)
180598
- return {
180599
- x: left,
180600
- y: top,
180601
- width: Math.trunc(n.absolutePosition.x + n.layout.width) - left,
180602
- height: Math.trunc(n.absolutePosition.y + n.layout.height) - top,
180603
- }
180604
- }
180605
- const painted = (n) => (n.visibleFrame?.area ?? 0) > 0
180606
- // one viewport contract, shared with isOffscreen in
180607
- // commands/inspect/resolve-target.ts: a center on the edge still takes
180608
- // a tap, so the edge counts as on screen here too.
180609
- const centerOnScreen = (n) => {
180610
- const cx = n.absolutePosition.x + n.layout.width / 2
180611
- const cy = n.absolutePosition.y + n.layout.height / 2
180612
- return cx >= 0 && cx <= ${screen.width} && cy >= 0 && cy <= ${screen.height}
180613
- }
180614
- const byPosition = (a, b) =>
180615
- a.absolutePosition.y - b.absolutePosition.y ||
180616
- a.absolutePosition.x - b.absolutePosition.x
180617
- const relative = {
180618
- below: (n, other) => bounds(n).y > bounds(other).y,
180619
- above: (n, other) => bounds(n).y < bounds(other).y,
180620
- leftOf: (n, other) => bounds(n).x < bounds(other).x,
180621
- rightOf: (n, other) => bounds(n).x > bounds(other).x,
180622
- }
180623
- const traitFilters = {
180624
- TEXT: (n) => n.text != null,
180625
- SQUARE: (n) => {
180626
- const b = bounds(n)
180627
- return Math.abs(1 - b.width / b.height) < 0.03
180628
- },
180629
- LONG_TEXT: (n) => (n.text?.length ?? 0) > 200,
180630
- }
180631
- const matchAll = (raw) => {
180632
- const sel = typeof raw === 'string' ? { text: raw } : raw
180633
- const matchesId = sel.id == null ? null : compile(sel.id, 'id')
180634
- const matchesText = sel.text == null ? null : compile(sel.text, 'text')
180635
- let candidates = all.filter((n) =>
180636
- (!matchesId || matchesId(n.testID)) &&
180637
- (!matchesText || matchesText(n.text) || matchesText(n.accessibilityLabel) || matchesText(n.placeholder)),
180638
- )
180639
- if (sel.width != null || sel.height != null) {
180640
- const tolerance = sel.tolerance ?? 0
180641
- candidates = candidates.filter((n) => {
180642
- const b = bounds(n)
180643
- return (sel.width == null || Math.abs(b.width - sel.width) <= tolerance) &&
180644
- (sel.height == null || Math.abs(b.height - sel.height) <= tolerance)
180645
- })
180646
- }
180647
- for (const trait of sel.traits ? String(sel.traits).split(' ') : []) {
180648
- const filter = traitFilters[trait.replaceAll('-', '_').toUpperCase()]
180649
- if (!filter) throw new Error('unknown selector trait: ' + trait)
180650
- candidates = candidates.filter(filter)
180651
- }
180652
- // ios reports isEnabled / isSelected from the accessibility traits
180653
- // react native derives from accessibilityState
180654
- if (sel.enabled != null) {
180655
- candidates = candidates.filter((n) => !n.accessibilityState?.disabled === sel.enabled)
180656
- }
180657
- if (sel.selected != null) {
180658
- candidates = candidates.filter((n) => !!n.accessibilityState?.selected === sel.selected)
180659
- }
180660
- // maestro's ios checked: a switch whose value is "1". react native
180661
- // gives the switch role that trait and reports "1" from
180662
- // accessibilityState.checked; a checkbox role gets no trait, so ios
180663
- // never reads it as checked.
180664
- if (sel.checked != null) {
180665
- candidates = candidates.filter(
180666
- (n) =>
180667
- (n.accessibilityRole === 'switch' && n.accessibilityState?.checked === true) ===
180668
- sel.checked,
180669
- )
180670
- }
180671
- for (const key of Object.keys(relative)) {
180672
- if (sel[key] == null) continue
180673
- const anchors = pick(matchAll(sel[key]), sel[key].index)
180674
- candidates = candidates.filter((n) => anchors.some((other) => relative[key](n, other)))
180675
- }
180676
- // scope before visibility: childOf narrows the match set first, so a
180677
- // clipped sliver inside the container survives to resolve (and refuse
180678
- // honestly) instead of being discarded for a hittable duplicate the
180679
- // scope then removes.
180680
- if (sel.childOf) {
180681
- const containers = matchAll(sel.childOf)
180682
- const container = containers.find(painted) ?? containers[0]
180683
- if (!container) return []
180684
- const x0 = container.absolutePosition.x
180685
- const y0 = container.absolutePosition.y
180686
- const x1 = x0 + container.layout.width
180687
- const y1 = y0 + container.layout.height
180688
- candidates = candidates.filter((n) => {
180689
- const cx = n.absolutePosition.x + n.layout.width / 2
180690
- const cy = n.absolutePosition.y + n.layout.height / 2
180691
- return cx >= x0 && cx <= x1 && cy >= y0 && cy <= y1
180692
- })
180693
- }
180694
- // prefer painted matches, then on-screen ones (findByTestId's
180695
- // visible-first behavior); only fall back to off-screen ones when
180696
- // nothing is on-screen, so index: still resolves a target that needs
180697
- // scrolling into view. a screen still mounted under the one on top
180698
- // paints nothing, and maestro's hierarchy never holds it.
180699
- const onScreen = candidates.filter(centerOnScreen)
180700
- // without an explicit index, prefer a painted match whose center is
180701
- // on screen: a painted sliver with its center off screen cannot take
180702
- // a tap at its center, so a duplicate id resolves to the hittable
180703
- // match. an explicit index keeps the full painted order, and a
180704
- // clipped-only match still resolves so the tap reports honestly.
180705
- const paintedCandidates = candidates.filter(painted)
180706
- if (paintedCandidates.length > 0) {
180707
- if (sel.index == null) {
180708
- const hittable = paintedCandidates.filter(centerOnScreen)
180709
- candidates = hittable.length > 0 ? hittable : paintedCandidates
180710
- } else {
180711
- candidates = paintedCandidates
180712
- }
180713
- } else if (onScreen.length > 0) candidates = onScreen
180714
- // maestro's index: sorts matches by frame y, then x, and without an
180715
- // index takes the first in the ios hierarchy, which lays siblings out
180716
- // by position rather than subview order (RAN on ios 27: two views with
180717
- // one identifier, the first subview moved below by a transform, maestro
180718
- // takes the upper one). a list that renders rows in key order and
180719
- // places them by transform still resolves its top row.
180720
- candidates.sort(byPosition)
180721
- if (sel.index == null && sel.text && !sel.id) {
180722
- candidates.sort((a, b) => (a.text || '').length - (b.text || '').length)
180723
- }
180724
- return candidates
180725
- }
180726
- // maestro Filters.index: a negative index counts from the end
180727
- const pick = (candidates, rawIndex) => {
180728
- if (rawIndex == null) return candidates
180729
- const index = Math.trunc(Number(rawIndex))
180730
- const resolved = index >= 0 ? index : candidates.length + index
180731
- return candidates[resolved] ? [candidates[resolved]] : []
180732
- }
180733
- const matches = pick(matchAll(selector), selector.index)
180734
- const nodes = ${JSON.stringify(preferHittable && opts.index == null)} ? matches : matches.slice(0, 1)
180735
- return nodes.map((node) => ({
180736
- nodeId: typeof node.nodeId === 'number' ? node.nodeId : null,
180737
- id: node.id || null,
180738
- testID: node.testID || null,
180739
- text: node.text || null,
180740
- absolutePosition: node.absolutePosition,
180741
- layout: node.layout,
180742
- // authoritative visibility, as in findElement above.
180743
- visibleFrame: node.visibleFrame || null,
180744
- isTextInput: !!node.isTextInput,
180745
- }))
180746
- })()`);
180747
- if (!candidates?.length) return null;
180590
+ const relativeKeys = ["below", "above", "leftOf", "rightOf"];
180591
+ const needsAnchors = opts.childOf != null || relativeKeys.some((key2) => opts[key2] != null);
180592
+ const recordQuery = this.bridge.send({
180593
+ type: "query",
180594
+ simId: this.opts.simId,
180595
+ query: { kind: "nodes", id: needsAnchors ? void 0 : opts.id }
180596
+ });
180597
+ const [screen, result] = await Promise.all([this.screenBounds(), recordQuery]);
180598
+ const all = result.records;
180599
+ if (!Array.isArray(all)) throw new Error("engine returned no selector node records");
180600
+ const bounds = (n) => {
180601
+ const left = Math.trunc(n.absolutePosition.x);
180602
+ const top = Math.trunc(n.absolutePosition.y);
180603
+ return {
180604
+ x: left,
180605
+ y: top,
180606
+ width: Math.trunc(n.absolutePosition.x + n.layout.width) - left,
180607
+ height: Math.trunc(n.absolutePosition.y + n.layout.height) - top
180608
+ };
180609
+ };
180610
+ const painted = (n) => (n.visibleFrame?.area ?? 0) > 0;
180611
+ const centerOnScreen = (n) => {
180612
+ const cx = n.absolutePosition.x + n.layout.width / 2;
180613
+ const cy = n.absolutePosition.y + n.layout.height / 2;
180614
+ return cx >= 0 && cx <= screen.width && cy >= 0 && cy <= screen.height;
180615
+ };
180616
+ const byPosition = (a, b) => a.absolutePosition.y - b.absolutePosition.y || a.absolutePosition.x - b.absolutePosition.x;
180617
+ const relative6 = {
180618
+ below: (n, other) => bounds(n).y > bounds(other).y,
180619
+ above: (n, other) => bounds(n).y < bounds(other).y,
180620
+ leftOf: (n, other) => bounds(n).x < bounds(other).x,
180621
+ rightOf: (n, other) => bounds(n).x > bounds(other).x
180622
+ };
180623
+ const traitFilters = /* @__PURE__ */ new Map([
180624
+ ["TEXT", (node) => node.text != null],
180625
+ [
180626
+ "SQUARE",
180627
+ (node) => {
180628
+ const frame = bounds(node);
180629
+ return Math.abs(1 - frame.width / frame.height) < 0.03;
180630
+ }
180631
+ ],
180632
+ ["LONG_TEXT", (node) => (node.text?.length ?? 0) > 200]
180633
+ ]);
180634
+ const matchAll = (raw2) => {
180635
+ const sel = typeof raw2 === "string" ? { text: raw2 } : raw2;
180636
+ const matchesId = sel.id == null ? null : maestroSelectorMatcher(sel.id, "id");
180637
+ const matchesText = sel.text == null ? null : maestroSelectorMatcher(sel.text, "text");
180638
+ let candidates2 = all.filter(
180639
+ (n) => (!matchesId || matchesId(n.testID)) && (!matchesText || matchesText(n.text) || matchesText(n.accessibilityLabel) || matchesText(n.placeholder))
180640
+ );
180641
+ if (sel.width != null || sel.height != null) {
180642
+ const tolerance = sel.tolerance ?? 0;
180643
+ candidates2 = candidates2.filter((n) => {
180644
+ const b = bounds(n);
180645
+ return (sel.width == null || Math.abs(b.width - sel.width) <= tolerance) && (sel.height == null || Math.abs(b.height - sel.height) <= tolerance);
180646
+ });
180647
+ }
180648
+ for (const trait of sel.traits ? String(sel.traits).split(" ") : []) {
180649
+ const filter = traitFilters.get(trait.replaceAll("-", "_").toUpperCase());
180650
+ if (!filter) throw new Error("unknown selector trait: " + trait);
180651
+ candidates2 = candidates2.filter(filter);
180652
+ }
180653
+ if (sel.enabled != null) {
180654
+ candidates2 = candidates2.filter(
180655
+ (n) => !n.accessibilityState?.disabled === sel.enabled
180656
+ );
180657
+ }
180658
+ if (sel.selected != null) {
180659
+ candidates2 = candidates2.filter(
180660
+ (n) => !!n.accessibilityState?.selected === sel.selected
180661
+ );
180662
+ }
180663
+ if (sel.checked != null) {
180664
+ candidates2 = candidates2.filter(
180665
+ (n) => (n.accessibilityRole === "switch" && n.accessibilityState?.checked === true) === sel.checked
180666
+ );
180667
+ }
180668
+ for (const key2 of relativeKeys) {
180669
+ const anchor = sel[key2];
180670
+ if (anchor == null) continue;
180671
+ const anchors = pick2(
180672
+ matchAll(anchor),
180673
+ typeof anchor === "string" ? void 0 : anchor.index
180674
+ );
180675
+ candidates2 = candidates2.filter(
180676
+ (n) => anchors.some((other) => relative6[key2](n, other))
180677
+ );
180678
+ }
180679
+ if (sel.childOf) {
180680
+ const containers = matchAll(sel.childOf);
180681
+ const container = containers.find(painted) ?? containers[0];
180682
+ if (!container) return [];
180683
+ const x0 = container.absolutePosition.x;
180684
+ const y0 = container.absolutePosition.y;
180685
+ const x1 = x0 + container.layout.width;
180686
+ const y1 = y0 + container.layout.height;
180687
+ candidates2 = candidates2.filter((n) => {
180688
+ const cx = n.absolutePosition.x + n.layout.width / 2;
180689
+ const cy = n.absolutePosition.y + n.layout.height / 2;
180690
+ return cx >= x0 && cx <= x1 && cy >= y0 && cy <= y1;
180691
+ });
180692
+ }
180693
+ const onScreen = candidates2.filter(centerOnScreen);
180694
+ const paintedCandidates = candidates2.filter(painted);
180695
+ if (paintedCandidates.length > 0) {
180696
+ if (sel.index == null) {
180697
+ const hittable = paintedCandidates.filter(centerOnScreen);
180698
+ candidates2 = hittable.length > 0 ? hittable : paintedCandidates;
180699
+ } else {
180700
+ candidates2 = paintedCandidates;
180701
+ }
180702
+ } else if (onScreen.length > 0) candidates2 = onScreen;
180703
+ candidates2.sort(byPosition);
180704
+ if (sel.index == null && sel.text && !sel.id) {
180705
+ candidates2.sort((a, b) => (a.text || "").length - (b.text || "").length);
180706
+ }
180707
+ return candidates2;
180708
+ };
180709
+ const pick2 = (candidates2, rawIndex) => {
180710
+ if (rawIndex == null) return candidates2;
180711
+ const index = Math.trunc(Number(rawIndex));
180712
+ const resolved = index >= 0 ? index : candidates2.length + index;
180713
+ return candidates2[resolved] ? [candidates2[resolved]] : [];
180714
+ };
180715
+ const matches = pick2(matchAll(opts), opts.index);
180716
+ const nodes = preferHittable && opts.index == null ? matches : matches.slice(0, 1);
180717
+ const candidates = nodes.map((node) => ({
180718
+ nodeId: typeof node.nodeId === "number" ? node.nodeId : null,
180719
+ id: node.id || null,
180720
+ testID: node.testID || null,
180721
+ text: node.text || null,
180722
+ absolutePosition: node.absolutePosition,
180723
+ layout: node.layout,
180724
+ // authoritative visibility, as in findElement above.
180725
+ visibleFrame: node.visibleFrame || null,
180726
+ isTextInput: !!node.isTextInput
180727
+ }));
180728
+ if (!candidates.length) return null;
180748
180729
  return preferHittable && opts.index == null ? this.preferHittableCandidate(candidates) : candidates[0];
180749
180730
  }
180750
180731
  async preferHittableCandidate(candidates) {
@@ -181015,13 +180996,14 @@ var init_bridge_flow_runner = __esm({
181015
180996
  const element = await this.findElement(opts);
181016
180997
  if (!element) return false;
181017
180998
  const frame = element.visibleFrame;
181018
- const usable = !!frame && Number.isFinite(frame.width) && Number.isFinite(frame.height) && Number.isFinite(frame.area);
180999
+ const area = frame?.area;
181000
+ const usable = !!frame && Number.isFinite(frame.width) && Number.isFinite(frame.height) && typeof area === "number" && Number.isFinite(area);
181019
181001
  if (!usable) {
181020
181002
  throw new Error(
181021
181003
  `authoritative visibility unavailable for ${JSON.stringify(opts)}: the engine returned visibleFrame ${JSON.stringify(frame ?? null)}`
181022
181004
  );
181023
181005
  }
181024
- return frame.width > 0 && frame.height > 0 && frame.area > 0;
181006
+ return frame.width > 0 && frame.height > 0 && area > 0;
181025
181007
  }
181026
181008
  async inputText(text7) {
181027
181009
  if (!await this.waitForFocusedTextInput()) {
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2490 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2492 | (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;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2490 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2492 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  import {
3
3
  FOUNDATION_IMPLICIT_MODULES,
4
4
  MULTI_MANIFEST_VERSION,
@@ -63,15 +63,15 @@ import {
63
63
  withoutSwiftDeclarations,
64
64
  wrapUIApplicationMainEntry,
65
65
  writeSwiftProject
66
- } from "./esm-chunks/chunk-LATLGHGM.mjs";
67
- import "./esm-chunks/chunk-6J6FWZLQ.mjs";
68
- import "./esm-chunks/chunk-ISB7UYPO.mjs";
69
- import "./esm-chunks/chunk-E6Q66I6T.mjs";
70
- import "./esm-chunks/chunk-ZR3V6DY4.mjs";
71
- import "./esm-chunks/chunk-HEOMLBGO.mjs";
72
- import "./esm-chunks/chunk-FLENJWNX.mjs";
73
- import "./esm-chunks/chunk-PBEN5WRU.mjs";
74
- import "./esm-chunks/chunk-6V2ECPE7.mjs";
66
+ } from "./esm-chunks/chunk-WHCH5I3R.mjs";
67
+ import "./esm-chunks/chunk-MA2ZJ77J.mjs";
68
+ import "./esm-chunks/chunk-HMFMZEYN.mjs";
69
+ import "./esm-chunks/chunk-SUBUXVVR.mjs";
70
+ import "./esm-chunks/chunk-DIKB4ZTF.mjs";
71
+ import "./esm-chunks/chunk-5CBH6U4Z.mjs";
72
+ import "./esm-chunks/chunk-HHC6G7P2.mjs";
73
+ import "./esm-chunks/chunk-WBME7FVJ.mjs";
74
+ import "./esm-chunks/chunk-WZC67JCE.mjs";
75
75
  export {
76
76
  FOUNDATION_IMPLICIT_MODULES,
77
77
  MULTI_MANIFEST_VERSION,
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2490 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2492 | (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 __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2490 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2492 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  import {
3
3
  OBJC_RESOURCE_ACCESSOR_BODY,
4
4
  OBJC_RESOURCE_ACCESSOR_HEADER,
@@ -33,8 +33,8 @@ import {
33
33
  swiftResourceBundles,
34
34
  swiftTargetModuleName,
35
35
  withoutGlogModuleMap
36
- } from "./esm-chunks/chunk-E6Q66I6T.mjs";
37
- import "./esm-chunks/chunk-6V2ECPE7.mjs";
36
+ } from "./esm-chunks/chunk-SUBUXVVR.mjs";
37
+ import "./esm-chunks/chunk-WZC67JCE.mjs";
38
38
  export {
39
39
  OBJC_RESOURCE_ACCESSOR_BODY,
40
40
  OBJC_RESOURCE_ACCESSOR_HEADER,
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2490 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2492 | (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 __defProp = Object.defineProperty;
@@ -1,12 +1,12 @@
1
- /*! peach v0.1.2490 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2492 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  import {
3
3
  isSwiftMetalLibrarySources
4
- } from "./esm-chunks/chunk-ISB7UYPO.mjs";
5
- import "./esm-chunks/chunk-ZR3V6DY4.mjs";
4
+ } from "./esm-chunks/chunk-HMFMZEYN.mjs";
5
+ import "./esm-chunks/chunk-DIKB4ZTF.mjs";
6
6
  import {
7
7
  isRecord
8
- } from "./esm-chunks/chunk-PBEN5WRU.mjs";
9
- import "./esm-chunks/chunk-6V2ECPE7.mjs";
8
+ } from "./esm-chunks/chunk-WBME7FVJ.mjs";
9
+ import "./esm-chunks/chunk-WZC67JCE.mjs";
10
10
 
11
11
  // src/swift-submit.ts
12
12
  var SWIFT_COMPILE_PATH = "/api/swift-compile";
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2490 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2492 | (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 __defProp = Object.defineProperty;