peachsim 0.1.663 → 0.1.665

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 (83) hide show
  1. package/cli/app-fonts.ts +6 -3
  2. package/cli/commands/control.ts +27 -19
  3. package/cli/commands/inspect/core.ts +58 -32
  4. package/cli/commands/inspect/settling.ts +27 -21
  5. package/dist-lib/agent-daemon-client.cjs +1 -1
  6. package/dist-lib/agent-events.cjs +1 -1
  7. package/dist-lib/agent-identity.cjs +1 -1
  8. package/dist-lib/agent-sessions.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 +1 -1
  14. package/dist-lib/bridge-constants.cjs +1 -1
  15. package/dist-lib/bridge-contract-input.cjs +2 -6
  16. package/dist-lib/bridge-contract-input.mjs +2 -6
  17. package/dist-lib/bridge-contract.cjs +6 -1
  18. package/dist-lib/bridge-contract.mjs +5 -1
  19. package/dist-lib/capture-contract.cjs +1 -1
  20. package/dist-lib/capture-contract.mjs +1 -1
  21. package/dist-lib/cli-constants.cjs +1 -1
  22. package/dist-lib/cloud-contract.cjs +1 -1
  23. package/dist-lib/cloud-contract.mjs +1 -1
  24. package/dist-lib/cloud-test-args.cjs +1 -1
  25. package/dist-lib/cloud-test-args.mjs +1 -1
  26. package/dist-lib/cloud.cjs +1 -1
  27. package/dist-lib/cloud.mjs +1 -1
  28. package/dist-lib/config.cjs +1 -1
  29. package/dist-lib/detox/index.cjs +1 -1
  30. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  31. package/dist-lib/home-paths.cjs +1 -1
  32. package/dist-lib/host/bridge-host.cjs +2191 -335
  33. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  34. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  35. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  36. package/dist-lib/host/replacement-module-handler.cjs +7 -7
  37. package/dist-lib/host/websocket-proxy.cjs +1 -1
  38. package/dist-lib/index.cjs +23 -30
  39. package/dist-lib/jump-to-source-babel.cjs +1 -1
  40. package/dist-lib/jump-to-source-native.cjs +1 -1
  41. package/dist-lib/kotlin-host.cjs +1 -1
  42. package/dist-lib/menu.cjs +1 -1
  43. package/dist-lib/menu.mjs +1 -1
  44. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  45. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  46. package/dist-lib/metro-production-bundle.cjs +1 -1
  47. package/dist-lib/metro-production-bundle.mjs +1 -1
  48. package/dist-lib/metro.cjs +7 -7
  49. package/dist-lib/native-app-identity.cjs +1 -1
  50. package/dist-lib/native-app-identity.mjs +1 -1
  51. package/dist-lib/plist.cjs +1 -1
  52. package/dist-lib/plist.mjs +1 -1
  53. package/dist-lib/profiles.cjs +1 -1
  54. package/dist-lib/public-brand.cjs +1 -1
  55. package/dist-lib/react-native-host-modules.cjs +1 -1
  56. package/dist-lib/react-native-host-modules.mjs +1 -1
  57. package/dist-lib/render-mode.cjs +1 -1
  58. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  59. package/dist-lib/sdk.cjs +56 -39
  60. package/dist-lib/sdk.mjs +54 -39
  61. package/dist-lib/skills.cjs +2803 -974
  62. package/dist-lib/swift-compile.cjs +1 -1
  63. package/dist-lib/swift-compile.mjs +1 -1
  64. package/dist-lib/swift-package.cjs +1 -1
  65. package/dist-lib/swift-package.mjs +1 -1
  66. package/dist-lib/swift-submit.cjs +1 -1
  67. package/dist-lib/swift-submit.mjs +1 -1
  68. package/dist-lib/swift.cjs +1 -1
  69. package/dist-lib/vite-swift.cjs +1 -1
  70. package/dist-lib/vite.cjs +7 -7
  71. package/kotlin/ComposeSources/PeachComposeHost.kt +6 -3
  72. package/kotlin/fixtures/kotlin-app-variants/Overlays.kt +56 -0
  73. package/kotlin/fixtures/kotlin-app-variants/Scroll.kt +63 -0
  74. package/kotlin/fixtures/kotlin-app-variants/Sheet.kt +43 -0
  75. package/kotlin/fixtures/kotlin-app-variants/Tabs.kt +47 -0
  76. package/kotlin/fixtures/kotlin-app-variants/Widgets.kt +67 -0
  77. package/package.json +2 -2
  78. package/skills/peach-setup/SKILL.md +1 -1
  79. package/src/bridge-contract-input.ts +1 -5
  80. package/src/bridge-contract.ts +16 -4
  81. package/src/expo-swift-host.ts +248 -0
  82. package/src/host/bridge-host.ts +19 -0
  83. package/src/vite-plugin.ts +3 -3
package/dist-lib/sdk.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.663 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.665 | (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);
@@ -13,6 +13,9 @@ function readyProbeHasContent(probe) {
13
13
  function readyProbeHasTargetContent(probe) {
14
14
  return probe.liveFrameActive || probe.targets > 0;
15
15
  }
16
+ function readyProbeIsReady(probe) {
17
+ return (probe.flag === true ? readyProbeHasContent(probe) : readyProbeHasTargetContent(probe)) && probe.externalReady !== false && !probe.externalError && !probe.loadingText;
18
+ }
16
19
 
17
20
  // cli/commands/inspect/core.ts
18
21
  function resolveMaxMsFlag(args, fallbackMs) {
@@ -753,39 +756,46 @@ function waitReadyReason(status) {
753
756
  return !status.externalError && status.suppressedEntryError ? `${base} (suppressed entry error: ${status.suppressedEntryError})` : base;
754
757
  }
755
758
  async function inspectWaitReady(bridge, timeoutMs = 2e4, options = {}) {
756
- const start = Date.now();
759
+ const result = await sendReadyWait(bridge, timeoutMs, timeoutMs + 1e3, options.simId);
760
+ const status = waitReadyStatus(result, result.matched && !result.probe?.externalError);
761
+ if (!status.ready && options.onProgress) options.onProgress(status);
762
+ return status;
763
+ }
764
+ var READY_SNAPSHOT_SEND_TIMEOUT_MS = 2e3;
765
+ async function inspectReadySnapshot(bridge, budgetMs, simId) {
766
+ const deadline = Date.now() + budgetMs;
757
767
  let result;
768
+ do {
769
+ result = await sendReadyWait(bridge, 1, READY_SNAPSHOT_SEND_TIMEOUT_MS, simId);
770
+ } while (result.polls !== 1 && !result.error && Date.now() < deadline);
771
+ return waitReadyStatus(
772
+ result,
773
+ result.polls === 1 && result.probe ? readyProbeIsReady(result.probe) : false
774
+ );
775
+ }
776
+ async function sendReadyWait(bridge, timeoutMs, sendTimeoutMs, simId) {
777
+ const start = Date.now();
758
778
  try {
759
- result = await bridge.send(
779
+ return await bridge.send(
760
780
  {
761
781
  type: "waitFor",
762
- ...options.simId ? { simId: options.simId } : {},
763
- waitForOptions: {
764
- condition: {
765
- type: "ready",
766
- ...options.stableMs === void 0 ? {} : { stableMs: options.stableMs }
767
- },
768
- timeoutMs
769
- }
782
+ ...simId ? { simId } : {},
783
+ waitForOptions: { condition: { type: "ready" }, timeoutMs }
770
784
  },
771
- { timeoutMs: timeoutMs + 1e3 }
785
+ { timeoutMs: sendTimeoutMs }
772
786
  );
773
787
  } catch (error) {
774
788
  const bridgeError = error instanceof Error ? error.message : String(error);
775
789
  if (bridgeError.startsWith("multiple sims are connected:") || bridgeError.startsWith("saved sim ")) {
776
790
  throw error;
777
791
  }
778
- result = {
779
- matched: false,
780
- elapsedMs: Date.now() - start,
781
- polls: 0,
782
- error: bridgeError
783
- };
792
+ return { matched: false, elapsedMs: Date.now() - start, polls: 0, error: bridgeError };
784
793
  }
794
+ }
795
+ function waitReadyStatus(result, ready) {
785
796
  const probe = result.probe;
786
- const externalError = probe?.externalError ?? "";
787
- const status = {
788
- ready: result.matched && !externalError,
797
+ return {
798
+ ready,
789
799
  elapsedMs: result.elapsedMs,
790
800
  nodes: probe?.nodes ?? 0,
791
801
  targets: probe?.targets ?? 0,
@@ -796,13 +806,11 @@ async function inspectWaitReady(bridge, timeoutMs = 2e4, options = {}) {
796
806
  loadingText: probe?.loadingText ?? "",
797
807
  externalReady: probe?.externalReady ?? null,
798
808
  externalStatus: probe?.externalStatus ?? "",
799
- externalError,
809
+ externalError: probe?.externalError ?? "",
800
810
  suppressedEntryError: probe?.suppressedEntryError ?? "",
801
811
  errors: probe?.errors ?? 0,
802
812
  bridgeError: result.error ?? ""
803
813
  };
804
- if (!status.ready && options.onProgress) options.onProgress(status);
805
- return status;
806
814
  }
807
815
  async function inspectWaitSelector(bridge, testId, timeoutMs = 5e3, opts = {}) {
808
816
  const gone = opts.gone === true;
@@ -1591,22 +1599,27 @@ async function waitForSootsimIdle({
1591
1599
  }
1592
1600
  async function waitReadyAndSettle(bridge, timeoutMs, options = {}) {
1593
1601
  const start = Date.now();
1594
- const ready = await inspectWaitReady(bridge, timeoutMs, options);
1595
- if (!ready.ready) return { status: ready, idle: null, elapsedMs: Date.now() - start };
1596
- const idle = await waitForSootsimIdle({
1597
- bridge,
1598
- simId: options.simId,
1599
- maxMs: Math.max(100, Math.min(1e4, timeoutMs - (Date.now() - start))),
1600
- pollMs: 32,
1601
- stablePolls: 2
1602
+ const remaining = () => Math.max(0, start + timeoutMs - Date.now());
1603
+ const result = (status, idle2) => ({
1604
+ status,
1605
+ idle: idle2,
1606
+ elapsedMs: Date.now() - start
1602
1607
  });
1603
- if (!idle.settled) return { status: ready, idle, elapsedMs: Date.now() - start };
1604
- const settled = await inspectWaitReady(
1605
- bridge,
1606
- Math.max(1e3, timeoutMs - (Date.now() - start)),
1607
- { ...options.simId ? { simId: options.simId } : {}, stableMs: 0 }
1608
- );
1609
- return { status: settled, idle, elapsedMs: Date.now() - start };
1608
+ let idle = null;
1609
+ for (; ; ) {
1610
+ const ready = await inspectWaitReady(bridge, remaining(), options);
1611
+ if (!ready.ready) return result(ready, idle);
1612
+ idle = await waitForSootsimIdle({
1613
+ bridge,
1614
+ simId: options.simId,
1615
+ maxMs: Math.min(1e4, remaining()),
1616
+ pollMs: 32,
1617
+ stablePolls: 2
1618
+ });
1619
+ if (!idle.settled) return result(ready, idle);
1620
+ const settled = await inspectReadySnapshot(bridge, remaining(), options.simId);
1621
+ if (settled.ready || remaining() === 0) return result(settled, idle);
1622
+ }
1610
1623
  }
1611
1624
 
1612
1625
  // cli/commands/inspect/actions.ts
@@ -2506,6 +2519,7 @@ export {
2506
2519
  inspectLogs,
2507
2520
  inspectMemory,
2508
2521
  inspectNodeCount,
2522
+ inspectReadySnapshot,
2509
2523
  inspectRequests,
2510
2524
  inspectScreens,
2511
2525
  inspectScrollStateAt,
@@ -2528,6 +2542,7 @@ export {
2528
2542
  rankInteractive,
2529
2543
  readyProbeHasContent,
2530
2544
  readyProbeHasTargetContent,
2545
+ readyProbeIsReady,
2531
2546
  resolveFindMode,
2532
2547
  resolveMaxMsFlag,
2533
2548
  scoreInteractive,