peachsim 0.1.626 → 0.1.628

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +3 -2
  3. package/cli/bin.ts +6 -2
  4. package/cli/bridge-flow-runner.ts +79 -72
  5. package/cli/commands/box/bundle-plane.ts +7 -2
  6. package/cli/commands/box.ts +9 -2
  7. package/cli/commands/cleanup.ts +6 -6
  8. package/cli/commands/control.ts +36 -6
  9. package/cli/commands/detox.ts +25 -11
  10. package/cli/commands/flow.ts +20 -8
  11. package/cli/commands/inspect.ts +22 -37
  12. package/cli/commands/maestro-generate.ts +5 -12
  13. package/cli/commands/maestro.ts +16 -6
  14. package/cli/commands/mode.ts +11 -7
  15. package/cli/commands/platform.ts +1 -0
  16. package/cli/commands/report-issue.ts +1 -1
  17. package/cli/commands/setup.ts +16 -11
  18. package/cli/commands/show-touches-mode.ts +33 -0
  19. package/cli/commands/skills.ts +16 -0
  20. package/cli/commands/test.ts +22 -1
  21. package/cli/commands/upload.ts +18 -8
  22. package/cli/commands/welcome.ts +3 -3
  23. package/cli/drivers/playwright-sim-host.ts +16 -8
  24. package/cli/drivers/playwright.ts +8 -5
  25. package/cli/help-core.ts +9 -4
  26. package/cli/internal-child.ts +14 -2
  27. package/cli/levenshtein.ts +27 -0
  28. package/cli/main.ts +28 -18
  29. package/cli/run-rnx.ts +8 -4
  30. package/cli/ws-bridge.ts +3 -2
  31. package/detox/index.ts +234 -7
  32. package/dist-lib/agent-daemon-client.cjs +2 -1
  33. package/dist-lib/agent-events.cjs +1 -1
  34. package/dist-lib/agent-identity.cjs +1 -1
  35. package/dist-lib/agent-sessions.cjs +1 -1
  36. package/dist-lib/attached-projects.cjs +1 -1
  37. package/dist-lib/auth/shared-session.cjs +1 -1
  38. package/dist-lib/backend-origin.cjs +1 -1
  39. package/dist-lib/beta.cjs +1 -1
  40. package/dist-lib/beta.mjs +1 -1
  41. package/dist-lib/bridge-constants.cjs +4 -1
  42. package/dist-lib/bridge-contract-input.cjs +1 -1
  43. package/dist-lib/bridge-contract-input.mjs +1 -1
  44. package/dist-lib/bridge-contract.cjs +1 -1
  45. package/dist-lib/bridge-contract.mjs +1 -1
  46. package/dist-lib/capture-contract.cjs +18 -8
  47. package/dist-lib/capture-contract.mjs +18 -8
  48. package/dist-lib/cli-constants.cjs +1 -1
  49. package/dist-lib/cloud-contract.cjs +1 -1
  50. package/dist-lib/cloud-contract.mjs +1 -1
  51. package/dist-lib/cloud-test-args.cjs +1 -1
  52. package/dist-lib/cloud-test-args.mjs +1 -1
  53. package/dist-lib/cloud.cjs +1 -1
  54. package/dist-lib/cloud.mjs +1 -1
  55. package/dist-lib/config.cjs +1 -1
  56. package/dist-lib/detox/index.cjs +170 -13
  57. package/dist-lib/dev-bundle-resolution.cjs +2 -2
  58. package/dist-lib/home-paths.cjs +1 -1
  59. package/dist-lib/host/bridge-host.cjs +280 -138
  60. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  61. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  62. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  63. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  64. package/dist-lib/host/websocket-proxy.cjs +1 -1
  65. package/dist-lib/index.cjs +62 -12
  66. package/dist-lib/jump-to-source-babel.cjs +1 -1
  67. package/dist-lib/jump-to-source-native.cjs +1 -1
  68. package/dist-lib/menu.cjs +7 -1
  69. package/dist-lib/menu.mjs +7 -1
  70. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  71. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  72. package/dist-lib/metro-production-bundle.cjs +1 -1
  73. package/dist-lib/metro-production-bundle.mjs +1 -1
  74. package/dist-lib/metro.cjs +43 -4
  75. package/dist-lib/profiles.cjs +1 -1
  76. package/dist-lib/public-brand.cjs +1 -1
  77. package/dist-lib/react-native-host-modules.cjs +1 -1
  78. package/dist-lib/react-native-host-modules.mjs +1 -1
  79. package/dist-lib/render-mode.cjs +1 -1
  80. package/dist-lib/scripts/dev-server-scanner.cjs +215 -28
  81. package/dist-lib/sdk.cjs +1 -1
  82. package/dist-lib/sdk.mjs +1 -1
  83. package/dist-lib/skills.cjs +431 -276
  84. package/dist-lib/swift-compile.cjs +1 -1
  85. package/dist-lib/swift-compile.mjs +1 -1
  86. package/dist-lib/swift-package.cjs +1 -1
  87. package/dist-lib/swift-package.mjs +1 -1
  88. package/dist-lib/swift-submit.cjs +1 -1
  89. package/dist-lib/swift-submit.mjs +1 -1
  90. package/dist-lib/swift.cjs +14512 -14208
  91. package/dist-lib/vite-kotlin.cjs +1 -1
  92. package/dist-lib/vite-swift.cjs +1 -1
  93. package/dist-lib/vite.cjs +44 -4
  94. package/install.mjs +16 -0
  95. package/install.sh +199 -0
  96. package/package.json +6 -1
  97. package/scripts/dev-server-scanner.ts +77 -46
  98. package/skills/contrast/SKILL.md +1 -1
  99. package/src/bridge-constants.ts +11 -0
  100. package/src/capture-contract.ts +40 -7
  101. package/src/dev-bundle-resolution.ts +1 -1
  102. package/src/host/bridge-host.ts +26 -137
  103. package/src/menu.ts +7 -0
  104. package/src/native-seam-manifest.ts +4 -16
  105. package/src/runtime-assets.ts +59 -2
  106. package/src/vite-plugin.ts +723 -25
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.626 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.628 | (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 __defProp = Object.defineProperty;
@@ -32,13 +32,18 @@ __export(capture_contract_exports, {
32
32
  });
33
33
  module.exports = __toCommonJS(capture_contract_exports);
34
34
  var RNX_SCREEN_CAPTURE_VERSION = 1;
35
+ function isLiveRasterSource(node) {
36
+ const source = node.props?.source;
37
+ return node.type === "image" && !!source && typeof source === "object" && "uri" in source && typeof source.uri === "string" && source.uri.startsWith("live:");
38
+ }
35
39
  function selectRnxRasterNodeIds(tree) {
36
40
  const nodesById = new Map(tree.nodes.map((node) => [node.nodeId, node]));
37
41
  const unsupported = /* @__PURE__ */ new Set();
38
42
  for (const node of tree.nodes) {
39
- const visibleFrame = node.visibleFrame ?? node.frame;
43
+ const liveVideo = isLiveRasterSource(node);
44
+ const visibleFrame = liveVideo && node.visibleFrame && (node.visibleFrame.width <= 0 || node.visibleFrame.height <= 0) ? node.frame : node.visibleFrame ?? node.frame;
40
45
  if (!visibleFrame || visibleFrame.width <= 0 || visibleFrame.height <= 0) continue;
41
- if (node.type === "masked-view" || node.type === "text" && typeof node.text === "string" && (new RegExp("\\p{Emoji_Presentation}", "u").test(node.text) || new RegExp("\\uFE0F|\\u200D|\\u20E3|\\p{Emoji_Modifier}|\\p{Regional_Indicator}", "u").test(
46
+ if (node.type === "masked-view" || liveVideo || node.type === "text" && typeof node.text === "string" && (new RegExp("\\p{Emoji_Presentation}", "u").test(node.text) || new RegExp("\\uFE0F|\\u200D|\\u20E3|\\p{Emoji_Modifier}|\\p{Regional_Indicator}", "u").test(
42
47
  node.text
43
48
  )) || node.style._liquidGlass !== void 0 || node.style._liquidGlassEdge !== void 0 || node.style._liquidGlassMaterialTint !== void 0) {
44
49
  unsupported.add(node.nodeId);
@@ -56,17 +61,21 @@ function selectRnxRasterNodeIds(tree) {
56
61
  }
57
62
  const screenArea = tree.width * tree.height;
58
63
  const maxLayerArea = screenArea * 0.25;
59
- const maxAtlasArea = screenArea * 0.5;
60
64
  const candidates = [...unsupported].map((nodeId) => {
61
65
  const node = nodesById.get(nodeId);
62
- const frame = node?.visibleFrame ?? node?.frame;
63
- return frame ? { nodeId, area: frame.width * frame.height } : null;
66
+ if (!node) return null;
67
+ const liveVideo = isLiveRasterSource(node);
68
+ const frame = liveVideo && node.visibleFrame && (node.visibleFrame.width <= 0 || node.visibleFrame.height <= 0) ? node.frame : node.visibleFrame ?? node.frame;
69
+ return frame ? { nodeId, area: frame.width * frame.height, liveVideo } : null;
64
70
  }).filter(
65
- (candidate) => candidate !== null && candidate.area <= maxLayerArea
66
- ).sort((left, right) => left.area - right.area || left.nodeId - right.nodeId);
71
+ (candidate) => candidate !== null && (candidate.liveVideo || candidate.area <= maxLayerArea)
72
+ ).sort(
73
+ (left, right) => Number(right.liveVideo) - Number(left.liveVideo) || left.area - right.area || left.nodeId - right.nodeId
74
+ );
67
75
  const selected = /* @__PURE__ */ new Set();
68
76
  let atlasArea = 0;
69
77
  for (const candidate of candidates) {
78
+ const maxAtlasArea = screenArea * (candidate.liveVideo ? 1 : 0.5);
70
79
  if (atlasArea + candidate.area > maxAtlasArea) continue;
71
80
  selected.add(candidate.nodeId);
72
81
  atlasArea += candidate.area;
@@ -147,6 +156,7 @@ function rnxCaptureRasterRegions(capture) {
147
156
  nodeId: node.nodeId,
148
157
  parentNodeId: node.parentNodeId,
149
158
  type: node.type,
159
+ props: node.props,
150
160
  text: node.text,
151
161
  style: node.style.resolved,
152
162
  layout: node.layout.local,
@@ -1,14 +1,19 @@
1
- /*! rnx v0.1.626 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.628 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/capture-contract.ts
4
4
  var RNX_SCREEN_CAPTURE_VERSION = 1;
5
+ function isLiveRasterSource(node) {
6
+ const source = node.props?.source;
7
+ return node.type === "image" && !!source && typeof source === "object" && "uri" in source && typeof source.uri === "string" && source.uri.startsWith("live:");
8
+ }
5
9
  function selectRnxRasterNodeIds(tree) {
6
10
  const nodesById = new Map(tree.nodes.map((node) => [node.nodeId, node]));
7
11
  const unsupported = /* @__PURE__ */ new Set();
8
12
  for (const node of tree.nodes) {
9
- const visibleFrame = node.visibleFrame ?? node.frame;
13
+ const liveVideo = isLiveRasterSource(node);
14
+ const visibleFrame = liveVideo && node.visibleFrame && (node.visibleFrame.width <= 0 || node.visibleFrame.height <= 0) ? node.frame : node.visibleFrame ?? node.frame;
10
15
  if (!visibleFrame || visibleFrame.width <= 0 || visibleFrame.height <= 0) continue;
11
- if (node.type === "masked-view" || node.type === "text" && typeof node.text === "string" && (/\p{Emoji_Presentation}/u.test(node.text) || /\uFE0F|\u200D|\u20E3|\p{Emoji_Modifier}|\p{Regional_Indicator}/u.test(
16
+ if (node.type === "masked-view" || liveVideo || node.type === "text" && typeof node.text === "string" && (/\p{Emoji_Presentation}/u.test(node.text) || /\uFE0F|\u200D|\u20E3|\p{Emoji_Modifier}|\p{Regional_Indicator}/u.test(
12
17
  node.text
13
18
  )) || node.style._liquidGlass !== void 0 || node.style._liquidGlassEdge !== void 0 || node.style._liquidGlassMaterialTint !== void 0) {
14
19
  unsupported.add(node.nodeId);
@@ -26,17 +31,21 @@ function selectRnxRasterNodeIds(tree) {
26
31
  }
27
32
  const screenArea = tree.width * tree.height;
28
33
  const maxLayerArea = screenArea * 0.25;
29
- const maxAtlasArea = screenArea * 0.5;
30
34
  const candidates = [...unsupported].map((nodeId) => {
31
35
  const node = nodesById.get(nodeId);
32
- const frame = node?.visibleFrame ?? node?.frame;
33
- return frame ? { nodeId, area: frame.width * frame.height } : null;
36
+ if (!node) return null;
37
+ const liveVideo = isLiveRasterSource(node);
38
+ const frame = liveVideo && node.visibleFrame && (node.visibleFrame.width <= 0 || node.visibleFrame.height <= 0) ? node.frame : node.visibleFrame ?? node.frame;
39
+ return frame ? { nodeId, area: frame.width * frame.height, liveVideo } : null;
34
40
  }).filter(
35
- (candidate) => candidate !== null && candidate.area <= maxLayerArea
36
- ).sort((left, right) => left.area - right.area || left.nodeId - right.nodeId);
41
+ (candidate) => candidate !== null && (candidate.liveVideo || candidate.area <= maxLayerArea)
42
+ ).sort(
43
+ (left, right) => Number(right.liveVideo) - Number(left.liveVideo) || left.area - right.area || left.nodeId - right.nodeId
44
+ );
37
45
  const selected = /* @__PURE__ */ new Set();
38
46
  let atlasArea = 0;
39
47
  for (const candidate of candidates) {
48
+ const maxAtlasArea = screenArea * (candidate.liveVideo ? 1 : 0.5);
40
49
  if (atlasArea + candidate.area > maxAtlasArea) continue;
41
50
  selected.add(candidate.nodeId);
42
51
  atlasArea += candidate.area;
@@ -117,6 +126,7 @@ function rnxCaptureRasterRegions(capture) {
117
126
  nodeId: node.nodeId,
118
127
  parentNodeId: node.parentNodeId,
119
128
  type: node.type,
129
+ props: node.props,
120
130
  text: node.text,
121
131
  style: node.style.resolved,
122
132
  layout: node.layout.local,
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.626 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.628 | (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 __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.626 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.628 | (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 __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.626 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.628 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/cloud-contract.ts
4
4
  var RNX_CLOUD_MAX_ARTIFACT_BYTES = 20 * 1024 * 1024;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.626 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.628 | (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 __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.626 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.628 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/cloud-test-args.ts
4
4
  var CLOUD_TEST_ARGS_MAX_COUNT = 32;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.626 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.628 | (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 __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.626 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.628 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  var __defProp = Object.defineProperty;
3
3
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
4
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.626 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.628 | (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 __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.626 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.628 | (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;
@@ -776,12 +776,22 @@ function resolveBrowserCompositeCdpClip(request, metrics) {
776
776
  }
777
777
  const devicePixelRatio = physicalWidth / cssWidth;
778
778
  const padding = 1;
779
+ const { rect } = request;
780
+ const left = Math.floor((rect.x - padding) * devicePixelRatio) / devicePixelRatio;
781
+ const top = Math.floor((rect.y - padding) * devicePixelRatio) / devicePixelRatio;
782
+ const right = Math.ceil((rect.x + rect.width + padding) * devicePixelRatio) / devicePixelRatio;
783
+ const bottom = Math.ceil((rect.y + rect.height + padding) * devicePixelRatio) / devicePixelRatio;
784
+ const outputScale = request.outputWidth / rect.width;
779
785
  return {
780
- x: request.rect.x - padding,
781
- y: request.rect.y - padding,
782
- width: request.rect.width + padding * 2,
783
- height: request.rect.height + padding * 2,
784
- scale: request.outputWidth / request.rect.width / devicePixelRatio
786
+ clip: {
787
+ x: left,
788
+ y: top,
789
+ width: right - left,
790
+ height: bottom - top,
791
+ scale: outputScale / devicePixelRatio
792
+ },
793
+ originX: Math.round((rect.x - left) * outputScale),
794
+ originY: Math.round((rect.y - top) * outputScale)
785
795
  };
786
796
  }
787
797
  function readBrowserCompositeCaptureRequest(value) {
@@ -2194,6 +2204,41 @@ function reapOwnedBrowser() {
2194
2204
  } catch {
2195
2205
  }
2196
2206
  }
2207
+ var CONTEXT_MEDIA_QUIESCE_TIMEOUT_MS = 2500;
2208
+ async function quiesceContextMedia(context) {
2209
+ const pages = context.pages();
2210
+ if (pages.length === 0) return;
2211
+ const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
2212
+ await Promise.race([
2213
+ Promise.all(
2214
+ pages.map(
2215
+ (page) => page.evaluate(() => {
2216
+ const doc = globalThis.document;
2217
+ if (!doc) return;
2218
+ if (doc.pictureInPictureElement && typeof doc.exitPictureInPicture === "function") {
2219
+ void doc.exitPictureInPicture().catch(() => {
2220
+ });
2221
+ }
2222
+ doc.querySelectorAll("video").forEach((v) => {
2223
+ try {
2224
+ if (v.srcObject && typeof v.srcObject.getTracks === "function") {
2225
+ ;
2226
+ v.srcObject.getTracks().forEach((t) => t.stop());
2227
+ v.srcObject = null;
2228
+ }
2229
+ v.pause();
2230
+ v.remove();
2231
+ } catch {
2232
+ }
2233
+ });
2234
+ }).catch(() => {
2235
+ })
2236
+ )
2237
+ ),
2238
+ sleep(CONTEXT_MEDIA_QUIESCE_TIMEOUT_MS)
2239
+ ]).catch(() => {
2240
+ });
2241
+ }
2197
2242
  async function closeContext() {
2198
2243
  if (_browserCompromised) {
2199
2244
  throw new Error(`sootsim browser is compromised: ${_browserCompromised}`);
@@ -2202,6 +2247,7 @@ async function closeContext() {
2202
2247
  const context = _context;
2203
2248
  const closingContextId = contextIdentity;
2204
2249
  try {
2250
+ await quiesceContextMedia(context);
2205
2251
  await withLifecycleTimeout("context.close()", closingContextId, () => context.close());
2206
2252
  _context = null;
2207
2253
  _page = null;
@@ -2456,7 +2502,9 @@ async function focusElementForTextEntry(el) {
2456
2502
  if (await isFocusedTextInputNode(page, node)) return;
2457
2503
  await el.tap();
2458
2504
  await pollUntil(
2459
- () => page.evaluate(async () => (await window.__sootsimTest.getFocusedNode?.())?.nodeId ?? null),
2505
+ () => page.evaluate(
2506
+ async () => (await window.__sootsimTest.getFocusedNode?.())?.nodeId ?? null
2507
+ ),
2460
2508
  (focusedNodeId) => focusedNodeId === node.nodeId,
2461
2509
  {
2462
2510
  timeoutMs: 5e3,
@@ -3072,7 +3120,13 @@ function createSootSimElement(matcher) {
3072
3120
  identifier: node.testID || node.id || "",
3073
3121
  visible: node.layout.width > 0 && node.layout.height > 0,
3074
3122
  enabled: !node.accessibilityState?.disabled,
3075
- ...node
3123
+ ...node,
3124
+ frame: node.absolutePosition ? {
3125
+ x: node.absolutePosition.x,
3126
+ y: node.absolutePosition.y,
3127
+ width: node.absolutePosition.width ?? node.frame?.width ?? 0,
3128
+ height: node.absolutePosition.height ?? node.frame?.height ?? 0
3129
+ } : node.frame
3076
3130
  };
3077
3131
  },
3078
3132
  atIndex(index) {
@@ -3084,6 +3138,72 @@ function createSootSimElement(matcher) {
3084
3138
  function element(matcher) {
3085
3139
  return createSootSimElement(matcher);
3086
3140
  }
3141
+ function detoxNotificationToApnsPayload(params) {
3142
+ const trigger = objectOrEmpty(objectOrEmpty(params).trigger);
3143
+ const supported = ["push", "calendar", "location", "timeInterval"];
3144
+ if (typeof trigger.type !== "string" || !supported.includes(trigger.type)) {
3145
+ throw new Error(
3146
+ `Missing trigger or invalid trigger type. A 'trigger' key must exist, with one of the following types: '${supported.join("', '")}'`
3147
+ );
3148
+ }
3149
+ if (trigger.type !== "push") {
3150
+ throw new Error(
3151
+ `sootsim device.sendUserNotification: trigger type '${trigger.type}' is not simulated, only 'push'`
3152
+ );
3153
+ }
3154
+ const assign = (record, key, value) => {
3155
+ if (value === void 0) delete record[key];
3156
+ else record[key] = value;
3157
+ };
3158
+ const payload = { ...objectOrEmpty(params.payload) };
3159
+ const aps = { ...objectOrEmpty(payload.aps) };
3160
+ const alert = { ...objectOrEmpty(aps.alert) };
3161
+ assign(alert, "title", params.title);
3162
+ assign(alert, "subtitle", params.subtitle);
3163
+ assign(alert, "body", params.body);
3164
+ aps.alert = alert;
3165
+ assign(aps, "badge", params.badge);
3166
+ assign(aps, "category", params.category);
3167
+ assign(aps, "content-available", params["content-available"]);
3168
+ payload.aps = aps;
3169
+ return {
3170
+ payload,
3171
+ actionId: typeof params["action-identifier"] === "string" ? params["action-identifier"] : void 0,
3172
+ userText: typeof params["user-text"] === "string" ? params["user-text"] : void 0
3173
+ };
3174
+ }
3175
+ function objectOrEmpty(value) {
3176
+ return value !== null && typeof value === "object" && !Array.isArray(value) ? { ...value } : {};
3177
+ }
3178
+ async function postPreparedRemotePush(prepared, launch) {
3179
+ const { payload, actionId, userText } = prepared;
3180
+ const page = getPage();
3181
+ await page.evaluate(
3182
+ ({ request }) => {
3183
+ const bridges = window.SootSim?.bridges;
3184
+ const target = bridges?.shellHost;
3185
+ const post = target?.postNativeUIRequest;
3186
+ if (typeof post !== "function") {
3187
+ throw new Error(
3188
+ "sootsim device.sendUserNotification: simulator shell unavailable \u2014 call device.launchApp() first"
3189
+ );
3190
+ }
3191
+ post.call(target, request);
3192
+ },
3193
+ {
3194
+ request: {
3195
+ kind: "notification.remote-push",
3196
+ payload,
3197
+ launch,
3198
+ ...actionId !== void 0 ? { actionId } : {},
3199
+ ...userText !== void 0 ? { userText } : {}
3200
+ }
3201
+ }
3202
+ );
3203
+ }
3204
+ async function postRemotePushToSimulator(params, launch) {
3205
+ await postPreparedRemotePush(detoxNotificationToApnsPayload(params), launch);
3206
+ }
3087
3207
  var device = {
3088
3208
  _currentUrl: "",
3089
3209
  _platform: DETOX_PLATFORM,
@@ -3111,6 +3231,9 @@ var device = {
3111
3231
  );
3112
3232
  _suspendedAppId = null;
3113
3233
  await waitForSootsimTree(page, 1e4);
3234
+ if (opts?.userNotification) {
3235
+ await postRemotePushToSimulator(opts.userNotification, true);
3236
+ }
3114
3237
  return;
3115
3238
  }
3116
3239
  if (!_browser) {
@@ -3151,16 +3274,17 @@ var device = {
3151
3274
  const request = readBrowserCompositeCaptureRequest(value);
3152
3275
  const session = await source.page.context().newCDPSession(source.page);
3153
3276
  try {
3277
+ const { clip, originX, originY } = resolveBrowserCompositeCdpClip(
3278
+ request,
3279
+ await session.send("Page.getLayoutMetrics")
3280
+ );
3154
3281
  const result = await session.send("Page.captureScreenshot", {
3155
3282
  format: "png",
3156
3283
  fromSurface: true,
3157
3284
  captureBeyondViewport: true,
3158
- clip: resolveBrowserCompositeCdpClip(
3159
- request,
3160
- await session.send("Page.getLayoutMetrics")
3161
- )
3285
+ clip
3162
3286
  });
3163
- return "data:image/png;base64," + result.data;
3287
+ return { dataUrl: "data:image/png;base64," + result.data, originX, originY };
3164
3288
  } finally {
3165
3289
  await session.detach();
3166
3290
  }
@@ -3185,6 +3309,20 @@ var device = {
3185
3309
  contextId: contextIdentity,
3186
3310
  operation: "launchApp"
3187
3311
  });
3312
+ if (opts?.userNotification) {
3313
+ const prepared = detoxNotificationToApnsPayload(opts.userNotification);
3314
+ await pollUntil(
3315
+ () => postPreparedRemotePush(prepared, true).then(
3316
+ () => true,
3317
+ () => false
3318
+ ),
3319
+ Boolean,
3320
+ {
3321
+ timeoutMs: 6e4,
3322
+ label: "SootSim shell to accept launch notification"
3323
+ }
3324
+ );
3325
+ }
3188
3326
  await waitForSootsimTree(_page, 3e4);
3189
3327
  await waitForSootsimSurfaceMetrics(_page, 3e4);
3190
3328
  await waitForSootsimShellReady(_page, 3e4);
@@ -3219,6 +3357,12 @@ var device = {
3219
3357
  await waitForSootsimShellReady(page, 1e4);
3220
3358
  await waitForSootsimWorkletsIdle(page, 3e3);
3221
3359
  },
3360
+ // detox device.sendUserNotification on ios: the notification goes straight
3361
+ // to the app's notification center delegate. an active app gets willPresent;
3362
+ // otherwise the app gets the tap response.
3363
+ async sendUserNotification(params) {
3364
+ await postRemotePushToSimulator(params, false);
3365
+ },
3222
3366
  async takeScreenshot(name2) {
3223
3367
  return writeSootsimScreenshot(name2);
3224
3368
  },
@@ -3924,7 +4068,20 @@ var device = {
3924
4068
  },
3925
4069
  async shake() {
3926
4070
  },
4071
+ // set the simulated device location at the platform level, the same step
4072
+ // native detox's setLocation takes: on iOS it drives the simulator location
4073
+ // (AppleSimUtils/simctl location set) and CLLocationManager delivers the fix
4074
+ // asynchronously. here the platform is the harness browser, so grant page
4075
+ // geolocation and override the context fix; the guest location seam observes
4076
+ // it through navigator.geolocation exactly like the app observes Core
4077
+ // Location. app permission state is untouched, matching native.
3927
4078
  async setLocation(lat, lon) {
4079
+ const page = getPage();
4080
+ const context = _context ?? page.context();
4081
+ await context.grantPermissions(["geolocation"], {
4082
+ origin: new URL(page.url()).origin
4083
+ });
4084
+ await context.setGeolocation({ latitude: lat, longitude: lon });
3928
4085
  },
3929
4086
  async setStatusBar(config) {
3930
4087
  await dispatchStatusBarOverride(config);
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.626 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.628 | (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 __defProp = Object.defineProperty;
@@ -93,7 +93,7 @@ function normalizeNativeDevBundleUrl(bundleUrl) {
93
93
  var DEFAULT_TEST_DRIVE_PORT = 8081;
94
94
  function buildUnresolvedTargetError(targetLabel) {
95
95
  return new Error(
96
- `could not resolve a native bundle for ${targetLabel}. pass an explicit bundle URL or open Connect and choose the app there.`
96
+ `could not resolve a native bundle for ${targetLabel}. start the app's dev server (for example npx expo start), pass an explicit bundle URL, or open Connect and choose the app there.`
97
97
  );
98
98
  }
99
99
  function inferManifestFramework(launchUrl, sdkVersion) {
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.626 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.628 | (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;